[vtkusers] Assign new position to point in vtkUnstructuredGrid
Dominik Szczerba
dominik at itis.ethz.ch
Mon Oct 20 10:13:08 EDT 2008
I do it like this (with polydata, but unstructured should be same or similar)
for(int i = 0; i<polydata->GetNumberOfPoints(); i++){
double* p = (double*)(polydata->GetPoints()->GetData())->GetVoidPointer(3*i);
p[0] += dt*vel[i].x;
p[1] += dt*vel[i].y;
p[2] += dt*vel[i].z;
}
polydata->Modified();
you will note that without Modified() things are not updated.
Dominik
On Monday 20 October 2008 04:03:50 pm Dirk Fressmann wrote:
> Hi
>
> for being able to drag a node from an unstructured grid I have to assign
> new coordinates to this point within the callback function of the mouse
> events. Is there a way to do this, such that the geometry of the
> unstructured grid is being updated as well?
>
> If you have any ideas, please help! I'm getting desperate!
>
> Dirk
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
--
Dominik Szczerba, Ph.D.
Computational Physics Group
Foundation for Research on Information Technologies in Society
http://www.itis.ethz.ch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081020/146f12ab/attachment.pgp>
More information about the vtkusers
mailing list