[vtkusers] how to display a mesh after it's been modified

Bill Chivas noo134 at googlemail.com
Mon Mar 15 11:33:13 EDT 2010


Hi all,

let's say i have a mesh (unstructuredGrid) and i want to visualize it before
and after i have modified it (e.g. change of one of its points its
coordinates)

Some code (not complete):

vtkSmartPointer<vtkUnstructuredGrid> Mesh =
vtkSmartPointer<vtkUnstructuredGrid>::New();

Mesh->SetPoints(MeshPoints);

vtkSmartPointer<vtkDataSetMapper> Mapper =
vtkSmartPointer<vtkDataSetMapper>::New();

Mapper->SetInput(Mesh);

vtkSmartPointer<vtkActor> Actor = vtkSmartPointer<vtkActor>::New();

Actor->SetMapper( Mapper );

VTKRenderer->AddActor( Actor );

VTKRenderer->ResetCamera();

VTKRenderer->Render();

// then modify one point of the mesh (point with id=1)

MeshPoints->SetPoint(1, newX, newY, newZ);

Then i want to display the modified mesh. How can i do it?



Thanks,

Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100315/6f6e8593/attachment.htm>


More information about the vtkusers mailing list