本文整理汇总了C++中TXshColumn类的典型用法代码示例。如果您正苦于以下问题:C++ TXshColumn类的具体用法?C++ TXshColumn怎么用?C++ TXshColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TXshColumn类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getXsheet
bool CellsMover::canMoveCells(const TPoint &pos) {
TXsheet *xsh = getXsheet();
if (pos.x < 0) return false;
if (pos.x != m_startPos.x) {
int count = 0;
// controlla il tipo
int i = 0;
while (i < m_rowCount * m_colCount) {
TXshColumn::ColumnType srcType = getColumnTypeFromCell(i);
int dstIndex = pos.x + i;
TXshColumn *dstColumn = xsh->getColumn(dstIndex);
if (srcType == TXshColumn::eZeraryFxType) return false;
if (dstColumn && !dstColumn->isEmpty() &&
dstColumn->getColumnType() != srcType)
return false;
if (!dstColumn || dstColumn->isLocked() == false) count++;
i += m_rowCount;
}
if (count == 0) return false;
}
if ((m_qualifiers & CellsMover::eInsertCells) ||
(m_qualifiers & CellsMover::eOverwriteCells))
return true;
int count = 0;
for (int i = 0; i < m_colCount; i++) {
for (int j = 0; j < m_rowCount; j++) {
if (!xsh->getCell(pos.y + j, pos.x + i).isEmpty()) return false;
count++;
}
}
if (count == 0) return false;
return true;
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:33,代码来源:xshcellmover.cpp
示例2: assert
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);
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:29,代码来源:stageobjectsdata.cpp
示例3: addShowHideStageObjectCmds
int addShowHideStageObjectCmds(const std::vector<int> &columnIndexes,
QMenu *menu, bool isShow) {
int ii, columnIndex = -1;
bool flag = true;
for (ii = columnIndexes.size() - 1; ii >= 0; ii--) {
TStageObjectId id = TStageObjectId::ColumnId(columnIndexes[ii]);
TXshColumn *col =
TApp::instance()->getCurrentXsheet()->getXsheet()->getColumn(
columnIndexes[ii]);
if (!col) continue;
if (!isShow && col->isCamstandVisible()) {
if (columnIndex == -1) columnIndex = columnIndexes[ii];
if (flag) {
menu->addSeparator();
flag = false;
}
addShowHideStageObjectCmd(menu, id, false);
} else if (isShow && !col->isCamstandVisible()) {
if (flag) {
menu->addSeparator();
flag = false;
}
addShowHideStageObjectCmd(menu, id, true);
}
}
return columnIndex;
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:28,代码来源:sceneviewercontextmenu.cpp
示例4: resequence
void ColumnCmd::resequence(int index) {
if (!canResequence(index)) return;
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
TXshColumn *column = xsh->getColumn(index);
assert(column);
TXshLevelColumn *lcolumn = column->getLevelColumn();
assert(lcolumn);
int r0 = 0, r1 = -1;
lcolumn->getRange(r0, r1);
assert(r0 <= r1);
TXshCell cell = lcolumn->getCell(r0);
assert(!cell.isEmpty());
TXshChildLevel *xl = cell.m_level->getChildLevel();
assert(xl);
TXsheet *childXsh = xl->getXsheet();
int frameCount = childXsh->getFrameCount();
if (frameCount < 1) frameCount = 1;
TUndoManager::manager()->add(new ResequenceUndo(index, frameCount));
lcolumn->clearCells(r0, r1 - r0 + 1);
for (int i = 0; i < frameCount; i++) {
cell.m_frameId = TFrameId(i + 1);
lcolumn->setCell(r0 + i, cell);
}
xsh->updateFrameCount();
TApp::instance()->getCurrentScene()->setDirtyFlag(true);
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
}
开发者ID:opentoonz,项目名称:opentoonz,代码行数:31,代码来源:columncommand.cpp
示例5: pos
void RowArea::mousePressEvent(QMouseEvent *event)
{
m_viewer->setQtModifiers(event->modifiers());
if (event->button() == Qt::LeftButton) {
bool playRangeModifierisClicked = false;
TApp *app = TApp::instance();
TXsheet *xsh = app->getCurrentScene()->getScene()->getXsheet();
TPoint pos(event->pos().x(), event->pos().y());
int row = m_viewer->yToRow(pos.y);
QRect visibleRect = visibleRegion().boundingRect();
int playR0, playR1, step;
XsheetGUI::getPlayRange(playR0, playR1, step);
bool playRangeEnabled = playR0 <= playR1;
if (!playRangeEnabled) {
TXsheet *xsh = m_viewer->getXsheet();
playR1 = xsh->getFrameCount() - 1;
playR0 = 0;
}
if (playR1 == -1) { //getFrameCount = 0 i.e. xsheet is empty
setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer));
} else if (m_xa <= pos.x && pos.x <= m_xa + 10 && (row == playR0 || row == playR1)) {
if (!playRangeEnabled)
XsheetGUI::setPlayRange(playR0, playR1, step);
setDragTool(XsheetGUI::DragTool::makePlayRangeModifierTool(m_viewer));
playRangeModifierisClicked = true;
} else
setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer));
//when shift+click the row area, select a single row region in the cell area
if (!playRangeModifierisClicked && 0 != (event->modifiers() & Qt::ShiftModifier)) {
int filledCol;
for (filledCol = xsh->getColumnCount() - 1; filledCol >= 0; filledCol--) {
TXshColumn *currentColumn = xsh->getColumn(filledCol);
if (!currentColumn)
continue;
if (!currentColumn->isEmpty())
break;
}
m_viewer->getCellSelection()->selectNone();
m_viewer->getCellSelection()->selectCells(row, 0, row, tmax(0, filledCol));
m_viewer->updateCellRowAree();
}
m_viewer->dragToolClick(event);
event->accept();
} // left-click
// pan by middle-drag
else if (event->button() == Qt::MidButton) {
m_pos = event->pos();
m_isPanning = true;
}
}
开发者ID:CroW-CZ,项目名称:opentoonz,代码行数:58,代码来源:xshrowviewer.cpp
示例6: isColumnEmpty
bool TXsheet::setCell(int row, int col, const TXshCell &cell) {
if (row < 0 || col < 0) return false;
bool wasColumnEmpty = isColumnEmpty(col);
TXshCellColumn *cellColumn;
if (!cell.isEmpty()) {
TXshLevel *level = cell.m_level.getPointer();
assert(level);
int levelType = level->getType();
TXshColumn::ColumnType type = TXshColumn::eLevelType;
if (levelType == SND_XSHLEVEL)
type = TXshColumn::eSoundType;
else if (levelType == SND_TXT_XSHLEVEL)
type = TXshColumn::eSoundTextType;
else if (levelType == PLT_XSHLEVEL)
type = TXshColumn::ePaletteType;
else if (levelType == ZERARYFX_XSHLEVEL)
type = TXshColumn::eZeraryFxType;
else if (levelType == MESH_XSHLEVEL)
type = TXshColumn::eMeshType;
cellColumn = touchColumn(col, type)->getCellColumn();
} else {
TXshColumn *column = getColumn(col);
cellColumn = column ? column->getCellColumn() : 0;
}
if (!cellColumn || cellColumn->isLocked()) return false;
cellColumn->setXsheet(this);
if (!cellColumn->setCell(row, cell)) {
if (wasColumnEmpty) {
removeColumn(col);
insertColumn(col);
}
return false;
}
TFx *fx = cellColumn->getFx();
if (wasColumnEmpty && fx && fx->getOutputConnectionCount() == 0 &&
cellColumn->getPaletteColumn() == 0)
getFxDag()->addToXsheet(fx);
if (cell.isEmpty())
updateFrameCount();
else if (row >= m_imp->m_frameCount)
m_imp->m_frameCount = row + 1;
TNotifier::instance()->notify(TXsheetChange());
return true;
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:57,代码来源:txsheet.cpp
示例7: onShowHide
void SceneViewerContextMenu::onShowHide() {
int columnIndex = qobject_cast<QAction *>(sender())->data().toInt();
TXsheetHandle *xsheetHandle = TApp::instance()->getCurrentXsheet();
TXshColumn *column = xsheetHandle->getXsheet()->getColumn(columnIndex);
if (column) {
column->setCamstandVisible(!column->isCamstandVisible());
xsheetHandle->notifyXsheetChanged();
}
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:9,代码来源:sceneviewercontextmenu.cpp
示例8: getViewer
// 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;
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:11,代码来源:xshcellmover.cpp
示例9:
TStageObject *ViewerKeyframeNavigator::getStageObject() const {
if (!m_xsheetHandle || !m_objectHandle) return 0;
TStageObjectId objectId = m_objectHandle->getObjectId();
TXsheet *xsh = m_xsheetHandle->getXsheet();
// Se e' una colonna sound non posso settare chiavi
if (objectId.isColumn()) {
TXshColumn *column = xsh->getColumn(objectId.getIndex());
if (column && column->getSoundColumn()) return 0;
}
return xsh->getStageObject(objectId);
}
开发者ID:luc--,项目名称:opentoonz,代码行数:12,代码来源:keyframenavigator.cpp
示例10: assert
bool SkeletonTool::doesApply() const
{
TTool::Application *app = TTool::getApplication();
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
assert(xsh);
TStageObjectId objId = app->getCurrentObject()->getObjectId();
if (objId.isColumn()) {
TXshColumn *column = xsh->getColumn(objId.getIndex());
if (column && column->getSoundColumn())
return false;
}
return true;
}
开发者ID:titer1,项目名称:opentoonz,代码行数:13,代码来源:skeletontool.cpp
示例11: mouseReleaseEvent
void LayerHeaderPanel::mouseReleaseEvent(QMouseEvent *event) {
TApp *app = TApp::instance();
TXsheet *xsh = m_viewer->getXsheet();
int col, totcols = xsh->getColumnCount();
bool sound_changed = false;
if (m_doOnRelease != 0 && totcols > 0) {
for (col = 0; col < totcols; col++) {
if (!xsh->isColumnEmpty(col)) {
TXshColumn *column = xsh->getColumn(col);
if (m_doOnRelease == ToggleAllPreviewVisible) {
column->setPreviewVisible(!column->isPreviewVisible());
} else if (m_doOnRelease == ToggleAllTransparency) {
column->setCamstandVisible(!column->isCamstandVisible());
if (column->getSoundColumn()) sound_changed = true;
} else if (m_doOnRelease == ToggleAllLock) {
column->lock(!column->isLocked());
}
}
}
if (sound_changed) {
app->getCurrentXsheet()->notifyXsheetSoundChanged();
}
app->getCurrentScene()->notifySceneChanged();
app->getCurrentXsheet()->notifyXsheetChanged();
}
m_viewer->updateColumnArea();
update();
m_doOnRelease = 0;
}
开发者ID:jcome,项目名称:opentoonz,代码行数:33,代码来源:layerheaderpanel.cpp
示例12: isMeshDeformed
static inline bool isMeshDeformed(TXsheet *xsh, TStageObject *obj,
const ImagePainter::VisualSettings *vs) {
const TStageObjectId &parentId = obj->getParent();
if (parentId.isColumn() && obj->getParentHandle()[0] != 'H') {
TStageObject *parentObj = xsh->getStageObject(parentId);
if (!parentObj->getPlasticSkeletonDeformation()) return false;
TXshColumn *parentCol = xsh->getColumn(parentId.getIndex());
return (parentCol->getColumnType() == TXshColumn::eMeshType) &&
(parentCol != vs->m_plasticVisualSettings.m_showOriginalColumn);
}
return false;
}
开发者ID:ideasman42,项目名称:opentoonz,代码行数:14,代码来源:stage.cpp
示例13: clearAll
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") {
开发者ID:walkerka,项目名称:opentoonz,代码行数:48,代码来源:txsheet.cpp
示例14: 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();
}
}
开发者ID:opentoonz,项目名称:opentoonz,代码行数:16,代码来源:schematicviewer.cpp
示例15: 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);
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:31,代码来源:fxdata.cpp
示例16: 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();
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:54,代码来源:stageobjectsdata.cpp
示例17: while
void ComboViewerPanel::onDrawFrame(
int frame, const ImagePainter::VisualSettings &settings) {
TApp *app = TApp::instance();
m_sceneViewer->setVisual(settings);
TFrameHandle *frameHandle = app->getCurrentFrame();
if (m_sceneViewer->isPreviewEnabled()) {
class Previewer *pr = Previewer::instance(m_sceneViewer->getPreviewMode() ==
SceneViewer::SUBCAMERA_PREVIEW);
pr->getRaster(frame - 1); // the 'getRaster' starts the render of the frame
// is not already started
int curFrame = frame;
if (frameHandle->isPlaying() &&
!pr->isFrameReady(
frame - 1)) // stops on last rendered frame until current is ready!
{
while (frame > 0 && !pr->isFrameReady(frame - 1)) frame--;
if (frame == 0)
frame = curFrame; // if no frame is ready, I stay on current...no use
// to rewind
m_flipConsole->setCurrentFrame(frame);
}
}
assert(frame >= 0);
if (frame != frameHandle->getFrameIndex() + 1) {
if (frameHandle->isEditingScene()) {
TXshColumn *column = app->getCurrentXsheet()->getXsheet()->getColumn(
app->getCurrentColumn()->getColumnIndex());
if (column) {
TXshSoundColumn *soundColumn = column->getSoundColumn();
if (soundColumn && !soundColumn->isPlaying())
app->getCurrentFrame()->scrubColumn(frame, frame, soundColumn);
}
}
frameHandle->setCurrentFrame(frame);
}
else if (settings.m_blankColor != TPixel::Transparent)
m_sceneViewer->update();
}
开发者ID:luc--,项目名称:opentoonz,代码行数:42,代码来源:comboviewerpane.cpp
示例18: canResequence
bool ColumnCmd::canResequence(int index) {
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
TXshColumn *column = xsh->getColumn(index);
if (!column) return false;
TXshLevelColumn *lcolumn = column->getLevelColumn();
if (!lcolumn) return false;
int r0 = 0, r1 = -1;
if (lcolumn->getRange(r0, r1) == 0) return false;
assert(r0 <= r1);
TXshCell cell = lcolumn->getCell(r0);
assert(!cell.isEmpty());
TXshLevel *xl = cell.m_level->getChildLevel();
if (!xl) return false;
for (int r = r0 + 1; r <= r1; r++) {
cell = lcolumn->getCell(r);
if (cell.isEmpty()) continue;
if (cell.m_level.getPointer() != xl) return false;
}
return true;
}
开发者ID:opentoonz,项目名称:opentoonz,代码行数:20,代码来源:columncommand.cpp
示例19: getKeyframes
// data -> xsh
bool TKeyframeData::getKeyframes(std::set<Position> &positions, TXsheet *xsh) const
{
std::set<TKeyframeSelection::Position>::iterator it2 = positions.begin();
int r0 = it2->first;
int c0 = it2->second;
for (++it2; it2 != positions.end(); ++it2) {
r0 = std::min(r0, it2->first);
c0 = std::min(c0, it2->second);
}
positions.clear();
TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();
Iterator it;
bool keyFrameChanged = false;
for (it = m_keyData.begin(); it != m_keyData.end(); ++it) {
Position pos = it->first;
int row = r0 + pos.first;
int col = c0 + pos.second;
positions.insert(std::make_pair(row, col));
TXshColumn *column = xsh->getColumn(col);
if (column && column->getSoundColumn())
continue;
TStageObject *pegbar = xsh->getStageObject(col >= 0 ? TStageObjectId::ColumnId(col) : cameraId);
if (pegbar->getId().isColumn() && xsh->getColumn(col) && xsh->getColumn(col)->isLocked())
continue;
keyFrameChanged = true;
assert(pegbar);
pegbar->setKeyframeWithoutUndo(row, it->second);
}
if (!keyFrameChanged)
return false;
for (auto const pegbar : m_isPegbarsCycleEnabled) {
int const col = pegbar.first;
TStageObjectId objectId = (col >= 0) ? TStageObjectId::ColumnId(col) : cameraId;
xsh->getStageObject(objectId)->enableCycle(pegbar.second);
}
return true;
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:39,代码来源:keyframedata.cpp
示例20: 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();
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:41,代码来源:fxdata.cpp
注:本文中的TXshColumn类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论