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

Method ProcessRequest

IO/OpenVDB/vtkOpenVDBWriter.cxx:384–447  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

382
383//----------------------------------------------------------------------------
384int vtkOpenVDBWriter::ProcessRequest(
385 vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
386{
387 if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT()))
388 {
389 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
390 inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),
391 (this->Controller ? this->Controller->GetNumberOfProcesses() : 1));
392 inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(),
393 (this->Controller ? this->Controller->GetLocalProcessId() : 0));
394 inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(), 0);
395
396 if (this->WriteAllTimeSteps)
397 {
398 double* inTimes = inputVector[0]->GetInformationObject(0)->Get(
399 vtkStreamingDemandDrivenPipeline::TIME_STEPS());
400 if (inTimes && this->WriteAllTimeSteps)
401 {
402 double timeReq = inTimes[this->Internals->CurrentTimeIndex];
403 inputVector[0]->GetInformationObject(0)->Set(
404 vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP(), timeReq);
405 }
406 }
407 return 1;
408 }
409 else if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_INFORMATION()))
410 {
411 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
412 if (inInfo->Has(vtkStreamingDemandDrivenPipeline::TIME_STEPS()))
413 {
414 // reset the CurrentTimeIndex in case we're writing out all of the time steps
415 this->Internals->CurrentTimeIndex = 0;
416 this->Internals->NumberOfTimeSteps =
417 inInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
418 }
419 else
420 {
421 this->Internals->NumberOfTimeSteps = 1;
422 }
423 }
424 else if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_DATA()))
425 {
426 if (this->WriteAllTimeSteps && this->Internals->CurrentTimeIndex == 0)
427 {
428 // Tell the pipeline to start looping.
429 request->Set(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING(), 1);
430 }
431 }
432
433 int retVal = this->Superclass::ProcessRequest(request, inputVector, outputVector);
434
435 if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_DATA()))
436 {
437 if (this->WriteAllTimeSteps &&
438 this->Internals->CurrentTimeIndex == this->Internals->NumberOfTimeSteps)
439 {
440 // Tell the pipeline to stop looping.
441 request->Remove(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING());

Callers

nothing calls this directly

Calls 8

GetInformationObjectMethod · 0.80
GetNumberOfProcessesMethod · 0.80
HasMethod · 0.45
SetMethod · 0.45
GetLocalProcessIdMethod · 0.45
GetMethod · 0.45
LengthMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected