Clean up comments and rebuilt wrappers.
Added extra event handlers to osgsimulator example
This commit is contained in:
parent
fac01b5a23
commit
74e968df76
@ -17,6 +17,9 @@
|
||||
#endif // WIN32
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
#include <osgViewer/StatsHandler>
|
||||
#include <osgViewer/HelpHandler>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
|
||||
#include <osg/Group>
|
||||
#include <osg/Geode>
|
||||
@ -37,6 +40,7 @@
|
||||
#include <osgSim/SphereSegment>
|
||||
|
||||
#include <osgGA/NodeTrackerManipulator>
|
||||
#include <osgGA/StateSetManipulator>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
194
src/osgWrappers/osgViewer/ViewerEventHandlers.cpp
Normal file
194
src/osgWrappers/osgViewer/ViewerEventHandlers.cpp
Normal file
@ -0,0 +1,194 @@
|
||||
// ***************************************************************************
|
||||
//
|
||||
// Generated automatically by genwrapper.
|
||||
// Please DO NOT EDIT this file!
|
||||
//
|
||||
// ***************************************************************************
|
||||
|
||||
#include <osgIntrospection/ReflectionMacros>
|
||||
#include <osgIntrospection/TypedMethodInfo>
|
||||
#include <osgIntrospection/StaticMethodInfo>
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/ApplicationUsage>
|
||||
#include <osgGA/GUIActionAdapter>
|
||||
#include <osgGA/GUIEventAdapter>
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user