Updraft  1.0
Open source glider flight visualisation tool.
Updraft::Core::SceneManager Class Reference

SceneManager class is a wrapper of the scene, and the scene graph. More...

#include <scenemanager.h>

Collaboration diagram for Updraft::Core::SceneManager:

List of all members.

Public Slots

void redrawScene ()
void resetNorth ()
void untilt ()
void saveHomePosition ()

Public Member Functions

 SceneManager ()
 ~SceneManager ()
QWidget * getWidget ()
 Returns the drawing widget.
osg::Group * getRoot ()
 Returns the root of the scene.
osgEarth::MapNode * getMapNode ()
 Returns the map node in the scene.
MapManagergetMapManager ()
 Returns the MapManager instance associated with currently displayed map.
void createMaps ()
 Let MapManagers re-create the maps.
void destroyMaps ()
 Destroy all map nodes.
bool removeGroup (osg::Group *group)
 Removes the group from the root.
osg::Group * getSimpleGroup ()
 Returns pointer to the group node for random drawing.
void registerOsgNode (osg::Node *node, MapObject *mapObject)
 Registers the osg node into Updraft for mouse picking.
void unregisterOsgNode (osg::Node *node)
 Unregisters osg node for mouse picking.
MapObjectgetNodeMapObject (osg::Node *node)
 Tries to get the associated MapObject for the given node.
osgEarth::Util::ElevationManager * getElevationManager ()
 Returns an elevation manager associated with the map that has elevation layer.
const osg::EllipsoidModel * getCurrentMapEllipsoid ()
 Returns the ellipsoid model associated with current active map.
osgEarth::Util::ObjectPlacer * getObjectPlacer ()
 Returns the osgEarth placer used to place nodes into the scene.
osgEarth::Util::Viewpoint getViewpoint ()
 Returns the current viewpoint.

Private Slots

void checkedMap (bool value, MapLayerInterface *layer)

Private Member Functions

void createMapManagers ()
 Create map managers from earth files.
void menuItems ()
 Create the menu items in main window.
void mapLayerGroup ()
 Create the map layer group and fill it with maps.
osgEarth::Util::ElevationManager * createElevationManager ()
osg::GraphicsContext::Traits * createGraphicsTraits (int x, int y, int w, int h, const std::string &name="", bool windowDecoration=false)
osgQt::GraphicsWindowQt * createGraphicsWindow (osg::GraphicsContext::Traits *traits)
osg::Camera * createCamera (osg::GraphicsContext::Traits *traits)
osgEarth::Viewpoint getHomePosition ()
osgEarth::Util::Viewpoint getInitialPosition ()
void startInitialAnimation ()
void updateCameraProjection ()
void insertMenuItems ()
double getAspectRatio ()

Private Attributes

osgEarth::Util::ObjectPlacer * placer
osgViewer::Viewer * viewer
osg::Group * sceneRoot
osg::ClearNode * background
 Node with the background.
osgEarth::MapNode * mapNode
osg::Group * simpleGroup
QVector< MapManager * > mapManagers
QVector< MapLayerInterface * > layers
int activeMapIndex
osg::Camera * camera
MapManipulatormanipulator
osgEarth::Viewpoint saveViewpoint
osgEarth::Util::ElevationManager * elevationManager
osgQt::GraphicsWindowQt * graphicsWindow
QTimer * timer
 Timer that triggers the drawing procedure.
QHash< osg::Node *, MapObject * > pickingMap
 Map of osg nodes registered for mouse picking.
SettingInterfacehomePositionSetting

Static Private Attributes

static const float flyToHomeDuration = 1.0

Detailed Description

SceneManager class is a wrapper of the scene, and the scene graph.


Constructor & Destructor Documentation


Member Function Documentation

