本文整理汇总了C++中TFx::getLinkedFx方法的典型用法代码示例。如果您正苦于以下问题:C++ TFx::getLinkedFx方法的具体用法?C++ TFx::getLinkedFx怎么用?C++ TFx::getLinkedFx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFx
的用法示例。
在下文中一共展示了TFx::getLinkedFx方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clones
TFx *TMacroFx::clone(bool recursive) const
{
int n = m_fxs.size();
vector<TFxP> clones(n);
std::map<TFx *, int> table;
std::map<TFx *, int>::iterator it;
int i, rootIndex = -1;
// nodi
for (i = 0; i < n; ++i) {
TFx *fx = m_fxs[i].getPointer();
assert(fx);
clones[i] = fx->clone(false);
assert(table.count(fx) == 0);
table[fx] = i;
if (fx == m_root.getPointer())
rootIndex = i;
TFx *linkedFx = fx->getLinkedFx();
if (linkedFx && table.find(linkedFx) != table.end())
clones[i]->linkParams(clones[table[linkedFx]].getPointer());
}
assert(rootIndex >= 0);
// connessioni
for (i = 0; i < n; i++) {
TFx *fx = m_fxs[i].getPointer();
for (int j = 0; j < fx->getInputPortCount(); j++) {
TFxPort *port = fx->getInputPort(j);
TFx *inputFx = port->getFx();
if (!inputFx)
continue;
it = table.find(inputFx);
if (it == table.end()) {
// il j-esimo input di fx e' esterno alla macro
if (recursive)
clones[i]->connect(fx->getInputPortName(j), inputFx->clone(true));
} else {
// il j-esimo input di fx e' interno alla macro
clones[i]->connect(fx->getInputPortName(j), clones[it->second].getPointer());
}
}
}
//TFx *rootClone =
// const_cast<TMacroFx*>(this)->
// clone(m_root.getPointer(), recursive, visited, clones);
TMacroFx *clone = TMacroFx::create(clones);
clone->setName(getName());
clone->setFxId(getFxId());
//Copy the index of the passive cache manager.
clone->getAttributes()->passiveCacheDataIdx() = getAttributes()->passiveCacheDataIdx();
assert(clone->getRoot() == clones[rootIndex].getPointer());
return clone;
}
示例2: setFxs
void FxsData::setFxs(const QList<TFxP> &selectedFxs,
const QList<Link> &selectedLinks,
const QList<int> &columnIndexes, TXsheet *xsh) {
// fx->clonedFx
QMap<TFx *, TFx *> clonedFxs;
for (int i = 0; i < selectedFxs.size(); i++) {
TFx *fx = selectedFxs[i].getPointer();
if (!canCopyFx(fx)) continue;
TZeraryColumnFx *zerayFx = dynamic_cast<TZeraryColumnFx *>(fx);
if (zerayFx) fx = zerayFx->getZeraryFx();
TFx *clonedFx = fx->clone(false);
TPointD pos;
if (zerayFx)
pos = zerayFx->getAttributes()->getDagNodePos();
else
pos = fx->getAttributes()->getDagNodePos();
clonedFx->getAttributes()->setDagNodePos(pos);
m_fxs.append(clonedFx);
if (zerayFx)
m_zeraryFxColumnSize[clonedFx] = zerayFx->getColumn()->getRowCount();
m_visitedFxs[clonedFx] = false;
clonedFxs[fx] = clonedFx;
TFx *linkedFx = fx->getLinkedFx();
if (linkedFx && clonedFxs.contains(linkedFx))
clonedFx->linkParams(clonedFxs[linkedFx]);
}
QList<int>::const_iterator it;
for (it = columnIndexes.begin(); it != columnIndexes.end(); it++) {
TXshColumn *col = xsh->getColumn(*it);
TXshColumn *newCol = col->clone();
newCol->getFx()->getAttributes()->setDagNodePos(
col->getFx()->getAttributes()->getDagNodePos());
m_columns.append(newCol);
clonedFxs[col->getFx()] = newCol->getFx();
}
linkFxs(clonedFxs, selectedLinks);
checkConnectivity();
}
示例3: if
//.........这里部分代码省略.........
fx = fxOrig->clone(false);
fx->setName(fxOrig->getName());
fx->getAttributes()->setId(fxOrig->getAttributes()->getId());
fx->getAttributes()->passiveCacheDataIdx() = -1;
if (resetFxDagPositions)
fx->getAttributes()->setDagNodePos(TConst::nowhere);
xsh->getFxDag()->assignUniqueId(fx);
}
fxTable[fxOrig] = fx;
// Insert the passed fx in the xsheet
TOutputFx *outFx = dynamic_cast<TOutputFx *>(fx);
if (!outFx)
xsh->getFxDag()->getInternalFxs()->addFx(fx);
else
xsh->getFxDag()->addOutputFx(outFx);
if (m_terminalFxs.count(fxOrig) > 0)
xsh->getFxDag()->getTerminalFxs()->addFx(fx);
if (!doClone) {
// Err.... don't remember. Inquire further? :|
int fxTypeCount = xsh->getFxDag()->getFxTypeCount(fx);
int maxFxTypeId = std::max(fxTypeCount, fx->getAttributes()->getId());
xsh->getFxDag()->updateFxTypeTable(fx, maxFxTypeId);
xsh->getFxDag()->updateFxIdTable(fx);
}
bool isLinked = (fxOrig->getLinkedFx() != fxOrig);
if (isLinked) {
if (m_fxs.find(fxOrig->getLinkedFx()) == m_fxs.end())
fx->linkParams(fxOrig->getLinkedFx());
else {
TFx *linkedFx, *oldLinkedFx = fxOrig->getLinkedFx();
if (doClone) {
// Clone the linked fx too
linkedFx = fx->clone(false);
linkedFx->linkParams(fx);
linkedFx->setName(oldLinkedFx->getName());
linkedFx->getAttributes()->setId(oldLinkedFx->getAttributes()->getId());
linkedFx->getAttributes()->passiveCacheDataIdx() = -1;
if (resetFxDagPositions)
linkedFx->getAttributes()->setDagNodePos(TConst::nowhere);
else
linkedFx->getAttributes()->setDagNodePos(oldLinkedFx->getAttributes()->getDagNodePos());
xsh->getFxDag()->assignUniqueId(linkedFx);
} else
linkedFx = oldLinkedFx;
fxTable[oldLinkedFx] = linkedFx;
xsh->getFxDag()->getInternalFxs()->addFx(linkedFx);
if (m_terminalFxs.count(oldLinkedFx) > 0)
xsh->getFxDag()->getTerminalFxs()->addFx(linkedFx);
if (!doClone) {
int fxTypeCount = xsh->getFxDag()->getFxTypeCount(linkedFx);
int maxFxTypeId = std::max(fxTypeCount, linkedFx->getAttributes()->getId());
示例4: storeColumnFxs
void StageObjectsData::storeColumnFxs(const std::set<int> &columnIndexes, TXsheet *xsh, int fxFlags)
{
bool doClone = (fxFlags & eDoClone);
bool resetFxDagPositions = (fxFlags & eResetFxDagPositions);
std::set<TFx *> internalFxs;
xsh->getFxDag()->getInternalFxs()->getFxs(internalFxs);
// Iterate internal fxs (note: columns NOT included)
// NOTE: Could this be too heavy ? Shouldn't we travel upstream from given column fxs?
std::set<TFx *>::iterator it;
for (it = internalFxs.begin(); it != internalFxs.end(); ++it) {
TFx *fxOrig = *it, *fx = fxOrig;
if (m_fxTable.find(fx) != m_fxTable.end()) // If already treated
continue;
if (!canGenerate(m_originalColumnFxs, fx)) // If not completely in the upstream
continue;
if (doClone) {
// Clone the fx if required
fx = fxOrig->clone(false);
fx->setName(fxOrig->getName());
fx->getAttributes()->setId(fxOrig->getAttributes()->getId());
fx->getAttributes()->passiveCacheDataIdx() = -1;
if (resetFxDagPositions)
fx->getAttributes()->setDagNodePos(TConst::nowhere);
}
m_fxTable[fxOrig] = fx;
fx->addRef();
m_fxs.insert(fx);
if (isColumnSelectionTerminalFx(
fxOrig, xsh->getFxDag()->getTerminalFxs(), m_originalColumnFxs)) {
fx->addRef();
m_terminalFxs.insert(fx);
}
if (fxOrig->getLinkedFx() != fxOrig) // Linked fx
{
if (!canGenerate(m_originalColumnFxs, fxOrig->getLinkedFx()))
fx->linkParams(fxOrig->getLinkedFx());
else {
// Insert the linked fx directly here
TFx *linkedFx, *oldLinkedFx = fxOrig->getLinkedFx();
if (doClone) {
linkedFx = fx->clone(false); // Not oldLinkedFx->clone() ?
linkedFx->linkParams(fx);
linkedFx->setName(oldLinkedFx->getName());
linkedFx->getAttributes()->setId(oldLinkedFx->getAttributes()->getId());
linkedFx->getAttributes()->passiveCacheDataIdx() = -1;
if (resetFxDagPositions)
fx->getAttributes()->setDagNodePos(TConst::nowhere); // Here too ?
xsh->getFxDag()->assignUniqueId(linkedFx);
} else
linkedFx = oldLinkedFx;
m_fxTable[oldLinkedFx] = linkedFx;
linkedFx->addRef();
m_fxs.insert(linkedFx);
if (xsh->getFxDag()->getTerminalFxs()->containsFx(fx->getLinkedFx())) // Here too - isATerminal ?
{
linkedFx->addRef();
m_terminalFxs.insert(linkedFx);
}
}
}
}
// Like in the functions above, update links
if (!m_fxTable.empty() && doClone)
updateFxLinks(m_fxTable);
}