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


C++ TransformNode::getParent方法代码示例

本文整理汇总了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;
}
开发者ID:zuchermann,项目名称:GraphicsClass,代码行数:17,代码来源:drawing.cpp

示例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;
}
开发者ID:zuchermann,项目名称:GraphicsClass,代码行数:22,代码来源:drawing.cpp

示例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();
}
开发者ID:zuchermann,项目名称:GraphicsClass,代码行数:22,代码来源:drawing.cpp

示例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();
}
开发者ID:zuchermann,项目名称:GraphicsClass,代码行数:23,代码来源:drawing.cpp


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