Class to define a view which contains a scene. More...
#include <Inventor/Gui/view/PoSceneView.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
virtual const SoNodekitCatalog * | getNodekitCatalog () const |
PoSceneView () | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static const SoNodekitCatalog * | getClassNodekitCatalog () |
Public Attributes | |
SoSFBool | isBackgroundVisible |
SoSFBool | isBorderVisible |
This class allows the user to define a view which contains a scene.
Views allow the application to specify multiple cameras, each with its own separate viewport (region of the 3D window). This is more powerful than just using multiple SoCamera nodes, because camera nodes do not allow specifying a viewport (the viewport is always the full window). See PoBaseView for more explanation.
A scene is a set of any nodes (except SoCamera nodes) placed under an SoGroup node which must be seen in a viewport according to a camera configuration. To define a view, set the fields viewportOrigin and viewportSize according to the viewport position and size you want to have (relative to the display window sizes), configure the camera (set the part cameraKit), build the scene under an SoGroup node, and set this scene to the view (set the part scene). All shape nodes contained in the scene will be drawn in the viewport previously defined and according to the camera definition. You can define as many views as you want.
NOTES:
LIMITATIONS:
// Must enable this option or viewer will not be able to find the camera in the PoSceneView nodeKit. SoBaseKit::setSearchingChildren( TRUE ); // First scene graph SoSeparator* scene1 = new SoSeparator(); scene1->addChild( new SoCone() ); // First view (lower left corner of window) PoSceneView* view1 = new PoSceneView(); view1->sensitiveOnEvents( TRUE ); view1->isBorderVisible.setValue( TRUE ); view1->viewportOrigin.setValue( 0, 0 ); view1->viewportSize.setValue( 0.5f, 0.5f ); SoPerspectiveCamera* cam1 = new SoPerspectiveCamera(); view1->setPart( "cameraKit.camera", cam1 ); view1->setPart( "scene", scene1 ); cam1->viewAll( scene1, SbViewportRegion(100, 100) ); root->addChild( view1 ); // Second scene graph SoSeparator* scene2 = new SoSeparator(); scene2->addChild( new SoCube() ); // Second view (upper right quadrant of window) PoSceneView* view2 = new PoSceneView(); view2->sensitiveOnEvents( TRUE ); view2->isBorderVisible.setValue( TRUE ); view2->set( "borderApp.drawStyle", "lineWidth 1.5" ); // Work-around for border view2->viewportOrigin.setValue( 0.5f, 0.5f ); view2->viewportSize.setValue( 0.5f, 0.5f ); SoPerspectiveCamera* cam2 = new SoPerspectiveCamera(); view2->setPart( "cameraKit.camera", cam2 ); view2->setPart( "scene", scene2 ); cam2->viewAll( scene2, SbViewportRegion(100, 100) ); root->addChild( view2 ); viewer->setSceneGraph( root );
viewportOrigin | 0 0 |
viewportSize | 1 1 |
isBackgroundVisible | FALSE |
isBorderVisible | FALSE |
PoSceneView::PoSceneView | ( | ) |
Default constructor.
static const SoNodekitCatalog* PoSceneView::getClassNodekitCatalog | ( | ) | [static] |
Returns the SoNodekitCatalog for this class.
Reimplemented from PoBaseView.
static SoType PoSceneView::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from PoBaseView.
virtual const SoNodekitCatalog* PoSceneView::getNodekitCatalog | ( | ) | const [virtual] |
Returns the SoNodekitCatalog for this instance.
Reimplemented from PoBaseView.
virtual SoType PoSceneView::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from PoBaseView.
Defines the visibility of the background of the view.
Defines the visibility of the borders of the view.