本文整理汇总了C++中TXshColumn::getFx方法的典型用法代码示例。如果您正苦于以下问题:C++ TXshColumn::getFx方法的具体用法?C++ TXshColumn::getFx怎么用?C++ TXshColumn::getFx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TXshColumn
的用法示例。
在下文中一共展示了TXshColumn::getFx方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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();
}
示例4: isTotallyEmptyColumn
// isTotallyEmptyColumn == column empty, no fx
bool LevelMoverTool::isTotallyEmptyColumn(int col) const {
if (col < 0) return false;
TXsheet *xsh = getViewer()->getXsheet();
TXshColumn *column = xsh->getColumn(col);
if (!column) return true;
if (!column->isEmpty()) return false;
if (column->getFx()->getOutputConnectionCount() != 0) return false;
// bisogna controllare lo stage object
return true;
}
示例5: 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();
}
示例6: updateScenes
void SchematicViewer::updateScenes() {
TStageObjectId id = m_stageScene->getCurrentObject();
if (id.isColumn()) {
m_stageScene->update();
TXsheet *xsh = m_stageScene->getXsheetHandle()->getXsheet();
if (!xsh) return;
TXshColumn *column = xsh->getColumn(id.getIndex());
if (!column) {
m_fxScene->getFxHandle()->setFx(0, false);
return;
}
TFx *fx = column->getFx();
m_fxScene->getFxHandle()->setFx(fx, false);
m_fxScene->update();
}
}
示例7: if
std::vector<TStageObjectId> StageObjectsData::restoreObjects(std::set<int> &columnIndices, std::list<int> &restoredSpline,
TXsheet *xsh, int fxFlags, const TPointD &pos) const
{
bool doClone = (fxFlags & eDoClone);
bool resetFxDagPositions = (fxFlags & eResetFxDagPositions);
QMap<TStageObjectId, TStageObjectId> idTable; // Trace stored/restored id pairings
std::map<TFx *, TFx *> fxTable; // Same for fxs here
std::vector<TStageObjectId> restoredIds;
std::set<int>::iterator idxt = columnIndices.begin();
int index = -1; // The actual column insertion index
int i, elementsCount = m_elements.size();
for (i = 0; i < elementsCount; ++i) {
TStageObjectDataElement *element = m_elements[i];
TCameraDataElement *cameraElement = dynamic_cast<TCameraDataElement *>(element);
TColumnDataElement *columnElement = dynamic_cast<TColumnDataElement *>(element);
// Restore the object depending on its specific type
TStageObjectId restoredId = TStageObjectId::NoneId;
if (!cameraElement && !columnElement)
restoredId = element->restoreObject(xsh, pos != TConst::nowhere);
else if (cameraElement)
restoredId = cameraElement->restoreCamera(xsh, pos != TConst::nowhere);
else if (columnElement) {
// Build the column insertion index
if (idxt != columnIndices.end())
index = *idxt++;
else {
++index;
columnIndices.insert(index);
}
// Restore the column element
restoredId = columnElement->restoreColumn(xsh, index, fxFlags, pos != TConst::nowhere);
FxDag *fxDag = xsh->getFxDag();
TXshColumn *column = columnElement->m_column.getPointer();
TXshColumn *pastedColumn = xsh->getColumn(index);
TFx *fx = column->getFx();
TFx *pastedFx = pastedColumn->getFx();
if (fx && pastedFx)
fxTable[fx] = pastedFx;
// Enforce the correct terminality. Added columns are terminal by default.
bool terminal = (fx && (m_terminalFxs.count(fx) > 0));
if (!terminal)
fxDag->getTerminalFxs()->removeFx(pastedFx);
// In case we've cloned a zerary fx column, update the actual fx's data
if (TXshZeraryFxColumn *zc = dynamic_cast<TXshZeraryFxColumn *>(pastedColumn)) {
TZeraryColumnFx *zfx = zc->getZeraryColumnFx();
TFx *zeraryFx = zfx->getZeraryFx();
if (zeraryFx && doClone) {
std::wstring app = zeraryFx->getName();
fxDag->assignUniqueId(zeraryFx);
zeraryFx->setName(app);
}
}
}
// Remember stored/restored stage object pairings
idTable[element->m_params->m_id] = restoredId;
restoredIds.push_back(restoredId);
}
// Apply stage object-parental relationships
for (i = 0; i < elementsCount; ++i) {
TStageObjectDataElement *element = m_elements[i];
TStageObjectId id = element->m_params->m_id;
TStageObjectId parentId = element->m_params->m_parentId;
TStageObjectId pastedId = idTable[id];
TStageObjectId pastedParentId = parentId;
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);
}
}
//.........这里部分代码省略.........
示例8: storeObjects
void StageObjectsData::storeObjects(const std::vector<TStageObjectId> &ids, TXsheet *xsh, int fxFlags)
{
assert(m_fxTable.empty()); // Should be enforced OUTSIDE. Track implicit uses.
m_fxTable.clear(); // TO BE REMOVED
int i, objCount = ids.size();
// Discriminate sensible stage object types (ie cameras and columns from the rest).
// Store them in a map, ordered by object index.
std::map<int, TStageObjectId> cameraIds, columnIds, pegbarIds;
for (i = 0; i < objCount; ++i) {
TStageObjectId id = ids[i];
if (id.isColumn())
columnIds[id.getIndex()] = id;
else if (id.isPegbar())
pegbarIds[id.getIndex()] = id;
else if (id.isCamera())
cameraIds[id.getIndex()] = id;
}
// Store a suitable object for each
std::map<int, TStageObjectId>::iterator it;
for (it = cameraIds.begin(); it != cameraIds.end(); ++it) {
// Cameras
TCameraDataElement *cameraElement = new TCameraDataElement();
cameraElement->storeCamera(it->second, xsh);
m_elements.append(cameraElement);
}
for (it = pegbarIds.begin(); it != pegbarIds.end(); ++it) {
// Pegbars (includes curves)
TStageObjectDataElement *objElement = new TStageObjectDataElement();
objElement->storeObject(it->second, xsh);
m_elements.append(objElement);
}
for (it = columnIds.begin(); it != columnIds.end(); ++it) {
// Columns
int colIndex = it->second.getIndex();
TXshColumn *column = xsh->getColumn(colIndex);
if (!column)
continue;
TColumnDataElement *columnElement = new TColumnDataElement();
columnElement->storeColumn(xsh, colIndex, fxFlags);
m_elements.append(columnElement);
TXshColumn *copiedColumn = columnElement->m_column.getPointer();
if (column->getFx() && copiedColumn->getFx()) {
// Store column fx pairings (even if the originals are not cloned)
m_fxTable[column->getFx()] = copiedColumn->getFx();
m_originalColumnFxs.insert(column->getFx());
}
}
// Insert terminal fxs
set<TFx *>::iterator jt;
for (jt = m_originalColumnFxs.begin(); jt != m_originalColumnFxs.end(); ++jt) {
if (isColumnSelectionTerminalFx(
*jt, xsh->getFxDag()->getTerminalFxs(), m_originalColumnFxs)) {
TFx *fx = m_fxTable[*jt];
fx->addRef();
m_terminalFxs.insert(fx);
}
}
}