[vtkusers] How to draw lines in wxWindow

Julian Ibarz julian.ibarz at gmail.com
Fri Jun 27 12:33:00 EDT 2008


Hum the position are defined in space coordinate so you need to explicitely
make them in world coordinate. When you create the vtkLineWidget and give it
his position, take the renderer where the vtkLineWidget will be added and do
that :

vtkRenderer renderer;
renderer.SetDisplayPoint(x,y,0);

Where x y are the position of the mouse in vtk display coordinate and 0
means you will put the line on the near plane (1 for the far plane...).

and follow by I thing like that :

renderer.DisplayToWorld();
double[] worldPoints = renderer.GetWorldPoint();
lineWidget->SetPoint1(worldPoints);
etc.



2008/6/27 Sercani <sercanimailgroups at gmail.com>:

>  Hi Julian,
>
> Codes are too long to write down here so I am sending drawing class files
> as a rar file to you.  I am sending wxWidgets mouse events to GlassPanel
> class and it handles (or will handle) everything and creates dynamically an
> instance of ShapesStructure (a line3D or angle3D) and these classes handles
> the drawing stuff. As you see in the codes comments I've tried many things
> but coulnd't manage to draw shapes correctly. I've done my new tryings in
> Line3D class and I was trying something new when I got your mail so I don't
> know what is inside that class right now :D. Thanks for your help and
> interest already…
>
> Have a nice day,
>
> Yours sincerely…
>



-- 
Julian Ibarz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080627/681ed1d8/attachment.htm>


More information about the vtkusers mailing list