[vtkusers] Contour lines of 3D objects (vtkPolyData)

Jothybasu Selvaraj jothybasu at gmail.com
Tue Feb 14 05:30:18 EST 2012


Instead of using vtkActor2D use vtkActor with vtkPolyDataMapper and use
SetPosition and RotateX,Y&Z to get the correct view.

Or use a vtkTransform with vtkActor.

Jothy

On Tue, Feb 14, 2012 at 10:01 AM, Daniel Kruber <ich_daniel at habmalnefrage.de
> wrote:

> Hi there,
>
> I create contour lines of a 3D object and put this in 3 different
> vtkCanvas, different in each of three sides. (look at screenshot, right
> side)
> The contour lines are vtkActor2D, which are always displayed correctly
> from the front. The other two views (side, bottom) are also shown only from
> the front, so you can see only a simple straight line.
>
> Is it possible to turn this vtkActor2D or similar?
>
>
> The production of contour lines is done by:
>
> //****
> /* 3 different planes for each view (3 total) */
> vtkPlane plane...
> /*
> example: vtkPlane sagPlane = new vtkPlane();
>          sagPlane.SetOrigin(0,0,0);
>          sagPlane.SetNormal(1, 0, 0);
> */
>
> vtkPolyData data...
>
> vtkCutter cutEdges = new vtkCutter(); //Generate cut lines
> cutEdges.SetInput(data);
> cutEdges.SetCutFunction (plane);
> cutEdges.GenerateCutScalarsOn();
> cutEdges.SetValue( 0, 0);
>
> vtkCoordinate coord = new vtkCoordinate();
> coord.SetCoordinateSystemToViewport();
>
> vtkPolyDataMapper2D contourMapper = new vtkPolyDataMapper2D();
> contourMapper.SetInputConnection(cutEdges.GetOutputPort());
> contourMapper.SetTransformCoordinate(coord);
> contourMapper.SetLookupTable(lut);
> contourMapper.ScalarVisibilityOff();
>
> vtkActor2D contourActor = new vtkActor2D();
> contourActor.SetMapper(contourMapper);
> //****
>
>
> Thanks in advance.
>
>
>
> --
> NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!
> Jetzt informieren: http://www.gmx.net/de/go/freephone/
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120214/85db4f1c/attachment.htm>


More information about the vtkusers mailing list