MCPcopy Create free account
hub / github.com/Kitware/VTK / GetChild

Method GetChild

Common/DataModel/vtkDataAssembly.cxx:918–935  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

916
917//------------------------------------------------------------------------------
918int vtkDataAssembly::GetChild(int parent, int index) const
919{
920 const auto& internals = (*this->Internals);
921 const auto node = internals.FindNode(parent);
922 int cur_child = 0;
923 for (const auto& cnode : node.children())
924 {
925 if (::IsAssemblyNode(cnode))
926 {
927 if (cur_child == index)
928 {
929 return cnode.attribute("id").as_int(-1);
930 }
931 ++cur_child;
932 }
933 }
934 return -1;
935}
936
937//------------------------------------------------------------------------------
938int vtkDataAssembly::GetChildIndex(int parent, int child) const

Callers

nothing calls this directly

Calls 5

IsAssemblyNodeFunction · 0.85
FindNodeMethod · 0.80
childrenMethod · 0.80
as_intMethod · 0.80
attributeMethod · 0.80

Tested by

no test coverage detected