本文整理汇总了C++中TFx::getAttributes方法的典型用法代码示例。如果您正苦于以下问题:C++ TFx::getAttributes方法的具体用法?C++ TFx::getAttributes怎么用?C++ TFx::getAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFx
的用法示例。
在下文中一共展示了TFx::getAttributes方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFxs
void FxsData::getFxs(QList<TFxP> &fxs, QMap<TFx *, int> &zeraryFxColumnSize,
QList<TXshColumnP> &columns) const {
QMap<TFx *, TFx *> clonedFxs;
for (int i = 0; i < m_fxs.size(); i++) {
TFx *clonedFx = m_fxs[i]->clone(false);
TPointD pos = m_fxs[i]->getAttributes()->getDagNodePos();
clonedFx->getAttributes()->setDagNodePos(pos);
clonedFx->getAttributes()->removeFromAllGroup();
fxs.append(clonedFx);
if (m_fxs[i]->isZerary())
zeraryFxColumnSize[clonedFx] =
m_zeraryFxColumnSize[m_fxs[i].getPointer()];
clonedFxs[m_fxs[i].getPointer()] = clonedFx;
TFx *linkedFx = m_fxs[i]->getLinkedFx();
if (linkedFx && clonedFxs.contains(linkedFx))
clonedFx->linkParams(clonedFxs[linkedFx]);
}
QList<TXshColumnP>::const_iterator it;
for (it = m_columns.begin(); it != m_columns.end(); it++) {
TXshColumn *col = it->getPointer();
TXshColumn *newCol = col->clone();
newCol->getFx()->getAttributes()->setDagNodePos(
col->getFx()->getAttributes()->getDagNodePos());
columns.append(newCol);
clonedFxs[col->getFx()] = newCol->getFx();
}
linkFxs(clonedFxs);
}
示例2: storeColumn
void TColumnDataElement::storeColumn(TXsheet *xsh, int index, int fxFlags)
{
if (index < 0)
return;
bool doClone = (fxFlags & eDoClone);
bool resetFxDagPositions = (fxFlags & eResetFxDagPositions);
// Fetch the specified column (if none, return)
TStageObject *obj = xsh->getStageObject(TStageObjectId::ColumnId(index));
assert(obj);
TXshColumn *column = xsh->getColumn(index);
if (!column)
return;
TFx *fx = column->getFx();
TPointD dagPos;
if (fx)
dagPos = fx->getAttributes()->getDagNodePos();
if (doClone)
column = column->clone(); // Zerary fxs clone the associated fx (drawn levels do not)
if (fx && !resetFxDagPositions)
column->getFx()->getAttributes()->setDagNodePos(dagPos);
m_column = column;
storeObject(obj->getId(), xsh);
}
示例3: visitFx
void FxSelection::visitFx(TFx *fx, QList<TFx *> &visitedFxs) {
if (visitedFxs.contains(fx)) return;
TZeraryColumnFx *zfx = dynamic_cast<TZeraryColumnFx *>(fx);
if (zfx) fx = zfx->getZeraryFx();
if (!canGroup(fx)) return;
visitedFxs.append(fx);
int i;
for (i = 0; i < fx->getInputPortCount(); i++) {
TFx *inputFx = fx->getInputPort(i)->getFx();
TZeraryColumnFx *onputZFx = dynamic_cast<TZeraryColumnFx *>(inputFx);
if (onputZFx) inputFx = onputZFx->getZeraryFx();
if (!inputFx) continue;
bool canBeGrouped = !inputFx->getAttributes()->isGrouped() ||
(inputFx->getAttributes()->getEditingGroupId() ==
fx->getAttributes()->getEditingGroupId());
if (!visitedFxs.contains(inputFx) && isSelected(inputFx) && canBeGrouped)
visitFx(inputFx, visitedFxs);
}
if (zfx) fx = zfx;
if (fx->isZerary() && !zfx) {
TXsheet *xsh = m_xshHandle->getXsheet();
int columnCount = xsh->getColumnCount();
int j;
for (j = 0; j < columnCount; j++) {
TZeraryColumnFx *zerary =
dynamic_cast<TZeraryColumnFx *>(xsh->getColumn(j)->getFx());
if (zerary && zerary->getZeraryFx() == fx) {
fx = zerary;
break;
}
}
}
for (i = 0; i < fx->getOutputConnectionCount(); i++) {
TFx *outputFx = fx->getOutputConnection(i)->getOwnerFx();
if (!outputFx) continue;
bool canBeGrouped = !outputFx->getAttributes()->isGrouped() ||
(outputFx->getAttributes()->getEditingGroupId() ==
fx->getAttributes()->getEditingGroupId());
if (!visitedFxs.contains(outputFx) && isSelected(outputFx) && canBeGrouped)
visitFx(outputFx, visitedFxs);
}
}
示例4: 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();
}
示例5: StageObjectsData
StageObjectsData *StageObjectsData::clone() const
{
StageObjectsData *data = new StageObjectsData();
// Clone each element (the new data gets ownership)
int i, elementsCount = m_elements.size();
for (i = 0; i < elementsCount; ++i)
data->m_elements.append(m_elements[i]->clone());
// Clone each spline (the new data gets ownership)
for (i = 0; i < m_splines.size(); ++i)
data->m_splines.append(m_splines[i]->clone());
// Same for internal fxs
std::map<TFx *, TFx *> fxTable; // And trace the pairings with the originals
std::set<TFx *>::const_iterator it;
for (it = m_fxs.begin(); it != m_fxs.end(); ++it) {
TFx *fxOrig = *it;
assert(fxOrig);
assert(fxTable.count(fxOrig) == 0);
TFx *fx = fxOrig->clone(false);
fx->getAttributes()->setId(fxOrig->getAttributes()->getId());
fx->getAttributes()->passiveCacheDataIdx() = -1;
fx->setName(fxOrig->getName());
fx->setFxId(fxOrig->getFxId());
fxTable[fxOrig] = fx;
fx->addRef();
data->m_fxs.insert(fx);
}
// Same with terminals
for (it = m_terminalFxs.begin(); it != m_terminalFxs.end(); ++it) {
TFx *fxOrig = *it;
assert(fxOrig);
// If the fx was not already cloned above, do it now
TFx *fx = searchFx(fxTable, fxOrig);
if (!fx) {
fx = fxOrig->clone(false);
fx->getAttributes()->setId(fxOrig->getAttributes()->getId());
fx->getAttributes()->passiveCacheDataIdx() = -1;
fx->setName(fxOrig->getName());
fx->setFxId(fxOrig->getFxId());
fxTable[fxOrig] = fx;
}
fx->addRef();
data->m_terminalFxs.insert(fx);
}
if (!fxTable.empty())
updateFxLinks(fxTable); // Applies the traced map pairings to every fx descendant
// of each fx stored in the map.
// WARNING: m_fxsTable is NOT COPIED / CLONED !!
return data;
}
示例6: loadData
void TXsheet::loadData(TIStream &is) {
clearAll();
TStageObjectId cameraId = TStageObjectId::CameraId(0);
TStageObject *firstCamera = getStageObject(cameraId);
m_imp->m_pegTree->removeStageObject(cameraId);
int col = 0;
string tagName;
while (is.openChild(tagName)) {
if (tagName == "columns") {
while (!is.eos()) {
TPersist *p = 0;
is >> p;
TXshColumn *column = dynamic_cast<TXshColumn *>(p);
if (!column) throw TException("expected xsheet column");
m_imp->m_columnSet.insertColumn(col++, column);
column->setXsheet(this);
if (TXshZeraryFxColumn *zc =
dynamic_cast<TXshZeraryFxColumn *>(column)) {
TFx *fx = zc->getZeraryColumnFx()->getZeraryFx();
int fxTypeCount = m_imp->m_fxDag->getFxTypeCount(fx);
int maxFxTypeId = std::max(fxTypeCount, fx->getAttributes()->getId());
m_imp->m_fxDag->updateFxTypeTable(fx, maxFxTypeId);
m_imp->m_fxDag->updateFxIdTable(fx);
for (int j = 0; j < fx->getParams()->getParamCount(); j++) {
TParam *param = fx->getParams()->getParam(j);
if (TDoubleParam *dp = dynamic_cast<TDoubleParam *>(param))
getStageObjectTree()->setGrammar(dp);
else if (dynamic_cast<TPointParam *>(param) ||
dynamic_cast<TRangeParam *>(param) ||
dynamic_cast<TPixelParam *>(param)) {
TParamSet *paramSet = dynamic_cast<TParamSet *>(param);
assert(paramSet);
int f;
for (f = 0; f < paramSet->getParamCount(); f++) {
TDoubleParam *dp = dynamic_cast<TDoubleParam *>(
paramSet->getParam(f).getPointer());
if (!dp) continue;
getStageObjectTree()->setGrammar(dp);
}
}
}
}
}
} else if (tagName == "pegbars") {
TPersist *p = m_imp->m_pegTree;
is >> *p;
} else if (tagName == "fxnodes") {
示例7: onAddFx
void AddFxContextMenu::onAddFx(QAction *action)
{
if (action->isCheckable() && action->isChecked())
action->setChecked(false);
TFx *fx = createFx(action, m_app->getCurrentXsheet());
if (fx) {
QList<TFxP> fxs = m_selection->getFxs();
// try to add node at cursor position
if (m_currentCursorScenePos.x() != 0 || m_currentCursorScenePos.y() != 0) {
fx->getAttributes()->setDagNodePos(TPointD(m_currentCursorScenePos.x(), m_currentCursorScenePos.y()));
m_currentCursorScenePos.setX(0);
m_currentCursorScenePos.setY(0);
}
TFxCommand::addFx(fx, fxs, m_app,
m_app->getCurrentColumn()->getColumnIndex(), m_app->getCurrentFrame()->getFrameIndex());
m_app->getCurrentXsheet()->notifyXsheetChanged();
//memorize the latest operation
m_app->getCurrentFx()->setPreviousActionString(QString("A ") + action->data().toString());
}
}
示例8: if
//.........这里部分代码省略.........
if (parentId.isColumn()) // Why discriminating for columns only ?
{
//Columns are redirected to table ids. If no redirected parent exists, store
//a void value that will be avoided later
QMap<TStageObjectId, TStageObjectId>::iterator it = idTable.find(parentId);
pastedParentId = (it == idTable.end()) ? TStageObjectId::NoneId : it.value();
}
if (pastedParentId != TStageObjectId::NoneId) {
xsh->setStageObjectParent(pastedId, pastedParentId);
TStageObject *pastedObj = xsh->getStageObject(pastedId);
// Shouldn't these be done outside ?
pastedObj->setHandle(element->m_params->m_handle);
pastedObj->setParentHandle(element->m_params->m_parentHandle);
}
}
// Iterate stored fxs
std::set<TFx *>::const_iterator fxt, end = m_fxs.end();
for (fxt = m_fxs.begin(); fxt != end; ++fxt) {
TFx *fxOrig = *fxt, *fx = fxOrig;
// Only NOT COLUMN fxs - ie internal fxs
if (fxTable.find(fxOrig) != fxTable.end())
continue;
// Internal fxs
if (doClone) {
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())
示例9: 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);
}
示例10: storeFxs
void StageObjectsData::storeFxs(const std::set<TFx *> &fxs, TXsheet *xsh, int fxFlags)
{
bool doClone = (fxFlags & eDoClone);
bool resetFxDagPositions = (fxFlags & eResetFxDagPositions);
TFxSet *terminalFxs = xsh->getFxDag()->getTerminalFxs();
// Traverse specified fxs
std::set<TFx *>::const_iterator it;
for (it = fxs.begin(); it != fxs.end(); ++it) {
TFx *fxOrig = *it, *fx = fxOrig;
if (doClone) {
// If required, clone them
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);
}
// Store them (and the original/clone pairing even if not cloning)
m_fxTable[fxOrig] = fx;
fx->addRef();
m_fxs.insert(fx);
// Find out if the fx is a terminal one in the selection. If so, store it there too.
bool isTerminal = true;
if (!terminalFxs->containsFx(fxOrig)) // If it's terminal in the xsheet, no doubt
{
// Otherwise, check terminality with respect to the selection
int i, outputConnectionsCount = fxOrig->getOutputConnectionCount();
for (i = 0; i < outputConnectionsCount; ++i) {
TFx *outputFx = fxOrig->getOutputConnection(i)->getOwnerFx();
if (outputFx && fxs.count(outputFx) > 0) {
isTerminal = false;
break;
}
}
}
// Well, excluding true TOutputFxs...
TOutputFx *outFx = dynamic_cast<TOutputFx *>(fx);
if (isTerminal && !outFx) {
fx->addRef();
m_terminalFxs.insert(fx);
}
}
// Updating terminality of the column fxs too!
// WARNING: This requires that storeObjects() is invoked BEFORE this !
for (it = m_originalColumnFxs.begin(); it != m_originalColumnFxs.end(); ++it) {
TFx *fxOrig = *it;
bool isTerminal = true;
if (!terminalFxs->containsFx(fxOrig)) {
int i, outputConnectionsCount = fxOrig->getOutputConnectionCount();
for (i = 0; i < outputConnectionsCount; ++i) {
TFx *outputFx = fxOrig->getOutputConnection(i)->getOwnerFx();
if (outputFx && fxs.count(outputFx) > 0) {
isTerminal = false;
break;
}
}
}
if (isTerminal) {
TFx *fx = m_fxTable[fxOrig];
fx->addRef();
m_terminalFxs.insert(fx);
}
}
if (!m_fxTable.empty() && doClone)
updateFxLinks(m_fxTable); // Apply original/clone pairings
// to fx relatives
}