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

Method TriangulateLocalIds

Common/DataModel/vtkConvexPointSet.cxx:98–134  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

96
97//------------------------------------------------------------------------------
98int vtkConvexPointSet::TriangulateLocalIds(int vtkNotUsed(index), vtkIdList* ptIds)
99{
100 vtkIdType numPts = this->GetNumberOfPoints();
101 double x[3];
102 vtkIdType ptId;
103
104 // Initialize
105 ptIds->Reset();
106 if (numPts < 1)
107 {
108 return 0;
109 }
110
111 // Initialize Delaunay insertion process.
112 // No more than numPts points can be inserted.
113 this->Triangulator->InitTriangulation(this->GetBounds(), numPts);
114
115 // Inject cell points into triangulation. Recall that the PreSortedOff()
116 // flag was set which means that the triangulator will order the points
117 // according to point id. We insert points with id == the index into the
118 // vtkConvexPointSet::PointIds and Points; but sort on the global point
119 // id.
120 for (vtkIdType i = 0; i < numPts; i++)
121 {
122 ptId = i; // Do not use this->PointIds->GetId(i) because we want local cell point ids
123 this->Points->GetPoint(i, x);
124 this->Triangulator->InsertPoint(i, ptId, x, x, 0);
125 } // for all points
126
127 // triangulate the points
128 this->Triangulator->Triangulate();
129
130 // Add the triangulation to the mesh
131 this->Triangulator->AddTetras(0, ptIds);
132
133 return 1;
134}
135
136//------------------------------------------------------------------------------
137void vtkConvexPointSet::Contour(double value, vtkDataArray* cellScalars,

Callers

nothing calls this directly

Calls 8

InitTriangulationMethod · 0.80
AddTetrasMethod · 0.80
GetNumberOfPointsMethod · 0.45
ResetMethod · 0.45
GetBoundsMethod · 0.45
GetPointMethod · 0.45
InsertPointMethod · 0.45
TriangulateMethod · 0.45

Tested by

no test coverage detected