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

Bill Lorensen bill.lorensen at gmail.com
Mon Mar 15 14:54:07 EDT 2010


On Mon, Mar 15, 2010 at 8:33 AM, Bill Chivas <noo134 at googlemail.com> wrote:
> 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
>
> _______________________________________________
> 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
>
>

Add MeshPoints->Modified();

These bulk data do not modify their times because of the small amount
of overhead associated with the modified time calls.

Bill



More information about the vtkusers mailing list