<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-9">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal>Hi everyone;<o:p></o:p></p>
<p class=MsoNormal>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?<o:p></o:p></p>
<p class=MsoNormal>Thanks already…<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>