本文整理汇总了C++中SLNode::parent方法的典型用法代码示例。如果您正苦于以下问题:C++ SLNode::parent方法的具体用法?C++ SLNode::parent怎么用?C++ SLNode::parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SLNode
的用法示例。
在下文中一共展示了SLNode::parent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shapeInit
/*!
The SLRefGroup::shapeInit checks the validity of the referenced node. To avoid
endless loops a refShape node is not allowed to refShape its ancestors. An
ancestor of a refShape node is group node followed along the previous pointers
with lower depth than the depth of the refShape node.
*/
void SLRefGroup::shapeInit(SLSceneView* sv)
{
// cummulate wm with referenced wm
SLShape* ref = (SLShape*)_refGroup;
_wm *= ref->m();
_wmI.setMatrix(_wm.inverse());
_wmN.setMatrix(_wmI.mat3());
_wmN.transpose();
// check circular references
SLNode* parent = this->parent();
while (parent)
{ if (parent==_refGroup)
SL_EXIT_MSG("Reference node produces a never ending loop.");
parent = parent->parent();
}
// set transparency flag
_aabb.hasAlpha(((SLShape*)_refGroup)->aabb()->hasAlpha());
// delete all child references
if (_first) deleteAll();
// loop through the referenced group and add a SLRefShape or SLRefGroup
SLNode* current = ((SLGroup*)_refGroup)->first();
while (current)
{ if (typeid(*current)==typeid(SLGroup))
addNode(new SLRefGroup((SLGroup*)current, name()+"_"+current->name()));
else addNode(new SLRefShape((SLShape*)current, name()+"_"+current->name()));
((SLShape*)_last)->wm(_wm);
((SLShape*)_last)->depth(depth()+1);
((SLShape*)_last)->shapeInit(sv);
current = current->next();
}
}
示例2: shapeInit
/*!
The SLRefShape::shapeInit checks the validity of the referenced node. To avoid
endless loops a refShape node is not allowed to refShape its ancestors. An
ancestor of a refShape node is group node followed along the previous pointers
with lower depth than the depth of the refShape node.
Do not initialize the referenced shape twice.
*/
void SLRefShape::shapeInit(SLSceneView* sv)
{ (void)sv; // avoid unused parameter warning
// cummulate my wm with referenced object transform (m)
SLShape* ref = (SLShape*)_refShape;
_wm *= ref->m();
_wmI.setMatrix(_wm.inverse());
_wmN.setMatrix(_wmI.mat3());
_wmN.transpose();
// set transparency flag
_aabb.hasAlpha(((SLShape*)_refShape)->aabb()->hasAlpha());
// check circular references
SLNode* parent = this->parent();
while (parent)
{ if (parent==_refShape)
SL_EXIT_MSG("Reference node produces a never ending loop.");
parent = parent->parent();
}
}