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


C++ TStageObject类代码示例

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


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

示例1: setKeyframes

void TKeyframeSelection::setKeyframes() {
  TApp *app                   = TApp::instance();
  TXsheetHandle *xsheetHandle = app->getCurrentXsheet();
  TXsheet *xsh                = xsheetHandle->getXsheet();
  TStageObjectId cameraId     = xsh->getStageObjectTree()->getCurrentCameraId();
  if (isEmpty()) return;
  Position pos         = *m_positions.begin();
  int row              = pos.first;
  int col              = pos.second;
  TStageObjectId id    = col < 0 ? cameraId : TStageObjectId::ColumnId(col);
  TStageObject *pegbar = xsh->getStageObject(id);
  if (!pegbar) return;
  if (pegbar->isKeyframe(row)) {
    TStageObject::Keyframe key = pegbar->getKeyframe(row);
    pegbar->removeKeyframeWithoutUndo(row);
    UndoRemoveKeyFrame *undo =
        new UndoRemoveKeyFrame(id, row, key, xsheetHandle);
    undo->setObjectHandle(app->getCurrentObject());
    TUndoManager::manager()->add(undo);
  } else {
    pegbar->setKeyframeWithoutUndo(row);
    UndoSetKeyFrame *undo = new UndoSetKeyFrame(id, row, xsheetHandle);
    undo->setObjectHandle(app->getCurrentObject());
    TUndoManager::manager()->add(undo);
  }
  TApp::instance()->getCurrentScene()->setDirtyFlag(true);
  TApp::instance()->getCurrentObject()->notifyObjectIdChanged(false);
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:28,代码来源:keyframeselection.cpp

示例2: visit

void Stage::visit(Visitor &visitor, const VisitArgs &args) {
  ToonzScene *scene        = args.m_scene;
  TXsheet *xsh             = args.m_xsh;
  int row                  = args.m_row;
  int col                  = args.m_col;
  const OnionSkinMask *osm = args.m_osm;
  bool camera3d            = args.m_camera3d;
  int xsheetLevel          = args.m_xsheetLevel;
  bool isPlaying           = args.m_isPlaying;

  StageBuilder sb;
  sb.m_vs                 = &visitor.m_vs;
  TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();
  TStageObject *camera    = xsh->getStageObject(cameraId);
  TAffine cameraAff       = camera->getPlacement(row);
  double z                = camera->getZ(row);
  sb.m_cameraPlacement    = ZPlacement(cameraAff, z);
  sb.m_camera3d           = camera3d;
  sb.m_currentColumnIndex = col;
  sb.m_xsheetLevel        = xsheetLevel;
  sb.m_onionSkinMask      = *osm;
  Player::m_onionSkinFrontSize = 0;
  Player::m_onionSkinBackSize  = 0;
  sb.addFrame(sb.m_players, scene, xsh, row, 0, args.m_onlyVisible,
              args.m_checkPreviewVisibility);

  updateOnionSkinSize(sb.m_players);

  sb.visit(sb.m_players, visitor, isPlaying);
}
开发者ID:ideasman42,项目名称:opentoonz,代码行数:30,代码来源:stage.cpp

示例3: assert

//-----------------------------------------------------------------------------
// data <- xsheet
void TKeyframeData::setKeyframes(std::set<Position> positions, TXsheet *xsh)
{
	if (positions.empty())
		return;

	TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();

	std::set<Position>::iterator it = positions.begin();
	int r0 = it->first;
	int c0 = it->second;
	for (++it; it != positions.end(); ++it) {
		r0 = std::min(r0, it->first);
		c0 = std::min(c0, it->second);
	}

	for (it = positions.begin(); it != positions.end(); ++it) {
		int row = it->first;
		int col = it->second;
		TStageObject *pegbar = xsh->getStageObject(col >= 0 ? TStageObjectId::ColumnId(col) : cameraId);
		assert(pegbar);
		m_isPegbarsCycleEnabled[col] = pegbar->isCycleEnabled();
		if (pegbar->isKeyframe(row)) {
			Position p(row - r0, col - c0);
			TStageObject::Keyframe k = pegbar->getKeyframe(row);
			m_keyData[p] = k;
		}
	}
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:30,代码来源:keyframedata.cpp

示例4: getStageObject

bool ViewerKeyframeNavigator::hasPrev() const {
  TStageObject *pegbar = getStageObject();
  if (!pegbar) return false;
  int r0, r1;
  pegbar->getKeyframeRange(r0, r1);
  return r0 <= r1 && getCurrentFrame() > r0;
}
开发者ID:luc--,项目名称:opentoonz,代码行数:7,代码来源:keyframenavigator.cpp

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

示例6: magicLink

void SkeletonTool::magicLink(int index)
{
	if (index < 0 || index >= (int)m_magicLinks.size())
		return;
	HookData h0 = m_magicLinks[index].m_h0;
	HookData h1 = m_magicLinks[index].m_h1;
	TTool::Application *app = TTool::getApplication();
	TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
	int columnIndex = app->getCurrentColumn()->getColumnIndex();
	TStageObjectId id = TStageObjectId::ColumnId(columnIndex);
	TStageObject *obj = xsh->getStageObject(id);

	int parentColumnIndex = h1.m_columnIndex;
	TStageObjectId parentId = TStageObjectId::ColumnId(parentColumnIndex);
	std::string parentHandle = h1.getHandle();

	std::string handle = "";
	if (h0.m_columnIndex < 0) {
		handle = obj->getHandle();
	} else {
		handle = h0.getHandle();
	}

	//TUndoManager *undoManager = TUndoManager::manager();
	//undoManager->beginBlock();
	TStageObjectCmd::setHandle(id, handle, app->getCurrentXsheet());
	TStageObjectCmd::setParent(id, parentId, parentHandle, app->getCurrentXsheet());
	//undoManager->endBlock();
}
开发者ID:titer1,项目名称:opentoonz,代码行数:29,代码来源:skeletontool.cpp

示例7: getStageObject

bool ViewerKeyframeNavigator::isFullKeyframe() const
{
	TStageObject *pegbar = getStageObject();
	if (!pegbar)
		return false;
	return pegbar->isFullKeyframe(getCurrentFrame());
}
开发者ID:CroW-CZ,项目名称:opentoonz,代码行数:7,代码来源:keyframenavigator.cpp

示例8: addBoneId

	void addBoneId(const TStageObjectId &id)
	{
		TStageObject *stageObject = getXsheet()->getStageObject(id);
		if (stageObject) {
			TStageObject::Keyframe k = stageObject->getKeyframe(m_frame);
			m_keyframes.push_back(std::make_pair(id, k));
		}
	}
开发者ID:titer1,项目名称:opentoonz,代码行数:8,代码来源:skeletontool.cpp

示例9: onSplineChanged

void TApp::onSplineChanged()
{
	if (m_currentObject->isSpline()) {
		TXsheet *xsh = m_currentXsheet->getXsheet();
		TStageObject *currentObject = xsh->getStageObject(m_currentObject->getObjectId());
		currentObject->setOffset(currentObject->getOffset()); //invalidate currentObject
	}
}
开发者ID:calebwoo92,项目名称:opentoonz,代码行数:8,代码来源:tapp.cpp

示例10: storeObject

void TStageObjectDataElement::storeObject(const TStageObjectId &objId, TXsheet *xsh)
{
	// Search the object in the xsheet (false = don't create a new one)
	TStageObject *obj = xsh->getStageObjectTree()->getStageObject(objId, false);
	assert(obj);

	m_params = obj->getParams();
	m_dagPos = obj->getDagNodePos();
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:9,代码来源:stageobjectsdata.cpp

示例11: storeCamera

void TCameraDataElement::storeCamera(const TStageObjectId &selectedObj, TXsheet *xsh)
{
	TStageObject *obj = xsh->getStageObjectTree()->getStageObject(selectedObj, false);
	assert(obj);

	m_params = obj->getParams();
	m_camera = *(obj->getCamera());
	m_dagPos = obj->getDagNodePos();
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:9,代码来源:stageobjectsdata.cpp

示例12: selectCellKeyframe

void TCellKeyframeSelection::selectCellKeyframe(int row, int col) {
  m_cellSelection->selectCell(row, col);
  TXsheet *xsh = m_xsheetHandle->getXsheet();
  TStageObjectId id =
      col < 0 ? TStageObjectId::CameraId(0) : TStageObjectId::ColumnId(col);
  TStageObject *stObj = xsh->getStageObject(id);
  m_keyframeSelection->clear();
  if (stObj->isKeyframe(row)) m_keyframeSelection->select(row, col);
}
开发者ID:opentoonz,项目名称:opentoonz,代码行数:9,代码来源:cellkeyframeselection.cpp

示例13: onObjectSwitched

void TApp::onObjectSwitched() {
  if (m_currentObject->isSpline()) {
    TXsheet *xsh = m_currentXsheet->getXsheet();
    TStageObject *currentObject =
        xsh->getStageObject(m_currentObject->getObjectId());
    TStageObjectSpline *ps = currentObject->getSpline();
    m_currentObject->setSplineObject(ps);
  } else
    m_currentObject->setSplineObject(0);
  onImageChanged();
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:11,代码来源:tapp.cpp

示例14: assert

void StageBuilder::addFrame(PlayerSet &players, ToonzScene *scene, TXsheet *xsh,
                            int row, int level, bool includeUnvisible,
                            bool checkPreviewVisibility) {
  int columnCount        = xsh->getColumnCount();
  unsigned int maskCount = m_masks.size();

  std::vector<std::pair<double, int>> shuffle;
  for (int c = 0; c < columnCount; c++) {
    TXshColumnP column = xsh->getColumn(c);
    assert(column);
    TStageObject *pegbar = xsh->getStageObject(TStageObjectId::ColumnId(c));
    double columnSO      = pegbar->getSO(row);
    shuffle.push_back(std::make_pair(columnSO, c));
  }
  std::stable_sort(shuffle.begin(), shuffle.end(), StackingOrder());

  for (int i = 0; i < columnCount; i++) {
    int c = shuffle[i].second;
    if (CameraTestCheck::instance()->isEnabled() && c != m_currentColumnIndex)
      continue;
    if (level == 0) {
      // m_isCurrentColumn = (c == m_currentColumnIndex);
      m_ancestorColumnIndex = c;
    }
    TXshColumn *column = xsh->getColumn(c);
    bool isMask        = false;
    if (column && !column->isEmpty()) {
      if (!column->isPreviewVisible() && checkPreviewVisibility) continue;
      if (column->isCamstandVisible() ||
          includeUnvisible)  // se l'"occhietto" non e' chiuso
      {
        if (column->isMask())  // se e' una maschera (usate solo in tab pro)
        {
          isMask = true;
          std::vector<int> saveMasks;
          saveMasks.swap(m_masks);
          int maskIndex   = m_maskPool.size();
          PlayerSet *mask = new PlayerSet();
          m_maskPool.push_back(mask);
          addCellWithOnionSkin(*mask, scene, xsh, row, c, level);
          std::stable_sort(mask->begin(), mask->end(), PlayerLt());
          saveMasks.swap(m_masks);
          m_masks.push_back(maskIndex);
        } else
          addCellWithOnionSkin(players, scene, xsh, row, c, level);
      }
    }
    if (!isMask) {
      while (m_masks.size() > maskCount) m_masks.pop_back();
    }
  }
  if (level == 0) std::stable_sort(players.begin(), players.end(), PlayerLt());
}
开发者ID:ideasman42,项目名称:opentoonz,代码行数:53,代码来源:stage.cpp

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


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