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

Method RequestData

Filters/Parallel/vtkExtractPolyDataPiece.cxx:96–270  ·  view source on GitHub ↗

=============================================================================

Source from the content-addressed store, hash-verified

94
95//=============================================================================
96int vtkExtractPolyDataPiece::RequestData(vtkInformation* vtkNotUsed(request),
97 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
98{
99 // get the info objects
100 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
101 vtkInformation* outInfo = outputVector->GetInformationObject(0);
102
103 // get the input and output
104 vtkPolyData* input = vtkPolyData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
105 vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
106
107 vtkPointData *pd = input->GetPointData(), *outPD = output->GetPointData();
108 vtkCellData *cd = input->GetCellData(), *outCD = output->GetCellData();
109 vtkIntArray* cellTags;
110 int ghostLevel, piece, numPieces;
111 vtkIdType cellId, newCellId;
112 vtkIdList *cellPts, *pointMap;
113 vtkIdList* newCellPts = vtkIdList::New();
114 vtkIdList* pointOwnership;
115 vtkCell* cell;
116 vtkPoints* newPoints;
117 vtkUnsignedCharArray* cellGhostLevels = nullptr;
118 vtkUnsignedCharArray* pointGhostLevels = nullptr;
119 vtkIdType ptId = 0, newId, numPts, i;
120 int numCellPts;
121 double* x = nullptr;
122
123 // Pipeline update piece will tell us what to generate.
124 ghostLevel = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
125 piece = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());
126 numPieces = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
127
128 outPD->CopyAllocate(pd);
129 outCD->CopyAllocate(cd);
130
131 if (ghostLevel > 0 && this->CreateGhostCells)
132 {
133 cellGhostLevels = vtkUnsignedCharArray::New();
134 pointGhostLevels = vtkUnsignedCharArray::New();
135 cellGhostLevels->Allocate(input->GetNumberOfCells());
136 pointGhostLevels->Allocate(input->GetNumberOfPoints());
137 }
138
139 // Break up cells based on which piece they belong to.
140 cellTags = vtkIntArray::New();
141 cellTags->Allocate(input->GetNumberOfCells(), 1000);
142 pointOwnership = vtkIdList::New();
143 pointOwnership->Allocate(input->GetNumberOfPoints());
144 // Cell tags end up being 0 for cells in piece and -1 for all others.
145 // Point ownership is the cell that owns the point.
146 this->ComputeCellTags(cellTags, pointOwnership, piece, numPieces, input);
147
148 // Find the layers of ghost cells.
149 if (this->CreateGhostCells)
150 {
151 for (i = 0; i < ghostLevel; i++)
152 {
153 this->AddGhostLevel(input, cellTags, i + 1);

Callers

nothing calls this directly

Calls 15

ComputeCellTagsMethod · 0.95
AddGhostLevelMethod · 0.95
GhostArrayNameFunction · 0.85
GetInformationObjectMethod · 0.80
AllocateCopyMethod · 0.80
SetNumberOfIdsMethod · 0.80
InsertIdMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetMethod · 0.45
GetPointDataMethod · 0.45
GetCellDataMethod · 0.45

Tested by

no test coverage detected