本文整理汇总了C++中scene::INodePtr::addChildNode方法的典型用法代码示例。如果您正苦于以下问题:C++ INodePtr::addChildNode方法的具体用法?C++ INodePtr::addChildNode怎么用?C++ INodePtr::addChildNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scene::INodePtr
的用法示例。
在下文中一共展示了INodePtr::addChildNode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addPrimitiveToEntity
bool MapImporter::addPrimitiveToEntity(const scene::INodePtr& primitive, const scene::INodePtr& entity)
{
_nodes.insert(NodeMap::value_type(
NodeIndexPair(_entityCount, _primitiveCount), primitive));
_primitiveCount++;
if (_dialog && _dialogEventLimiter.readyForEvent())
{
_dialog->setTextAndFraction(
_dlgEntityText + "Primitive " + string::to_string(_primitiveCount),
getProgressFraction()
);
}
if (Node_getEntity(entity)->isContainer())
{
entity->addChildNode(primitive);
return true;
}
else
{
return false;
}
}
示例2: addPrimitiveToEntity
bool addPrimitiveToEntity(const scene::INodePtr& primitive, const scene::INodePtr& entity)
{
if (Node_getEntity(entity)->isContainer())
{
entity->addChildNode(primitive);
return true;
}
else
{
return false;
}
}
示例3: 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;
}
}
}
示例4: addEntity
bool addEntity(const scene::INodePtr& entityNode)
{
_root->addChildNode(entityNode);
return true;
}