• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TFx类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了TFx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: undo

 void undo() const {
   FxDag *fxDag =
       TApp::instance()->getCurrentXsheet()->getXsheet()->getFxDag();
   int i, j;
   for (i = 0; i < (int)m_fxs.size(); i++) {
     TApp::instance()->getCurrentFx()->setFx(m_fxs[i].m_fx.getPointer());
     TFxCommand::addFx(m_fxs[i].m_fx.getPointer());
   }
   for (i = 0; i < (int)m_fxs.size(); i++) {
     const Node &node = m_fxs[i];
     TFx *fx          = node.m_fx.getPointer();
     if (node.m_xsheetConnected) fxDag->addToXsheet(fx);
     for (j = 0; j < (int)node.m_inputLinks.size(); j++)
       fx->getInputPort(j)->setFx(node.m_inputLinks[j].getPointer());
     for (j = 0; j < (int)node.m_outputLinks.size(); j++) {
       TFx *outFx = node.m_outputLinks[j].second.getPointer();
       outFx->getInputPort(node.m_outputLinks[j].first)->setFx(fx);
     }
   }
   for (i = 0; i < (int)m_inputConnectedToXsheet.size(); i++) {
     TFx *inputFx = m_inputConnectedToXsheet[i].getPointer();
     fxDag->getTerminalFxs()->removeFx(inputFx);
   }
   TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
 }
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:25,代码来源:fxschematicnodeselection.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:

//!Build the scene fx for each node below the xsheet one.
//!Remember that left xsheet ports must not be expanded.
void MultimediaRenderer::Imp::scanSceneForLayers()
{
	//Retrieve the terminal fxs (ie, fxs which are implicitly
	//connected to the xsheet one)
	TXsheet *xsh = m_scene->getXsheet();
	TFxSet *fxs = xsh->getFxDag()->getTerminalFxs();

	//Examine all of them and - eventually - expand left xsheet
	//ports (ie fx nodes who allow implicit overlaying)
	for (int i = 0; i < fxs->getFxCount(); ++i) {
		TFx *fx = fxs->getFx(i);
		TFxPort *leftXSheetPort;

	retry:

		if (!fx)
			continue;
		leftXSheetPort = fx->getXsheetPort();

		if (!leftXSheetPort) {
			m_fxsToRender.addFx(fx);
			continue;
		}

		//If the leftXSheetPort is not connected, retry on port 0
		if (leftXSheetPort->isConnected())
			m_fxsToRender.addFx(fx);
		else {
			fx = fx->getInputPort(0)->getFx();
			goto retry;
		}
	}
}
开发者ID:titer1,项目名称:opentoonz,代码行数:35,代码来源:multimediarenderer.cpp


示例4: getFx

void FxKeyframeNavigator::toggle() {
  TFx *fx = getFx();
  if (!fx) return;
  int i, paramCount = fx->getParams()->getParamCount();

  // determino in quale caso ci troviamo:
  // il frame corrente non e' keyframe di nessun parametro (isKeyframe=false),
  // di qualche parametro o di tutti i parametri (isFullKeyframe=true)
  bool isFullKeyframe = true;
  bool isKeyframe     = false;
  int frame           = getCurrentFrame();
  for (i = 0; i < paramCount; i++) {
    TParamP param = fx->getParams()->getParam(i);
    if (!param->isAnimatable()) continue;
    if (param->isKeyframe(frame))
      isKeyframe = true;
    else
      isFullKeyframe = false;
  }
  if (!isKeyframe) isFullKeyframe = false;

  // modifico lo stato: nokeyframe->full, full->no, partial->full
  bool on = !isKeyframe || isKeyframe && !isFullKeyframe;
  for (i = 0; i < fx->getParams()->getParamCount();
       i++) {  // TODO. spostare questo codice in TParam
    TParamP param = fx->getParams()->getParam(i);
    if (TDoubleParamP dp = param) {
      if (on)
        dp->setValue(frame, dp->getValue(frame));
      else
        dp->deleteKeyframe(frame);
    } else if (TRangeParamP rp = param) {
      if (on)
        rp->setValue(frame, rp->getValue(frame));
      else
        rp->deleteKeyframe(frame);
    } else if (TPointParamP pp = param) {
      if (on)
        pp->setValue(frame, pp->getValue(frame));
      else
        pp->deleteKeyframe(frame);
    } else if (TPixelParamP pip = param) {
      if (on)
        pip->setValue(frame, pip->getValue(frame));
      else
        pip->deleteKeyframe(frame);
    } else if (TSpectrumParamP sp = param) {
      if (on)
        sp->setValue(frame, sp->getValue(frame), false);
      else
        sp->deleteKeyframe(frame);
    } else if (TToneCurveParamP tcp = param) {
      if (on)
        tcp->setValue(frame, tcp->getValue(frame), false);
      else
        tcp->deleteKeyframe(frame);
    }
  }
  m_fxHandle->notifyFxChanged();
}
开发者ID:luc--,项目名称:opentoonz,代码行数:60,代码来源:keyframenavigator.cpp


