本文整理汇总了C++中TransformNode::getParent方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformNode::getParent方法的具体用法?C++ TransformNode::getParent怎么用?C++ TransformNode::getParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransformNode
的用法示例。
在下文中一共展示了TransformNode::getParent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: noParentAncestorSelections
// Function to verify that no ancestor of the last selected node
// is a member of the selection set.
bool noParentAncestorSelections()
{
TransformNode* current = lastSelected->getParent();
while (current)
{
if (selections.find(current) != selections.end())
{
cerr << "Operation not valid for selection set." << endl;
cerr << "An ancestor of the last selected item is also selected." << endl;
return false;
}
current = current->getParent();
}
return true;
}
示例2: noAncestorDescendantSelections
// Function to verify that selection set includes no two nodes, one of
// which is an ancestor of the other.
bool noAncestorDescendantSelections()
{
for (set<TransformNode*>::const_iterator iter = selections.begin();
iter != selections.end();
++iter)
{
TransformNode* current = (*iter)->getParent();
while (current)
{
if (selections.find(current) != selections.end())
{
cerr << "Operation not valid for selection set." << endl;
cerr << "An ancestor of a selected item is also selected." << endl;
return false;
}
current = current->getParent();
}
}
return true;
}
示例3: deleteSelectedObjects
// Function to process the Delete menu command.
void deleteSelectedObjects()
{
if (lastSelected == NULL) return;
if (!noAncestorDescendantSelections()) return;
for (set<TransformNode*>::const_iterator iter = selections.begin();
iter != selections.end();
++iter)
{
TransformNode* target = *iter;
if (target == sceneRoot)
{
sceneRoot = new TransformNode(NULL);
sceneRoot->addChild(target);
target->setParent(sceneRoot);
}
target->getParent()->removeChild(target);
delete target;
}
selections.clear();
glutPostRedisplay();
}
示例4: copySelectedObjects
// Function to process the Copy menu command.
void copySelectedObjects()
{
if (!noAncestorDescendantSelections()) return;
for (set<TransformNode*>::const_iterator iter = selections.begin();
iter != selections.end();
++iter)
{
TransformNode* target = *iter;
if (target == sceneRoot)
{
sceneRoot = new TransformNode(NULL);
sceneRoot->addChild(target);
target->setParent(sceneRoot);
}
TransformNode* parent = target->getParent();
TransformNode* newThing = target->clone();
parent->addChild(newThing);
newThing->setParent(parent);
target->translate(COPY_OFF_X, COPY_OFF_Y);
}
glutPostRedisplay();
}