[vtkusers] Migration to VTK6

David E DeMarle dave.demarle at kitware.com
Thu Dec 3 09:25:53 EST 2015


I agree with Cory on Update() being redundant before the Write().

>    vtkDataObject* dobj = someAlgorithm->GetOutput(1);
>    dobj->Update();

should become:

  someAlgorithm->Update(1); //to make sure there is something valid
  vtkDataObject* dobj = someAlgorithm->GetOutput(1); //keep the output for
later use

Because since vtk6, dobj no longer has any connection to the algorithm, so
updating it (which used to update the algorithm for you) no longer has any
meaning.



David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Thu, Dec 3, 2015 at 9:09 AM, Cory Quammen <cory.quammen at kitware.com>
wrote:

> Arno,
>
> That pattern should be valid in VTK6. Are you getting compile errors?
>
> I believe the Update() and Write() calls to the writer are redundant - you
> should need only one.
>
> Thanks,
> Cory
>
> On Wed, Dec 2, 2015 at 5:56 PM, Arno Klein <binarybottle at gmail.com> wrote:
>
>> I am trying to update my code to migrate to VTK6 according to:
>>
>> http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_Update
>>
>> According to the examples on that site, I understand that:
>>
>>     vtkDataObject* dobj = someAlgorithm->GetOutput(1);
>>     dobj->Update();
>>
>> should become:
>>
>>     someAlgorithm->Update(1);
>>
>>
>> However, I don’t know how to deal with the following pattern:
>>
>> void PointAreaComputer::WriteIntoFile(char *fileName)
>> {
>>     vtkPolyDataWriter* writer=vtkPolyDataWriter::New();
>>     writer->SetFileName(fileName);
>>     m_mesh->GetPointData()->SetScalars(m_pointsArea);
>>     writer->SetInputData(m_mesh);
>>     writer->Update();
>>     writer->Write();
>>     writer->Delete();
>> }
>>
>> What should I do to make this compatible with VTK6?
>>
>> Cheers,
>> @rno
>>
>> _______________________________________________
>> 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
>>
>>
>
>
> --
> Cory Quammen
> R&D Engineer
> Kitware, Inc.
>
> _______________________________________________
> 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/20151203/70a44527/attachment.html>


More information about the vtkusers mailing list