[vtkusers] Problems with Visualization Pipeline Execution
David E DeMarle
dave.demarle at kitware.com
Tue Mar 3 12:00:28 EST 2009
I believe you have to call Modified on the vtkPoints. Without that,
everything downstream is unaware of the change and the pipeline
doesn't flow.
The reason that changing that value doesn't call Modified itself is
because Modified is a potentially expensive call that you don't want
to do with every array entry write. For example, if you have many
points to change you can do so quickly by changing them all and then
calling Modified just once.
On Tue, Mar 3, 2009 at 11:53 AM, John L. Papp <jpapp at craft-tech.com> wrote:
> Hello,
>
> I've created a render pipeline roughly as follows
>
> 1. Created a vtkPoints object and filled with points
> 2. Created a vtkCellArray and filled with indexes associated with
> vtkPoints
> 3. Created a vtkPolyData object and SetPoints with vtkPoints object
> and SetVerts with vtkCellArray object
> 4. Created a vtkPolyDataMapper object and SetInput to vtkPolyData object
> 5. Created a vtkActor object and SetMapper to vtkPolyDataMapper object
>
> Here is what I think the visualization pipeline looks like
>
> vtkPoints->vtkPolyData->vtkPolyDataMapper->vtkActor
> (source) (filter) (mapper) (actor)
>
> Everything renders fine and displays perfectly. The issue arises when I
> attempt to modify the location of any of points in the vtkPoints object. I
> access the vtkPoint object associated with the vtkActor through (using
> Java):
>
> ((vtkPolyData) ((vtkPolyDataMapper)
> vtkactVerts.GetMapper()).GetInput()).GetPoints()
>
> I then use the member function of the vtkPoints class to modify the first
> point location:
>
> ((vtkPolyData) ((vtkPolyDataMapper)
> vtkactVerts.GetMapper()).GetInput()).GetPoints().SetPoint(0, dblX, dblY,
> dblZ);
>
> I verified that the point locational information has changed to the new
> values, however, I can't get the visualization pipeline to recognize the
> locational change. I tried to force a render of the pipeline, an Update()
> of the vtkPolyDataMapper, and an Update() of the vtkActor object associated
> with the vtkPoints object but the plotted location of the point does not
> change. My previous implementation would just create a new of vtkPoints and
> vtkCellArray object, fill with new points with the locational change
> (although only one of the points actually has a different location) and then
> associate this with the vtkPolyData mapper. This seems wasteful since all I
> am doing is changing the location of one point. Obviously, I'm missing
> something as to how the visualization pipeline is updated. So what am I
> doing wrong?
>
> Thanks,
>
> John
>
> --
> **************************************************************
> Dr. John Papp
> Senior Research Scientist
> CRAFT Tech.
> 6210 Kellers Church Road
> Pipersville, PA 18947
>
> Email: jpapp at craft-tech.com
> Phone: (215) 766-1520
> Fax : (215) 766-1524
> www.craft-tech.com
>
> **************************************************************
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
--
David E DeMarle
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109
More information about the vtkusers
mailing list