本文整理汇总了C++中TStageObject::setDagNodePos方法的典型用法代码示例。如果您正苦于以下问题:C++ TStageObject::setDagNodePos方法的具体用法?C++ TStageObject::setDagNodePos怎么用?C++ TStageObject::setDagNodePos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStageObject
的用法示例。
在下文中一共展示了TStageObject::setDagNodePos方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: restoreColumn
TStageObjectId TColumnDataElement::restoreColumn(TXsheet *xsh, int index, int fxFlags, bool copyPosition) const
{
bool doClone = (fxFlags & eDoClone);
bool resetFxDagPositions = (fxFlags & eResetFxDagPositions);
TXshColumn *column = m_column.getPointer();
// The xsheet 'changes' if a new column is inserted. If it was already there, no.
bool xsheetChange = false;
if (column && column->getXsheet() && column->getXsheet() != xsh)
xsheetChange = true;
// Insert a column at the specified index. If a column was stored, insert that one.
TPointD dagPos = TConst::nowhere;
if (column) {
if (column->getFx())
dagPos = column->getFx()->getAttributes()->getDagNodePos();
if (doClone)
column = column->clone();
xsh->insertColumn(index, column);
} else
xsh->insertColumn(index); // Create a new one otherwise
if (!resetFxDagPositions && dagPos != TConst::nowhere) {
// Don't accept the default position (fx object)
TXshColumn *restoredColumn = xsh->getColumn(index);
restoredColumn->getFx()->getAttributes()->setDagNodePos(dagPos);
}
// Retrieve the newly inserted column stage object
TStageObject *obj = xsh->getStageObject(TStageObjectId::ColumnId(index));
assert(obj);
obj->assignParams(m_params, doClone); // Assign the stored params
if (copyPosition)
obj->setDagNodePos(m_dagPos);
// Clone the associated curve if any
if (xsheetChange && obj->getSpline()) {
TStageObjectSpline *srcSpl = obj->getSpline();
TStageObjectSpline *dstSpl = xsh->getStageObjectTree()->createSpline();
dstSpl->addRef();
dstSpl->setStroke(new TStroke(*srcSpl->getStroke()));
obj->setSpline(dstSpl);
}
int gridType = xsh->getStageObjectTree()->getDagGridDimension();
obj->setIsOpened(gridType == 0); // gridType is 0 if the node is opened, 1 if closed
// see StageSchematicScene::GridDimension
// TODO: Should be made PUBLIC!!
xsh->updateFrameCount();
return obj->getId();
}
示例2: restoreCamera
TStageObjectId TCameraDataElement::restoreCamera(TXsheet *xsh, bool copyPosition) const
{
TStageObjectTree *tree = xsh->getStageObjectTree();
// Search the first unused camera id in the xsheet
int index = 0;
while (tree->getStageObject(TStageObjectId::CameraId(index), false))
++index;
// Create the new camera object and assign stored data
TStageObject *newCamera = tree->getStageObject(TStageObjectId::CameraId(index), true);
newCamera->assignParams(m_params);
*(newCamera->getCamera()) = m_camera;
if (copyPosition)
newCamera->setDagNodePos(m_dagPos);
return newCamera->getId();
}
示例3: restoreObject
TStageObjectId TStageObjectDataElement::restoreObject(TXsheet *xsh, bool copyPosition) const
{
int index = 2; // Skip the table and camera 1 (I guess)
// Search the first unused common (pegbar) id
TStageObjectTree *tree = xsh->getStageObjectTree();
while (tree->getStageObject(TStageObjectId::PegbarId(index), false))
++index;
// Create the new object to be inserted
TStageObject *newObj = tree->getStageObject(TStageObjectId::PegbarId(index), true);
newObj->setParent(m_params->m_parentId);
newObj->assignParams(m_params);
// If specified, copy the stored position in the viewer
if (copyPosition)
newObj->setDagNodePos(m_dagPos);
return newObj->getId();
}
示例4: if
//.........这里部分代码省略.........
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())
fx->linkParams(fxOrig->getLinkedFx());
else {
TFx *linkedFx, *oldLinkedFx = fxOrig->getLinkedFx();
if (doClone) {