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

Method Extract

Filters/Extraction/vtkExtractSelectedArraysOverTime.cxx:192–230  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

190
191//------------------------------------------------------------------------------
192vtkSmartPointer<vtkDataObject> vtkExtractSelectedArraysOverTime::Extract(
193 vtkInformationVector** inputVector, vtkInformation* outInfo)
194{
195 vtkDataObject* input = vtkDataObject::GetData(inputVector[0], 0);
196 vtkSelection* selInput = vtkSelection::GetData(inputVector[1], 0);
197 vtkSmartPointer<vtkExtractSelection> filter = this->SelectionExtractor;
198 if (filter == nullptr)
199 {
200 return input;
201 }
202 filter->SetPreserveTopology(false);
203 filter->SetInputData(0, input);
204 filter->SetInputData(1, selInput);
205
206 vtkDebugMacro(<< "Preparing subfilter to extract from dataset");
207 // pass all required information to the helper filter
208 int piece = 0;
209 int npieces = 1;
210 int* uExtent = nullptr;
211 if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()))
212 {
213 piece = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());
214 npieces = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
215 }
216
217 if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT()))
218 {
219 uExtent = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT());
220 }
221 filter->UpdatePiece(piece, npieces, 0, uExtent);
222
223 vtkSmartPointer<vtkDataObject> extractedData;
224 extractedData.TakeReference(filter->GetOutputDataObject(0)->NewInstance());
225 extractedData->ShallowCopy(filter->GetOutputDataObject(0));
226
227 double dtime = input->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP());
228 extractedData->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(), dtime);
229 return extractedData;
230}
231
232//------------------------------------------------------------------------------
233int vtkExtractSelectedArraysOverTime::DetermineSelectionType(vtkSelection* sel)

Callers 1

RequestDataMethod · 0.95

Calls 11

UpdatePieceMethod · 0.80
GetDataFunction · 0.50
SetInputDataMethod · 0.45
HasMethod · 0.45
GetMethod · 0.45
TakeReferenceMethod · 0.45
NewInstanceMethod · 0.45
GetOutputDataObjectMethod · 0.45
ShallowCopyMethod · 0.45
GetInformationMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected