Click and drag a vertex of a vtkUnstructuredGrid

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Click and drag a vertex of a vtkUnstructuredGrid

lokida
Hello,

I have used the Click and drag a vertex example and it works with vtkPolyData.
Now, I would like to use it with a vtkUnstructuredGrid but I haven't found any examples or documentation about this.

Is-it possible do click and drag a vertex of an unstructuredGrid. If yes, how Can I do that (example, link,..) ?

Than you.
Reply | Threaded
Open this post in threaded view
|

Re: Click and drag a vertex of a vtkUnstructuredGrid

David Doria-2-3
On Thu, Aug 11, 2011 at 4:37 AM, lokida <[hidden email]> wrote:

> Hello,
>
> I have used the
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertex Click and
> drag a vertex  example and it works with vtkPolyData.
> Now, I would like to use it with a vtkUnstructuredGrid but I haven't found
> any examples or documentation about this.
>
> Is-it possible do click and drag a vertex of an unstructuredGrid. If yes,
> how Can I do that (example, link,..) ?
>
> Than you.

It should be exactly the same, just using a vtkDataSetMapper instead
of a vtkPolyDataMapper, no?

David
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re : Click and drag a vertex of a vtkUnstructuredGrid

lokida
Apparently not. The interaction to select points works with a vtkInteractorStyleTrackballActor class and it seems to only works with vtkPolyData.

May be I should convert my unstructured grid into a polydata ?


De : David Doria <[hidden email]>
À : lokida <[hidden email]>
Cc : [hidden email]
Envoyé le : Jeu 11 août 2011, 14h 37min 46s
Objet : Re: [vtkusers] Click and drag a vertex of a vtkUnstructuredGrid

On Thu, Aug 11, 2011 at 4:37 AM, lokida <[hidden email]> wrote:

> Hello,
>
> I have used the
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertex Click and
> drag a vertex  example and it works with vtkPolyData.
> Now, I would like to use it with a vtkUnstructuredGrid but I haven't found
> any examples or documentation about this.
>
> Is-it possible do click and drag a vertex of an unstructuredGrid. If yes,
> how Can I do that (example, link,..) ?
>
> Than you.

It should be exactly the same, just using a vtkDataSetMapper instead
of a vtkPolyDataMapper, no?

David

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Re : Click and drag a vertex of a vtkUnstructuredGrid

David Doria-2-3
On Thu, Aug 11, 2011 at 8:54 AM, R M <[hidden email]> wrote:
> Apparently not. The interaction to select points works with a
> vtkInteractorStyleTrackballActor class and it seems to only works with
> vtkPolyData.
>
> May be I should convert my unstructured grid into a polydata ?

You could use a polydata for the interaction but still update the
unstructuredGrid points:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertexUnstructuredGrid

Or you could do the unstructuredGrid->PolyData conversion that you mentioned:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/DataSetSurfaceFilter

David
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re : Re : Click and drag a vertex of a vtkUnstructuredGrid

lokida
Hi,

The first example http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertexUnstructuredGrid seems to have no difference with the http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertex example.

So for the moment I use a vtkCompositeDataGeometryFilter and then use vtkCleanPolyData on the output of the vtkCompositeDataGeometryFilter. And it seems to work.

But because I have only one vtkPolyData now, I am quite block because I would like to hide some blocks. But, I have only one actor because only one vtkPolyData.

I think I will try to loop through all blocks and convert each block in a vtkPolyData et change the points in order to point to the global array points (In order to move vertices that are shared by several blocks). And, I could use an Actor for each polydata and make them visible or not. I don't know yet if it will work. It is just a test.

Thank you.


De : David Doria <[hidden email]>
À : R M <[hidden email]>
Cc : [hidden email]
Envoyé le : Ven 12 août 2011, 16h 30min 50s
Objet : Re: [vtkusers] Re : Click and drag a vertex of a vtkUnstructuredGrid

On Thu, Aug 11, 2011 at 8:54 AM, R M <[hidden email]> wrote:
> Apparently not. The interaction to select points works with a
> vtkInteractorStyleTrackballActor class and it seems to only works with
> vtkPolyData.
>
> May be I should convert my unstructured grid into a polydata ?

You could use a polydata for the interaction but still update the
unstructuredGrid points:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertexUnstructuredGrid

Or you could do the unstructuredGrid->PolyData conversion that you mentioned:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/DataSetSurfaceFilter

David

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Re : Re : Click and drag a vertex of a vtkUnstructuredGrid

David Doria-2-3
On Fri, Aug 12, 2011 at 10:59 AM, R M <[hidden email]> wrote:

> Hi,
>
> The first example
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertexUnstructuredGrid
> seems to have no difference with the
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertex example.
>
> So for the moment I use a vtkCompositeDataGeometryFilter and then use
> vtkCleanPolyData on the output of the vtkCompositeDataGeometryFilter. And it
> seems to work.
>
> But because I have only one vtkPolyData now, I am quite block because I
> would like to hide some blocks. But, I have only one actor because only one
> vtkPolyData.
>
> I think I will try to loop through all blocks and convert each block in a
> vtkPolyData et change the points in order to point to the global array
> points (In order to move vertices that are shared by several blocks). And, I
> could use an Actor for each polydata and make them visible or not. I don't
> know yet if it will work. It is just a test.
>
> Thank you.

Sorry, I uploaded the wrong file:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MoveAVertexUnstructuredGrid

There is not much different, but you'll see the input data is an
unstructuredGrid instead of a PolyData.

David
_______________________________________________
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