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

Method InsertTuple

Common/Core/vtkVariantArray.cxx:261–300  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

259
260//------------------------------------------------------------------------------
261void vtkVariantArray::InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray* source)
262{
263 if (source->IsA("vtkVariantArray"))
264 {
265 vtkVariantArray* a = vtkArrayDownCast<vtkVariantArray>(source);
266 vtkIdType loci = i * this->NumberOfComponents;
267 vtkIdType locj = j * a->GetNumberOfComponents();
268 for (vtkIdType cur = 0; cur < this->NumberOfComponents; cur++)
269 {
270 this->InsertValue(loci + cur, a->GetValue(locj + cur));
271 }
272 }
273 else if (source->IsA("vtkDataArray"))
274 {
275 vtkDataArray* a = vtkArrayDownCast<vtkDataArray>(source);
276 vtkIdType loci = i * this->NumberOfComponents;
277 vtkIdType locj = j * a->GetNumberOfComponents();
278 for (vtkIdType cur = 0; cur < this->NumberOfComponents; cur++)
279 {
280 vtkIdType tuple = (locj + cur) / a->GetNumberOfComponents();
281 int component = static_cast<int>((locj + cur) % a->GetNumberOfComponents());
282 this->InsertValue(loci + cur, ValueType(a->GetComponent(tuple, component)));
283 }
284 }
285 else if (source->IsA("vtkStringArray"))
286 {
287 vtkStringArray* a = vtkArrayDownCast<vtkStringArray>(source);
288 vtkIdType loci = i * this->NumberOfComponents;
289 vtkIdType locj = j * a->GetNumberOfComponents();
290 for (vtkIdType cur = 0; cur < this->NumberOfComponents; cur++)
291 {
292 this->InsertValue(loci + cur, ValueType(a->GetValue(locj + cur)));
293 }
294 }
295 else
296 {
297 vtkWarningMacro("Unrecognized type is incompatible with vtkVariantArray.");
298 }
299 this->DataChanged();
300}
301
302//------------------------------------------------------------------------------
303void vtkVariantArray::InsertTuplesStartingAt(

Callers 1

InterpolateTupleMethod · 0.95

Calls 7

InsertValueMethod · 0.95
DataChangedMethod · 0.95
IsAMethod · 0.80
ValueTypeEnum · 0.50
GetNumberOfComponentsMethod · 0.45
GetValueMethod · 0.45
GetComponentMethod · 0.45

Tested by

no test coverage detected