[vtkusers] selecting points
Scott Johnson
Scott.Johnson at neuwave.com
Mon Dec 19 10:51:18 EST 2011
Hello Lukas,
My solution was to create 2 parallel vtkPolyData objects. One defines the closed vtkPolygon and the other shows a vtkCellArray which is defined as a series of lines showing the same shape.
The full pipeline for the polygon looks like vtkPolyon -> vtkPolyData -> vtkGeometryFilter -> vtkTriangleFilter -> vtkPolyDataMapper -> vtkActor. The vtkActor has it's opacity set to 0.01 and a representation of Surface. (If the opacity is set to 0.0 it will not be picked.) Because the opacity is so low you can't see it.
When you check for the pick it will occur in the vtkActor connected to the vtkPolygon pipeline.
There may be a more optimized solution, but this one seems to work.
-- Scott
-----Original Message-----
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Boehm, Lukas
Sent: Monday, December 19, 2011 9:35 AM
To: David Doria
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] selecting points
This solution is nearly perfect. There's only the problem that I do not want the polygon to be filled. Because in a filled polygon the user cannot see the selected points.
How can I draw the polygon without filling it? I want to see only the borders, so I can see the points within the polygon.
Thank you for this solution!
Lukas
-----Original Message-----
From: David Doria [mailto:daviddoria at gmail.com]
Sent: Montag, 19. Dezember 2011 15:01
To: Boehm, Lukas
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] selecting points
2011/12/19 Boehm, Lukas <Lukas.Boehm at cellent.de>:
> Correct, this is the case.
>
> Thank you!
Then yes, you can just have the user draw the polygon (you could store the ordered corners here if you'd like :
http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/Polygon).
Then you can use:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/PointInPolygon as you suggested.
David
More information about the vtkusers
mailing list