[osg-users] osgViewer::Viewer and getSceneView

Pasquale Tricarico tricaric at gmail.com
Wed Oct 10 15:35:06 PDT 2007


Hi,

I'm updating a project to OSG-2.2, after several months (~6) of
interrupted development, and I'm facing a problem. Before I based my
code on the QT viewer example, with:

class ViewerQT : public osgViewer::Viewer, public GraphicsWindowQT {...}

and I could do:

ViewerQT * viewerWindow = new ViewerQT;
viewerWindow->getSceneView()->...;

Now, I've updated my code using the latest osgviewerQT example, where:

class AdapterWidget : public QGLWidget {...}

class ViewerQT : public osgViewer::Viewer, public AdapterWidget {...}

but now ViewerQT doesn't provide the getSceneView() method. How can I
recover it? I needed it mainly to modify the near/far ratio:

...->getSceneView()->setNearFarRatio(1.0e-8); // big scene, with many
tiny important details that need to be rendered

and for debugging/verbose output such as:

...->getSceneView()->getProjectionMatrixAsPerspective(fovy,
aspectRatio, zNear, zFar);

Maybe now OSG 2.2 offers better ways to perform these two tasks?

Thanks a lot,
Pasquale

(BTW, the first line of osgviewerQT.cpp says "OpenSceneGraph example,
osganimate.", got to love cut'n'paste ;)



More information about the osg-users mailing list