------------------------------------------------------------------------------
| 1669 | |
| 1670 | //------------------------------------------------------------------------------ |
| 1671 | void vtkGraph::ReorderOutVertices(vtkIdType v, vtkIdTypeArray* vertices) |
| 1672 | { |
| 1673 | vtkIdType index = v; |
| 1674 | if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper()) |
| 1675 | { |
| 1676 | int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER()); |
| 1677 | if (myRank != helper->GetVertexOwner(v)) |
| 1678 | { |
| 1679 | vtkErrorMacro("vtkGraph cannot reorder the out vertices for a non-local vertex"); |
| 1680 | return; |
| 1681 | } |
| 1682 | |
| 1683 | index = helper->GetVertexIndex(v); |
| 1684 | } |
| 1685 | |
| 1686 | this->ForceOwnership(); |
| 1687 | std::vector<vtkOutEdgeType> outEdges; |
| 1688 | std::vector<vtkOutEdgeType>::iterator it, itEnd; |
| 1689 | itEnd = this->Internals->Adjacency[index].OutEdges.end(); |
| 1690 | for (vtkIdType i = 0; i < vertices->GetNumberOfTuples(); ++i) |
| 1691 | { |
| 1692 | vtkIdType vert = vertices->GetValue(i); |
| 1693 | // Find the matching edge |
| 1694 | for (it = this->Internals->Adjacency[index].OutEdges.begin(); it != itEnd; ++it) |
| 1695 | { |
| 1696 | if (it->Target == vert) |
| 1697 | { |
| 1698 | outEdges.push_back(*it); |
| 1699 | break; |
| 1700 | } |
| 1701 | } |
| 1702 | } |
| 1703 | if (outEdges.size() != this->Internals->Adjacency[index].OutEdges.size()) |
| 1704 | { |
| 1705 | vtkErrorMacro("Invalid reorder list."); |
| 1706 | return; |
| 1707 | } |
| 1708 | this->Internals->Adjacency[index].OutEdges = outEdges; |
| 1709 | } |
| 1710 | |
| 1711 | //------------------------------------------------------------------------------ |
| 1712 | bool vtkGraph::IsSameStructure(vtkGraph* other) |
no test coverage detected