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

Method GenerateGhostArray

Common/DataModel/vtkDataSet.cxx:757–932  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

755
756//------------------------------------------------------------------------------
757void vtkDataSet::GenerateGhostArray(int zeroExt[6], bool cellOnly)
758{
759 // Make sure this is a structured data set.
760 if (this->GetExtentType() != VTK_3D_EXTENT)
761 {
762 return;
763 }
764
765 int extent[6];
766 this->Information->Get(vtkDataObject::DATA_EXTENT(), extent);
767
768 int i, j, k, di, dj, dk, dist;
769
770 bool sameExtent = true;
771 for (i = 0; i < 6; i++)
772 {
773 if (extent[i] != zeroExt[i])
774 {
775 sameExtent = false;
776 break;
777 }
778 }
779 if (sameExtent)
780 {
781 return;
782 }
783
784 vtkIdType index = 0;
785
786 // ---- POINTS ----
787
788 if (!cellOnly)
789 {
790 vtkSmartPointer<vtkUnsignedCharArray> ghostPoints = vtkArrayDownCast<vtkUnsignedCharArray>(
791 this->PointData->GetArray(vtkDataSetAttributes::GhostArrayName()));
792 if (!ghostPoints)
793 {
794 ghostPoints.TakeReference(vtkUnsignedCharArray::New());
795 ghostPoints->SetName(vtkDataSetAttributes::GhostArrayName());
796 ghostPoints->SetNumberOfValues(vtkStructuredData::GetNumberOfPoints(extent));
797 ghostPoints->FillValue(0);
798 this->PointData->AddArray(ghostPoints);
799 }
800
801 // Loop through the points in this image.
802 for (k = extent[4]; k <= extent[5]; ++k)
803 {
804 dk = 0;
805 if (k < zeroExt[4])
806 {
807 dk = zeroExt[4] - k;
808 }
809 if (k > zeroExt[5])
810 { // Special case for last tile.
811 dk = k - zeroExt[5] + 1;
812 }
813 for (j = extent[2]; j <= extent[3]; ++j)
814 {

Callers 7

ImageDataExecuteMethod · 0.45
StructuredGridExecuteMethod · 0.45
ReadMeshMethod · 0.45
RequestDataMethod · 0.45
ExecuteDataEndMethod · 0.45
GenerateGhostArrayFunction · 0.45
RootExecuteMethod · 0.45

Calls 13

GhostArrayNameFunction · 0.85
GetNumberOfPointsFunction · 0.70
GetNumberOfCellsFunction · 0.70
NewFunction · 0.50
maxFunction · 0.50
GetMethod · 0.45
GetArrayMethod · 0.45
TakeReferenceMethod · 0.45
SetNameMethod · 0.45
SetNumberOfValuesMethod · 0.45
AddArrayMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected