[vtkusers] How to draw lines in wxWindow

Sercani sercanimailgroups at gmail.com
Thu Jun 26 09:26:22 EDT 2008


Hi everyone;

I am trying to get the points where user clicks and drags the mouse and
create shapes by using these points. I've written a class that looks like
wxVTKRenderWindowInteractor which doesn't handle interaction but shows vtk
scene in wxWindow. When user selects one of the toggle toolbar buttons (for
drawing line, angle, rectangle etc.) mouse events are sent to a class named
GlassPanel that handles all drawing stuff. When user clicks a point, that
point is taken as p1, and when user starts dragging the mouse , position of
mouse is taken as p2, depending on what shape is selected a shape must be
created by using these two points. Firstly I decided to use vtkLineWidget
for drawing lines but I couldn't manage it, because wxWidgets coordinate
system's origin is upper left hand corner, and vtk uses lower left hand
corner as origin. I tried to convert wxWidgets event coordinates to
vtkCoordinate system, but I even couldn't find which coordinate system is
used by vtkRenderer. Wherever i click on wxWindow lines are drawn at the
windows center. How should I convert these coordinates?Or what is the best
way to draw 2D shapes using vtk?

Thanks already.

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080626/bdde7913/attachment.htm>


More information about the vtkusers mailing list