示例5: 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


示例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: locker

void SwatchCacheManager::setFx(const TFxP &fx)
{
	QMutexLocker locker(&m_mutex);

	//Update the fxs id data
	if (fx == TFxP()) {
		//Clear if no fx is set
		m_setFxId = 0;
		m_childrenFxIds.clear();
	} else {
		m_setFxId = fx->getIdentifier();
		m_childrenFxIds.clear();
		assert(m_setFxId != 0);

		TRasterFx *rfx = dynamic_cast<TRasterFx *>(fx.getPointer());
		assert(rfx);

		for (int i = 0; i < fx->getInputPortCount(); ++i) {
			//Fxs not allowing cache on the input port are skipped
			if (!rfx->allowUserCacheOnPort(i))
				continue;

			TFxPort *iport = fx->getInputPort(i);
			if (iport && iport->isConnected()) {
				TFx *child = iport->getFx();

				//In the zerary case, extract the actual fx
				TZeraryColumnFx *zcfx = dynamic_cast<TZeraryColumnFx *>(child);
				if (zcfx)
					child = zcfx->getZeraryFx();

				assert(child && child->getIdentifier() != 0);
				m_childrenFxIds.insert(child->getIdentifier());
			}
		}
	}

	//NOTE: Check if this should be avoided in some case...

	//Release the locks and clear the resources
	if (m_currEditedFxResult)
		m_currEditedFxResult->releaseLock();
	m_currEditedFxResult = TCacheResourceP();

	std::set<TCacheResourceP>::iterator it;
	for (it = m_swatchCacheContainer.begin(); it != m_swatchCacheContainer.end(); ++it)
		(*it)->releaseLock();
	m_swatchCacheContainer.clear();

#ifdef USE_SQLITE_HDPOOL
	TCacheResourcePool::instance()->releaseReferences("S");
#else
	for (it = m_genericCacheContainer.begin(); it != m_genericCacheContainer.end(); ++it)
		(*it)->releaseLock();
	m_genericCacheContainer.clear();
#endif
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:57,代码来源:swatchviewer.cpp


示例8: clones

TFx *TMacroFx::clone(bool recursive) const
{
	int n = m_fxs.size();
	vector<TFxP> clones(n);
	std::map<TFx *, int> table;
	std::map<TFx *, int>::iterator it;
	int i, rootIndex = -1;
	// nodi
	for (i = 0; i < n; ++i) {
		TFx *fx = m_fxs[i].getPointer();
		assert(fx);
		clones[i] = fx->clone(false);
		assert(table.count(fx) == 0);
		table[fx] = i;
		if (fx == m_root.getPointer())
			rootIndex = i;
		TFx *linkedFx = fx->getLinkedFx();
		if (linkedFx && table.find(linkedFx) != table.end())
			clones[i]->linkParams(clones[table[linkedFx]].getPointer());
	}
	assert(rootIndex >= 0);
	// connessioni
	for (i = 0; i < n; i++) {
		TFx *fx = m_fxs[i].getPointer();
		for (int j = 0; j < fx->getInputPortCount(); j++) {
			TFxPort *port = fx->getInputPort(j);
			TFx *inputFx = port->getFx();
			if (!inputFx)
				continue;
			it = table.find(inputFx);
			if (it == table.end()) {
				// il j-esimo input di fx e' esterno alla macro
				if (recursive)
					clones[i]->connect(fx->getInputPortName(j), inputFx->clone(true));
			} else {
				// il j-esimo input di fx e' interno alla macro
				clones[i]->connect(fx->getInputPortName(j), clones[it->second].getPointer());
			}
		}
	}

	//TFx *rootClone =
	//  const_cast<TMacroFx*>(this)->
	//  clone(m_root.getPointer(), recursive, visited, clones);

	TMacroFx *clone = TMacroFx::create(clones);
	clone->setName(getName());
	clone->setFxId(getFxId());

	//Copy the index of the passive cache manager.
	clone->getAttributes()->passiveCacheDataIdx() = getAttributes()->passiveCacheDataIdx();

	assert(clone->getRoot() == clones[rootIndex].getPointer());

	return clone;
}
开发者ID:AmEv7Fam,项目名称:opentoonz,代码行数:56,代码来源:tmacrofx.cpp


示例9:

TFx *TMacroFx::getFxById(const wstring &id) const
{
	int i;
	for (i = 0; i < (int)m_fxs.size(); i++) {
		TFx *fx = m_fxs[i].getPointer();
		if (fx->getFxId() == id)
			return fx;
	}
	return 0;
}
开发者ID:AmEv7Fam,项目名称:opentoonz,代码行数:10,代码来源:tmacrofx.cpp


示例10: 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


示例11: clearGadgets

void FxGadgetController::onFxSwitched() {
  clearGadgets();
  bool enabled = false;
  TFx *fx      = m_fxHandle ? m_fxHandle->getFx() : 0;
  if (fx) {
    int referenceColumnIndex = fx->getReferenceColumnIndex();
    if (referenceColumnIndex == -1) {
      TObjectHandle *oh = m_tool->getApplication()->getCurrentObject();
      if (!oh->getObjectId().isCamera()) {
        oh->setObjectId(TStageObjectId::CameraId(0));
      }
      enabled = true;
    } else if (referenceColumnIndex == m_tool->getColumnIndex())
      enabled = true;
  }
  if (fx && enabled) {
    m_editingNonZeraryFx = true;
    TZeraryColumnFx *zfx = 0;
    if ((zfx = dynamic_cast<TZeraryColumnFx *>(fx)) ||
        dynamic_cast<TLevelColumnFx *>(fx))
    // WARNING! quick patch for huge bug:  I added the || with TLevelColumnFx;
    // before, the levels were considered as nonZeraryFx and the edit tool
    // gadget was not displayed! Vinz
    {
      if (zfx) fx          = zfx->getZeraryFx();
      m_editingNonZeraryFx = false;
    }

    // Parse the UI Concepts returned by the fx
    TParamUIConcept *uiConcepts = 0;
    int i, count;

    fx->getParamUIs(uiConcepts, count);

    for (i = 0; i < count; ++i) {
      FxGadget *gadget = allocateGadget(uiConcepts[i]);
      if (gadget) addGadget(gadget);
    }

    delete[] uiConcepts;
  } else
    m_editingNonZeraryFx = false;

  m_tool->invalidate();
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:45,代码来源:edittoolgadgets.cpp


示例12: m_zeraryColumnFx

TXshZeraryFxColumn::TXshZeraryFxColumn(const TXshZeraryFxColumn &src)
	: m_zeraryColumnFx(new TZeraryColumnFx()), m_zeraryFxLevel(new TXshZeraryFxLevel())
{
	m_zeraryColumnFx->addRef();
	m_zeraryColumnFx->setColumn(this);
	m_zeraryFxLevel->addRef();
	m_zeraryFxLevel->setColumn(this);
	m_first = src.m_first;
	int i;
	for (i = 0; i < (int)src.m_cells.size(); i++)
		m_cells.push_back(TXshCell(m_zeraryFxLevel, src.m_cells[i].getFrameId()));
	assert((int)src.m_cells.size() == (int)m_cells.size());
	TFx *fx = src.getZeraryColumnFx()->getZeraryFx();
	if (fx) {
		wstring fxName = fx->getName();
		fx = fx->clone(false);
		fx->setName(fxName);
		m_zeraryColumnFx->setZeraryFx(fx);
	}
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:20,代码来源:txshzeraryfxcolumn.cpp


示例13:

StageObjectsData::~StageObjectsData()
{
	int i, elementsCount = m_elements.size();
	for (i = 0; i < elementsCount; ++i)
		delete m_elements[i];

	for (i = 0; i < m_splines.size(); ++i)
		delete m_splines[i];

	std::set<TFx *>::iterator it;
	for (it = m_fxs.begin(); it != m_fxs.end(); ++it) {
		TFx *fx = *it;
		if (fx)
			fx->release();
	}

	for (it = m_terminalFxs.begin(); it != m_terminalFxs.end(); ++it) {
		TFx *fx = *it;
		if (fx)
			fx->release();
	}
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:22,代码来源:stageobjectsdata.cpp


示例14: createFx

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());
	}
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:23,代码来源:addfxcontextmenu.cpp


示例15: DeleteFxsUndo

 DeleteFxsUndo(const QList<TFx *> &fxs) {
   TApp *app    = TApp::instance();
   FxDag *fxDag = app->getCurrentXsheet()->getXsheet()->getFxDag();
   for (int i = 0; i < (int)fxs.size(); i++) {
     TFx *fx              = fxs[i];
     TZeraryColumnFx *zfx = dynamic_cast<TZeraryColumnFx *>(fx);
     if (zfx) fx          = zfx->getZeraryFx();
     Node node;
     node.m_fx              = fx;
     node.m_xsheetConnected = fxDag->getTerminalFxs()->containsFx(fx);
     int j;
     for (j = 0; j < fx->getInputPortCount(); j++) {
       TFxP inputFx(fx->getInputPort(j)->getFx());
       int i;
       if (inputFx &&
           !fxDag->getTerminalFxs()->containsFx(inputFx.getPointer())) {
         for (i = 0; i < (int)m_inputConnectedToXsheet.size(); i++)
           if (m_inputConnectedToXsheet[i].getPointer() ==
               inputFx.getPointer())
             break;
         if (i == (int)m_inputConnectedToXsheet.size())
           m_inputConnectedToXsheet.push_back(inputFx);
       }
       node.m_inputLinks.push_back(inputFx);
     }
     for (j = 0; j < fx->getOutputConnectionCount(); j++) {
       TFxPort *port = fx->getOutputConnection(j);
       TFx *outFx    = port->getOwnerFx();
       if (outFx) {
         int k;
         for (k = 0; k < outFx->getInputPortCount(); k++)
           if (outFx->getInputPort(k)->getFx() == fx) break;
         if (k < outFx->getInputPortCount())
           node.m_outputLinks.push_back(std::make_pair(k, TFxP(outFx)));
       }
     }
     m_fxs.push_back(node);
   }
 }
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:39,代码来源:fxschematicnodeselection.cpp


示例16: 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


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


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


示例19: assert

Link FxSelection::getBoundingFxs(SchematicPort *inputPort,
                                 SchematicPort *outputPort) {
  Link boundingFxs;
  FxSchematicNode *inputNode =
      dynamic_cast<FxSchematicNode *>(outputPort->getNode());
  FxSchematicNode *outputNode =
      dynamic_cast<FxSchematicNode *>(inputPort->getNode());
  FxGroupNode *groupNode = dynamic_cast<FxGroupNode *>(inputNode);

  if (!inputNode || !outputNode ||
      (groupNode && groupNode->getOutputConnectionsCount() != 1))
    return boundingFxs;
  if (dynamic_cast<TXsheetFx *>(outputNode->getFx())) {
    if (!groupNode)
      boundingFxs.m_inputFx = inputNode->getFx();
    else {
      TFxSet *terminals =
          m_xshHandle->getXsheet()->getFxDag()->getTerminalFxs();
      QList<TFxP> roots = groupNode->getRootFxs();
      int i;
      for (i = 0; i < roots.size(); i++)
        if (terminals->containsFx(roots[i].getPointer())) {
          boundingFxs.m_inputFx = roots[i];
          break;
        }
    }
    boundingFxs.m_outputFx = outputNode->getFx();
    return boundingFxs;
  }

  if (outputNode->isA(eGroupedFx)) {
    // devo prima trovare l'effetto interno al gruppo al quale inputNode e'
    // linkato.
    FxGroupNode *groupNode = dynamic_cast<FxGroupNode *>(outputNode);
    assert(groupNode);
    QList<TFx *> fxs;
    TFx *inputFx = inputNode->getFx();
    int i;
    for (i = 0; i < inputFx->getOutputConnectionCount(); i++) {
      TFx *outputFx = inputFx->getOutputConnection(i)->getOwnerFx();
      if (!outputFx) continue;
      if (groupNode->contains(outputFx)) fxs.push_back(outputFx);
    }
    if (fxs.size() != 1)  // un nodo esterno al gruppo puo' essere linkato a
                          // piu' nodi interni al gruppo
      return boundingFxs;

    TFx *outputFx = fxs[0];
    // ho tovato l'effetto, ora devo trovare l'indice della porta a cui e'
    // linkato l'effetto in input
    for (i = 0; i < outputFx->getInputPortCount(); i++) {
      TFxPort *inputPort = outputFx->getInputPort(i);
      TFx *fx            = inputPort->getFx();
      if (fx == inputFx) break;
    }
    if (i >= outputFx->getInputPortCount()) return boundingFxs;
    boundingFxs.m_inputFx  = inputFx;
    boundingFxs.m_outputFx = outputFx;
    boundingFxs.m_index    = i;
    return boundingFxs;
  } else {
    bool found = false;
    int i, index = -1;
    for (i = 0; i < outputNode->getInputPortCount() && !found; i++) {
      FxSchematicPort *inputAppPort = outputNode->getInputPort(i);
      int j;
      for (j = 0; j < inputAppPort->getLinkCount(); j++) {
        FxSchematicNode *outputAppNode =
            dynamic_cast<FxSchematicNode *>(inputAppPort->getLinkedNode(j));
        if (!outputAppNode) continue;
        FxSchematicPort *outputAppPort = outputAppNode->getOutputPort();
        if (inputAppPort == inputPort && outputPort == outputAppPort) {
          found = true;
          index = i;
          break;
        }
      }
    }
    if (index == -1) return boundingFxs;
    TFx *inputFx           = inputNode->getFx();
    TFx *outputFx          = outputNode->getFx();
    boundingFxs.m_inputFx  = inputFx;
    boundingFxs.m_outputFx = outputFx;
    boundingFxs.m_index    = index;
    return boundingFxs;
  }
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:87,代码来源:fxselection.cpp


示例20: switch

void MultimediaRenderer::Imp::start()
{
	//Retrieve some useful infos
	double stretchTo = m_renderSettings.m_timeStretchTo;
	double stretchFrom = m_renderSettings.m_timeStretchFrom;

	double timeStretchFactor = stretchFrom / stretchTo;
	bool fieldRendering = m_renderSettings.m_fieldPrevalence != TRenderSettings::NoField;

	std::wstring modeStr;
	switch (m_multimediaMode) {
	case COLUMNS:
		modeStr = L"_col";
		break;
	case LAYERS:
		modeStr = L"_lay";
		break;
	default:
		assert(0);
	}

	//Build the post processing fxs tree
	std::vector<TFxP> postFxs(m_framesToRender.size());

	std::set<double>::iterator jt;
	int j;
	for (j = 0, jt = m_framesToRender.begin(); jt != m_framesToRender.end(); ++j, ++jt)
		postFxs[j] = buildPostSceneFx(m_scene, *jt, m_renderSettings.m_shrinkX, false); // Adds camera and camera dpi transforms

	//For each node to be rendered
	int i, count = m_fxsToRender.getFxCount();
	for (i = 0; i < count; ++i) {
		//In case the process has been canceled, return
		if (m_canceled)
			return;

		//Then, build the scene fx for each frame to be rendered
		std::vector<std::pair<double, TFxPair>> pairsToBeRendered;

		//NOTE: The above pairs should not be directly added to a previously declared movierenderer,
		//since an output level would be created even before knowing if any cell to be rendered is
		//actually available.
		const BSFX_Transforms_Enum transforms =   // Do NOT add camera and
			BSFX_Transforms_Enum(BSFX_COLUMN_TR); // camera dpi transforms

		int j;
		for (j = 0, jt = m_framesToRender.begin(); jt != m_framesToRender.end(); ++j, ++jt) {
			TFxPair fx;

			if (m_renderSettings.m_stereoscopic)
				m_scene->shiftCameraX(-m_renderSettings.m_stereoscopicShift / 2);

			fx.m_frameA = buildSceneFx(m_scene, *jt, 0, m_fxsToRender.getFx(i),
									   transforms);

			if (m_renderSettings.m_stereoscopic) {
				m_scene->shiftCameraX(m_renderSettings.m_stereoscopicShift);
				fx.m_frameB = buildSceneFx(m_scene, *jt, 0, m_fxsToRender.getFx(i),
										   transforms);
				m_scene->shiftCameraX(-m_renderSettings.m_stereoscopicShift / 2);
			} else if (fieldRendering)
				fx.m_frameB = buildSceneFx(m_scene, *jt + 0.5 * timeStretchFactor, 0,
										   m_fxsToRender.getFx(i), transforms);
			else
				fx.m_frameB = TRasterFxP();

			//Substitute with the post-process...
			if (fx.m_frameA)
				fx.m_frameA = addPostProcessing(fx.m_frameA, postFxs[j]);
			if (fx.m_frameB)
				fx.m_frameB = addPostProcessing(fx.m_frameB, postFxs[j]);

			if (fx.m_frameA) //Could be 0, if the corresponding cell is void / not rendered
				pairsToBeRendered.push_back(std::pair<double, TFxPair>(*jt, fx));
		}

		if (pairsToBeRendered.size() == 0)
			continue; //Could be, if no cell for this column was in the frame range.

		//Build the output name
		TColumnFx *colFx = searchColumn(m_fxsToRender.getFx(i));
		TFx *currFx = m_fxsToRender.getFx(i);
		assert(colFx);
		if (!colFx)
			continue;

		int columnIndex = colFx->getColumnIndex();
		std::wstring columnName(colFx->getColumnName());
		std::wstring columnId(colFx->getColumnId());
		std::wstring fxName(currFx->getName());
		std::wstring fxNameNoSpaces(::removeSpaces(fxName));
		std::wstring fxId(currFx->getFxId());

		std::wstring fpName = m_fp.getWideName() +
						 L"_" + columnName + (columnId == columnName ? L"" : L"(" + columnId + L")") +
						 (fxId.empty() ? L"" : L"_" + fxName + (fxId == fxNameNoSpaces ? L"" : L"(" + fxId + L")"));
		TFilePath movieFp(m_fp.withName(fpName));

		//Initialize a MovieRenderer with our infos
		MovieRenderer movieRenderer(m_scene, movieFp, m_threadCount, false);
//.........这里部分代码省略.........
开发者ID:titer1,项目名称:opentoonz,代码行数:101,代码来源:multimediarenderer.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TGadget类代码示例发布时间:2022-05-31
下一篇:
C++ TFunction_Logbook类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap