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

Method RemoveNode

Common/DataModel/vtkDataAssembly.cxx:629–653  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

627
628//------------------------------------------------------------------------------
629bool vtkDataAssembly::RemoveNode(int id)
630{
631 if (id == 0)
632 {
633 vtkErrorMacro("Cannot remove root node.");
634 return false;
635 }
636
637 auto& internals = (*this->Internals);
638 auto node = internals.FindNode(id);
639 if (!node)
640 {
641 return false;
642 }
643
644 // cleanup nodemap.
645 for (auto childid : this->GetChildNodes(id))
646 {
647 internals.NodeMap.erase(childid);
648 }
649 internals.NodeMap.erase(id);
650 node.parent().remove_child(node);
651 this->Modified();
652 return true;
653}
654
655//------------------------------------------------------------------------------
656void vtkDataAssembly::SetNodeName(int id, const char* name)

Callers

nothing calls this directly

Calls 6

GetChildNodesMethod · 0.95
FindNodeMethod · 0.80
remove_childMethod · 0.80
eraseMethod · 0.45
parentMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected