当前位置: 首页>>代码示例>>C++>>正文


C++ TXshColumn::clone方法代码示例

本文整理汇总了C++中TXshColumn::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ TXshColumn::clone方法的具体用法?C++ TXshColumn::clone怎么用?C++ TXshColumn::clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TXshColumn的用法示例。


在下文中一共展示了TXshColumn::clone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:31,代码来源:fxdata.cpp

示例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);
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:29,代码来源:stageobjectsdata.cpp

示例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();
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:54,代码来源:stageobjectsdata.cpp

示例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();
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:41,代码来源:fxdata.cpp


注:本文中的TXshColumn::clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。