[vtkusers] Re: about drawing line

Andrew Wilford andrew at artwork.com
Wed Jul 20 11:01:28 EDT 2005


Yes, capture the points as the mouse moves (depending on your OS) and store
them in vtkPoints, then use vtkCellArray to define the edges, from one point
to the next. Create a vtkPolyData and SetPoints and SetLines on the points
and edges. Follow the typical polydata pipeline, using vtkPolyDataMapper2D,
vtkActor2D and finally use AddActor2D to add the polydata to the renderer.

I can provide some code fragments for an implementation in Visual C++ if you
need them.

----- Original Message -----
From: "Yixun Liu" <yxliu at fudan.edu.cn>
To: <andrew at artwork.com>
Sent: Wednesday, July 20, 2005 10:04 AM
Subject: about drawing line


> Hi,
>
> Thank your help!
>
> What I mean is that when I move the mouse around the VTKWindow, a curve
will be drawn. Does 2D actor and mapper support this function?
>
> Regards,
>
> Yixun Liu
>




More information about the vtkusers mailing list