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

Method ProcessTrees

Filters/Hybrid/vtkAdaptiveDataSetSurfaceFilter.cxx:225–319  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

223
224//------------------------------------------------------------------------------
225void vtkAdaptiveDataSetSurfaceFilter::ProcessTrees(vtkHyperTreeGrid* input, vtkPolyData* output)
226{
227 if (this->Points)
228 {
229 this->Points->Delete();
230 }
231 // Create storage for corners of leaf cells
232 this->Points = vtkPoints::New();
233
234 // Create storage for unstructured leaf cells
235 if (this->Cells)
236 {
237 this->Cells->Delete();
238 }
239 this->Cells = vtkCellArray::New();
240
241 // Initialize a Locator
242 if (this->Merging)
243 {
244 this->Locator = vtkMergePoints::New();
245 this->Locator->InitPointInsertion(this->Points, input->GetBounds());
246 }
247
248 // Retrieve material mask
249 this->Mask = input->HasMask() ? input->GetMask() : nullptr;
250
251 if (this->Dimension == 3)
252 {
253 vtkIdType index;
254 vtkHyperTreeGrid::vtkHyperTreeGridIterator it;
255 input->InitializeTreeIterator(it);
256 vtkNew<vtkHyperTreeGridNonOrientedVonNeumannSuperCursorLight> cursor;
257 while (it.GetNextTree(index))
258 {
259 if (this->CheckAbort())
260 {
261 break;
262 }
263 // In 3 dimensions, von Neumann neighborhood information is needed
264 input->InitializeNonOrientedVonNeumannSuperCursorLight(cursor, index);
265 this->RecursivelyProcessTree3D(cursor, 0);
266 }
267 }
268 else
269 {
270 vtkIdType index;
271 vtkHyperTreeGrid::vtkHyperTreeGridIterator it;
272 input->InitializeTreeIterator(it);
273 vtkNew<vtkHyperTreeGridNonOrientedGeometryCursor> cursor;
274 while (it.GetNextTree(index))
275 {
276 if (this->CheckAbort())
277 {
278 break;
279 }
280 // Otherwise, geometric properties of the cells suffice
281 input->InitializeNonOrientedGeometryCursor(cursor, index);
282 if (this->Dimension == 1)

Callers 1

DataObjectExecuteMethod · 0.95

Calls 15

HasMaskMethod · 0.80
GetNextTreeMethod · 0.80
CheckAbortMethod · 0.80
SetLinesMethod · 0.80
SetPolysMethod · 0.80
GetAbstractArrayMethod · 0.80

Tested by

no test coverage detected