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

Method GetChildIndex

Common/DataModel/vtkDataAssembly.cxx:938–955  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

936
937//------------------------------------------------------------------------------
938int vtkDataAssembly::GetChildIndex(int parent, int child) const
939{
940 const auto& internals = (*this->Internals);
941 const auto node = internals.FindNode(parent);
942 int index = 0;
943 for (const auto& cnode : node.children())
944 {
945 if (::IsAssemblyNode(cnode))
946 {
947 if (cnode.attribute("id").as_int(-1) == child)
948 {
949 return index;
950 }
951 ++index;
952 }
953 }
954 return -1;
955}
956
957//------------------------------------------------------------------------------
958int vtkDataAssembly::GetParent(int id) const

Calls 5

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

Tested by

no test coverage detected