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

Method UnstructuredGridExecute

Filters/Geometry/vtkDataSetRegionSurfaceFilter.cxx:150–872  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

148
149//------------------------------------------------------------------------------
150int vtkDataSetRegionSurfaceFilter::UnstructuredGridExecute(
151 vtkDataSet* dataSetInput, vtkPolyData* output)
152{
153 vtkUnstructuredGrid* input = vtkUnstructuredGrid::SafeDownCast(dataSetInput);
154
155 // Before we start doing anything interesting, check if we need handle
156 // non-linear cells using sub-division.
157 bool handleSubdivision = false;
158 if (this->NonlinearSubdivisionLevel >= 1)
159 {
160 // Check to see if the data actually has nonlinear cells. Handling
161 // nonlinear cells adds unnecessary work if we only have linear cells.
162 auto distinctCellTypesArray = input->GetDistinctCellTypesArray();
163 for (vtkIdType i = 0; i < distinctCellTypesArray->GetNumberOfValues(); i++)
164 {
165 if (!vtkCellTypeUtilities::IsLinear(distinctCellTypesArray->GetValue(i)))
166 {
167 handleSubdivision = true;
168 break;
169 }
170 }
171 }
172
173 vtkSmartPointer<vtkUnstructuredGrid> tempInput;
174 if (handleSubdivision)
175 {
176 // Since this filter only properly subdivides 2D cells past
177 // level 1, we convert 3D cells to 2D by using
178 // vtkUnstructuredGridGeometryFilter.
179 vtkNew<vtkUnstructuredGridGeometryFilter> uggf;
180 vtkNew<vtkUnstructuredGrid> clone;
181 clone->ShallowCopy(input);
182 uggf->SetInputData(clone);
183 uggf->SetPassThroughCellIds(this->PassThroughCellIds);
184 uggf->SetPassThroughPointIds(this->PassThroughPointIds);
185 uggf->SetMatchBoundariesIgnoringCellOrder(this->MatchBoundariesIgnoringCellOrder);
186 uggf->Update();
187
188 tempInput = vtkSmartPointer<vtkUnstructuredGrid>::New();
189 tempInput->ShallowCopy(uggf->GetOutputDataObject(0));
190 input = tempInput;
191 }
192
193 vtkCellArray* newVerts;
194 vtkCellArray* newLines;
195 vtkCellArray* newPolys;
196 vtkPoints* newPts;
197 const vtkIdType* ids;
198 int progressCount;
199 int i, j;
200 int cellType;
201 vtkIdType numPts = input->GetNumberOfPoints();
202 vtkIdType numCells = input->GetNumberOfCells();
203 vtkGenericCell* cell;
204 int numFacePts;
205 vtkIdType numCellPts;
206 vtkIdType inPtId, outPtId;
207 vtkPointData* inputPD = input->GetPointData();

Callers

nothing calls this directly

Calls 15

RecordOrigCellIdMethod · 0.95
InsertQuadInHashMethod · 0.95
InsertTriInHashMethod · 0.95
TakeFunction · 0.85
InitializeQuadHashMethod · 0.80
AllocateEstimateMethod · 0.80
InterpolateAllocateMethod · 0.80
GoToNextCellMethod · 0.80
GetOutputPointIdMethod · 0.80
InsertCellPointMethod · 0.80

Tested by

no test coverage detected