[vtkusers] HOWTO: pick points on 2D Plane & show points?
kent williams
nkwmailinglists at gmail.com
Tue Feb 17 09:11:28 EST 2009
That helps a lot. Sometimes just a pointer into the ocean of VTK
classes can save you a lot of time.
I was actually considering just hacking vtkContourWidget into my own
version -- make a degenerate representation with just one point, trim
out the spline curve calculation and display. The rest of the event
handling and representation are fine.
Though the Seed Widget sounds like a more straightforward solution.
On Mon, Feb 16, 2009 at 7:38 PM, Karthik Krishnan
<karthik.krishnan at kitware.com> wrote:
> 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