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

Method InsertTuples

Common/Core/vtkStringArray.cxx:603–637  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

601
602//------------------------------------------------------------------------------
603void vtkStringArray::InsertTuples(vtkIdList* dstIds, vtkIdList* srcIds, vtkAbstractArray* source)
604{
605 vtkStringArray* sa = vtkArrayDownCast<vtkStringArray>(source);
606 if (!sa)
607 {
608 vtkWarningMacro("Input and outputs array data types do not match.");
609 return;
610 }
611
612 if (this->NumberOfComponents != source->GetNumberOfComponents())
613 {
614 vtkWarningMacro("Input and output component sizes do not match.");
615 return;
616 }
617
618 vtkIdType numIds = dstIds->GetNumberOfIds();
619 if (srcIds->GetNumberOfIds() != numIds)
620 {
621 vtkWarningMacro("Input and output id array sizes do not match.");
622 return;
623 }
624
625 for (vtkIdType idIndex = 0; idIndex < numIds; ++idIndex)
626 {
627 vtkIdType numComp = this->NumberOfComponents;
628 vtkIdType srcLoc = srcIds->GetId(idIndex) * this->NumberOfComponents;
629 vtkIdType dstLoc = dstIds->GetId(idIndex) * this->NumberOfComponents;
630 while (numComp-- > 0)
631 {
632 this->InsertValue(dstLoc++, sa->GetValue(srcLoc++));
633 }
634 }
635
636 this->DataChanged();
637}
638
639//------------------------------------------------------------------------------
640void vtkStringArray::InsertTuplesStartingAt(

Callers

nothing calls this directly

Calls 7

InsertValueMethod · 0.95
DataChangedMethod · 0.95
GetNumberOfComponentsMethod · 0.45
GetNumberOfIdsMethod · 0.45
GetIdMethod · 0.45
GetValueMethod · 0.45
GetNumberOfTuplesMethod · 0.45

Tested by

no test coverage detected