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

Method GetArrayToProcess

Rendering/SceneGraph/vtkMapperNode.cxx:37–125  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

35
36//------------------------------------------------------------------------------
37vtkAbstractArray* vtkMapperNode::GetArrayToProcess(vtkDataSet* input, int& cellFlag)
38{
39 cellFlag = -1;
40 vtkAbstractVolumeMapper* mapper = vtkAbstractVolumeMapper::SafeDownCast(this->GetRenderable());
41 if (!mapper)
42 {
43 return nullptr;
44 }
45
46 vtkAbstractArray* scalars;
47 int scalarMode = mapper->GetScalarMode();
48 if (scalarMode == VTK_SCALAR_MODE_DEFAULT)
49 {
50 scalars = input->GetPointData()->GetScalars();
51 cellFlag = 0;
52 if (!scalars)
53 {
54 scalars = input->GetCellData()->GetScalars();
55 cellFlag = 1;
56 }
57 return scalars;
58 }
59
60 if (scalarMode == VTK_SCALAR_MODE_USE_POINT_DATA)
61 {
62 scalars = input->GetPointData()->GetScalars();
63 cellFlag = 0;
64 return scalars;
65 }
66 if (scalarMode == VTK_SCALAR_MODE_USE_CELL_DATA)
67 {
68 scalars = input->GetCellData()->GetScalars();
69 cellFlag = 1;
70 return scalars;
71 }
72
73 int arrayAccessMode = mapper->GetArrayAccessMode();
74 const char* arrayName = mapper->GetArrayName();
75 int arrayId = mapper->GetArrayId();
76 vtkPointData* pd;
77 vtkCellData* cd;
78 vtkFieldData* fd;
79 if (scalarMode == VTK_SCALAR_MODE_USE_POINT_FIELD_DATA)
80 {
81 pd = input->GetPointData();
82 if (arrayAccessMode == VTK_GET_ARRAY_BY_ID)
83 {
84 scalars = pd->GetAbstractArray(arrayId);
85 }
86 else
87 {
88 scalars = pd->GetAbstractArray(arrayName);
89 }
90 cellFlag = 0;
91 return scalars;
92 }
93
94 if (scalarMode == VTK_SCALAR_MODE_USE_CELL_FIELD_DATA)

Callers 4

RenderMethod · 0.80
RenderMethod · 0.80
RenderMethod · 0.80
SynchronizeMethod · 0.80

Calls 8

GetArrayAccessModeMethod · 0.80
GetArrayIdMethod · 0.80
GetAbstractArrayMethod · 0.80
GetScalarsMethod · 0.45
GetPointDataMethod · 0.45
GetCellDataMethod · 0.45
GetArrayNameMethod · 0.45
GetFieldDataMethod · 0.45

Tested by

no test coverage detected