[vtkusers] polydata Update() problem

Malcolm Drummond geov at netactive.co.za
Sun Apr 22 07:01:15 EDT 2001


Hi Ganesh

The DataSet doesn't know it has been modified so the mesh pipeline is not
executing (or at least it's not executing "up-stream" of meshmapper). Use
something like scalars->Modified to force an update on the DataSet. You
don't need to update meshmapper; the Render command propagates a signal back
up any pipelines connected to the renderer - this process will ascertain
that the modified DataSet is the most "up-stream" object and execute from
there (this is a terrible over-simplification, it's explained properly in
the textbook and user's guide).

Malcolm

----- Original Message -----
From: Ganesh Sankaranarayanan <ganeshs at uta.edu>
To: <vtkusers at public.kitware.com>
Sent: Sunday, April 22, 2001 9:32 AM
Subject: [vtkusers] polydata Update() problem


> Hi all,
>
> I am trying to deform the vertices of a structured grid.I created the mesh
> as follows
>
> for (i=0; i<121; i++) points->InsertPoint(i,x[i]);
> for (i=0; i<100; i++) polys->InsertNextCell(4,pts[i]);
> for (i=0; i<121; i++) scalars->InsertScalar(i,i);
>
> and giving all the three to a VTK polydata and then the output to a mapper
> 'meshmapper'.I am trying to update the meshmapper in a loop.I also have a
> sphere object and i  set the center of the sphere using the X,Y,Z
> coordinate.
> file://Code fragment
> while(1)
> {
>
> getcursor3D()//Not an vtk function ** returns XYZ coordinates of my
> interface.
>
> sphere->SetCenter(x,y,z);
> sphere->Update();
> deformation();//This function changes the array of points i used to create
> the mesh x[121][3]
> for (i=0; i<121; i++) points->InsertPoint(i,x[i]);
> for (i=0; i<100; i++) polys->InsertNextCell(4,pts[i]);
> for (i=0; i<121; i++) scalars->InsertScalar(i,i);
> meshmapper->Update();
> renWin->Render()
>
> file://infinite loop just for my simulation testing
> }
>
> When the program is executed i could get the sphere to update every time
> when x,y,z changes but my mesh just updates only for the first time.I
> couldn't update it afterwards.
>
> Does anyone know why its so.How should i use Update() for polydata class.
>
> Thanks in advance,
> Ganesh
>
> ********************************************
> Arise Awake and Stop not till the goal is
> reached
> ********************************************
> Ganesh Sankaranarayanan
> Graduate Research Assistant
> Virtual Environment lab
> 142,Nedderman Building
> Yates Street Arlington TX 76010
> Ph 817-272 5719
> ********************************************
> Homepage http://www.geocities.com/sankaganesh
> ********************************************
>
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>





More information about the vtkusers mailing list