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

Method GetDistinctCellTypesArray

Common/DataModel/vtkUnstructuredGrid.cxx:1008–1046  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1006
1007//------------------------------------------------------------------------------
1008vtkUnsignedCharArray* vtkUnstructuredGrid::GetDistinctCellTypesArray()
1009{
1010 if (this->Types == nullptr)
1011 {
1012 if (this->DistinctCellTypes == nullptr)
1013 {
1014 this->DistinctCellTypes = vtkSmartPointer<vtkCellTypes>::New();
1015 }
1016 return this->DistinctCellTypes->GetCellTypesArray();
1017 }
1018
1019 if (this->DistinctCellTypes == nullptr ||
1020 this->Types->GetMTime() > this->DistinctCellTypesUpdateMTime)
1021 {
1022 if (this->DistinctCellTypes)
1023 {
1024 this->DistinctCellTypes->Reset();
1025 }
1026 else
1027 {
1028 this->DistinctCellTypes = vtkSmartPointer<vtkCellTypes>::New();
1029 this->DistinctCellTypes->Register(this);
1030 this->DistinctCellTypes->Delete();
1031 }
1032 if (auto constantTypes = vtkConstantArray<unsigned char>::FastDownCast(this->GetCellTypes()))
1033 {
1034 this->DistinctCellTypes->Reset();
1035 this->DistinctCellTypes->InsertNextType(constantTypes->GetValue(0));
1036 }
1037 else
1038 {
1039 vtkDataSet::GetDistinctCellTypes(this->DistinctCellTypes);
1040 }
1041
1042 this->DistinctCellTypesUpdateMTime = this->Types->GetMTime();
1043 }
1044
1045 return this->DistinctCellTypes->GetCellTypesArray();
1046}
1047
1048//------------------------------------------------------------------------------
1049vtkUnsignedCharArray* vtkUnstructuredGrid::GetCellTypesArray()

Callers 15

GetDistinctCellTypesMethod · 0.95
IsHomogeneousMethod · 0.95
ProcessRequestMethod · 0.80
GetElementCountsFunction · 0.80
GetNumShapesFunction · 0.80
FillMixedShapeFunction · 0.80
CanProcessInputMethod · 0.80
CanProcessInputMethod · 0.80
CanProcessInputMethod · 0.80
otherUnstructuredGridFunction · 0.80

Calls 9

DeleteMethod · 0.65
NewFunction · 0.50
FastDownCastFunction · 0.50
GetCellTypesArrayMethod · 0.45
GetMTimeMethod · 0.45
ResetMethod · 0.45
RegisterMethod · 0.45
GetCellTypesMethod · 0.45
GetValueMethod · 0.45

Tested by 1