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

Method SetNeighbors

Filters/Geometry/vtkStructuredGridConnectivity.cxx:842–865  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

840
841//------------------------------------------------------------------------------
842void vtkStructuredGridConnectivity::SetNeighbors(
843 int i, int j, int i2jOrientation[3], int j2iOrientation[3], int overlapExtent[6])
844{
845 vtkStructuredNeighbor Ni2j(j, overlapExtent, i2jOrientation);
846 vtkStructuredNeighbor Nj2i(i, overlapExtent, j2iOrientation);
847
848 // STEP 0: Setup i-to-j
849 this->Neighbors[i].push_back(Ni2j);
850 int i2jNeiIdx = static_cast<int>(this->Neighbors[i].size()) - 1;
851 std::pair<int, int> i2jPair = std::make_pair(i, j);
852 assert("ERROR: Duplicate neighboring pair!" &&
853 this->NeighborPair2NeighborListIndex.find(i2jPair) ==
854 this->NeighborPair2NeighborListIndex.end());
855 this->NeighborPair2NeighborListIndex[i2jPair] = i2jNeiIdx;
856
857 // STEP 1: Setup j-to-i
858 this->Neighbors[j].push_back(Nj2i);
859 int j2iNeiIdx = static_cast<int>(this->Neighbors[j].size()) - 1;
860 std::pair<int, int> j2iPair = std::make_pair(j, i);
861 assert("ERROR: Duplicate neighboring pair!" &&
862 this->NeighborPair2NeighborListIndex.find(j2iPair) ==
863 this->NeighborPair2NeighborListIndex.end());
864 this->NeighborPair2NeighborListIndex[j2iPair] = j2iNeiIdx;
865}
866
867//------------------------------------------------------------------------------
868void vtkStructuredGridConnectivity::PrintExtent(int ex[6])

Callers 1

DetectNeighborsMethod · 0.95

Calls 5

assertFunction · 0.50
push_backMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected