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

Method GetAbstractScalars

Rendering/Core/vtkAbstractMapper.cxx:152–228  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

150
151//------------------------------------------------------------------------------
152vtkAbstractArray* vtkAbstractMapper::GetAbstractScalars(vtkDataSet* input, int scalarMode,
153 int arrayAccessMode, int arrayId, const char* arrayName, int& cellFlag)
154{
155 vtkAbstractArray* scalars = nullptr;
156 vtkPointData* pd;
157 vtkCellData* cd;
158 vtkFieldData* fd;
159
160 // make sure we have an input
161 if (!input)
162 {
163 return nullptr;
164 }
165
166 // get and scalar data according to scalar mode
167 if (scalarMode == VTK_SCALAR_MODE_DEFAULT)
168 {
169 scalars = input->GetPointData()->GetScalars();
170 cellFlag = 0;
171 if (!scalars)
172 {
173 scalars = input->GetCellData()->GetScalars();
174 cellFlag = 1;
175 }
176 }
177 else if (scalarMode == VTK_SCALAR_MODE_USE_POINT_DATA)
178 {
179 scalars = input->GetPointData()->GetScalars();
180 cellFlag = 0;
181 }
182 else if (scalarMode == VTK_SCALAR_MODE_USE_CELL_DATA)
183 {
184 scalars = input->GetCellData()->GetScalars();
185 cellFlag = 1;
186 }
187 else if (scalarMode == VTK_SCALAR_MODE_USE_POINT_FIELD_DATA)
188 {
189 pd = input->GetPointData();
190 if (arrayAccessMode == VTK_GET_ARRAY_BY_ID)
191 {
192 scalars = pd->GetAbstractArray(arrayId);
193 }
194 else
195 {
196 scalars = pd->GetAbstractArray(arrayName);
197 }
198 cellFlag = 0;
199 }
200 else if (scalarMode == VTK_SCALAR_MODE_USE_CELL_FIELD_DATA)
201 {
202 cd = input->GetCellData();
203 if (arrayAccessMode == VTK_GET_ARRAY_BY_ID)
204 {
205 scalars = cd->GetAbstractArray(arrayId);
206 }
207 else
208 {
209 scalars = cd->GetAbstractArray(arrayName);

Callers 6

GenerateHashMethod · 0.80
GenerateHashMethod · 0.80
InternalRenderMethod · 0.80
MakeCellMaterialsFunction · 0.80
ORenderPolyMethod · 0.80
AnariRenderPolyMethod · 0.80

Calls 5

GetAbstractArrayMethod · 0.80
GetScalarsMethod · 0.45
GetPointDataMethod · 0.45
GetCellDataMethod · 0.45
GetFieldDataMethod · 0.45

Tested by

no test coverage detected