Added bare bones osgGA::SimpleViewer class to help simplify OSG setup when embedding the OSG

into existing GUI applications, and for one one a single camera, single window is required.
This commit is contained in:
Robert Osfield
2006-09-25 16:25:53 +00:00
parent 78444878c3
commit 5c0eb0b013
17 changed files with 552 additions and 179 deletions

View File

@@ -32,7 +32,7 @@ BEGIN_OBJECT_REFLECTOR(osgGA::EventQueue)
I_Method1(bool, copyEvents, IN, osgGA::EventQueue::Events &, events);
I_Method1(void, appendEvents, IN, osgGA::EventQueue::Events &, events);
I_Method1(void, addEvent, IN, osgGA::GUIEventAdapter *, event);
I_Method4(void, windowResize, IN, float, Xmin, IN, float, Ymin, IN, float, Xmax, IN, float, Ymax);
I_MethodWithDefaults5(void, windowResize, IN, int, x, , IN, int, y, , IN, unsigned int, width, , IN, unsigned int, height, , IN, bool, updateMouseRange, true);
I_Method1(void, mouseScroll, IN, osgGA::GUIEventAdapter::ScrollingMotion, sm);
I_Method2(void, mouseScroll2D, IN, float, x, IN, float, y);
I_Method1(void, penPressure, IN, float, pressure);

View File

@@ -15,6 +15,7 @@ CXXFILES =\
MatrixManipulator.cpp\
NodeTrackerManipulator.cpp\
SetSceneViewVisitor.cpp\
SimpleViewer.cpp\
StateSetManipulator.cpp\
TerrainManipulator.cpp\
TrackballManipulator.cpp\

View File

@@ -215,18 +215,19 @@ BEGIN_OBJECT_REFLECTOR(osgGA::GUIEventAdapter)
I_Method1(void, setTime, IN, double, time);
I_Method0(double, getTime);
I_Method0(double, time);
I_MethodWithDefaults5(void, setWindowRectangle, IN, int, x, , IN, int, y, , IN, unsigned int, width, , IN, unsigned int, height, , IN, bool, updateMouseRange, true);
I_Method0(int, getWindowX);
I_Method0(int, getWindowY);
I_Method0(unsigned int, getWindowWidth);
I_Method0(unsigned int, getWindowHeight);
I_Method1(void, setKey, IN, int, key);
I_Method0(int, getKey);
I_Method1(void, setButton, IN, int, button);
I_Method0(int, getButton);
I_Method4(void, setWindowSize, IN, float, Xmin, IN, float, Ymin, IN, float, Xmax, IN, float, Ymax);
I_Method1(void, setXmin, IN, float, x);
I_Method4(void, setInputRange, IN, float, Xmin, IN, float, Ymin, IN, float, Xmax, IN, float, Ymax);
I_Method0(float, getXmin);
I_Method1(void, setXmax, IN, float, x);
I_Method0(float, getXmax);
I_Method1(void, setYmin, IN, float, y);
I_Method0(float, getYmin);
I_Method1(void, setYmax, IN, float, y);
I_Method0(float, getYmax);
I_Method1(void, setX, IN, float, x);
I_Method0(float, getX);
@@ -261,13 +262,17 @@ BEGIN_OBJECT_REFLECTOR(osgGA::GUIEventAdapter)
I_Property(osgGA::GUIEventAdapter::ScrollingMotion, ScrollingMotion);
I_Property(osgGA::GUIEventAdapter::TabletPointerType, TabletPointerType);
I_Property(double, Time);
I_ReadOnlyProperty(unsigned int, WindowHeight);
I_ReadOnlyProperty(unsigned int, WindowWidth);
I_ReadOnlyProperty(int, WindowX);
I_ReadOnlyProperty(int, WindowY);
I_Property(float, X);
I_Property(float, Xmax);
I_Property(float, Xmin);
I_ReadOnlyProperty(float, Xmax);
I_ReadOnlyProperty(float, Xmin);
I_ReadOnlyProperty(float, Xnormalized);
I_Property(float, Y);
I_Property(float, Ymax);
I_Property(float, Ymin);
I_ReadOnlyProperty(float, Ymax);
I_ReadOnlyProperty(float, Ymin);
I_ReadOnlyProperty(float, Ynormalized);
END_REFLECTOR

View File

@@ -0,0 +1,74 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/CameraNode>
#include <osg/Node>
#include <osgDB/DatabasePager>
#include <osgGA/EventQueue>
#include <osgGA/GUIEventHandler>
#include <osgGA/MatrixManipulator>
#include <osgGA/SimpleViewer>
#include <osgUtil/SceneView>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osgGA::GUIEventHandler > >, osgGA::SimpleViewer::EventHandlers);
BEGIN_OBJECT_REFLECTOR(osgGA::SimpleViewer)
I_BaseType(osgGA::GUIActionAdapter);
I_Constructor0();
I_Method1(void, setSceneData, IN, osg::Node *, node);
I_Method0(osg::Node *, getSceneData);
I_Method0(const osg::Node *, getSceneData);
I_Method0(osg::CameraNode *, getCamera);
I_Method0(const osg::CameraNode *, getCamera);
I_Method1(void, setCameraManipulator, IN, osgGA::MatrixManipulator *, manipulator);
I_Method0(osgGA::MatrixManipulator *, getCameraManipulator);
I_Method0(const osgGA::MatrixManipulator *, getCameraManipulator);
I_Method1(void, addEventHandler, IN, osgGA::GUIEventHandler *, eventHandler);
I_Method0(osgGA::SimpleViewer::EventHandlers &, getEventHandlers);
I_Method0(const osgGA::SimpleViewer::EventHandlers &, getEventHandlers);
I_Method0(osgGA::EventQueue *, getEventQueue);
I_Method0(const osgGA::EventQueue *, getEventQueue);
I_Method1(void, setDatabasePager, IN, osgDB::DatabasePager *, dp);
I_Method0(osgDB::DatabasePager *, getDatabasePager);
I_Method0(const osgDB::DatabasePager *, getDatabasePager);
I_Method0(void, frame);
I_Method0(void, frameAdvance);
I_Method0(void, frameEventTraversal);
I_Method0(void, frameUpdateTraversal);
I_Method0(void, frameCullTraversal);
I_Method0(void, frameDrawTraversal);
I_Method0(void, cleanup);
I_Method0(void, requestRedraw);
I_MethodWithDefaults1(void, requestContinuousUpdate, IN, bool, x, true);
I_Method2(void, requestWarpPointer, IN, float, x, IN, float, x);
I_Method0(osgUtil::SceneView *, getSceneView);
I_Method0(const osgUtil::SceneView *, getSceneView);
I_Method0(void, init);
I_ReadOnlyProperty(osg::CameraNode *, Camera);
I_Property(osgGA::MatrixManipulator *, CameraManipulator);
I_Property(osgDB::DatabasePager *, DatabasePager);
I_ReadOnlyProperty(osgGA::SimpleViewer::EventHandlers &, EventHandlers);
I_ReadOnlyProperty(osgGA::EventQueue *, EventQueue);
I_Property(osg::Node *, SceneData);
I_ReadOnlyProperty(osgUtil::SceneView *, SceneView);
END_REFLECTOR
STD_LIST_REFLECTOR(std::list< osg::ref_ptr< osgGA::GUIEventHandler > >);