<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-9">
<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 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;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","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;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.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><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thanks for the reply Julian, I’ve already tried that but nothing
was drawn on screen…<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Julian Ibarz
[mailto:julian.ibarz@gmail.com] <br>
<b>Sent:</b> Thursday, June 26, 2008 4:46 PM<br>
<b>To:</b> Sercani; vtkusers@vtk.org<br>
<b>Subject:</b> Re: [vtkusers] How to draw lines in wxWindow<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>To convert from wx coordinates to display coordinates (that
is the display coordinates of VTK and viewport coordinates of opengl) you just
simply did this :<br>
<br>
x = x;<br>
y = height - y; // height of the renderer<br>
<br>
And doing this stuff (java syntax) :<br>
<br>
vtkCoordinate coord = new vtkCoordinate();<br>
coord.SetValue(x,y,0);<br>
coord.SetCoordinateSystemToDisp<o:p></o:p></p>
<div id=1fqt>
<p class=MsoNormal>lay();<o:p></o:p></p>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p>
<div>
<p class=MsoNormal>2008/6/26 Julian Ibarz <<a
href="mailto:julian.ibarz@gmail.com">julian.ibarz@gmail.com</a>>:<o:p></o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>To convert from wx coordinates
to display coordinates (that is the display coordinates of VTK and viewport
coordinates of opengl) you just simply did this :<br>
<br>
x = x;<br>
y = height - y; // height of the renderer<br>
<br>
And doing this stuff (java syntax) :<br>
<br>
vtkCoordinate coord = new vtkCoordinate();<br>
coord.SetValue(x,y,0);<br>
coord.SetCoordinateSystemToDisplay();<br>
<br>
<br>
<o:p></o:p></p>
<div>
<p class=MsoNormal>2008/6/26 Sercani <<a
href="mailto:sercanimailgroups@gmail.com" target="_blank">sercanimailgroups@gmail.com</a>>:<o:p></o:p></p>
<div>
<div>
<div>
<p>Hi everyone;<o:p></o:p></p>
<p>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>Thanks already…<o:p></o:p></p>
<p> <o:p></o:p></p>
<p> <o:p></o:p></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'>_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a
href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><o:p></o:p></p>
</div>
<p class=MsoNormal><br>
<br clear=all>
<br>
-- <br>
<span style='color:#888888'>Julian Ibarz </span><o:p></o:p></p>
</div>
<p class=MsoNormal><br>
<br clear=all>
<br>
-- <br>
Julian Ibarz <o:p></o:p></p>
</div>
</body>
</html>