[vtkusers] HOWTO: pick points on 2D Plane & show points?

Karthik Krishnan karthik.krishnan at kitware.com
Mon Feb 16 20:38:24 EST 2009


vtkSeedWidget does precisely this. A few tips follow.

- Play around with TestSeedWidget2.cxx. You may need to uncomment the 
test from Widgets/Testing/Cxx/CMakeLists.txt, so that it gets compiled.

- The default handle representation is rendered as 2D crosshairs. You 
can change this to any arbitrary shape. The seed representation allows 
you to set any vtkHandleRepresentation. So you can use a 
vtkPolygonalHandleRepresentation3D which allows the handles (seeds) to 
be representated with a user specified geometry. Check out 
TestPolygonalRepresentationHandleWidget.cxx to see how handles can be 
represented as arbitrary geometries.

Hope this helps.

--
karthik

kent williams wrote:
> I've been looking through the mailing list archive and VTK examples
> for some time and not come up with any good way to what I need to do,
> so I'm asking you-all.
>
> We want to be able to pick points on a 2D view plane, display some
> sort of geometry (a circle?) where a point has been placed, and be
> able to move points around after the fact.
>
> In other words the use case would be this.
>
> 1. User clicks 'add point' button to go into point-choosing mode.
> 2. User clicks in 2D view, and the point clicked is marked with some
> geometry -- e.g. a white circle.
> 3. After a point has been placed, the user can pick and drag the point.
>
> Actually, what would be great would be for there to be a widget that
> acts like the vtkContourWidget handles.  You click, it drops a white
> dot, and once the Contour is closed, you can pick and drag the points.
>
> Suggestions?
> _______________________________________________
> 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
>   

-- 
Karthik Krishnan
R & D Engineer,
Kitware Inc,
Ph:  518 371 3971 x119
Fax: 518 371 3971




More information about the vtkusers mailing list