17 #ifndef AGXOSG_RENDERINGWRAPPER_H
18 #define AGXOSG_RENDERINGWRAPPER_H
20 #if defined(SWIG) || defined(_MSC_VER)
27 #include <osgViewer/Viewer>
28 #include <osg/Version>
29 #include <osgGA/TrackBallManipulator>
30 #if defined(OSG_VERSION_GREATER_OR_EQUAL)
31 # if OSG_VERSION_GREATER_OR_EQUAL(3,0,0)
32 # include <osgViewer/api/Win32/GraphicsWindowWin32>
34 # include <osgViewer/GraphicsWindowWin32>
37 # include <osgViewer/GraphicsWindowWin32>
53 GraphicsNode(osg::Node* node);
93 osg::observer_ptr< osg::Node > m_node;
99 enum WindowFunctionDisable
114 osg::Group* getRoot();
116 void fitSceneIntoView();
126 bool initOpenGLContext(HWND);
127 bool initOSG(HWND hwnd,
int disabledFunctions);
128 bool setPixelFormat(HDC hdc);
129 void initCamera(osg::Camera *camera);
134 osg::ref_ptr<osgViewer::Viewer> m_viewer;
136 osg::ref_ptr<osg::Group> m_root;
137 osgGA::StandardManipulator *m_manipulator;
139 osg::ref_ptr<osg::GraphicsContext::Traits> m_traits;
140 osg::ref_ptr<osg::GraphicsContext> m_graphicsContext;
141 struct SimulationViewContext {
143 osg::ref_ptr<osg::Camera> camera;
147 SimulationFactoryTable m_factoryTable;
151 RigidBodyGraphicsNodeContainer m_rbNodes;
152 GeometryGraphicsNodeContainer m_geometryNodes;
175 #ifndef AGXOSG_RENDERINGWRAPPER_H
176 #define AGXOSG_RENDERINGWRAPPER_H
178 #if defined(SWIG) || defined(_MSC_VER)
180 #include <Winsock2.h>
185 #include <osgViewer/Viewer>
186 #include <osg/Version>
187 #include <osgGA/TrackBallManipulator>
188 #if defined(OSG_VERSION_GREATER_OR_EQUAL)
189 # if OSG_VERSION_GREATER_OR_EQUAL(3,0,0)
190 # include <osgViewer/api/Win32/GraphicsWindowWin32>
192 # include <osgViewer/GraphicsWindowWin32>
195 # include <osgViewer/GraphicsWindowWin32>
211 GraphicsNode( osg::Node* node );
251 osg::observer_ptr< osg::Node > m_node;
257 enum WindowFunctionDisable
266 bool initEmbeddedQT(
int x,
int y,
int width,
int height,
float scale = 1.0f);
267 void resize(
int x,
int y,
int width,
int height);
268 osgGA::EventQueue* getEventQueue()
const;
270 void mouseMoveEvent(
int x,
int y);
272 void mousePressEvent(
int x,
int y,
int button);
274 void mouseReleaseEvent(
int x,
int y,
int button);
276 void keyPressEvent(
int key,
int mod_key);
277 void keyReleaseEvent(
int key,
int mod_key);
279 void wheelEvent(
int motion);
287 osg::Group* getRoot();
290 void fitSceneIntoView();
292 agxOSG::GraphicsNode* getVisual(
const agx::RigidBody* rb )
const;
302 bool initOpenGLContext( HWND );
303 bool initOSG( HWND hwnd,
int disabledFunctions );
304 bool setPixelFormat(HDC hdc);
305 void initCamera( osg::Camera *camera );
310 osg::ref_ptr<osgViewer::Viewer> m_viewer;
312 osg::ref_ptr<osg::Group> m_root;
313 osg::ref_ptr<agxOSG::SceneDecorator> m_decorator;
314 osgGA::StandardManipulator *m_manipulator;
316 osg::ref_ptr<osg::GraphicsContext::Traits> m_traits;
317 osg::ref_ptr<osg::GraphicsContext> m_graphicsContext;
318 struct SimulationViewContext {
320 osg::ref_ptr<osg::Camera> camera;
324 SimulationFactoryTable m_factoryTable;
328 RigidBodyGraphicsNodeContainer m_rbNodes;
329 GeometryGraphicsNodeContainer m_geometryNodes;
330 osg::ref_ptr<osgViewer::GraphicsWindowEmbedded> m_embeddedWindow;
The geometry representation used by the collision detection engine.
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...
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Inheritance with partial specialization due to bug with ref_ptr containers.
The rigid body class, combining a geometric model and a frame of reference.
A class holding 4 dimensional vectors and providing basic arithmetic.
Smart pointer for handling referenced counted objects.
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
AGXOSG_EXPORT void setDiffuseColor(osg::Node *node, const agx::Vec4f &color)
Set the diffuse part of a material for a node.
AGXOSG_EXPORT void setAlpha(osg::Node *node, float alpha)
Set the alpha part of the material for a node.
AGXOSG_EXPORT void setAmbientColor(osg::Node *node, const agx::Vec4f &color)
Set the ambient part of a material for a node.
AGXOSG_EXPORT void setShininess(osg::Node *node, float shininess)
Set the shininess exponent for the Phong specular model.
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...
AGXOSG_EXPORT void setSpecularColor(osg::Node *node, const agx::Vec4f &color)
Set the specular part of a material for a node.
AGXTERRAIN_EXPORT void clear()
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...
void AGXPHYSICS_EXPORT init()
Initialize agx.