17 #ifndef AGXOSG_RENDERINGWRAPPER_H 18 #define AGXOSG_RENDERINGWRAPPER_H 20 #if defined(SWIG) || defined(_MSC_VER) 25 #include <osgViewer/Viewer> 26 #include <osg/Version> 27 #include <osgGA/TrackBallManipulator> 28 #if defined(OSG_VERSION_GREATER_OR_EQUAL) 29 # if OSG_VERSION_GREATER_OR_EQUAL(3,0,0) 30 # include <osgViewer/api/Win32/GraphicsWindowWin32> 32 # include <osgViewer/GraphicsWindowWin32> 35 # include <osgViewer/GraphicsWindowWin32> 48 struct RenderingWrapperWindowsTypes;
56 GraphicsNode(osg::Node* node);
96 osg::observer_ptr< osg::Node > m_node;
102 enum WindowFunctionDisable
117 osg::Group* getRoot();
119 void fitSceneIntoView();
128 friend RenderingWrapperWindowsTypes;
130 void initCamera(osg::Camera *camera);
132 std::unique_ptr<RenderingWrapperWindowsTypes> m_winTypes;
133 osg::ref_ptr<osgViewer::Viewer> m_viewer;
135 osg::ref_ptr<osg::Group> m_root;
136 osgGA::StandardManipulator *m_manipulator;
138 osg::ref_ptr<osg::GraphicsContext::Traits> m_traits;
139 osg::ref_ptr<osg::GraphicsContext> m_graphicsContext;
140 struct SimulationViewContext {
142 osg::ref_ptr<osg::Camera> camera;
146 SimulationFactoryTable m_factoryTable;
150 RigidBodyGraphicsNodeContainer m_rbNodes;
151 GeometryGraphicsNodeContainer m_geometryNodes;
174 #ifndef AGXOSG_RENDERINGWRAPPER_H 175 #define AGXOSG_RENDERINGWRAPPER_H 177 #if defined(SWIG) || defined(_MSC_VER) 182 #include <osgViewer/Viewer> 183 #include <osg/Version> 184 #include <osgGA/TrackBallManipulator> 185 #if defined(OSG_VERSION_GREATER_OR_EQUAL) 186 # if OSG_VERSION_GREATER_OR_EQUAL(3,0,0) 187 # include <osgViewer/api/Win32/GraphicsWindowWin32> 189 # include <osgViewer/GraphicsWindowWin32> 192 # include <osgViewer/GraphicsWindowWin32> 201 struct RenderingWrapperWindowsTypes;
209 GraphicsNode( osg::Node* node );
249 osg::observer_ptr< osg::Node > m_node;
255 enum WindowFunctionDisable
264 bool initEmbeddedQT(
int x,
int y,
int width,
int height,
float scale = 1.0f);
265 void resize(
int x,
int y,
int width,
int height);
266 osgGA::EventQueue* getEventQueue()
const;
268 void mouseMoveEvent(
int x,
int y);
270 void mousePressEvent(
int x,
int y,
int button);
272 void mouseReleaseEvent(
int x,
int y,
int button);
274 void keyPressEvent(
int key,
int mod_key);
275 void keyReleaseEvent(
int key,
int mod_key);
277 void wheelEvent(
int motion);
285 osg::Group* getRoot();
288 void fitSceneIntoView();
290 agxOSG::GraphicsNode* getVisual(
const agx::RigidBody* rb )
const;
300 void initCamera( osg::Camera *camera );
302 std::unique_ptr<RenderingWrapperWindowsTypes> m_winTypes;
303 osg::ref_ptr<osgViewer::Viewer> m_viewer;
305 osg::ref_ptr<osg::Group> m_root;
306 osg::ref_ptr<agxOSG::SceneDecorator> m_decorator;
307 osgGA::StandardManipulator *m_manipulator;
309 osg::ref_ptr<osg::GraphicsContext::Traits> m_traits;
310 osg::ref_ptr<osg::GraphicsContext> m_graphicsContext;
311 struct SimulationViewContext {
313 osg::ref_ptr<osg::Camera> camera;
317 SimulationFactoryTable m_factoryTable;
321 RigidBodyGraphicsNodeContainer m_rbNodes;
322 GeometryGraphicsNodeContainer m_geometryNodes;
323 osg::ref_ptr<osgViewer::GraphicsWindowEmbedded> m_embeddedWindow;
AGXTERRAIN_EXPORT void clear()
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API...
AGXOSG_EXPORT void setAlpha(osg::Node *node, float alpha)
Set the alpha part of the material for a node.
A class holding 4 dimensional vectors and providing basic arithmetic.
AGXOSG_EXPORT void setShininess(osg::Node *node, float shininess)
Set the shininess exponent for the Phong specular model.
AGXOSG_EXPORT void setSpecularColor(osg::Node *node, const agx::Vec4f &color)
Set the specular part of a material for a node.
Decorates a scene with a specific AGX Rendering Style.
The geometry representation used by the collision detection engine.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
const Node * getNode(const IteratorCompatibleContainer &container, agx::Real distanceFromStart)
Finds the wire node given current distance from the start of the wire (wire defined to be iterator co...
AGXOSG_EXPORT bool setTexture(const agxCollide::Geometry *geometry, osg::Group *rootNode, const std::string &imagePath, bool repeat=false, TextureMode mode=DIFFUSE_TEXTURE)
Read an image from disk and apply to the specified geometry as a 2D Texture in OVERRIDE|PROTECTED mod...
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
Smart pointer for handling referenced counted objects.
The rigid body class, combining a geometric model and a frame of reference.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
AGXOSG_EXPORT void setDiffuseColor(osg::Node *node, const agx::Vec4f &color)
Set the diffuse part of a material for a node.
Inheritance with partial specialization due to bug with ref_ptr containers.
AGXOSG_EXPORT void setAmbientColor(osg::Node *node, const agx::Vec4f &color)
Set the ambient part of a material for a node.