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

Method SetTuple

Common/Core/vtkStringArray.cxx:563–579  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Set the tuple at the ith location using the jth tuple in the source array. This method assumes that the two arrays have the same type and structure. Note that range checking and memory allocation is not performed; use in conjunction with SetNumberOfTuples() to allocate space.

Source from the content-addressed store, hash-verified

561// and structure. Note that range checking and memory allocation is not
562// performed; use in conjunction with SetNumberOfTuples() to allocate space.
563void vtkStringArray::SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray* source)
564{
565 vtkStringArray* sa = vtkArrayDownCast<vtkStringArray>(source);
566 if (!sa)
567 {
568 vtkWarningMacro("Input and outputs array data types do not match.");
569 return;
570 }
571
572 vtkIdType loci = i * this->NumberOfComponents;
573 vtkIdType locj = j * sa->GetNumberOfComponents();
574 for (vtkIdType cur = 0; cur < this->NumberOfComponents; cur++)
575 {
576 this->SetValue(loci + cur, sa->GetValue(locj + cur));
577 }
578 this->DataChanged();
579}
580
581//------------------------------------------------------------------------------
582// Insert the jth tuple in the source array, at ith location in this array.

Callers

nothing calls this directly

Calls 4

SetValueMethod · 0.95
DataChangedMethod · 0.95
GetNumberOfComponentsMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected