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

Method GetDistinctCellTypes

Common/DataModel/vtkGenericDataSet.cxx:83–105  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Get a list of types of cells in a dataset. The list consists of an array of types (not necessarily in any order), with a single entry per type. For example a dataset 5 triangles, 3 lines, and 100 hexahedra would result a list of three entries, corresponding to the types VTK_TRIANGLE, VTK_LINE, and VTK_HEXAH

Source from the content-addressed store, hash-verified

81// THE DATASET IS NOT MODIFIED
82// \pre types_exist: types!=0
83void vtkGenericDataSet::GetDistinctCellTypes(vtkCellTypes* types)
84{
85 assert("pre: types_exist" && types != nullptr);
86
87 unsigned char type;
88 vtkGenericCellIterator* it = this->NewCellIterator(-1);
89 vtkGenericAdaptorCell* c = it->NewCell();
90
91 types->Reset();
92 it->Begin();
93 while (!it->IsAtEnd())
94 {
95 it->GetCell(c);
96 type = c->GetType();
97 if (!types->IsType(type))
98 {
99 types->InsertNextType(type);
100 }
101 it->Next();
102 }
103 c->Delete();
104 it->Delete();
105}
106
107//------------------------------------------------------------------------------
108// Return a pointer to the geometry bounding box in the form

Callers

nothing calls this directly

Calls 11

DeleteMethod · 0.65
assertFunction · 0.50
NewCellIteratorMethod · 0.45
NewCellMethod · 0.45
ResetMethod · 0.45
BeginMethod · 0.45
IsAtEndMethod · 0.45
GetCellMethod · 0.45
GetTypeMethod · 0.45
IsTypeMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected