------------------------------------------------------------------------------
| 565 | |
| 566 | //------------------------------------------------------------------------------ |
| 567 | int vtkDataAssembly::AddNode(const char* name, int parent) |
| 568 | { |
| 569 | if (!vtkDataAssembly::IsNodeNameValid(name)) |
| 570 | { |
| 571 | vtkErrorMacro("Invalid name specified '" << (name ? name : "(nullptr)")); |
| 572 | return -1; |
| 573 | } |
| 574 | |
| 575 | auto& internals = (*this->Internals); |
| 576 | auto pnode = internals.FindNode(parent); |
| 577 | if (!pnode) |
| 578 | { |
| 579 | vtkErrorMacro("Parent node with id=" << parent << " not found."); |
| 580 | return -1; |
| 581 | } |
| 582 | |
| 583 | auto child = ++internals.MaxUniqueId; |
| 584 | auto cnode = pnode.append_child(name); |
| 585 | cnode.append_attribute("id") = child; |
| 586 | internals.NodeMap[child] = cnode; |
| 587 | this->Modified(); |
| 588 | return child; |
| 589 | } |
| 590 | |
| 591 | //------------------------------------------------------------------------------ |
| 592 | std::vector<int> vtkDataAssembly::AddNodes(const std::vector<std::string>& names, int parent) |
no test coverage detected