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

Method RequestData

Filters/Modeling/vtkQuadRotationalExtrusionFilter.cxx:142–505  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

140
141//------------------------------------------------------------------------------
142int vtkQuadRotationalExtrusionFilter::RequestData(vtkInformation* vtkNotUsed(request),
143 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
144{
145 // get the info objects
146 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
147 vtkInformation* outInfo = outputVector->GetInformationObject(0);
148
149 // Get composite input
150 vtkCompositeDataSet* compositeInput =
151 vtkCompositeDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
152
153 // Get typed output
154 vtkMultiBlockDataSet* compositeOutput =
155 vtkMultiBlockDataSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
156
157 if (compositeInput == nullptr || compositeOutput == nullptr)
158 {
159 vtkErrorMacro(<< "Invalid algorithm connection\n");
160 return 0;
161 }
162
163 vtkDebugMacro(<< "input=" << compositeInput->GetClassName() << "\n");
164
165 // we want the output to have the same structure than the input
166 compositeOutput->CopyStructure(compositeInput);
167
168 // allocate composite iterator
169 vtkCompositeDataIterator* inputIterator = compositeInput->NewIterator();
170 inputIterator->SkipEmptyNodesOff();
171 inputIterator->InitTraversal();
172
173 vtkCompositeDataIterator* outputIterator = compositeOutput->NewIterator();
174 outputIterator->SkipEmptyNodesOff();
175 outputIterator->InitTraversal();
176
177 while (inputIterator->IsDoneWithTraversal() == 0)
178 {
179 if (this->CheckAbort())
180 {
181 break;
182 }
183 // get the input and output
184 int blockId = inputIterator->GetCurrentFlatIndex();
185 vtkPolyData* input = vtkPolyData::SafeDownCast(inputIterator->GetCurrentDataObject());
186 inputIterator->GoToNextItem();
187 if (!input)
188 {
189 outputIterator->GoToNextItem();
190 continue;
191 }
192
193 vtkPolyData* output = vtkPolyData::New();
194 compositeOutput->SetDataSet(outputIterator, output);
195 outputIterator->GoToNextItem();
196 output->Delete();
197
198 vtkIdType numPts, numCells;
199 numPts = input->GetNumberOfPoints();

Callers

nothing calls this directly

Calls 15

RotateAroundAxisMethod · 0.95
GetInformationObjectMethod · 0.80
CheckAbortMethod · 0.80
GetCurrentFlatIndexMethod · 0.80
GetVertsMethod · 0.80
GetPolysMethod · 0.80
GetStripsMethod · 0.80
SetVertsMethod · 0.80
SetLinesMethod · 0.80
SetPolysMethod · 0.80
SetStripsMethod · 0.80
AllocateEstimateMethod · 0.80

Tested by

no test coverage detected