本文整理汇总了C++中scene::INodePtr::removeChildNode方法的典型用法代码示例。如果您正苦于以下问题:C++ INodePtr::removeChildNode方法的具体用法?C++ INodePtr::removeChildNode怎么用?C++ INodePtr::removeChildNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scene::INodePtr
的用法示例。
在下文中一共展示了INodePtr::removeChildNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createCaps
void createCaps(Patch& patch, const scene::INodePtr& parent, EPatchCap type, const std::string& shader)
{
if ((type == eCapEndCap || type == eCapIEndCap) && patch.getWidth() != 5)
{
rError() << "cannot create end-cap - patch width != 5" << std::endl;
gtkutil::MessageBox::ShowError(_("Cannot create end-cap, patch must have a width of 5."),
GlobalMainFrame().getTopLevelWindow());
return;
}
if ((type == eCapBevel || type == eCapIBevel) && patch.getWidth() != 3)
{
gtkutil::MessageBox::ShowError(_("Cannot create bevel-cap, patch must have a width of 3."),
GlobalMainFrame().getTopLevelWindow());
rError() << "cannot create bevel-cap - patch width != 3" << std::endl;
return;
}
if (type == eCapCylinder && patch.getWidth() != 9)
{
gtkutil::MessageBox::ShowError(_("Cannot create cylinder-cap, patch must have a width of 9."),
GlobalMainFrame().getTopLevelWindow());
rError() << "cannot create cylinder-cap - patch width != 9" << std::endl;
return;
}
assert(parent != NULL);
{
scene::INodePtr cap(GlobalPatchCreator(DEF2).createPatch());
parent->addChildNode(cap);
Patch* capPatch = Node_getPatch(cap);
assert(capPatch != NULL);
patch.MakeCap(capPatch, type, ROW, true);
capPatch->setShader(shader);
// greebo: Avoid creating "degenerate" patches (all vertices merged in one 3D point)
if (!capPatch->isDegenerate())
{
Node_setSelected(cap, true);
}
else
{
parent->removeChildNode(cap);
rWarning() << "Prevented insertion of degenerate patch." << std::endl;
}
}
{
scene::INodePtr cap(GlobalPatchCreator(DEF2).createPatch());
parent->addChildNode(cap);
Patch* capPatch = Node_getPatch(cap);
assert(capPatch != NULL);
patch.MakeCap(capPatch, type, ROW, false);
capPatch->setShader(shader);
// greebo: Avoid creating "degenerate" patches (all vertices merged in one 3D point)
if (!capPatch->isDegenerate())
{
Node_setSelected(cap, true);
}
else
{
parent->removeChildNode(cap);
rWarning() << "Prevented insertion of degenerate patch." << std::endl;
}
}
}