------------------------------------------------------------------------------
| 96 | |
| 97 | //------------------------------------------------------------------------------ |
| 98 | int 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 | //------------------------------------------------------------------------------ |
| 137 | void vtkConvexPointSet::Contour(double value, vtkDataArray* cellScalars, |
nothing calls this directly
no test coverage detected