本文整理汇总了C++中TopLoc_Location::Multiplied方法的典型用法代码示例。如果您正苦于以下问题:C++ TopLoc_Location::Multiplied方法的具体用法?C++ TopLoc_Location::Multiplied怎么用?C++ TopLoc_Location::Multiplied使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopLoc_Location
的用法示例。
在下文中一共展示了TopLoc_Location::Multiplied方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: recurse_CascadeDoc
static bool recurse_CascadeDoc(TDF_Label label,
Handle_XCAFDoc_ShapeTool& shapeTool,
TopLoc_Location& parentloc,
int level,
ChCascadeDoc::callback_CascadeDoc& mcallback) {
TDF_LabelSequence child_labels;
Standard_Boolean is_assembly;
is_assembly = shapeTool->GetComponents(label, child_labels, 0);
char mstring[200] = "no name";
Standard_PCharacter mchastr = mstring;
// access name
Handle_TDataStd_Name N;
if (label.FindAttribute(TDataStd_Name::GetID(), N)) {
N->Get().ToUTF8CString(mchastr);
}
TDF_Label reflabel;
Standard_Boolean isref = shapeTool->GetReferredShape(label, reflabel);
if (isref) // ..maybe it references some shape: the name is stored there...
{
Handle_TDataStd_Name N;
if (reflabel.FindAttribute(TDataStd_Name::GetID(), N)) {
N->Get().ToUTF8CString(mchastr);
}
}
TopLoc_Location mloc = shapeTool->GetLocation(label);
TopLoc_Location absloc = parentloc.Multiplied(mloc);
// access shape and position
TopoDS_Shape rShape;
rShape = shapeTool->GetShape(label);
if (!rShape.IsNull()) {
// === call the callback! ===
if (!mcallback.ForShape(rShape, absloc, mstring, level, label))
return false; // (skip children recursion if returned false)
}
// Recurse all children !!!
if (is_assembly) {
for (Standard_Integer j = 1; j <= child_labels.Length(); j++) {
TDF_Label clabel = child_labels.Value(j);
recurse_CascadeDoc(clabel, shapeTool, absloc, (level + 1), mcallback);
}
}
// If it is a reference, Recurse all children of reference
if (isref) {
TDF_LabelSequence refchild_labels;
Standard_Boolean refis_assembly;
refis_assembly = shapeTool->GetComponents(reflabel, refchild_labels, 0);
for (Standard_Integer j = 1; j <= refchild_labels.Length(); j++) {
TDF_Label clabel = refchild_labels.Value(j);
recurse_CascadeDoc(clabel, shapeTool, absloc, (level + 1), mcallback);
}
}
return true;
}