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

Function ClonePointData

Parallel/DIY/vtkDIYGhostUtilities.cxx:3539–3570  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3537
3538//----------------------------------------------------------------------------
3539void ClonePointData(vtkPointSet* ps, vtkPointSet* clone, ::UnstructuredDataInformation& info)
3540{
3541 vtkPointData* clonePointData = clone->GetPointData();
3542 vtkPointData* psPointData = ps->GetPointData();
3543 clonePointData->CopyAllOn();
3544 clonePointData->CopyAllocate(psPointData, clone->GetNumberOfPoints());
3545 clonePointData->SetNumberOfTuples(clone->GetNumberOfPoints());
3546
3547 if (vtkIdList* redirectionMap = info.OutputToInputPointIdRedirectionMap)
3548 {
3549 for (int arrayId = 0; arrayId < clonePointData->GetNumberOfArrays(); ++arrayId)
3550 {
3551 psPointData->GetAbstractArray(arrayId)->GetTuples(
3552 redirectionMap, clonePointData->GetAbstractArray(arrayId));
3553 }
3554 }
3555 else
3556 {
3557 for (int arrayId = 0; arrayId < clonePointData->GetNumberOfArrays(); ++arrayId)
3558 {
3559 vtkAbstractArray* sourceArray = psPointData->GetAbstractArray(arrayId);
3560 sourceArray->GetTuples(
3561 0, sourceArray->GetNumberOfTuples() - 1, clonePointData->GetAbstractArray(arrayId));
3562 }
3563 }
3564 // We need to initialize newly allocated ghosts to zero
3565 if (vtkUnsignedCharArray* ghostPoints = clonePointData->GetGhostArray())
3566 {
3567 auto ghostRange = vtk::DataArrayValueRange<1>(ghostPoints);
3568 std::fill(ghostRange.begin() + info.NumberOfInputPoints, ghostRange.end(), 0);
3569 }
3570}
3571
3572//----------------------------------------------------------------------------
3573void ClonePoints(vtkPointSet* ps, vtkPointSet* clone, ::UnstructuredDataInformation& info)

Callers 2

CloneUnstructuredGridFunction · 0.85
ClonePolyDataFunction · 0.85

Calls 13

GetAbstractArrayMethod · 0.80
fillFunction · 0.50
GetPointDataMethod · 0.45
CopyAllOnMethod · 0.45
CopyAllocateMethod · 0.45
GetNumberOfPointsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
GetNumberOfArraysMethod · 0.45
GetTuplesMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetGhostArrayMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected