<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Here's the code that I wrote to reset the actor positions to their
defaults after being modified by the
vtkInteractorStyleTrackballActor class.<br>
It works, but does anybody know if this is the correct way to do it?
Thanks!<br>
<title>Snippet</title>
<title>Snippet</title>
<pre style="font-family:Consolas;font-size:13;color:black;background:white;"> <span style="color:blue;">vtkActorCollection</span> *<span style="color:navy;">actors</span>= <span style="color:navy;">CurrentRenderer</span>-><span style="color:#880000;">GetActors</span>();
<span style="color:blue;">vtkCollectionSimpleIterator</span> <span style="color:navy;">cookie</span>;
<span style="color:blue;">vtkActor</span> *<span style="color:navy;">actor</span>;
<span style="color:navy;">actors</span>-><span style="color:#880000;">InitTraversal</span>(<span style="color:navy;">cookie</span>);
<span style="color:blue;">while</span> ((<span style="color:navy;">actor</span>= <span style="color:navy;">actors</span>-><span style="color:#880000;">GetNextActor</span>(<span style="color:navy;">cookie</span>)) != <span style="color:#a000a0;">NULL</span>)
{
<span style="color:blue;">if</span> (<span style="color:navy;">actor</span>-><span style="color:#880000;">GetUserMatrix</span>() != <span style="color:#a000a0;">NULL</span>)
<span style="color:navy;">actor</span>-><span style="color:#880000;">GetUserMatrix</span>()-><span style="color:#880000;">Identity</span>();
<span style="color:navy;">actor</span>-><span style="color:#880000;">GetMatrix</span>()-><span style="color:#880000;">Identity</span>();
<span style="color:navy;">actor</span>-><span style="color:#880000;">SetOrientation</span>(0, 0, 0);
<span style="color:navy;">actor</span>-><span style="color:#880000;">SetScale</span>(1, 1, 1);
<span style="color:navy;">actor</span>-><span style="color:#880000;">SetPosition</span>(0, 0, 0);
}
<span style="color:blue;">if</span> (<span style="color:navy;">AutoAdjustCameraClippingRange</span>)
<span style="color:navy;">CurrentRenderer</span>-><span style="color:#880000;">ResetCameraClippingRange</span>();
<span style="color:navy;">Interactor</span>-><span style="color:blue;">Render</span>();
</pre>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<title>Signature</title>
<a href="http:://www.infolytica.com">www.infolytica.com </a><br>
300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3<br>
(514) 849-8752 x236, Fax: (514) 849-4239
</div>
</body>
</html>