本文整理汇总了C++中TStageObject类的典型用法代码示例。如果您正苦于以下问题:C++ TStageObject类的具体用法?C++ TStageObject怎么用?C++ TStageObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TStageObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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
示例17: 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
示例18: clearAllItems
void StageSchematicScene::updateScene()
{
clearAllItems();
QPointF firstPos = sceneRect().center();
m_nextNodePos = TPointD(firstPos.x(), firstPos.y());
TStageObjectTree *pegTree = m_xshHandle->getXsheet()->getStageObjectTree();
m_nodeTable.clear();
m_GroupTable.clear();
m_groupEditorTable.clear();
m_gridDimension = pegTree->getDagGridDimension();
QMap<int, QList<TStageObject *>> groupedObj;
QMap<int, QList<SchematicNode *>> editedGroup;
// in order to draw the position-specified nodes first
QList<int> modifiedNodeIds;
for (int i = 0; i < pegTree->getStageObjectCount(); i++) {
TStageObject *pegbar = pegTree->getStageObject(i);
if (pegbar->getDagNodePos() == TConst::nowhere)
modifiedNodeIds.push_back(i);
else
modifiedNodeIds.push_front(i);
}
for (int i = 0; i < modifiedNodeIds.size(); i++) {
TStageObject *pegbar = pegTree->getStageObject(modifiedNodeIds.at(i));
if (pegbar->isGrouped() && !pegbar->isGroupEditing()) {
groupedObj[pegbar->getGroupId()].push_back(pegbar);
continue;
}
StageSchematicNode *node = addStageSchematicNode(pegbar);
if (node != 0) {
m_nodeTable[pegbar->getId()] = node;
if (pegbar->isGrouped())
editedGroup[pegbar->getEditingGroupId()].append(node);
}
}
//Motion Path
m_splineTable.clear();
for (int i = 0; i < pegTree->getSplineCount(); i++) {
TStageObjectSpline *spline = pegTree->getSpline(i);
StageSchematicSplineNode *node = addSchematicSplineNode(spline);
if (node != 0) {
m_splineTable[spline] = node;
connect(node, SIGNAL(currentObjectChanged(const TStageObjectId &, bool)), this,
SLOT(onCurrentObjectChanged(const TStageObjectId &, bool)));
}
}
开发者ID:PsmithG,项目名称:opentoonz,代码行数:51,代码来源:stageschematicscene.cpp
示例19: assert
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
示例20: while
TStageObjectId TCameraDataElement::restoreCamera(TXsheet *xsh, bool copyPosition) const
{
TStageObjectTree *tree = xsh->getStageObjectTree();
// Search the first unused camera id in the xsheet
int index = 0;
while (tree->getStageObject(TStageObjectId::CameraId(index), false))
++index;
// Create the new camera object and assign stored data
TStageObject *newCamera = tree->getStageObject(TStageObjectId::CameraId(index), true);
newCamera->assignParams(m_params);
*(newCamera->getCamera()) = m_camera;
if (copyPosition)
newCamera->setDagNodePos(m_dagPos);
return newCamera->getId();
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:19,代码来源:stageobjectsdata.cpp
注:本文中的TStageObject类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论