void Updraft::Core::SceneManager::checkedMap ( bool  value,
MapLayerInterface layer 
) [private, slot]
osg::Camera * Updraft::Core::SceneManager::createCamera ( osg::GraphicsContext::Traits *  traits) [private]
osgEarth::Util::ElevationManager * Updraft::Core::SceneManager::createElevationManager ( ) [private]
osg::GraphicsContext::Traits * Updraft::Core::SceneManager::createGraphicsTraits ( int  x,
int  y,
int  w,
int  h,
const std::string &  name = "",
bool  windowDecoration = false 
) [private]
osgQt::GraphicsWindowQt * Updraft::Core::SceneManager::createGraphicsWindow ( osg::GraphicsContext::Traits *  traits) [private]

Create map managers from earth files.

Let MapManagers re-create the maps.

Destroy all map nodes.

const osg::EllipsoidModel * Updraft::Core::SceneManager::getCurrentMapEllipsoid ( )

Returns the ellipsoid model associated with current active map.

Returns:
Ellipsoid model used for calculations on the current map.
osgEarth::Util::ElevationManager * Updraft::Core::SceneManager::getElevationManager ( )

Returns an elevation manager associated with the map that has elevation layer.

Returns:
pointer to the elevation manager object for the current map.
osgEarth::Util::Viewpoint Updraft::Core::SceneManager::getHomePosition ( ) [private]
osgEarth::Util::Viewpoint Updraft::Core::SceneManager::getInitialPosition ( ) [private]

Returns the MapManager instance associated with currently displayed map.

Returns:
The MapManager instance for the currently displayed map.
osgEarth::MapNode * Updraft::Core::SceneManager::getMapNode ( )

Returns the map node in the scene.

Note that there must be only one map node in the scene.

Returns:
Map node for the scene.

Tries to get the associated MapObject for the given node.

Parameters:
nodeThe node whose MapObject we want
Returns:
Pointer to the MapObject that contains the registration info for the given node, if the node was registered.
osgEarth::Util::ObjectPlacer * Updraft::Core::SceneManager::getObjectPlacer ( )

Returns the osgEarth placer used to place nodes into the scene.

Returns:
Object placer instance used to correctly place nodes onto the map.

Returns the root of the scene.

Returns:
osg::Group object that represents the root of the scene.

Returns pointer to the group node for random drawing.

osgEarth::Util::Viewpoint Updraft::Core::SceneManager::getViewpoint ( )

Returns the current viewpoint.

Returns:
The currently used viewpoint

Returns the drawing widget.

Returns:
The widget the scene is drawn into

Create the map layer group and fill it with maps.

Create the menu items in main window.

void Updraft::Core::SceneManager::registerOsgNode ( osg::Node *  node,
MapObject mapObject 
)

Registers the osg node into Updraft for mouse picking.

Parameters:
nodeThe node that should be registered
mapObjectMapObject that represents this pickable node
bool Updraft::Core::SceneManager::removeGroup ( osg::Group *  group)

Removes the group from the root.

Unregisters osg node for mouse picking.

Parameters:
nodeThe node that should be unregistered

Member Data Documentation

osg::ClearNode* Updraft::Core::SceneManager::background [private]

Node with the background.

osg::Camera* Updraft::Core::SceneManager::camera [private]
osgEarth::Util::ElevationManager* Updraft::Core::SceneManager::elevationManager [private]
const float Updraft::Core::SceneManager::flyToHomeDuration = 1.0 [static, private]
osgQt::GraphicsWindowQt* Updraft::Core::SceneManager::graphicsWindow [private]
osgEarth::MapNode* Updraft::Core::SceneManager::mapNode [private]
QHash<osg::Node*, MapObject*> Updraft::Core::SceneManager::pickingMap [private]

Map of osg nodes registered for mouse picking.

osgEarth::Util::ObjectPlacer* Updraft::Core::SceneManager::placer [private]
osgEarth::Viewpoint Updraft::Core::SceneManager::saveViewpoint [private]

Timer that triggers the drawing procedure.

osgViewer::Viewer* Updraft::Core::SceneManager::viewer [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines