I have to override both Dolly(double) and Dolly(void). Dolly(void) is identical to the original found in vtkInteractorStyleTrackballCamera, but is included because I have calls to Dolly(void) in my subclass, and Dolly(double) is the one that actually calls camera->Dolly() (Dolly(double) is called from Dolly(void)).<br>
<br>Anyway, I can do this:<br><br> double fpx, fpy, fpz, fcx, fcy, fcz;<br> camera->GetFocalPoint(fpx, fpy, fpz);<br> camera->GetPosition(fcx, fcy, fcz);<br> VECTOR Position(fcx, fcy, fcz);<br> VECTOR FocalPoint(fpx, fpy, fpz);<br>
VECTOR NewFocalPoint = Position + (FocalPoint - Position).Normalize() * 30.0;<br> camera->SetFocalPoint(NewFocalPoint.X, NewFocalPoint.Y, NewFocalPoint.Z);<br> camera->Dolly(factor);<br><br>This makes dolly work OK, but now the focal point is wrong and Pan() and Rotate() get weird as a result. I can recalculate the actual focal point before I leave my function maybe...<br>
<br>Has anyone else tried to do this?<br><br><div class="gmail_quote">On Tue, Jan 13, 2009 at 9:54 PM, 王瘢雹君臣 <span dir="ltr"><<a href="mailto:wangjunchen@gmail.com">wangjunchen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>THE OVERRIDED VIRTUAL FUNCTION MUST BE THE SAME SIGNATURE WITH THE CORRESPONDING FUNCTION IN ITS SUPER CLASS.</div>
<div> </div>
<div>IN YOUR CASE, IN THE SUPER CLASS IS Dolly(double), SO</div>
<div>IN YOUR DERIVED CLASS, IT MUST BE Dolly(double), CAN NOT BE Dolly(void)</div>
<div><br><br> </div>
<div class="gmail_quote">2009/1/14 Kerry Loux <span dir="ltr"><<a href="mailto:louxkr@gmail.com" target="_blank">louxkr@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">Hello,<br><br>I have an interactor derived from vtkInteractorTrackballCamera. I am interested in changing the dolly behavior so that instead of moving the camera some fraction of the distance to the focal point, the camera is moved a constant distance with every call to Dolly(). As a test, I copied the Dolly(double) function from vtkInteractorTrackballCamera to my derived class as the Dolly(void) and replaced "factor" with 10.0. This did not change the behavior. I also tried changing the call to the camera's Dolly() function to camera->Dolly(10.0) and camera(camera->GetDistance() * 10.0) with no avail. Am I going to have to create my own subclass of vtkCamera? It seems that there has to be an easier way. Any ideas?<br>
<br>Thanks,<br><font color="#888888"><br>Kerry<br></font><br></div></div>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>
<font color="#888888">
王瘢雹君臣<br>
</font></blockquote></div><br>