[vtkusers] Error in vtkRenderer::ResetCamera

Jeff Baumes jeff.baumes at kitware.com
Wed Nov 25 08:14:20 EST 2009


> I’m new to VTK and was trying to figure out some clipping issues in
> vtkRenderer.  While poking around in the code I ran across
> vtkRenderer::ResetCamera and a potential coding error.  It seems that ‘vn’
> is never initialized prior to being used.

>   if ( this->ActiveCamera != NULL )
>     {
>     this->ActiveCamera->GetViewPlaneNormal(vn);
>     }
>   else
>     {
>     vtkErrorMacro(<< "Trying to reset non-existant camera");
>     return;
>     }

This part of the code you sent will initialize vn or return from the
function without using it, so the extra line you suggested is not
needed.

Jeff



More information about the vtkusers mailing list