From 3c6eec78f9faac713ca169d1eedaab16a4290fd7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 23 Jan 2007 16:28:59 +0000 Subject: [PATCH] Updated wrappers --- .../osgViewer/wrapper_osgViewer.dsp | 4 ++ applications/osgviewer/osgviewer.cpp | 7 +- src/osgWrappers/osg/Stats.cpp | 12 ++-- src/osgWrappers/osgGA/StateSetManipulator.cpp | 7 +- src/osgWrappers/osgViewer/GNUmakefile | 1 + src/osgWrappers/osgViewer/StatsHandler.cpp | 72 +++++++++++++++++++ 6 files changed, 90 insertions(+), 13 deletions(-) create mode 100644 src/osgWrappers/osgViewer/StatsHandler.cpp diff --git a/VisualStudio/osgWrappers/osgViewer/wrapper_osgViewer.dsp b/VisualStudio/osgWrappers/osgViewer/wrapper_osgViewer.dsp index 5675857b2..f78e72f34 100644 --- a/VisualStudio/osgWrappers/osgViewer/wrapper_osgViewer.dsp +++ b/VisualStudio/osgWrappers/osgViewer/wrapper_osgViewer.dsp @@ -111,6 +111,10 @@ SOURCE=..\..\..\src\osgWrappers\osgViewer\Scene.cpp SOURCE=..\..\..\src\osgWrappers\osgViewer\SimpleViewer.cpp # End Source File +# Begin Source File +SOURCE=..\..\..\src\osgWrappers\osgViewer\StatsHandler.cpp +# End Source File + # Begin Source File SOURCE=..\..\..\src\osgWrappers\osgViewer\View.cpp # End Source File diff --git a/applications/osgviewer/osgviewer.cpp b/applications/osgviewer/osgviewer.cpp index 34d28ff62..c61294cf0 100644 --- a/applications/osgviewer/osgviewer.cpp +++ b/applications/osgviewer/osgviewer.cpp @@ -157,12 +157,7 @@ int main(int argc, char** argv) } // add the state manipulator - { - osg::ref_ptr statesetManipulator = new osgGA::StateSetManipulator; - statesetManipulator->setStateSet(viewer.getCamera()->getOrCreateStateSet()); - - viewer.addEventHandler( statesetManipulator.get() ); - } + viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); // add the thread model handler viewer.addEventHandler(new ThreadingHandler); diff --git a/src/osgWrappers/osg/Stats.cpp b/src/osgWrappers/osg/Stats.cpp index 4867a18a1..532606605 100644 --- a/src/osgWrappers/osg/Stats.cpp +++ b/src/osgWrappers/osg/Stats.cpp @@ -66,10 +66,14 @@ BEGIN_OBJECT_REFLECTOR(osg::Stats) __C5_AttributeMap_R1__getAttributeMap__int, "", ""); - I_Method1(void, report, IN, std::ostream &, out, - __void__report__std_ostream_R1, - "", - ""); + I_MethodWithDefaults2(void, report, IN, std::ostream &, out, , IN, const char *, indent, 0, + __void__report__std_ostream_R1__C5_char_P1, + "", + ""); + I_MethodWithDefaults3(void, report, IN, std::ostream &, out, , IN, unsigned int, frameNumber, , IN, const char *, indent, 0, + __void__report__std_ostream_R1__unsigned_int__C5_char_P1, + "", + ""); I_SimpleProperty(int, EarliestFrameNumber, __int__getEarliestFrameNumber, 0); diff --git a/src/osgWrappers/osgGA/StateSetManipulator.cpp b/src/osgWrappers/osgGA/StateSetManipulator.cpp index a730ce475..e2a97701b 100644 --- a/src/osgWrappers/osgGA/StateSetManipulator.cpp +++ b/src/osgWrappers/osgGA/StateSetManipulator.cpp @@ -27,9 +27,10 @@ BEGIN_OBJECT_REFLECTOR(osgGA::StateSetManipulator) I_BaseType(osgGA::GUIEventHandler); - I_Constructor0(____StateSetManipulator, - "", - ""); + I_ConstructorWithDefaults1(IN, osg::StateSet *, stateset, 0, + ____StateSetManipulator__osg_StateSet_P1, + "", + ""); I_Method0(const char *, className, __C5_char_P1__className, "return the name of the object's class type. ", diff --git a/src/osgWrappers/osgViewer/GNUmakefile b/src/osgWrappers/osgViewer/GNUmakefile index 185f4963d..f81f47717 100644 --- a/src/osgWrappers/osgViewer/GNUmakefile +++ b/src/osgWrappers/osgViewer/GNUmakefile @@ -6,6 +6,7 @@ CXXFILES =\ GraphicsWindow.cpp\ Scene.cpp\ SimpleViewer.cpp\ + StatsHandler.cpp\ View.cpp\ Viewer.cpp\ diff --git a/src/osgWrappers/osgViewer/StatsHandler.cpp b/src/osgWrappers/osgViewer/StatsHandler.cpp new file mode 100644 index 000000000..5bcbb5f87 --- /dev/null +++ b/src/osgWrappers/osgViewer/StatsHandler.cpp @@ -0,0 +1,72 @@ +// *************************************************************************** +// +// Generated automatically by genwrapper. +// Please DO NOT EDIT this file! +// +// *************************************************************************** + +#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_ENUM_REFLECTOR(osgViewer::StatsHandler::StatsType) + I_EnumLabel(osgViewer::StatsHandler::NO_STATS); + I_EnumLabel(osgViewer::StatsHandler::FRAME_RATE); + I_EnumLabel(osgViewer::StatsHandler::VIEWER_STATS); + I_EnumLabel(osgViewer::StatsHandler::SCENE_STATS); + I_EnumLabel(osgViewer::StatsHandler::LAST); +END_REFLECTOR + +BEGIN_OBJECT_REFLECTOR(osgViewer::StatsHandler) + I_BaseType(osgGA::GUIEventHandler); + I_Constructor0(____StatsHandler, + "", + ""); + I_Method1(void, setKeyEventTogglesOnScreenStats, IN, int, key, + __void__setKeyEventTogglesOnScreenStats__int, + "", + ""); + I_Method0(int, getKeyEventTogglesOnScreenStats, + __int__getKeyEventTogglesOnScreenStats, + "", + ""); + I_Method1(void, setKeyEventPrintsOutStats, IN, int, key, + __void__setKeyEventPrintsOutStats__int, + "", + ""); + I_Method0(int, getKeyEventPrintsOutStats, + __int__getKeyEventPrintsOutStats, + "", + ""); + I_Method2(bool, handle, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, aa, + __bool__handle__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1, + "deprecated, Handle events, return true if handled, false otherwise. ", + ""); + I_Method0(double, getBlockMultiplier, + __double__getBlockMultiplier, + "", + ""); + I_SimpleProperty(double, BlockMultiplier, + __double__getBlockMultiplier, + 0); + I_SimpleProperty(int, KeyEventPrintsOutStats, + __int__getKeyEventPrintsOutStats, + __void__setKeyEventPrintsOutStats__int); + I_SimpleProperty(int, KeyEventTogglesOnScreenStats, + __int__getKeyEventTogglesOnScreenStats, + __void__setKeyEventTogglesOnScreenStats__int); +END_REFLECTOR +