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

Method RequestData

Rendering/Core/vtkMapArrayValues.cxx:110–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110int vtkMapArrayValues::RequestData(vtkInformation* vtkNotUsed(request),
111 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
112{
113 // get the info objects
114 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
115 vtkInformation* outInfo = outputVector->GetInformationObject(0);
116
117 // get the input and output
118 vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT());
119 vtkDataObject* output = outInfo->Get(vtkDataObject::DATA_OBJECT());
120
121 if (!this->InputArrayName)
122 {
123 // vtkErrorMacro(<<"Input array not specified.");
124 output->ShallowCopy(input);
125 return 1;
126 }
127
128 vtkDataSetAttributes* ods = nullptr;
129 if (vtkDataSet::SafeDownCast(input))
130 {
131 vtkDataSet* dsInput = vtkDataSet::SafeDownCast(input);
132 vtkDataSet* dsOutput = vtkDataSet::SafeDownCast(output);
133 // This has to be here because it initialized all field datas.
134 dsOutput->CopyStructure(dsInput);
135
136 if (dsOutput->GetFieldData() && dsInput->GetFieldData())
137 {
138 dsOutput->GetFieldData()->PassData(dsInput->GetFieldData());
139 }
140 dsOutput->GetPointData()->PassData(dsInput->GetPointData());
141 dsOutput->GetCellData()->PassData(dsInput->GetCellData());
142 switch (this->FieldType)
143 {
144 case vtkMapArrayValues::POINT_DATA:
145 ods = dsOutput->GetPointData();
146 break;
147 case vtkMapArrayValues::CELL_DATA:
148 ods = dsOutput->GetCellData();
149 break;
150 default:
151 vtkErrorMacro(<< "Data must be point or cell for vtkDataSet");
152 return 0;
153 }
154 }
155 else if (vtkGraph::SafeDownCast(input))
156 {
157 vtkGraph* graphInput = vtkGraph::SafeDownCast(input);
158 vtkGraph* graphOutput = vtkGraph::SafeDownCast(output);
159 graphOutput->ShallowCopy(graphInput);
160 switch (this->FieldType)
161 {
162 case vtkMapArrayValues::VERTEX_DATA:
163 ods = graphOutput->GetVertexData();
164 break;
165 case vtkMapArrayValues::EDGE_DATA:
166 ods = graphOutput->GetEdgeData();
167 break;

Callers

nothing calls this directly

Calls 15

GetInformationObjectMethod · 0.80
GetVertexDataMethod · 0.80
GetEdgeDataMethod · 0.80
GetRowDataMethod · 0.80
GetAbstractArrayMethod · 0.80
IsAMethod · 0.80
FillComponentMethod · 0.80
NewFunction · 0.70
DeleteMethod · 0.65
CreateArrayFunction · 0.50
GetMethod · 0.45
ShallowCopyMethod · 0.45

Tested by

no test coverage detected