[vtkusers] How to reset actor positions
Bill Lorensen
bill.lorensen at gmail.com
Fri Aug 2 12:52:00 EDT 2013
Looks good to me. You may want to set the origin to 0 if appropriate.
actor->SetOrigin(0,0,0);
On Fri, Aug 2, 2013 at 12:42 PM, Serge Lalonde <serge at infolytica.com> wrote:
> Here's the code that I wrote to reset the actor positions to their
> defaults after being modified by the vtkInteractorStyleTrackballActor class.
> It works, but does anybody know if this is the correct way to do it?
> Thanks!
>
> vtkActorCollection *actors= CurrentRenderer->GetActors();
> vtkCollectionSimpleIterator cookie;
> vtkActor *actor;
>
> actors->InitTraversal(cookie);
> while ((actor= actors->GetNextActor(cookie)) != NULL)
> {
> if (actor->GetUserMatrix() != NULL)
> actor->GetUserMatrix()->Identity();
> actor->GetMatrix()->Identity();
> actor->SetOrientation(0, 0, 0);
> actor->SetScale(1, 1, 1);
> actor->SetPosition(0, 0, 0);
> }
>
> if (AutoAdjustCameraClippingRange)
> CurrentRenderer->ResetCameraClippingRange();
>
> Interactor->Render();
>
>
> --
> www.infolytica.com
> 300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3
> (514) 849-8752 x236, Fax: (514) 849-4239
>
> _______________________________________________
> 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
>
>
--
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130802/ed71346f/attachment.htm>
More information about the vtkusers
mailing list