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

Method SetComponent

Common/Core/vtkDataArray.cxx:197–217  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

195
196//------------------------------------------------------------------------------
197void vtkDataArray::SetComponent(vtkIdType tupleIdx, int compIdx, double value)
198{
199 double* tuple = new double[this->NumberOfComponents];
200
201 if (tupleIdx < this->GetNumberOfTuples())
202 {
203 this->GetTuple(tupleIdx, tuple);
204 }
205 else
206 {
207 for (int k = 0; k < this->NumberOfComponents; k++)
208 {
209 tuple[k] = 0.0;
210 }
211 }
212
213 tuple[compIdx] = value;
214 this->SetTuple(tupleIdx, tuple);
215
216 delete[] tuple;
217}
218
219//------------------------------------------------------------------------------
220void vtkDataArray::InsertComponent(vtkIdType tupleIdx, int compIdx, double value)

Callers 2

SetTupleMethod · 0.95
FillComponentMethod · 0.95

Calls 3

SetTupleMethod · 0.95
GetNumberOfTuplesMethod · 0.45
GetTupleMethod · 0.45

Tested by

no test coverage detected