本文整理汇总了C++中NodePtr::editMFChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ NodePtr::editMFChildren方法的具体用法?C++ NodePtr::editMFChildren怎么用?C++ NodePtr::editMFChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodePtr
的用法示例。
在下文中一共展示了NodePtr::editMFChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: traverseLeave
Action::ResultE SplitGraphOp::traverseLeave(NodePtr& node, Action::ResultE res)
{
std::vector<NodePtr>::iterator it = node->editMFChildren()->getValues().begin();
std::vector<NodePtr>::iterator en = node->editMFChildren()->getValues().end ();
std::vector<NodePtr> toAdd;
std::vector<NodePtr> toSub;
for ( ; it != en; ++it )
{
bool special=isInExcludeList(*it);
bool leaf=isLeaf(*it);
if (!special && leaf)
{
if (splitNode(*it, toAdd))
toSub.push_back(*it);
}
}
it = toAdd.begin();
en = toAdd.end ();
for ( ; it != en; ++it )
{
beginEditCP(node, Node::ChildrenFieldMask);
node->addChild(*it);
endEditCP (node, Node::ChildrenFieldMask);
}
it = toSub.begin();
en = toSub.end ();
for ( ; it != en; ++it )
{
beginEditCP(node, Node::ChildrenFieldMask);
addRefCP(*it);
node->subChild(*it);
endEditCP (node, Node::ChildrenFieldMask);
}
return res;
}
示例2: updateScene
void updateScene()
{
statfg->editCollector().getElem(majorAlignDesc)->set(alignmentToString(layoutParam.majorAlignment));
statfg->editCollector().getElem(minorAlignDesc)->set(alignmentToString(layoutParam.minorAlignment));
statfg->editCollector().getElem(dirDesc)->set(layoutParam.horizontal ? "Horizontal" : "Vertical");
statfg->editCollector().getElem(horiDirDesc)->set(layoutParam.leftToRight ? "Left to right" : "Right to left");
statfg->editCollector().getElem(vertDirDesc)->set(layoutParam.topToBottom ? "Top to bottom" : "Bottom to top");
if(face == NULL)
return;
// Put it all together into a Geometry NodeCore.
TextLayoutResult layoutResult;
Real32 scale = 2.f;
face->layout(lines, layoutParam, layoutResult);
#if 0
GeometryPtr geo = Geometry::create();
face->fillGeo(geo, layoutResult, scale);
NodePtr textNode = Node::create();
beginEditCP(textNode, Node::CoreFieldMask);
{
textNode->setCore(geo);
}
endEditCP(textNode, Node::CoreFieldMask);
#else
NodePtr textNode = face->makeNode(layoutResult, scale);
GeometryPtr geo = GeometryPtr::dcast(textNode->getCore());
#endif
NodePtr transNodePtr = Node::create();
TransformPtr transPtr = Transform::create();
Matrix transMatrix;
transMatrix.setTranslate(0.f, 0.f, -0.03f);
beginEditCP(transPtr);
{
transPtr->setMatrix(transMatrix);
}
endEditCP(transPtr);
beginEditCP(transNodePtr, Node::CoreFieldMask | Node::ChildrenFieldMask);
{
transNodePtr->setCore(transPtr);
transNodePtr->addChild(textNode);
}
endEditCP(transNodePtr, Node::CoreFieldMask | Node::ChildrenFieldMask);
ImagePtr imagePtr = face->getTexture();
TextureChunkPtr texChunk = TextureChunk::create();
beginEditCP(texChunk);
{
texChunk->setImage(imagePtr);
texChunk->setWrapS(GL_CLAMP);
texChunk->setWrapT(GL_CLAMP);
texChunk->setMagFilter(GL_NEAREST);
texChunk->setMinFilter(GL_NEAREST);
texChunk->setEnvMode(GL_MODULATE);
}
endEditCP(texChunk);
MaterialChunkPtr matChunk = MaterialChunk::create();
beginEditCP(matChunk);
{
matChunk->setAmbient(Color4f(1.f, 1.f, 1.f, 1.f));
matChunk->setDiffuse(Color4f(1.f, 1.f, 1.f, 1.f));
matChunk->setEmission(Color4f(0.f, 0.f, 0.f, 1.f));
matChunk->setSpecular(Color4f(0.f, 0.f, 0.f, 1.f));
matChunk->setShininess(0);
}
endEditCP(matChunk);
BlendChunkPtr blendChunk = BlendChunk::create();
beginEditCP(blendChunk);
{
blendChunk->setSrcFactor(GL_SRC_ALPHA);
blendChunk->setDestFactor(GL_ONE_MINUS_SRC_ALPHA);
}
endEditCP(blendChunk);
ChunkMaterialPtr m = ChunkMaterial::create();
beginEditCP(m);
{
m->addChunk(texChunk);
m->addChunk(matChunk);
m->addChunk(blendChunk);
}
endEditCP(m);
beginEditCP(geo, Geometry::MaterialFieldMask);
{
geo->setMaterial(m);
}
endEditCP(geo, Geometry::MaterialFieldMask);
beginEditCP(scene, Node::ChildrenFieldMask);
{
scene->editMFChildren()->clear();
scene->addChild(createCoordinateCross());
scene->addChild(createMetrics(face, scale, layoutParam, layoutResult));
scene->addChild(transNodePtr);
}
endEditCP(scene, Node::ChildrenFieldMask);
//.........这里部分代码省略.........