17#ifndef AGXOSG_EMBEDDEDGLWINDOW_H
18#define AGXOSG_EMBEDDEDGLWINDOW_H
23#include <osgViewer/Viewer>
25#include <osgGA/TrackballManipulator>
26#include <osgViewer/GraphicsWindow>
53 bool init(
int x,
int y,
int width,
int height);
60 void resize(
int x,
int y,
int width,
int height);
165 osg::ref_ptr<osgViewer::Viewer> m_viewer;
167 osg::ref_ptr<osg::Group> m_root;
168 osg::ref_ptr<agxOSG::SceneDecorator> m_decorator;
169 osgGA::StandardManipulator *m_manipulator;
171 osg::ref_ptr<osgViewer::GraphicsWindowEmbedded> m_embeddedWindow;
This class is for embedding an OSG based window inside another OpenGL contex, for example in QT.
void fitSceneIntoView()
Will move the camera so that the whole scene is visible.
agxSDK::Simulation * getSimulation() const
void mouseMoveEvent(int x, int y)
Called upon mouse event.
void frame()
Should be called to update the rendering frame.
void mousePressEvent(int x, int y, int button)
Called upon pressing a mouse button.
osgGA::EventQueue * getEventQueue() const
const osg::Group * getRoot() const
void resize(int x, int y, int width, int height)
Called at resize of the window.
bool init(int x, int y, int width, int height)
Will initialize the scenegraph, camera, viewer A valid OpenGL context should be initialized and activ...
EmbeddedGLWindow()
Constructor.
void keyPressEvent(int key, int mod_mask)
Called upon a keypress event.
const osg::Camera * getCamera() const
void mouseReleaseEvent(int x, int y, int button)
Called upon releasing a mouse button.
void clear()
Will remove simulation, deallocate all scene graph elements After call to this method,...
void setSimulation(agxSDK::Simulation *simulation)
Associate a Simulation to this window.
agxOSG::SceneDecorator * getSceneDecorator()
void removeSimulation()
Deassociates any registered simulation.
void wheelEvent(int motion)
Called when the mouse wheel is used.
void keyReleaseEvent(int key, int mod_mask)
Called upon a keyrelease event.
osg::Camera * getCamera()
~EmbeddedGLWindow()
Destructor.
Decorates a scene with a specific AGX Rendering Style.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.