MCPcopy Create free account
hub / github.com/Kitware/TeleSculptor / findArrayToColor

Function findArrayToColor

gui/WorldView.cxx:99–126  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

97
98//-----------------------------------------------------------------------------
99vtkDataArray* findArrayToColor(vtkDataSet* dataset)
100{
101 bool mapScalars;
102 vtkPointData* pd = dataset->GetPointData();
103 // first try the active scalars
104 vtkDataArray* a = pd->GetScalars();
105 if (VolumeOptions::isArrayValidForColoring(a, mapScalars))
106 {
107 return a;
108 }
109 // if active scalars are not set look through all arrays,
110 // if we find an array that fits, set it as active scalars and return it.
111 for(int i = 0; i < pd->GetNumberOfArrays(); ++i)
112 {
113 a = pd->GetArray(i);
114 if (VolumeOptions::isArrayValidForColoring(a, mapScalars))
115 {
116 pd->SetScalars(a);
117 return a;
118 }
119 else
120 {
121 continue;
122 }
123 }
124 mapScalars = false;
125 return nullptr;
126}
127
128} // namespace <anonymous>
129

Callers 1

setMeshMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected