[vtkusers] Prevent Pipeline Execution
David E DeMarle
dave.demarle at kitware.com
Mon Apr 4 09:06:05 EDT 2016
Try this,
In VTK >= 6.0, connect the writer to the output data produced by the
pipeline instead of the algorithm's output port.
writer->SetInputData(filter->GetOutput())
instead of
writer->SetInputConnection(filter->GetOutputPort())
Than have your code call filter->Update();
writer->SetInputData(filter->GetOutput()); only when it needs to.
David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909
On Mon, Apr 4, 2016 at 8:45 AM, Michael Bußler <
Michael.Bussler at visus.uni-stuttgart.de> wrote:
> Hi,
>
>
>
> I have a question regarding the pipeline execution.
>
> My pipeline consists of some computational heavy modules, which are at the
> end triggered by a writer module.
>
> Now I want to prevent this pipeline to be executed, if the file, that is
> produced at the end, already exists.
>
>
>
> So far, I’ve tried to use RequestUpdateExtent() as it is called before
> RequestData() and I can get the time from outInfo:
>
>
>
> int vtkWritePolyData::RequestUpdateExtent(vtkInformation* request,
> vtkInformationVector** inputVector, vtkInformationVector* outputVector)
>
> {
>
> vtkInformation *outInfo = outputVector->GetInformationObject(0);
>
>
>
> std::string timeStr;
>
> if(
> outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP())) {
>
>
>
> if(checkFileExists(outInfo) )
>
> {
>
>
> request->Remove(vtkStreamingDemandDrivenPipeline::REQUEST_DATA());
>
>
> outInfo->Set(vtkDemandDrivenPipeline::REQUEST_DATA_NOT_GENERATED());
>
> }
>
> }
>
> return 1;
>
> }
>
>
>
> But the RequestData() method of my writer module is still being executed.
>
>
>
> How can I prevent the pipeline from being executed?
>
>
>
> Best, Michael
>
>
>
> --
> Michael Bußler, Dipl.-Inf.
> Visualization Research Center, Universität Stuttgart (VISUS) Allmandring 19
> 70569 Stuttgart
> Germany
>
> mail: michael.bussler at visus.uni-stuttgart.de
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160404/b3b2c8bb/attachment.html>
More information about the vtkusers
mailing list