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


C++ TXsheet::getStageObject方法代码示例

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


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

示例1: showEvent

void FunctionViewer::showEvent(QShowEvent *) {
  refreshModel();

  // Connect handles
  bool ret = true;

  if (m_xshHandle) {
    ret = connect(m_xshHandle, SIGNAL(xsheetChanged()), this,
                  SLOT(refreshModel())) &&
          ret;
    ret = connect(m_xshHandle, SIGNAL(xsheetSwitched()), this,
                  SLOT(rebuildModel())) &&
          ret;
  }

  if (m_frameHandle)
    ret = connect(m_frameHandle, SIGNAL(frameSwitched()), this,
                  SLOT(propagateExternalSetFrame())) &&
          ret;

  if (m_objectHandle) {
    ret = connect(m_objectHandle, SIGNAL(objectSwitched()), this,
                  SLOT(onStageObjectSwitched())) &&
          ret;
    ret = connect(m_objectHandle, SIGNAL(objectChanged(bool)), this,
                  SLOT(onStageObjectChanged(bool))) &&
          ret;
  }

  if (m_fxHandle)
    ret =
        connect(m_fxHandle, SIGNAL(fxSwitched()), this, SLOT(onFxSwitched())) &&
        ret;

  // display animated channels when the scene is switched
  if (m_sceneHandle)
    ret = connect(m_sceneHandle, SIGNAL(sceneSwitched()), m_treeView,
                  SLOT(displayAnimatedChannels())) &&
          ret;

  assert(ret);

  m_treeView->setExpanded(m_treeView->model()->index(0, 0), true);
  m_treeView->setExpanded(m_treeView->model()->index(1, 0), true);

  FunctionTreeModel *ftm =
      static_cast<FunctionTreeModel *>(m_treeView->model());

  if (m_objectHandle) {
    assert(m_xshHandle);
    TXsheet *xsh = m_xshHandle->getXsheet();

    const TStageObjectId &objId = m_objectHandle->getObjectId();
    ftm->setCurrentStageObject((objId == TStageObjectId::NoneId)
                                   ? (TStageObject *)0
                                   : xsh->getStageObject(objId));
  }

  if (m_fxHandle) ftm->setCurrentFx(m_fxHandle->getFx());
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:60,代码来源:functionviewer.cpp

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

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

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

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

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

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

示例8: addSelectCommand

void SceneViewerContextMenu::addSelectCommand(QMenu *menu,
                                              const TStageObjectId &id) {
  TXsheet *xsh              = TApp::instance()->getCurrentXsheet()->getXsheet();
  TStageObject *stageObject = xsh->getStageObject(id);
  if (!stageObject) return;
  QString text           = getName(stageObject);
  if (menu == this) text = "Select " + text;
  QAction *action        = new QAction(text, this);
  action->setData(id.getCode());
  connect(action, SIGNAL(triggered()), this, SLOT(onSetCurrent()));
  menu->addAction(action);
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:12,代码来源:sceneviewercontextmenu.cpp

示例9: addShowHideCommand

void SceneViewerContextMenu::addShowHideCommand(QMenu *menu,
                                                TXshColumn *column) {
  bool isHidden = !column->isCamstandVisible();
  TXsheet *xsh  = TApp::instance()->getCurrentXsheet()->getXsheet();
  TStageObject *stageObject =
      xsh->getStageObject(TStageObjectId::ColumnId(column->getIndex()));
  QString text    = (isHidden ? "Show " : "Hide ") + getName(stageObject);
  QAction *action = new QAction(text, this);
  action->setData(column->getIndex());
  connect(action, SIGNAL(triggered()), this, SLOT(onShowHide()));
  menu->addAction(action);
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:12,代码来源:sceneviewercontextmenu.cpp

示例10:

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

示例11: getColumnMatrix

TAffine TTool::getColumnMatrix(int columnIndex) const {
  if (!m_application) return TAffine();

  TFrameHandle *fh = m_application->getCurrentFrame();
  if (fh->isEditingLevel()) return TAffine();
  int frame               = fh->getFrame();
  TXsheet *xsh            = m_application->getCurrentXsheet()->getXsheet();
  TStageObjectId columnId = TStageObjectId::ColumnId(columnIndex);
  TAffine columnPlacement = xsh->getPlacement(columnId, frame);
  double columnZ          = xsh->getZ(columnId, frame);

  TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();
  TStageObject *camera    = xsh->getStageObject(cameraId);
  TAffine cameraPlacement = camera->getPlacement(frame);
  double cameraZ          = camera->getZ(frame);

  TStageObject *object = xsh->getStageObject(columnId);
  TAffine placement;
  TStageObject::perspective(placement, cameraPlacement, cameraZ,
                            columnPlacement, columnZ,
                            object->getGlobalNoScaleZ());

  return placement;
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:24,代码来源:tool.cpp

示例12: addShowHideStageObjectCmd

void addShowHideStageObjectCmd(QMenu *menu, const TStageObjectId &id,
                               bool isShow) {
  TXsheet *xsh         = TApp::instance()->getCurrentXsheet()->getXsheet();
  TStageObject *pegbar = xsh->getStageObject(id);
  QString cmdStr;
  if (id.isCamera())
    cmdStr = (isShow ? "Show " : "Hide ") +
             QString::fromStdString(pegbar->getName());
  else
    cmdStr = (isShow ? "Show Column" : "Hide Column") +
             QString::fromStdString(pegbar->getName());
  QAction *showHideAction = new QAction(cmdStr, menu);
  showHideAction->setData((int)id.getCode());
  menu->addAction(showHideAction);
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:15,代码来源:sceneviewercontextmenu.cpp

示例13: notify

	void notify() const
	{
		m_tool->invalidate();
		TXsheet *xsh = getXsheet();
		int index = m_columnIndex;
		if (index < 0)
			index = m_oldColumnIndex;
		if (index >= 0) {
			TStageObjectId id = TStageObjectId::ColumnId(index);
			TStageObjectId parentId;
			while (parentId = xsh->getStageObjectParent(id), parentId.isColumn())
				id = parentId;
			xsh->getStageObject(id)->invalidate();
			TTool::getApplication()->getCurrentXsheet()->notifyXsheetChanged();
			TTool::getApplication()->getCurrentObject()->notifyObjectIdChanged(false);
		}
	}
开发者ID:titer1,项目名称:opentoonz,代码行数:17,代码来源:skeletontool.cpp

示例14: selectCellsKeyframes

void TCellKeyframeSelection::selectCellsKeyframes(int r0, int c0, int r1,
                                                  int c1) {
  m_cellSelection->selectCells(r0, c0, r1, c1);
  TXsheet *xsh = m_xsheetHandle->getXsheet();
  m_xsheetHandle->getXsheet();
  if (r1 < r0) std::swap(r0, r1);
  if (c1 < c0) std::swap(c0, c1);
  m_keyframeSelection->clear();
  int r, c;
  for (c = c0; c <= c1; c++)
    for (r = r0; r <= r1; r++) {
      TStageObjectId id =
          c < 0 ? TStageObjectId::CameraId(0) : TStageObjectId::ColumnId(c);
      TStageObject *stObj = xsh->getStageObject(id);
      if (stObj->isKeyframe(r)) m_keyframeSelection->select(r, c);
    }
}
开发者ID:opentoonz,项目名称:opentoonz,代码行数:17,代码来源:cellkeyframeselection.cpp

示例15: acquirePreview

void MeshifyPopup::acquirePreview()
{
	m_viewer->clear();

	// Assign preview input to the viewer
	bool enabled = false;

	::xshPos(m_r, m_c);
	m_cell = TApp::instance()->getCurrentXsheet()->getXsheet()->getCell(m_r, m_c);

	// Redirect mesh case to texture
	TXshSimpleLevel *sl = m_cell.getSimpleLevel();
	if (sl && sl->getType() == MESH_XSHLEVEL) {
		// Mesh image case
		TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
		TStageObject *meshObj = xsh->getStageObject(TStageObjectId::ColumnId(m_c));

		const TStageObjectId &childId = ::firstChildLevelColumn(*xsh, *meshObj);
		if (childId.isColumn())
			// Retrieved the associated texture cell - redirect acquisition there
			m_cell = xsh->getCell(m_r, childId.getIndex());
	}

	if ((sl = m_cell.getSimpleLevel())) {
		// Standard image case
		m_viewer->m_img = sl->getFullsampledFrame(m_cell.getFrameId(), ImageManager::dontPutInCache);

		enabled = true;
	} else if (TXshChildLevel *cl = m_cell.getChildLevel()) {
		// Sub-xsheet case
		TXsheet *xsh = cl->getXsheet();
		int row = m_cell.getFrameId().getNumber() - 1;

		m_viewer->m_xsh = xsh, m_viewer->m_row = row;

		enabled = true;
	}

	m_okBtn->setEnabled(enabled);

	// Update the corresponding processed image in the viewer
	updateMeshPreview();
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:43,代码来源:meshifypopup.cpp


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