diff --git a/examples/osgsimulation/osgsimulation.cpp b/examples/osgsimulation/osgsimulation.cpp index 9c3261b23..22e8fc7de 100644 --- a/examples/osgsimulation/osgsimulation.cpp +++ b/examples/osgsimulation/osgsimulation.cpp @@ -17,6 +17,9 @@ #endif // WIN32 #include +#include +#include +#include #include #include @@ -37,6 +40,7 @@ #include #include +#include #include @@ -172,6 +176,22 @@ int main(int argc, char **argv) // construct the viewer. osgViewer::Viewer viewer; + // add the state manipulator + viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); + + // add the thread model handler + viewer.addEventHandler(new osgViewer::ThreadingHandler); + + // add the window size toggle handler + viewer.addEventHandler(new osgViewer::WindowSizeHandler); + + // add the stats handler + viewer.addEventHandler(new osgViewer::StatsHandler); + + // add the help handler + viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage())); + + // set the near far ration computation up. viewer.getCamera()->setComputeNearFarMode(osg::CullSettings::COMPUTE_NEAR_FAR_USING_PRIMITIVES); viewer.getCamera()->setNearFarRatio(0.00001f); diff --git a/include/osg/Drawable b/include/osg/Drawable index 3af22fcbf..ef23de6ce 100644 --- a/include/osg/Drawable +++ b/include/osg/Drawable @@ -421,7 +421,7 @@ class OSG_EXPORT Drawable : public Object * must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. * drawImplementation(RenderInfo&) is called from the draw(RenderInfo&) method, with the draw method handling management of OpenGL display lists, * and drawImplementation(RenderInfo&) handling the actuall drawing itself. - * @param state The osg::State object that encapulates the current OpenGL state for the current graphics context. */ + * @param renderInfo The osg::RenderInfo object that encapulates the current rendering information including the osg::State OpenGL state for the current graphics context. */ virtual void drawImplementation(RenderInfo& renderInfo) const = 0; diff --git a/include/osgSim/HeightAboveTerrain b/include/osgSim/HeightAboveTerrain index 6dca38d2a..d490730bf 100644 --- a/include/osgSim/HeightAboveTerrain +++ b/include/osgSim/HeightAboveTerrain @@ -64,7 +64,7 @@ class OSGSIM_EXPORT HeightAboveTerrain * If the topmost node is not a CoordinateSystemNode then a local coordinates frame is assumed, with a local up vector. */ void computeIntersections(osg::Node* scene, osg::Node::NodeMask traversalMask=0xffffffff); - /** Compute the vertical distance between the specified scene graph and a single HAT point. .*/ + /** Compute the vertical distance between the specified scene graph and a single HAT point. */ static double computeHeightAboveTerrain(osg::Node* scene, const osg::Vec3d& point, osg::Node::NodeMask traversalMask=0xffffffff); diff --git a/include/osgViewer/Viewer b/include/osgViewer/Viewer index eaeb68bde..8a8da7695 100644 --- a/include/osgViewer/Viewer +++ b/include/osgViewer/Viewer @@ -20,7 +20,7 @@ namespace osgViewer { -/** Viewer holds a single view on to a single scene..*/ +/** Viewer holds a single view on to a single scene.*/ class OSGVIEWER_EXPORT Viewer : public osgViewer::View { public: diff --git a/src/osgWrappers/osg/DrawPixels.cpp b/src/osgWrappers/osg/DrawPixels.cpp index f60a0d9a7..e2153e4f5 100644 --- a/src/osgWrappers/osg/DrawPixels.cpp +++ b/src/osgWrappers/osg/DrawPixels.cpp @@ -114,7 +114,7 @@ BEGIN_OBJECT_REFLECTOR(osg::DrawPixels) Properties::VIRTUAL, __void__drawImplementation__RenderInfo_R1, "drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. ", - " param state The osg::State object that encapulates the current OpenGL state for the current graphics context. "); + " param renderInfo The osg::RenderInfo object that encapulates the current rendering information including the osg::State OpenGL state for the current graphics context. "); I_Method0(osg::BoundingBox, computeBound, Properties::VIRTUAL, __BoundingBox__computeBound, diff --git a/src/osgWrappers/osg/Drawable.cpp b/src/osgWrappers/osg/Drawable.cpp index 0beb85554..3c9974644 100644 --- a/src/osgWrappers/osg/Drawable.cpp +++ b/src/osgWrappers/osg/Drawable.cpp @@ -342,7 +342,7 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::Drawable) Properties::PURE_VIRTUAL, __void__drawImplementation__RenderInfo_R1, "drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. ", - " param state The osg::State object that encapulates the current OpenGL state for the current graphics context. "); + " param renderInfo The osg::RenderInfo object that encapulates the current rendering information including the osg::State OpenGL state for the current graphics context. "); I_Method1(bool, supports, IN, const osg::Drawable::AttributeFunctor &, x, Properties::VIRTUAL, __bool__supports__C5_AttributeFunctor_R1, diff --git a/src/osgWrappers/osgParticle/ParticleSystem.cpp b/src/osgWrappers/osgParticle/ParticleSystem.cpp index a9f723117..c3e94e6c3 100644 --- a/src/osgWrappers/osgParticle/ParticleSystem.cpp +++ b/src/osgWrappers/osgParticle/ParticleSystem.cpp @@ -225,7 +225,7 @@ BEGIN_OBJECT_REFLECTOR(osgParticle::ParticleSystem) Properties::VIRTUAL, __void__drawImplementation__osg_RenderInfo_R1, "drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. ", - " param state The osg::State object that encapulates the current OpenGL state for the current graphics context. "); + " param renderInfo The osg::RenderInfo object that encapulates the current rendering information including the osg::State OpenGL state for the current graphics context. "); I_Method0(osg::BoundingBox, computeBound, Properties::VIRTUAL, __osg_BoundingBox__computeBound, diff --git a/src/osgWrappers/osgParticle/PrecipitationEffect.cpp b/src/osgWrappers/osgParticle/PrecipitationEffect.cpp index 3f35f9caf..5975ab1fe 100644 --- a/src/osgWrappers/osgParticle/PrecipitationEffect.cpp +++ b/src/osgWrappers/osgParticle/PrecipitationEffect.cpp @@ -403,7 +403,7 @@ BEGIN_OBJECT_REFLECTOR(osgParticle::PrecipitationEffect::PrecipitationDrawable) Properties::VIRTUAL, __void__drawImplementation__osg_RenderInfo_R1, "drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable. ", - " param state The osg::State object that encapulates the current OpenGL state for the current graphics context. "); + " param renderInfo The osg::RenderInfo object that encapulates the current rendering information including the osg::State OpenGL state for the current graphics context. "); I_Method0(osgParticle::PrecipitationEffect::PrecipitationDrawable::CellMatrixMap &, getCurrentCellMatrixMap, Properties::NON_VIRTUAL, __CellMatrixMap_R1__getCurrentCellMatrixMap, diff --git a/src/osgWrappers/osgViewer/ViewerEventHandlers.cpp b/src/osgWrappers/osgViewer/ViewerEventHandlers.cpp new file mode 100644 index 000000000..c40eaaec5 --- /dev/null +++ b/src/osgWrappers/osgViewer/ViewerEventHandlers.cpp @@ -0,0 +1,194 @@ +// *************************************************************************** +// +// Generated automatically by genwrapper. +// Please DO NOT EDIT this file! +// +// *************************************************************************** + +#include +#include +#include +#include + +#include +#include +#include +#include + +// Must undefine IN and OUT macros defined in Windows headers +#ifdef IN +#undef IN +#endif +#ifdef OUT +#undef OUT +#endif + +BEGIN_OBJECT_REFLECTOR(osgViewer::ThreadingHandler) + I_BaseType(osgGA::GUIEventHandler); + I_Constructor0(____ThreadingHandler, + "", + ""); + I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage, + Properties::VIRTUAL, + __void__getUsage__osg_ApplicationUsage_R1, + "Get the keyboard and mouse usage of this manipulator. ", + ""); + I_Method1(void, setKeyEventChangeThreadingModel, IN, int, key, + Properties::NON_VIRTUAL, + __void__setKeyEventChangeThreadingModel__int, + "", + ""); + I_Method0(int, getKeyEventChangeThreadingModel, + Properties::NON_VIRTUAL, + __int__getKeyEventChangeThreadingModel, + "", + ""); + I_Method1(void, setChangeThreadingModel, IN, bool, flag, + Properties::NON_VIRTUAL, + __void__setChangeThreadingModel__bool, + "", + ""); + I_Method0(bool, getChangeThreadingModel, + Properties::NON_VIRTUAL, + __bool__getChangeThreadingModel, + "", + ""); + I_Method1(void, setKeyEventChangeEndBarrierPosition, IN, int, key, + Properties::NON_VIRTUAL, + __void__setKeyEventChangeEndBarrierPosition__int, + "", + ""); + I_Method0(int, getKeyEventChangeEndBarrierPosition, + Properties::NON_VIRTUAL, + __int__getKeyEventChangeEndBarrierPosition, + "", + ""); + I_Method1(void, setChangeEndBarrierPosition, IN, bool, flag, + Properties::NON_VIRTUAL, + __void__setChangeEndBarrierPosition__bool, + "", + ""); + I_Method0(bool, getChangeEndBarrierPosition, + Properties::NON_VIRTUAL, + __bool__getChangeEndBarrierPosition, + "", + ""); + I_Method2(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, aa, + Properties::VIRTUAL, + __bool__handle__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1, + "deprecated, Handle events, return true if handled, false otherwise. ", + ""); + I_SimpleProperty(bool, ChangeEndBarrierPosition, + __bool__getChangeEndBarrierPosition, + __void__setChangeEndBarrierPosition__bool); + I_SimpleProperty(bool, ChangeThreadingModel, + __bool__getChangeThreadingModel, + __void__setChangeThreadingModel__bool); + I_SimpleProperty(int, KeyEventChangeEndBarrierPosition, + __int__getKeyEventChangeEndBarrierPosition, + __void__setKeyEventChangeEndBarrierPosition__int); + I_SimpleProperty(int, KeyEventChangeThreadingModel, + __int__getKeyEventChangeThreadingModel, + __void__setKeyEventChangeThreadingModel__int); +END_REFLECTOR + +BEGIN_OBJECT_REFLECTOR(osgViewer::WindowSizeHandler) + I_BaseType(osgGA::GUIEventHandler); + I_Constructor0(____WindowSizeHandler, + "", + ""); + I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage, + Properties::VIRTUAL, + __void__getUsage__osg_ApplicationUsage_R1, + "Get the keyboard and mouse usage of this manipulator. ", + ""); + I_Method1(void, setKeyEventToggleFullscreen, IN, int, key, + Properties::NON_VIRTUAL, + __void__setKeyEventToggleFullscreen__int, + "", + ""); + I_Method0(int, getKeyEventToggleFullscreen, + Properties::NON_VIRTUAL, + __int__getKeyEventToggleFullscreen, + "", + ""); + I_Method1(void, setToggleFullscreen, IN, bool, flag, + Properties::NON_VIRTUAL, + __void__setToggleFullscreen__bool, + "", + ""); + I_Method0(bool, getToggleFullscreen, + Properties::NON_VIRTUAL, + __bool__getToggleFullscreen, + "", + ""); + I_Method1(void, setKeyEventWindowedResolutionUp, IN, int, key, + Properties::NON_VIRTUAL, + __void__setKeyEventWindowedResolutionUp__int, + "", + ""); + I_Method0(int, getKeyEventWindowedResolutionUp, + Properties::NON_VIRTUAL, + __int__getKeyEventWindowedResolutionUp, + "", + ""); + I_Method1(void, setKeyEventWindowedResolutionDown, IN, int, key, + Properties::NON_VIRTUAL, + __void__setKeyEventWindowedResolutionDown__int, + "", + ""); + I_Method0(int, getKeyEventWindowedResolutionDown, + Properties::NON_VIRTUAL, + __int__getKeyEventWindowedResolutionDown, + "", + ""); + I_Method1(void, setChangeWindowedResolution, IN, bool, flag, + Properties::NON_VIRTUAL, + __void__setChangeWindowedResolution__bool, + "", + ""); + I_Method0(bool, getChangeWindowedResolution, + Properties::NON_VIRTUAL, + __bool__getChangeWindowedResolution, + "", + ""); + I_Method2(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, aa, + Properties::VIRTUAL, + __bool__handle__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1, + "deprecated, Handle events, return true if handled, false otherwise. ", + ""); + I_ProtectedMethod1(void, toggleFullscreen, IN, osgViewer::GraphicsWindow *, window, + Properties::NON_VIRTUAL, + Properties::NON_CONST, + __void__toggleFullscreen__osgViewer_GraphicsWindow_P1, + "", + ""); + I_ProtectedMethod2(void, changeWindowedResolution, IN, osgViewer::GraphicsWindow *, window, IN, bool, increase, + Properties::NON_VIRTUAL, + Properties::NON_CONST, + __void__changeWindowedResolution__osgViewer_GraphicsWindow_P1__bool, + "", + ""); + I_ProtectedMethod4(unsigned int, getNearestResolution, IN, int, screenWidth, IN, int, screenHeight, IN, int, width, IN, int, height, + Properties::NON_VIRTUAL, + Properties::CONST, + __unsigned_int__getNearestResolution__int__int__int__int, + "", + ""); + I_SimpleProperty(bool, ChangeWindowedResolution, + __bool__getChangeWindowedResolution, + __void__setChangeWindowedResolution__bool); + I_SimpleProperty(int, KeyEventToggleFullscreen, + __int__getKeyEventToggleFullscreen, + __void__setKeyEventToggleFullscreen__int); + I_SimpleProperty(int, KeyEventWindowedResolutionDown, + __int__getKeyEventWindowedResolutionDown, + __void__setKeyEventWindowedResolutionDown__int); + I_SimpleProperty(int, KeyEventWindowedResolutionUp, + __int__getKeyEventWindowedResolutionUp, + __void__setKeyEventWindowedResolutionUp__int); + I_SimpleProperty(bool, ToggleFullscreen, + __bool__getToggleFullscreen, + __void__setToggleFullscreen__bool); +END_REFLECTOR +