17#ifndef AGXOSG_EMBEDDEDGLWINDOW_H
18#define AGXOSG_EMBEDDEDGLWINDOW_H
25#include <osgViewer/Viewer>
27#include <osgGA/TrackballManipulator>
28#include <osgGA/StateSetManipulator>
29#include <osgViewer/GraphicsWindow>
55 MAIN_SCENE_MASK = 1 << 1,
56 DEBUG_RENDER_MASK = 1 << 2,
57 OSG_RENDER_MASK = 1 << 3,
59 DECORATOR_MASK = 1 << 5,
73 bool init(
int x,
int y,
int width,
int height);
80 void resize(
int x,
int y,
int width,
int height);
206 osg::ref_ptr<osgViewer::Viewer> m_viewer;
208 osg::ref_ptr<osg::Group> m_root;
209 osg::ref_ptr<agxOSG::SceneDecorator> m_decorator;
210 osg::ref_ptr<osgGA::StandardManipulator> m_manipulator;
211 osg::ref_ptr<osgGA::StateSetManipulator> m_ssm;
214 osg::ref_ptr<osgViewer::GraphicsWindowEmbedded> m_embeddedWindow;
217 osg::ref_ptr<agxOSG::GuiEventAdapter> m_adapter;
219 bool m_agxgl_initialized;
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 setOrbitCamera(agxOSG::GeometryNode *node, const agx::Vec3 &pos)
void mouseMoveEvent(int x, int y)
Called upon mouse event.
void setTrackBallManipulator()
void setPolygonMode(int mode)
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...
int getPolygonMode() const
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,...
agx::Real getSceneRadius(osg::Group *scene) const
CameraMask
Specifies node masks for different parts of the rendering scene.
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.
A node that can be associated with a collision geometry so that the transformation of this node is up...
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.