Moved osgProducer and osgproducerviewer out into their own repository.

Clean up the source for remaining references to osgProducer/Producer.
This commit is contained in:
Robert Osfield
2007-02-27 13:16:18 +00:00
parent 6a539c4110
commit eb4ad4229f
154 changed files with 672 additions and 8418 deletions

View File

@@ -1,21 +0,0 @@
TOPDIR = ../..
include $(TOPDIR)/Make/makedefs
CXXFILES =\
KeyboardMouseCallback.cpp\
GraphicsContextImplementation.cpp\
OsgCameraGroup.cpp\
OsgSceneHandler.cpp\
ViewerEventHandler.cpp\
Viewer.cpp\
Version.cpp\
LIBS += -lProducer $(GL_LIBS) -losgText -losgGA -losgUtil -losgDB -losg $(OTHER_LIBS)
DEF += -DOSGPRODUCER_LIBRARY
TARGET_BASENAME = osgProducer
LIB = $(LIB_PREFIX)$(TARGET_BASENAME).$(LIB_EXT)
INC += $(X_INC)
include $(TOPDIR)/Make/makerules

View File

@@ -1,299 +0,0 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osgProducer/GraphicsContextImplementation>
#include <osg/TextureRectangle>
#include <osg/TextureCubeMap>
#include <osg/Notify>
using namespace osgProducer;
#if 0
namespace osgProducer
{
struct MyWindowingSystemInterface : public osg::GraphicsContext::WindowingSystemInterface
{
virtual unsigned int getNumScreens(const osg::GraphicsContext::ScreenIdentifier& /*screenIdentifier*/)
{
return Producer::RenderSurface::getNumberOfScreens();
}
virtual void getScreenResolution(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, unsigned int& width, unsigned int& height)
{
osg::ref_ptr<Producer::RenderSurface> rs = new Producer::RenderSurface;
rs->setHostName(screenIdentifier.hostName);
rs->setDisplayNum(screenIdentifier.displayNum);
rs->setScreenNum(screenIdentifier.screenNum);
rs->getScreenSize(width, height);
}
virtual osg::GraphicsContext* createGraphicsContext(osg::GraphicsContext::Traits* traits)
{
return new GraphicsContextImplementation(traits);
}
};
struct RegisterWindowingSystemInterfaceProxy
{
RegisterWindowingSystemInterfaceProxy()
{
osg::GraphicsContext::setWindowingSystemInterface(new MyWindowingSystemInterface);
}
~RegisterWindowingSystemInterfaceProxy()
{
osg::GraphicsContext::setWindowingSystemInterface(0);
}
};
RegisterWindowingSystemInterfaceProxy createWindowingSystemInterfaceProxy;
};
#endif
GraphicsContextImplementation::GraphicsContextImplementation(Traits* traits)
{
_traits = traits;
_rs = new Producer::RenderSurface;
_rs->setWindowName(traits->windowName);
_rs->setWindowRectangle(traits->x, traits->y, traits->width, traits->height);
_rs->useBorder(traits->windowDecoration);
_rs->setDisplayNum(traits->displayNum);
_rs->setScreenNum(traits->screenNum);
// set the visual chooser
Producer::VisualChooser* rs_vc = _rs->getVisualChooser();
if (!rs_vc)
{
rs_vc = new Producer::VisualChooser;
_rs->setVisualChooser(rs_vc);
}
rs_vc->setRedSize(_traits->red);
rs_vc->setGreenSize(_traits->green);
rs_vc->setBlueSize(_traits->blue);
rs_vc->setAlphaSize(_traits->alpha);
rs_vc->setDepthSize(_traits->depth);
rs_vc->setStencilSize(_traits->stencil);
if (_traits->doubleBuffer) rs_vc->useDoubleBuffer();
rs_vc->addAttribute( Producer::VisualChooser::RGBA );
// Always use UseGL
rs_vc->addAttribute( Producer::VisualChooser::UseGL );
if (traits->pbuffer)
{
_rs->setDrawableType(Producer::RenderSurface::DrawableType_PBuffer);
if (traits->target)
{
_rs->setRenderToTextureOptions(traits->mipMapGeneration ? Producer::RenderSurface::RequestSpaceForMipMaps :
Producer::RenderSurface::RenderToTextureOptions_Default);
_rs->setRenderToTextureMipMapLevel(traits->level);
_rs->setRenderToTextureMode(traits->alpha>0 ? Producer::RenderSurface::RenderToRGBATexture :
Producer::RenderSurface::RenderToRGBTexture);
switch(traits->target)
{
case(GL_TEXTURE_1D) :
_rs->setRenderToTextureTarget(Producer::RenderSurface::Texture1D);
break;
case(GL_TEXTURE_2D) :
_rs->setRenderToTextureTarget(Producer::RenderSurface::Texture2D);
break;
case(GL_TEXTURE_3D) :
osg::notify(osg::NOTICE)<<"PBuffer render to Texture3D not supported."<<std::endl;
// not supported.
// _rs->setRenderToTextureTarget(Producer::RenderSurface::Texture3D);
break;
case(GL_TEXTURE_RECTANGLE) :
osg::notify(osg::NOTICE)<<"PBuffer render to TextureRectangle not supported."<<std::endl;
// not supported.
// _rs->setRenderToTextureTarget(Producer::RenderSurface::TextureRectangle);
break;
case(GL_TEXTURE_CUBE_MAP_POSITIVE_X) :
case(GL_TEXTURE_CUBE_MAP_NEGATIVE_X) :
case(GL_TEXTURE_CUBE_MAP_POSITIVE_Y) :
case(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) :
case(GL_TEXTURE_CUBE_MAP_POSITIVE_Z) :
case(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) :
_rs->setRenderToTextureTarget(Producer::RenderSurface::TextureCUBE);
_rs->setRenderToTextureFace( Producer::RenderSurface::CubeMapFace(traits->target - GL_TEXTURE_CUBE_MAP_POSITIVE_X));
break;
}
}
}
GraphicsContextImplementation* sharedContext = dynamic_cast<GraphicsContextImplementation*>(traits->sharedContext);
if (sharedContext)
{
// different graphics context so we have our own state.
setState(new osg::State);
if (sharedContext->getState())
{
getState()->setContextID( sharedContext->getState()->getContextID() );
incrementContextIDUsageCount( sharedContext->getState()->getContextID() );
}
else
{
getState()->setContextID( osg::GraphicsContext::createNewContextID() );
}
// but we share texture objects etc. so we also share the same contextID
//_rs->realize( 0, sharedContext->_rs->getGLContext() );
}
else
{
// need to do something here....
setState( new osg::State );
getState()->setContextID( osg::GraphicsContext::createNewContextID() );
//_rs->realize();
}
// _rs->useConfigEventThread(false);
_closeOnDestruction = true;
}
GraphicsContextImplementation::GraphicsContextImplementation(Producer::RenderSurface* rs)
{
_rs = rs;
_closeOnDestruction = false;
_traits = new osg::GraphicsContext::Traits;
_traits->windowName = _rs->getWindowName();
_traits->displayNum = _rs->getDisplayNum();
_traits->screenNum = _rs->getScreenNum();
}
GraphicsContextImplementation::~GraphicsContextImplementation()
{
if (_closeOnDestruction) close();
}
bool GraphicsContextImplementation::realizeImplementation()
{
if (_rs.valid())
{
GraphicsContextImplementation* sharedContext = dynamic_cast<GraphicsContextImplementation*>(_traits->sharedContext);
if (sharedContext)
{
_rs->realize( 0, sharedContext->_rs->getGLContext() );
}
else
{
osg::notify(osg::NOTICE)<<"GraphicsContextImplementation::realize"<<std::endl;
_rs->realize();
}
return _rs->isRealized();
}
else
{
return false;
}
}
bool GraphicsContextImplementation::makeCurrentImplementation()
{
if (!_rs)
{
osg::notify(osg::NOTICE)<<"Error: GraphicsContextImplementation::makeCurrentImplementation() no RenderSurface."<<std::endl;
return false;
}
if (!isRealized())
{
osg::notify(osg::NOTICE)<<"Error: GraphicsContextImplementation::makeCurrentImplementation() not Realized."<<std::endl;
return false;
}
// osg::notify(osg::INFO)<<"GraphicsContextImplementation::makeCurrentImplementation()"<<std::endl;
_rs->setReadDrawable( 0 );
// comment out right now, as Producer's setReadDrawable() is doing a call for us.
// _rs->makeCurrent();
return true;
}
bool GraphicsContextImplementation::makeContextCurrentImplementation(osg::GraphicsContext* readContext)
{
if (!_rs) return false;
GraphicsContextImplementation* readContextImplemention = dynamic_cast<GraphicsContextImplementation*>(readContext);
if (readContextImplemention)
{
_rs->setReadDrawable( readContextImplemention->getRenderSurface() );
}
else
{
_rs->setReadDrawable( 0 );
}
// comment out right now, as Producer's setReadDrawable() is doing a call for us.
// _rs->makeCurrent();
return true;
}
bool GraphicsContextImplementation::releaseContextImplementation()
{
osg::notify(osg::NOTICE)<<"GraphicsContextImplementation::releaseContextImplementation(): not implemented - release not supported under Producer."<<std::endl;
return false;
}
void GraphicsContextImplementation::closeImplementation()
{
if (!_rs) return;
// close render surface by deleting it
_rs = 0;
}
void GraphicsContextImplementation::bindPBufferToTextureImplementation(GLenum buffer)
{
if (!_rs) return;
Producer::RenderSurface::BufferType bufferType = Producer::RenderSurface::FrontBuffer;
switch(buffer)
{
case(GL_BACK): bufferType = Producer::RenderSurface::BackBuffer; break;
case(GL_FRONT): bufferType = Producer::RenderSurface::FrontBuffer; break;
default: bufferType = Producer::RenderSurface::FrontBuffer; break;
}
_rs->bindPBufferToTexture(bufferType);
}
void GraphicsContextImplementation::swapBuffersImplementation()
{
_rs->swapBuffers();
}

View File

@@ -1,215 +0,0 @@
#include <osgProducer/KeyboardMouseCallback>
#include <osg/Math>
#include <osg/Notify>
#include <float.h>
using namespace osgProducer;
KeyboardMouseCallback::KeyboardMouseCallback(Producer::KeyboardMouse* keyboardMouse, bool &done, bool escapeKeySetsDone):
Producer::KeyboardMouseCallback(),
_keyboardMouse(keyboardMouse),
_mx(0.0f),_my(0.0f),_mbutton(0),
_done(done),
_escapeKeySetsDone(escapeKeySetsDone)
{
updateWindowSize();
}
void KeyboardMouseCallback::mouseScroll( Producer::KeyboardMouseCallback::ScrollingMotion sm )
{
updateWindowSize();
if (_eventQueue.valid())
{
switch(sm)
{
case(Producer::KeyboardMouseCallback::ScrollNone): break;
case(Producer::KeyboardMouseCallback::ScrollLeft): _eventQueue->mouseScroll(osgGA::GUIEventAdapter::SCROLL_LEFT); break;
case(Producer::KeyboardMouseCallback::ScrollRight): _eventQueue->mouseScroll(osgGA::GUIEventAdapter::SCROLL_RIGHT); break;
case(Producer::KeyboardMouseCallback::ScrollUp): _eventQueue->mouseScroll(osgGA::GUIEventAdapter::SCROLL_UP); break;
case(Producer::KeyboardMouseCallback::ScrollDown): _eventQueue->mouseScroll(osgGA::GUIEventAdapter::SCROLL_DOWN); break;
case(Producer::KeyboardMouseCallback::Scroll2D): _eventQueue->mouseScroll(osgGA::GUIEventAdapter::SCROLL_2D); break;
}
}
}
void KeyboardMouseCallback::mouseScroll2D( float x, float y )
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->mouseScroll2D(x,y);
}
void KeyboardMouseCallback::penPressure( float pressure )
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->penPressure(pressure);
}
void KeyboardMouseCallback::penProximity(Producer::KeyboardMouseCallback::TabletPointerType pt, bool isEntering)
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->penProximity((osgGA::GUIEventAdapter::TabletPointerType)pt, isEntering);
}
void KeyboardMouseCallback::buttonPress( float mx, float my, unsigned int mbutton )
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->mouseButtonPress(mx,my,mbutton);
}
void KeyboardMouseCallback::buttonRelease( float mx, float my, unsigned int mbutton )
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->mouseButtonRelease(mx,my,mbutton);
}
void KeyboardMouseCallback::doubleButtonPress( float mx, float my, unsigned int mbutton )
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->mouseDoubleButtonPress(mx,my,mbutton);
}
void KeyboardMouseCallback::keyPress( Producer::KeyCharacter key )
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->keyPress((osgGA::GUIEventAdapter::KeySymbol)key);
// check against adapted key symbol.
if (_escapeKeySetsDone &&
(osgGA::GUIEventAdapter::KeySymbol)key==osgGA::GUIEventAdapter::KEY_Escape) _done = true;
}
void KeyboardMouseCallback::keyRelease( Producer::KeyCharacter key )
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->keyRelease((osgGA::GUIEventAdapter::KeySymbol)key);
}
void KeyboardMouseCallback::specialKeyPress( Producer::KeyCharacter key )
{
updateWindowSize();
keyPress(key);
}
void KeyboardMouseCallback::specialKeyRelease( Producer::KeyCharacter key )
{
updateWindowSize();
keyRelease(key);
}
void KeyboardMouseCallback::windowConfig( int x, int y, unsigned int width, unsigned int height )
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->windowResize(x,y,x+width,y+height);
}
void KeyboardMouseCallback::mouseMotion( float mx, float my)
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->mouseMotion(mx,my);
}
void KeyboardMouseCallback::passiveMouseMotion( float mx, float my)
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->mouseMotion(mx,my);
}
void KeyboardMouseCallback::mouseWarp( float mx, float my)
{
updateWindowSize();
if (_eventQueue.valid()) _eventQueue->mouseWarped(mx,my); // need mouse warp??
}
void KeyboardMouseCallback::updateWindowSize()
{
if (!_eventQueue) return;
osgGA::GUIEventAdapter* ea = _eventQueue->getCurrentEventState();
Producer::InputArea* ia = _keyboardMouse->getInputArea();
Producer::RenderSurface* rs = _keyboardMouse->getRenderSurface();
if (ia)
{
float minX = FLT_MAX;
float minY = FLT_MAX;
float maxX = -FLT_MAX;
float maxY = -FLT_MAX;
//int numInputRectangle = ia->getNumInputRectangle();
int numRenderSurfaces = ia->getNumRenderSurfaces();
for (int i=0;i<numRenderSurfaces;++i)
{
const Producer::RenderSurface::InputRectangle &ir =
ia->getRenderSurface(i)->getInputRectangle();
minX = osg::minimum(minX,ir.left());
minX = osg::minimum(minX,ir.left()+ir.width());
minY = osg::minimum(minY,ir.bottom());
minY = osg::minimum(minY,ir.bottom()+ir.height());
maxX = osg::maximum(maxX,ir.left());
maxX = osg::maximum(maxX,ir.left()+ir.width());
maxY = osg::maximum(maxY,ir.bottom());
maxY = osg::maximum(maxY,ir.bottom()+ir.height());
}
ea->setInputRange(minX,minY,maxX,maxY);
}
else if (rs)
{
//ea->setWindowSize(-1.0f,-1.0f,1.0f,1.0f);
const Producer::RenderSurface::InputRectangle &ir = rs->getInputRectangle();
float minX = osg::minimum(ir.left(),ir.left()+ir.width());
float maxX = osg::maximum(ir.left(),ir.left()+ir.width());
float minY = osg::minimum(ir.bottom(),ir.bottom()+ir.height());
float maxY = osg::maximum(ir.bottom(),ir.bottom()+ir.height());
// osg::notify(osg::NOTICE)<<"RS ea->setWindowSize("<<minX<<","<<minY<<","<<maxX<<","<<maxY<<")"<<std::endl;
ea->setInputRange(minX,minY,maxX,maxY);
}
if (rs)
{
ea->setWindowRectangle(rs->getWindowOriginX(), rs->getWindowOriginY(), rs->getWindowWidth(),rs->getWindowHeight(), false);
}
}
bool KeyboardMouseCallback::takeEventQueue(EventQueue& queue)
{
updateWindowSize();
return _eventQueue->takeEvents(queue);
}
bool KeyboardMouseCallback::copyEventQueue(EventQueue& queue) const
{
return _eventQueue->copyEvents(queue);
}
void KeyboardMouseCallback::setEventQueue(EventQueue& queue)
{
_eventQueue->setEvents(queue);
}
void KeyboardMouseCallback::appendEventQueue(EventQueue& queue)
{
_eventQueue->appendEvents(queue);
}
void KeyboardMouseCallback::shutdown()
{
_done = true;
_keyboardMouse->cancel();
}
osgGA::GUIEventAdapter* KeyboardMouseCallback::createEventAdapter()
{
return new osgGA::GUIEventAdapter(*(_eventQueue->getCurrentEventState()));
}

View File

@@ -1,815 +0,0 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osg/ApplicationUsage>
#include <osg/Timer>
#include <osg/Notify>
#include <osg/Texture2D>
#include <osg/TextureRectangle>
#include <osg/ImageStream>
#include <osgUtil/DisplayRequirementsVisitor>
#include <osgDB/FileUtils>
#include <osgProducer/OsgCameraGroup>
#include <Producer/CameraConfig>
#ifdef WIN32
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLES_ARB 0x2042
#endif
using namespace osgProducer;
static osg::ApplicationUsageProxy OsgCameraGroup_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE, "OSG_PROCESSOR_AFFINITY <mode>", "ON | OFF - Where supported, switch on or off the processor affinity." );
OsgCameraGroup::RealizeCallback::~RealizeCallback()
{
}
class RenderSurfaceRealizeCallback : public Producer::RenderSurface::Callback
{
public:
RenderSurfaceRealizeCallback(OsgCameraGroup* cameraGroup,OsgSceneHandler* sceneHandler):
_cameraGroup(cameraGroup),
_sceneHandler(sceneHandler)
{
const OsgCameraGroup::SceneHandlerList& shl = _cameraGroup->getSceneHandlerList();
for(unsigned int i=0; i<shl.size(); ++i)
{
if (shl[i]==sceneHandler) _sceneHandlerNumber = i;
}
}
virtual void operator()( const Producer::RenderSurface & rs)
{
osg::Timer timer;
osg::Timer_t start_t = timer.tick();
if (_cameraGroup->getRealizeCallback())
{
(*(_cameraGroup->getRealizeCallback()))(*_cameraGroup,*_sceneHandler,rs);
}
else if (_sceneHandler) _sceneHandler->init();
osg::Timer_t end_t = timer.tick();
double time = timer.delta_m(start_t,end_t);
osg::notify(osg::INFO) << "Time to init = "<<time<<std::endl;
}
OsgCameraGroup* _cameraGroup;
OsgSceneHandler* _sceneHandler;
int _numberOfProcessors;
int _sceneHandlerNumber;
bool _enableProccessAffinityHint;
};
std::string findCameraConfigFile(const std::string& configFile)
{
std::string foundFile = osgDB::findDataFile(configFile);
if (foundFile.empty()) return "";
else return foundFile;
}
std::string extractCameraConfigFile(osg::ArgumentParser& arguments)
{
// report the usage options.
if (arguments.getApplicationUsage())
{
arguments.getApplicationUsage()->addCommandLineOption("-c <filename>","Specify camera config file");
}
std::string filename;
if (arguments.read("-c",filename)) return findCameraConfigFile(filename);
char *ptr;
if( (ptr = getenv( "PRODUCER_CAMERA_CONFIG_FILE" )) )
{
osg::notify(osg::DEBUG_INFO) << "PRODUCER_CAMERA_CONFIG_FILE("<<ptr<<")"<<std::endl;
return findCameraConfigFile(ptr);
}
return "";
}
static osg::ApplicationUsageProxy OsgCameraGroup_e1(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"PRODUCER_CAMERA_CONFIG_FILE <filename>","specify the default producer camera config to use when opening osgProducer based applications.");
static osg::ApplicationUsageProxy OsgCameraGroup_e4(
osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,
"PRODUCER_CAMERA_BLOCK_ON_VSYNC",
"After the CPU finishes generating the scene for one frame,"
" block the CPU until the start of the next frame. Same as pressing 'v'"
" within an osgProducer-based application.");
OsgCameraGroup::OsgCameraGroup() : Producer::CameraGroup()
{
_init();
}
OsgCameraGroup::OsgCameraGroup(Producer::CameraConfig *cfg):
Producer::CameraGroup(cfg)
{
_init();
}
OsgCameraGroup::OsgCameraGroup(const std::string& configFile):
Producer::CameraGroup(findCameraConfigFile(configFile))
{
_init();
}
OsgCameraGroup::OsgCameraGroup(osg::ArgumentParser& arguments):
Producer::CameraGroup(extractCameraConfigFile(arguments))
{
_init();
_applicationUsage = arguments.getApplicationUsage();
while (arguments.read("--affinity"))
{
_enableProccessAffinityHint = true;
}
// report the usage options.
if (arguments.getApplicationUsage())
{
arguments.getApplicationUsage()->addCommandLineOption("--affinity","Enable processor affinity where supported.");
}
for( unsigned int i = 0; i < _cfg->getNumberOfCameras(); i++ )
{
Producer::Camera *cam = _cfg->getCamera(i);
Producer::RenderSurface *rs = cam->getRenderSurface();
if (rs->getWindowName()== Producer::RenderSurface::defaultWindowName )
{
rs->setWindowName(arguments.getApplicationName());
}
}
}
class QuitImageStreamVisitor : public osg::NodeVisitor
{
public:
QuitImageStreamVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}
/** Simply traverse using standard NodeVisitor traverse method.*/
virtual void apply(osg::Node& node)
{
if (node.getStateSet())
apply(*(node.getStateSet()));
traverse(node);
}
virtual void apply(osg::Geode& node)
{
if (node.getStateSet())
apply(*(node.getStateSet()));
for(unsigned int i=0;i<node.getNumDrawables();++i)
{
osg::Drawable* drawable = node.getDrawable(i);
if (drawable && drawable->getStateSet())
apply(*(drawable->getStateSet()));
}
}
void apply(osg::StateSet& stateset)
{
for(unsigned int i=0;i<stateset.getTextureAttributeList().size();++i)
{
osg::StateAttribute* texture = stateset.getTextureAttribute(i,osg::StateAttribute::TEXTURE);
if (texture)
{
osg::TextureRectangle* textureRect = dynamic_cast<osg::TextureRectangle*>(texture);
if (textureRect)
{
osg::ImageStream* imageStream = dynamic_cast<osg::ImageStream*>(textureRect->getImage());
if (imageStream)
{
imageStream->quit();
}
}
osg::Texture2D* texture2D = dynamic_cast<osg::Texture2D*>(texture);
if (texture2D)
{
osg::ImageStream* imageStream = dynamic_cast<osg::ImageStream*>(texture2D->getImage());
if (imageStream)
{
imageStream->quit();
}
}
}
}
}
};
OsgCameraGroup::~OsgCameraGroup()
{
// kill the DatabasePager and associated thread if one exists.
osgDB::Registry::instance()->setDatabasePager(0);
osg::Node* node = getTopMostSceneData();
if (node)
{
// kill any ImageStream threads
QuitImageStreamVisitor qisv;
node->accept(qisv);
}
}
static osg::ApplicationUsageProxy OsgCameraGroup_e2(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_CAMERA_THREADING <value>","Set the threading model using by osgProducer::Viewer/OsgCameraGroup based apps. <value> can be SingleThreaded or ThreadPerCamera");
static osg::ApplicationUsageProxy OsgCameraGroup_e3(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_SHARE_GRAPHICS_CONTEXTS <value>","Set whether to share graphics contexts. <value> can be ON or OFF");
void OsgCameraGroup::_init()
{
if (_cfg.valid())
{
// By default select ThreadPerCamera when we have multiple cameras.
_threadModel = (_cfg->getNumberOfCameras()>1) ? ThreadPerCamera : SingleThreaded;
}
const char* str = getenv("OSG_CAMERA_THREADING");
if (str)
{
if (strcmp(str,"SingleThreaded")==0) _threadModel = SingleThreaded;
else if (strcmp(str,"ThreadPerCamera")==0) _threadModel = ThreadPerCamera;
}
// work out how many graphics context we have
std::set<Producer::RenderSurface*> renderSurfaces;
for(unsigned int i=0; i<getNumberOfCameras(); ++i)
{
if (getCamera(i) && getCamera(i)->getRenderSurface())
{
renderSurfaces.insert(getCamera(i)->getRenderSurface());
}
}
unsigned int numContexts = renderSurfaces.size();
str = getenv("OSG_SHARE_GRAPHICS_CONTEXTS");
if (str)
{
if (strcmp(str,"ON")==0)
{
Producer::RenderSurface::shareAllGLContexts(true);
// if we are sharing graphics contexts then we just treat them all as one.
numContexts = 1;
}
else if (strcmp(str,"OFF")==0)
{
Producer::RenderSurface::shareAllGLContexts(false);
}
}
osg::DisplaySettings::instance()->setMaxNumberOfGraphicsContexts(numContexts);
if ((_threadModel==ThreadPerCamera || _threadModel==ThreadPerRenderSurface) && _cfg->getNumberOfCameras()>1)
{
// switch on thread safe reference counting by default when running multi-threaded.
osg::Referenced::setThreadSafeReferenceCounting(true);
}
_scene_data = NULL;
_global_stateset = NULL;
_clear_color.set( 0.2f, 0.2f, 0.4f, 1.0f );
_fusionDistanceMode = osgUtil::SceneView::PROPORTIONAL_TO_SCREEN_DISTANCE;
_fusionDistanceValue = 1.0f;
_realizeSceneViewOptions = osgUtil::SceneView::STANDARD_SETTINGS;
_initialized = false;
// set up the time and frame counter.
_frameNumber = 0;
_start_tick = _timer.tick();
if (!_frameStamp) _frameStamp = new osg::FrameStamp;
_applicationUsage = osg::ApplicationUsage::instance();
_enableProccessAffinityHint = false;
str = getenv("OSG_PROCESSOR_AFFINITY");
if (str && (strcmp(str,"ON")==0 || strcmp(str,"On")==0 || strcmp(str,"on")==0))
{
_enableProccessAffinityHint = true;
}
}
void OsgCameraGroup::setSceneData( osg::Node *scene )
{
if (_scene_data==scene) return;
if (_scene_decorator.valid() && _scene_data.valid())
{
_scene_decorator->removeChild(_scene_data.get());
}
_scene_data = scene;
if (_scene_decorator.valid() && _scene_data.valid())
{
_scene_decorator->addChild(scene);
}
updatedSceneData();
}
void OsgCameraGroup::setSceneDecorator( osg::Group* decorator)
{
if (_scene_decorator==decorator) return;
_scene_decorator = decorator;
if (_scene_data.valid() && decorator)
{
decorator->addChild(_scene_data.get());
}
updatedSceneData();
}
void OsgCameraGroup::updatedSceneData()
{
setUpSceneViewsWithData();
}
void OsgCameraGroup::setUpSceneViewsWithData()
{
for(SceneHandlerList::iterator p = _shvec.begin(); p != _shvec.end(); p++ )
{
osgUtil::SceneView* sv = (*p)->getSceneView();
if (_scene_decorator.valid())
{
sv->setSceneData( _scene_decorator.get() );
}
else if (_scene_data.valid())
{
sv->setSceneData( _scene_data.get() );
}
else
{
sv->setSceneData( 0 );
}
sv->setFrameStamp( _frameStamp.get() );
sv->setGlobalStateSet( _global_stateset.get() );
sv->setFusionDistance( _fusionDistanceMode, _fusionDistanceValue );
}
}
void OsgCameraGroup::setFrameStamp( osg::FrameStamp* fs )
{
_frameStamp = fs;
setUpSceneViewsWithData();
}
void OsgCameraGroup::setGlobalStateSet( osg::StateSet *sset )
{
_global_stateset = sset;
setUpSceneViewsWithData();
}
void OsgCameraGroup::setClearColor( const osg::Vec4& clearColor )
{
_clear_color = clearColor;
for(unsigned int i=0;i<getNumberOfCameras();++i)
{
Producer::Camera *cam = _cfg->getCamera(i);
cam->setClearColor(_clear_color[0],_clear_color[1],_clear_color[2],_clear_color[3]);
}
}
const osg::Vec4& OsgCameraGroup::getClearColor() const
{
return _clear_color;
}
void OsgCameraGroup::setLODScale( float scale )
{
getCullSettings().setLODScale(scale);
setUpSceneViewsWithData();
}
float OsgCameraGroup::getLODScale() const
{
return getCullSettings().getLODScale();
}
void OsgCameraGroup::setFusionDistance( osgUtil::SceneView::FusionDistanceMode mode,float value)
{
// need to set a local variable?
_fusionDistanceMode = mode;
_fusionDistanceValue = value;
setUpSceneViewsWithData();
}
void OsgCameraGroup::advance()
{
if( !_initialized ) return;
CameraGroup::advance();
}
bool OsgCameraGroup::realize( ThreadingModel thread_model )
{
if( _realized ) return _realized;
if (_cfg.valid()) _cfg->setThreadModelDirective(thread_model);
_threadModel = thread_model;
return realize();
}
bool OsgCameraGroup::realize()
{
if( _initialized ) return _realized;
if (!_ds) _ds = osg::DisplaySettings::instance();
if (_enableProccessAffinityHint)
{
unsigned int numProcessors = OpenThreads::GetNumberOfProcessors();
if (numProcessors>1)
{
for( unsigned int i = 0; i < _cfg->getNumberOfCameras(); i++ )
{
Producer::Camera *cam = _cfg->getCamera(i);
cam->setProcessorAffinity(i % numProcessors);
}
}
}
_shvec.clear();
// create the osg::View to keep track of complete views in an OSG centric way.
_view = new osg::View;
osg::Node* node = getTopMostSceneData();
if (node)
{
// traverse the scene graphs gathering the requirements of the OpenGL buffers.
osgUtil::DisplayRequirementsVisitor drv;
drv.setDisplaySettings(_ds.get());
node->accept(drv);
}
// set up each render stage to clear the appropriate buffers.
GLbitfield clear_mask=0;
if (_ds->getRGB()) clear_mask |= GL_COLOR_BUFFER_BIT;
if (_ds->getDepthBuffer()) clear_mask |= GL_DEPTH_BUFFER_BIT;
if (_ds->getStencilBuffer()) clear_mask |= GL_STENCIL_BUFFER_BIT;
// make sure any camera's which share the same render surface also share the same osg::State.
// use a std::map to keep track of what render surfaces are associated with what state.
typedef std::map<Producer::RenderSurface*,osg::State*> RenderSurfaceStateMap;
RenderSurfaceStateMap _renderSurfaceStateMap;
bool needToCreatedNewContextID = true;
unsigned int contextID = 0;
for(unsigned int i = 0; i < _cfg->getNumberOfCameras(); i++ )
{
Producer::Camera *cam = _cfg->getCamera(i);
Producer::RenderSurface* rs = cam->getRenderSurface();
cam->setClearColor(_clear_color[0],_clear_color[1],_clear_color[2],_clear_color[3]);
// get or create the scene handler.
osgProducer::OsgSceneHandler *sh;
sh = dynamic_cast<osgProducer::OsgSceneHandler*>(cam->getSceneHandler());
if(sh == NULL)
sh = new osgProducer::OsgSceneHandler(_ds.get());
osgUtil::SceneView* sv = sh->getSceneView();
sv->setDefaults(_realizeSceneViewOptions);
// note, should really compute the projection and view offsets...
// but not critical as Producer controls the osg::Camera matrices via SceneView.
_view->addSlave(sv->getCamera());
sv->setView(_view.get());
if (_renderSurfaceStateMap.count(rs)==0)
{
_renderSurfaceStateMap[rs] = sv->getState();
if (needToCreatedNewContextID)
{
// create a unique contextID for this graphics context.
contextID = osg::GraphicsContext::createNewContextID();
// if we are sharing our graphics context then when needn't create any more.
needToCreatedNewContextID = !Producer::RenderSurface::allGLContextsAreShared();
}
else
{
osg::GraphicsContext::incrementContextIDUsageCount(contextID);
}
sv->getState()->setContextID(contextID);
}
else
{
sv->setState(_renderSurfaceStateMap[rs]);
}
_shvec.push_back( sh );
cam->setSceneHandler( sh );
// set up the clear mask.
osgUtil::RenderStage *stage = sv->getRenderStage();
if (stage) stage->setClearMask(clear_mask);
// set the realize callback.
rs->setRealizeCallback( new RenderSurfaceRealizeCallback(this, sh));
// set up the visual chooser.
if (_ds.valid())
{
Producer::VisualChooser* rs_vc = rs->getVisualChooser();
if (!rs_vc)
{
rs_vc = new Producer::VisualChooser;
rs_vc->setSimpleConfiguration();
rs->setVisualChooser(rs_vc);
}
unsigned int numStencilBits = 0;
if (_ds->getStereo())
{
switch(_ds->getStereoMode())
{
case(osg::DisplaySettings::QUAD_BUFFER):
rs_vc->useStereo();
break;
case(osg::DisplaySettings::HORIZONTAL_INTERLACE):
case(osg::DisplaySettings::VERTICAL_INTERLACE):
numStencilBits = 8;
break;
default:
break;
}
}
// set up stencil buffer if required.
numStencilBits = osg::maximum(numStencilBits,_ds->getMinimumNumStencilBits());
if (numStencilBits > 0)
{
rs_vc->setStencilSize(numStencilBits);
}
if (_ds->getAlphaBuffer()) rs_vc->setAlphaSize(_ds->getMinimumNumAlphaBits());
rs_vc->setDepthSize(24);
if (_ds->getAccumBuffer())
{
rs_vc->setAccumRedSize(_ds->getMinimumNumAccumRedBits());
rs_vc->setAccumGreenSize(_ds->getMinimumNumAccumGreenBits());
rs_vc->setAccumBlueSize(_ds->getMinimumNumAccumBlueBits());
rs_vc->setAccumAlphaSize(_ds->getMinimumNumAccumAlphaBits());
}
if (_ds->getMultiSamples())
{
rs_vc->addAttribute(Producer::VisualChooser::SampleBuffers, 1);
rs_vc->addAttribute(Producer::VisualChooser::Samples, _ds->getNumMultiSamples());
}
}
}
// now set up GraphicsContext wrappers for each of the render surfaces
// to all core OSG classes to keep track of the graphics context.
for(RenderSurfaceStateMap::iterator ritr = _renderSurfaceStateMap.begin();
ritr != _renderSurfaceStateMap.end();
++ritr)
{
Producer::RenderSurface* rs = ritr->first;
osg::State* state = ritr->second;
GraphicsContextImplementation* gc = new GraphicsContextImplementation(rs);
gc->setState(state);
state->setGraphicsContext(gc);
_gcList.push_back(gc);
}
if( _global_stateset == NULL && _shvec.size() > 0 )
{
SceneHandlerList::iterator p = _shvec.begin();
_global_stateset = (*p)->getSceneView()->getGlobalStateSet();
}
setUpSceneViewsWithData();
// if we are still multi-thread check to make sure that no render surfaces
// are shared and don't use shared contexts, if they do we need to
// disable multi-threading of cameras.
if (_threadModel == Producer::CameraGroup::ThreadPerCamera)
{
std::set<Producer::RenderSurface*> renderSurfaceSet;
for( unsigned int i = 0; i < _cfg->getNumberOfCameras(); i++ )
{
Producer::Camera *cam = _cfg->getCamera(i);
renderSurfaceSet.insert(cam->getRenderSurface());
}
if (renderSurfaceSet.size()!=_cfg->getNumberOfCameras())
{
// camera's must be sharing a RenderSurface, so we need to ensure that we're
// running single threaded, to avoid OpenGL threading issues.
osg::notify(osg::INFO)<<"Warning: disabling multi-threading of cull and draw to avoid"<<std::endl;
osg::notify(osg::INFO)<<" threading problems when camera's share a RenderSurface."<<std::endl;
_threadModel = Producer::CameraGroup::SingleThreaded;
}
else if (renderSurfaceSet.size()>1 && Producer::RenderSurface::allGLContextsAreShared())
{
// we have multiple RenderSurface, but with share contexts, which is dangerous for multi-threaded usage,
// so need to disable multi-threading to prevent problems.
osg::notify(osg::INFO)<<"Warning: disabling multi-threading of cull and draw to avoid"<<std::endl;
osg::notify(osg::INFO)<<" threading problems when sharing graphics contexts within RenderSurface."<<std::endl;
_threadModel = Producer::CameraGroup::SingleThreaded;
}
}
if (_threadModel==Producer::CameraGroup::SingleThreaded)
{
osg::notify(osg::INFO)<<"OsgCameraGroup::realize() _threadModel==Producer::CameraGroup::SingleThreaded"<<std::endl;
}
else
{
osg::notify(osg::INFO)<<"OsgCameraGroup::realize() _threadModel==Producer::CameraGroup::ThreadPerCamera"<<std::endl;
}
if (_cfg.valid()) _cfg->setThreadModelDirective(_threadModel);
_initialized = CameraGroup::realize();
return _initialized;
}
osg::Node* OsgCameraGroup::getTopMostSceneData()
{
if (_scene_decorator.valid())
return _scene_decorator.get();
else
return _scene_data.get();
}
const osg::Node* OsgCameraGroup::getTopMostSceneData() const
{
if (_scene_decorator.valid())
return _scene_decorator.get();
else
return _scene_data.get();
}
void OsgCameraGroup::setView(const osg::Matrixd& matrix)
{
Producer::Matrix pm(matrix.ptr());
setViewByMatrix(pm);
}
osg::Matrixd OsgCameraGroup::getViewMatrix() const
{
osg::Matrixd matrix;
if (_cfg.valid() && _cfg->getNumberOfCameras()>=1)
{
const Producer::Camera *cam = _cfg->getCamera(0);
matrix.set(cam->getViewMatrix());
}
return matrix;
}
static osg::Timer_t _last_frame_tick = 0;
static osg::Timer_t _previous_previous_frame_tick = 0;
static osg::Timer_t _previous_frame_tick = 0;
static bool _useStartOfUpdateForFrameTime = true;
void OsgCameraGroup::sync()
{
CameraGroup::sync();
// set the frame stamp for the new frame.
_frameStamp->setFrameNumber(_frameNumber++);
if (_useStartOfUpdateForFrameTime)
{
double time_since_start = _timer.delta_s(_start_tick,_timer.tick());
_frameStamp->setReferenceTime(time_since_start);
_frameStamp->setSimulationTime(_frameStamp->getReferenceTime());
}
else
{
osg::Timer_t endOfNewFrameTick = _last_frame_tick + (_last_frame_tick-_previous_previous_frame_tick);
double estimatedSwapTimeForFrame = _timer.delta_s(_start_tick,endOfNewFrameTick);
_frameStamp->setReferenceTime(estimatedSwapTimeForFrame);
_frameStamp->setSimulationTime(_frameStamp->getReferenceTime());
}
}
void OsgCameraGroup::frame()
{
if (!_useStartOfUpdateForFrameTime)
{
_previous_previous_frame_tick = _previous_frame_tick;
_previous_frame_tick = _last_frame_tick;
_last_frame_tick = _timer.tick();
}
osg::Node* node = getTopMostSceneData();
if (node) node->getBound();
if (_view.valid())
{
double left, right, bottom, top, nearClip, farClip;
getLensParams(left, right, bottom, top, nearClip, farClip);
if (!_view->getCamera())
{
_view->setCamera(new osg::Camera);
}
if (getLensProjectionType()==Producer::Camera::Lens::Perspective)
{
_view->getCamera()->setProjectionMatrixAsFrustum(left, right, bottom, top, nearClip, farClip);
}
else
{
_view->getCamera()->setProjectionMatrixAsOrtho(left, right, bottom, top, nearClip, farClip);
}
_view->getCamera()->setViewMatrix(getViewMatrix());
}
// the settings in sync.
for(SceneHandlerList::iterator itr = _shvec.begin();
itr != _shvec.end();
++itr)
{
(*itr)->getSceneView()->inheritCullSettings(_cullSettings);
}
CameraGroup::frame();
}
void OsgCameraGroup::cleanup_frame()
{
// first relase all GL objects and switch on the flush of deleted objects
// in the next frame.
for(SceneHandlerList::iterator itr = _shvec.begin();
itr != _shvec.end();
++itr)
{
(*itr)->getSceneView()->releaseAllGLObjects();
(*itr)->getSceneView()->setRenderStage(0);
(*itr)->setCleanUpOnNextFrame(true);
}
// make sure that the registry all flushes all its texture objects.
osgDB::Registry::instance()->releaseGLObjects();
// then run the frame to do the actuall OpenGL clean up.
frame();
}

View File

@@ -1,191 +0,0 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <OpenThreads/Mutex>
#include <osgDB/Registry>
#include <osgProducer/OsgSceneHandler>
using namespace osgUtil;
using namespace osgProducer;
OsgSceneHandler::OsgSceneHandler( osg::DisplaySettings *ds) :
_sceneView(new osgUtil::SceneView(ds)),
_collectStats(false)
{
_frameStartTick = 0;
_previousFrameStartTick = 0;
_flushOfAllDeletedGLObjectsOnNextFrame = false;
_cleanUpOnNextFrame = false;
}
void OsgSceneHandler::init()
{
static OpenThreads::Mutex mutex;
osg::notify(osg::INFO)<<"entering "<<this<<" init."<<std::endl;
mutex.lock();
osg::notify(osg::INFO)<<" running "<<this<<" init."<<std::endl;
_sceneView->SceneView::init();
osg::notify(osg::INFO)<<" done "<<this<<" init."<<std::endl;
mutex.unlock();
osg::notify(osg::INFO)<<" unlocked "<<this<<" init."<<std::endl;
}
void OsgSceneHandler::clearImplementation(Producer::Camera& /*camera*/)
{
_previousFrameStartTick = _frameStartTick;
_frameStartTick = osg::Timer::instance()->tick();
osgDB::DatabasePager* dp = osgDB::Registry::instance()->getDatabasePager();
if (dp)
{
dp->signalBeginFrame(getSceneView()->getState()->getFrameStamp());
}
// no-op right now as scene view manages its own clear.
}
void OsgSceneHandler::cullImplementation(Producer::Camera &cam)
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_cullMutex);
_sceneView->getProjectionMatrix().set(cam.getProjectionMatrix());
_sceneView->getViewMatrix().set(cam.getPositionAndAttitudeMatrix());
int x, y;
unsigned int w, h;
cam.getProjectionRectangle( x, y, w, h );
_sceneView->setViewport( x, y, w, h );
osg::Vec4 clear_color;
cam.getClearColor(clear_color[0],clear_color[1],clear_color[2],clear_color[3]);
_sceneView->setClearColor(clear_color);
_sceneView->cull();
if (_collectStats)
{
_stats.reset();
_sceneView->getStats(_stats);
}
}
bool OsgSceneHandler::getStats(Statistics& primStats)
{
if (!_collectStats) return false;
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_cullMutex);
primStats.add(_stats);
return true;
}
void OsgSceneHandler::drawImplementation(Producer::Camera &)
{
// dipatch the draw traversal of the scene graph
_sceneView->SceneView::draw();
// for the database pager now manage any GL object operations that are required.
osgDB::DatabasePager* dp = osgDB::Registry::instance()->getDatabasePager();
if (dp)
{
#if 1
double timeForCullAndDraw = osg::Timer::instance()->delta_s(_frameStartTick, osg::Timer::instance()->tick());
double targeFrameTime = 1.0/dp->getTargetFrameRate();
double drawCostFactor = 2.0; // must be greater than 1 to account for the extra cost of emptying the OpenGL fifo.
double frameFactor = 0.9; // must be less than 1, to compensate for extra time spent in update and swap buffers etc.
double timeLeftTillEndOfFrame = targeFrameTime*frameFactor - timeForCullAndDraw*drawCostFactor;
double availableTime = timeLeftTillEndOfFrame / drawCostFactor; // account for the fifo when download texture objects.
// clamp the available time by the prescribed minimum
if (availableTime<dp->getMinimumTimeAvailableForGLCompileAndDeletePerFrame())
{
availableTime = dp->getMinimumTimeAvailableForGLCompileAndDeletePerFrame();
}
static unsigned int _numFramesThatNoTimeAvailable = 0;
static unsigned int _maxNumFramesThatNoTimeAvailable = 10;
if (_numFramesThatNoTimeAvailable>_maxNumFramesThatNoTimeAvailable)
{
availableTime = 0.0025; // 2.5ms.
}
if (availableTime>0.0)
{
_numFramesThatNoTimeAvailable = 0;
// osg::notify(osg::NOTICE)<<"Time available = "<<availableTime<<std::endl;
dp->compileGLObjects(*(getSceneView()->getState()),availableTime);
// flush deleted GL objects.
getSceneView()->flushDeletedGLObjects(availableTime);
}
else
{
++_numFramesThatNoTimeAvailable;
}
#else
double timeForPreviousFrame = osg::Timer::instance()->delta_s(_previousFrameStartTick, _frameStartTick);
double timeForCullAndDraw = osg::Timer::instance()->delta_s(_frameStartTick, osg::Timer::instance()->tick());
double minimumTargetMaxFrameTime = 0.010; // 10ms.
double targetMaxFrameTime = osg::minimum(timeForPreviousFrame, minimumTargetMaxFrameTime);
double drawCostFactor = 2.0; // must be greater than 1 to account for the extra cost of emptying the OpenGL fifo.
double frameFactor = 0.9; // must be less than 1, to compensate for extra time spent in update and swap buffers etc.
double timeLeftTillEndOfFrame = targetMaxFrameTime*frameFactor - timeForCullAndDraw*drawCostFactor;
double availableTime = timeLeftTillEndOfFrame / drawCostFactor; // account for the fifo when download texture objects.
static unsigned int _numFramesThatNoTimeAvailable = 0;
static unsigned int _maxNumFramesThatNoTimeAvailable = 10;
if (_numFramesThatNoTimeAvailable>_maxNumFramesThatNoTimeAvailable)
{
availableTime = 0.0025; // 2.5ms.
}
if (availableTime>0.0)
{
_numFramesThatNoTimeAvailable = 0;
// osg::notify(osg::NOTICE)<<"Time available = "<<availableTime<<std::endl;
dp->compileGLObjects(*(getSceneView()->getState()),availableTime);
// flush deleted GL objects.
getSceneView()->flushDeletedGLObjects(availableTime);
}
else
{
++_numFramesThatNoTimeAvailable;
}
#endif
dp->signalEndFrame();
}
}
void OsgSceneHandler::setContextID( int id )
{
_sceneView->getState()->setContextID( id );
}

View File

@@ -1,12 +0,0 @@
#include <osgProducer/Version>
const char* osgProducerGetVersion()
{
return "1.2";
}
const char* osgProducerGetLibraryName()
{
return "OpenSceneGraph Producer Library";
}

View File

@@ -1,996 +0,0 @@
#include <osg/LightSource>
#include <osg/ApplicationUsage>
#include <osg/AlphaFunc>
#include <osg/DeleteHandler>
#include <osg/io_utils>
#include <osgUtil/UpdateVisitor>
#include <osgDB/Registry>
#include <osgGA/EventVisitor>
#include <osgGA/AnimationPathManipulator>
#include <osgGA/TrackballManipulator>
#include <osgGA/FlightManipulator>
#include <osgGA/DriveManipulator>
#include <osgGA/TerrainManipulator>
#include <osgGA/UFOManipulator>
#include <osgGA/StateSetManipulator>
#include <osgProducer/Viewer>
#include <osgProducer/ViewerEventHandler>
#include <stdio.h>
using namespace osgProducer;
#ifdef __APPLE__
#define SINGLE_THREAD_KEYBOARDMOUSE
#endif
class CollectedCoordinateSystemNodesVisitor : public osg::NodeVisitor
{
public:
CollectedCoordinateSystemNodesVisitor():
NodeVisitor(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN) {}
virtual void apply(osg::Node& node)
{
traverse(node);
}
virtual void apply(osg::CoordinateSystemNode& node)
{
if (_pathToCoordinateSystemNode.empty())
{
osg::notify(osg::INFO)<<"Found CoordianteSystemNode node"<<std::endl;
osg::notify(osg::INFO)<<" CoordinateSystem = "<<node.getCoordinateSystem()<<std::endl;
_pathToCoordinateSystemNode = getNodePath();
}
else
{
osg::notify(osg::INFO)<<"Found additional CoordianteSystemNode node, but ignoring"<<std::endl;
osg::notify(osg::INFO)<<" CoordinateSystem = "<<node.getCoordinateSystem()<<std::endl;
}
traverse(node);
}
osg::NodePath _pathToCoordinateSystemNode;
};
/** callback class to use to allow matrix manipulators to querry the application for the local coordinate frame.*/
class ViewerCoordinateFrameCallback : public osgGA::MatrixManipulator::CoordinateFrameCallback
{
public:
ViewerCoordinateFrameCallback(Viewer* viewer):
_viewer(viewer) {}
virtual osg::CoordinateFrame getCoordinateFrame(const osg::Vec3d& position) const
{
osg::notify(osg::INFO)<<"getCoordinateFrame("<<position<<")"<<std::endl;
osg::NodePath tmpPath = _viewer->getCoordinateSystemNodePath();
if (!tmpPath.empty())
{
osg::Matrixd coordinateFrame;
osg::CoordinateSystemNode* csn = dynamic_cast<osg::CoordinateSystemNode*>(tmpPath.back());
if (csn)
{
osg::Vec3 local_position = position*osg::computeWorldToLocal(tmpPath);
// get the coordinate frame in world coords.
coordinateFrame = csn->computeLocalCoordinateFrame(local_position)* osg::computeLocalToWorld(tmpPath);
// keep the position of the coordinate frame to reapply after rescale.
osg::Vec3d pos = coordinateFrame.getTrans();
// compensate for any scaling, so that the coordinate frame is a unit size
osg::Vec3d x(1.0,0.0,0.0);
osg::Vec3d y(0.0,1.0,0.0);
osg::Vec3d z(0.0,0.0,1.0);
x = osg::Matrixd::transform3x3(x,coordinateFrame);
y = osg::Matrixd::transform3x3(y,coordinateFrame);
z = osg::Matrixd::transform3x3(z,coordinateFrame);
coordinateFrame.preMult(osg::Matrixd::scale(1.0/x.length(),1.0/y.length(),1.0/z.length()));
// reapply the position.
coordinateFrame.setTrans(pos);
osg::notify(osg::INFO)<<"csn->computeLocalCoordinateFrame(position)* osg::computeLocalToWorld(tmpPath)"<<coordinateFrame<<std::endl;
}
else
{
osg::notify(osg::INFO)<<"osg::computeLocalToWorld(tmpPath)"<<std::endl;
coordinateFrame = osg::computeLocalToWorld(tmpPath);
}
return coordinateFrame;
}
else
{
osg::notify(osg::INFO)<<" no coordinate system found, using default orientation"<<std::endl;
return osg::Matrixd::translate(position);
}
}
protected:
virtual ~ViewerCoordinateFrameCallback() {}
Viewer* _viewer;
};
//////////////////////////////////////////////////////////////////////////////
//
// osgProducer::Viewer implemention
//
Viewer::Viewer():
_setDoneAtElapsedTimeEnabled(false),
_setDoneAtElapsedTime(0.0),
_setDoneAtFrameNumberEnabled(false),
_setDoneAtFrameNumber(0),
_done(false),
_writeImageWhenDone(false),
_writeImageFileName(getDefaultImageFileName()),
_recordingAnimationPath(false),
_recordingStartTime(0.0)
{
_eventQueue = new osgGA::EventQueue(osgGA::GUIEventAdapter::Y_INCREASING_UPWARDS);
_position[0] = 0.0;
_position[1] = 0.0;
_position[2] = 0.0;
_speed = 0.0;
}
Viewer::Viewer(Producer::CameraConfig *cfg):
OsgCameraGroup(cfg),
_setDoneAtElapsedTimeEnabled(false),
_setDoneAtElapsedTime(0.0),
_setDoneAtFrameNumberEnabled(false),
_setDoneAtFrameNumber(0),
_done(false),
_writeImageWhenDone(false),
_writeImageFileName(getDefaultImageFileName()),
_recordingAnimationPath(false),
_recordingStartTime(0.0)
{
_eventQueue = new osgGA::EventQueue(osgGA::GUIEventAdapter::Y_INCREASING_UPWARDS);
_position[0] = 0.0;
_position[1] = 0.0;
_position[2] = 0.0;
_speed = 0.0;
_recordingStartTime = 0.0;
}
Viewer::Viewer(const std::string& configFile):
OsgCameraGroup(configFile),
_setDoneAtElapsedTimeEnabled(false),
_setDoneAtElapsedTime(0.0),
_setDoneAtFrameNumberEnabled(false),
_setDoneAtFrameNumber(0),
_done(false),
_writeImageWhenDone(false),
_writeImageFileName(getDefaultImageFileName()),
_recordingAnimationPath(false),
_recordingStartTime(0.0)
{
_eventQueue = new osgGA::EventQueue(osgGA::GUIEventAdapter::Y_INCREASING_UPWARDS);
_position[0] = 0.0;
_position[1] = 0.0;
_position[2] = 0.0;
_speed = 0.0;
}
Viewer::Viewer(osg::ArgumentParser& arguments):
OsgCameraGroup(arguments),
_setDoneAtElapsedTimeEnabled(false),
_setDoneAtElapsedTime(0.0),
_setDoneAtFrameNumberEnabled(false),
_setDoneAtFrameNumber(0),
_done(false),
_writeImageWhenDone(false),
_writeImageFileName(getDefaultImageFileName()),
_recordingAnimationPath(false),
_recordingStartTime(0.0)
{
_eventQueue = new osgGA::EventQueue(osgGA::GUIEventAdapter::Y_INCREASING_UPWARDS);
_position[0] = 0.0;
_position[1] = 0.0;
_position[2] = 0.0;
_speed = 0.0;
// report the usage options.
if (arguments.getApplicationUsage())
{
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Specify camera path file to animate the camera through the loaded scene");
arguments.getApplicationUsage()->addCommandLineOption("--run-till-frame-number <integer>","Specify the number of frame to run");
arguments.getApplicationUsage()->addCommandLineOption("--run-till-elapsed-time","Specify the amount of time to run");
arguments.getApplicationUsage()->addCommandLineOption("--clear-color <float>,<float>,<float>[,<float>]","Specify the clear color as RGB or RGBA");
}
osg::DisplaySettings::instance()->readCommandLine(arguments);
osgDB::readCommandLine(arguments);
std::string pathfile;
while (arguments.read("-p",pathfile))
{
osg::ref_ptr<osgGA::AnimationPathManipulator> apm = new osgGA::AnimationPathManipulator(pathfile);
if( apm.valid() && apm->valid() )
{
unsigned int num = addCameraManipulator(apm.get());
selectCameraManipulator(num);
}
}
unsigned int frameNumber;
while (arguments.read("--run-till-frame-number",frameNumber))
{
setDoneAtFrameNumber(frameNumber);
}
double elapsedTime;
while (arguments.read("--run-till-elapsed-time",elapsedTime))
{
setDoneAtElapsedTime(elapsedTime);
}
std::string filename;
while (arguments.read("--write-image-when-done",filename))
{
setWriteImageWhenDone(true);
setWriteImageFileName(filename);
}
std::string colorStr;
while (arguments.read("--clear-color",colorStr))
{
float r, g, b;
float a = 1.0f;
int cnt = sscanf( colorStr.c_str(), "%f,%f,%f,%f", &r, &g, &b, &a );
if( cnt==3 || cnt==4 ) setClearColor( osg::Vec4(r,g,b,a) );
else osg::notify(osg::WARN)<<"Invalid clear color \""<<colorStr<<"\""<<std::endl;
}
}
Viewer::~Viewer()
{
setSceneData(0);
if (osg::Referenced::getDeleteHandler())
{
osg::Referenced::getDeleteHandler()->flushAll();
}
}
osg::NodePath Viewer::getCoordinateSystemNodePath() const
{
osg::NodePath nodePath;
for(ObserveredNodePath::const_iterator itr = _coordinateSystemNodePath.begin();
itr != _coordinateSystemNodePath.end();
++itr)
{
nodePath.push_back(const_cast<osg::Node*>(itr->get()));
}
return nodePath;
}
void Viewer::setWriteImageFileName(const std::string& filename)
{
_writeImageFileName = filename;
for(EventHandlerList::iterator itr = getEventHandlerList().begin();
itr != getEventHandlerList().end();
++itr)
{
ViewerEventHandler* viewerEventHandler = dynamic_cast<ViewerEventHandler*>(itr->get());
if (viewerEventHandler)
{
viewerEventHandler->setWriteImageFileName(filename);
}
}
}
const std::string& Viewer::getWriteImageFileName() const
{
return _writeImageFileName;
}
static osg::ApplicationUsageProxy Viewer_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE, "OSG_IMAGE_FILE_NAME <filename>", "name of snapshot image file" );
const char* Viewer::getDefaultImageFileName()
{
const char* name = getenv( "OSG_IMAGE_FILE_NAME" );
return name ? name : "saved_image.jpg";
}
void Viewer::setCoordinateSystemNodePath(const osg::NodePath& nodePath)
{
_coordinateSystemNodePath.clear();
std::copy(nodePath.begin(),
nodePath.end(),
std::back_inserter(_coordinateSystemNodePath));
}
void Viewer::computeActiveCoordinateSystemNodePath()
{
// now search for CoordinateSystemNode's for which we want to track.
osg::Node* subgraph = getTopMostSceneData();
if (subgraph)
{
CollectedCoordinateSystemNodesVisitor ccsnv;
subgraph->accept(ccsnv);
if (!ccsnv._pathToCoordinateSystemNode.empty())
{
setCoordinateSystemNodePath(ccsnv._pathToCoordinateSystemNode);
return;
}
}
// otherwise no node path found so reset to empty.
setCoordinateSystemNodePath(osg::NodePath());
}
void Viewer::updatedSceneData()
{
OsgCameraGroup::updatedSceneData();
// refresh the coordinate system node path.
computeActiveCoordinateSystemNodePath();
// refresh the camera manipulators
if (_keyswitchManipulator.valid()) _keyswitchManipulator->setNode(getTopMostSceneData());
}
void Viewer::setKeyboardMouse(Producer::KeyboardMouse* kbm)
{
_kbm = kbm;
if (_kbm.valid() && _kbmcb.valid()) _kbm->setCallback(_kbmcb.get());
}
void Viewer::setKeyboardMouseCallback(osgProducer::KeyboardMouseCallback* kbmcb)
{
_kbmcb = kbmcb;
if (_kbm.valid() && _kbmcb.valid())
{
_kbm->setCallback(_kbmcb.get());
_kbmcb->setEventQueue(_eventQueue.get());
}
}
void Viewer::setUpViewer(unsigned int options)
{
// set up the keyboard and mouse handling.
Producer::InputArea *ia = getCameraConfig()->getInputArea();
if (!_kbm)
{
setKeyboardMouse(ia ?
(new Producer::KeyboardMouse(ia)) :
(new Producer::KeyboardMouse(getCamera(0)->getRenderSurface())) );
}
// set the keyboard mouse callback to catch the events from the windows.
if (!_kbmcb)
{
setKeyboardMouseCallback(new osgProducer::KeyboardMouseCallback( _kbm.get(), _done, (options & ESCAPE_SETS_DONE)!=0 ));
}
// register the callback with the keyboard mouse manger.
_kbm->setCallback( _kbmcb.get() );
//kbm->allowContinuousMouseMotionUpdate(true);
// set the globa state
osg::ref_ptr<osg::StateSet> globalStateSet = new osg::StateSet;
setGlobalStateSet(globalStateSet.get());
{
globalStateSet->setGlobalDefaults();
// enable depth testing by default.
globalStateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON);
#if 0
// set up an alphafunc by default to speed up blending operations.
osg::AlphaFunc* alphafunc = new osg::AlphaFunc;
alphafunc->setFunction(osg::AlphaFunc::GREATER,0.0f);
globalStateSet->setAttributeAndModes(alphafunc, osg::StateAttribute::ON);
#endif
}
if (options & HEAD_LIGHT_SOURCE || options & SKY_LIGHT_SOURCE)
{
// enable lighting by default
globalStateSet->setMode(GL_LIGHTING, osg::StateAttribute::ON);
// add either a headlight or sun light to the scene.
osg::LightSource* lightsource = new osg::LightSource;
setSceneDecorator(lightsource);
{
osg::Light* light = new osg::Light;
lightsource->setLight(light);
if (options & HEAD_LIGHT_SOURCE)
{
lightsource->setReferenceFrame(osg::LightSource::ABSOLUTE_RF); // headlight.
}
else
{
lightsource->setReferenceFrame(osg::LightSource::RELATIVE_RF); // skylight
}
lightsource->setLocalStateSetModes(osg::StateAttribute::ON);
}
}
if (!_updateVisitor) _updateVisitor = new osgUtil::UpdateVisitor;
_updateVisitor->setFrameStamp(_frameStamp.get());
if (!_eventVisitor) _eventVisitor = new osgGA::EventVisitor;
_eventVisitor->setActionAdapter(this);
if (options&TRACKBALL_MANIPULATOR) addCameraManipulator(new osgGA::TrackballManipulator);
if (options&FLIGHT_MANIPULATOR) addCameraManipulator(new osgGA::FlightManipulator);
if (options&DRIVE_MANIPULATOR) addCameraManipulator(new osgGA::DriveManipulator);
if (options&TERRAIN_MANIPULATOR) addCameraManipulator(new osgGA::TerrainManipulator);
if (options&UFO_MANIPULATOR) addCameraManipulator(new osgGA::UFOManipulator);
if (options&STATE_MANIPULATOR)
{
osg::ref_ptr<osgGA::StateSetManipulator> statesetManipulator = new osgGA::StateSetManipulator;
statesetManipulator->setStateSet(getGlobalStateSet());
_eventHandlerList.push_back(statesetManipulator.get());
}
if (options&VIEWER_MANIPULATOR)
{
getEventHandlerList().push_back(new ViewerEventHandler(this));
}
}
unsigned int Viewer::addCameraManipulator(osgGA::MatrixManipulator* cm)
{
if (!cm) return 0xfffff;
// create a key switch manipulator if one doesn't already exist.
if (!_keyswitchManipulator)
{
_keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
_eventHandlerList.push_back(_keyswitchManipulator.get());
}
unsigned int num = _keyswitchManipulator->getNumMatrixManipulators();
_keyswitchManipulator->addNumberedMatrixManipulator(cm);
return num;
}
bool Viewer::done() const
{
return _done ||
!validForRendering() ||
(_setDoneAtElapsedTimeEnabled && _setDoneAtElapsedTime<=getFrameStamp()->getReferenceTime()) ||
(_setDoneAtFrameNumberEnabled && _setDoneAtFrameNumber<=_frameNumber);
}
void Viewer::setViewByMatrix( const Producer::Matrix & pm)
{
CameraGroup::setViewByMatrix(pm);
if (_keyswitchManipulator.valid())
{
// now convert Producer matrix to an osg::Matrix so we can update
// the internal camera...
osg::Matrixd matrix(pm.ptr());
_keyswitchManipulator->setByInverseMatrix(matrix);
}
}
bool Viewer::realize( ThreadingModel thread_model )
{
if( _realized ) return _realized;
_threadModel = thread_model;
return realize();
}
class PostSwapFinishCallback : public Producer::Camera::Callback
{
public:
PostSwapFinishCallback() {}
virtual void operator()(const Producer::Camera&)
{
// glFinish();
}
};
bool Viewer::realize()
{
if (_realized) return _realized;
OsgCameraGroup::realize();
// force a sync before we intialize the keyswitch manipulator to home
// so that Producer has a chance to set up the windows before we do
// any work on them.
OsgCameraGroup::sync();
#ifndef SINGLE_THREAD_KEYBOARDMOUSE
// kick start the keyboard mouse if needed.
if (_kbm.valid() && !_kbm->isRunning())
{
_kbm->startThread();
while (!_kbm->isRunning())
{
// osg::notify(osg::NOTICE)<<"Waiting"<<std::endl;
OpenThreads::Thread::YieldCurrentThread();
}
}
#endif
if (_kbmcb.valid()) _kbmcb->updateWindowSize();
// by default set up the DatabasePager.
{
osgDB::DatabasePager* databasePager = osgDB::Registry::instance()->getOrCreateDatabasePager();
databasePager->registerPagedLODs(getTopMostSceneData());
for(SceneHandlerList::iterator p=_shvec.begin();
p!=_shvec.end();
++p)
{
// pass the database pager to the cull visitor so node can send requests to the pager.
(*p)->getSceneView()->getCullVisitor()->setDatabaseRequestHandler(databasePager);
// tell the database pager which graphic context the compile of rendering objexts is needed.
databasePager->setCompileGLObjectsForContextID((*p)->getSceneView()->getState()->getContextID(),true);
}
// set up a post swap callback to flush deleted GL objects and compile new GL objects
for(unsigned int cameraNum=0;cameraNum<getNumberOfCameras();++cameraNum)
{
Producer::Camera* camera=getCamera(cameraNum);
camera->addPostSwapCallback(new PostSwapFinishCallback());
}
}
if (_keyswitchManipulator.valid() && _keyswitchManipulator->getCurrentMatrixManipulator() && _eventQueue.valid())
{
_keyswitchManipulator->setCoordinateFrameCallback(new ViewerCoordinateFrameCallback(this));
osg::ref_ptr<osgGA::GUIEventAdapter> init_event = _eventQueue->createEvent();
_keyswitchManipulator->setNode(getTopMostSceneData());
_keyswitchManipulator->home(*init_event,*this);
}
// set up osg::State objects with the _done prt to allow early termination of
// draw traversal.
for(SceneHandlerList::iterator p=_shvec.begin(); p!=_shvec.end(); p++ )
{
(*p)->getSceneView()->getState()->setAbortRenderingPtr(&_done);
}
return _realized;
}
void Viewer::update()
{
#ifdef SINGLE_THREAD_KEYBOARDMOUSE
if (_kbm.valid() && !_kbm->isRunning()) _kbm->update(*(_kbm->getCallback()));
#endif
// create an event to signal the new frame.
getEventQueue()->frame(_frameStamp->getReferenceTime());
// get the event since the last frame.
osgGA::EventQueue::Events events;
getEventQueue()->takeEvents(events);
if (_eventVisitor.valid())
{
_eventVisitor->setTraversalNumber(_frameStamp->getFrameNumber());
}
// dispatch the events in order of arrival.
for(osgGA::EventQueue::Events::iterator event_itr=events.begin();
event_itr!=events.end();
++event_itr)
{
bool handled = false;
if (_eventVisitor.valid())
{
_eventVisitor->reset();
_eventVisitor->addEvent(event_itr->get());
getTopMostSceneData()->accept(*_eventVisitor);
if (_eventVisitor->getEventHandled())
handled = true;
}
for(EventHandlerList::iterator handler_itr=_eventHandlerList.begin();
handler_itr!=_eventHandlerList.end() && !handled;
++handler_itr)
{
handled = (*handler_itr)->handle(*(*event_itr),*this,0,0);
}
}
if (osgDB::Registry::instance()->getDatabasePager())
{
// update the scene graph by remove expired subgraphs and merge newly loaded subgraphs
osgDB::Registry::instance()->getDatabasePager()->updateSceneGraph(_frameStamp->getReferenceTime());
}
if (_updateVisitor.valid())
{
_updateVisitor->setTraversalNumber(_frameStamp->getFrameNumber());
// update the scene by traversing it with the the update visitor which will
// call all node update callbacks and animations.
getTopMostSceneData()->accept(*_updateVisitor);
}
// update the main producer camera
if (_keyswitchManipulator.valid() && _keyswitchManipulator->getCurrentMatrixManipulator())
{
osgGA::MatrixManipulator* mm = _keyswitchManipulator->getCurrentMatrixManipulator();
osg::Matrixd matrix = mm->getInverseMatrix();
CameraGroup::setViewByMatrix(Producer::Matrix(matrix.ptr()));
setFusionDistance(mm->getFusionDistanceMode(),mm->getFusionDistanceValue());
}
}
void Viewer::frame()
{
// record the position of the view point.
osg::Matrixd matrix;
matrix.invert(getViewMatrix());
_orientation = matrix.getRotate();
double newPosition[3];
newPosition[0] = matrix(3,0);
newPosition[1] = matrix(3,1);
newPosition[2] = matrix(3,2);
_speed = sqrtf(osg::square(newPosition[0]-_position[0])+osg::square(newPosition[1]-_position[1])+osg::square(newPosition[2]-_position[2]));
_position[0] = newPosition[0];
_position[1] = newPosition[1];
_position[2] = newPosition[2];
#if 0
osg::Quat::value_type angle;
osg::Vec3 axis;
osg::Quat roll;
roll.makeRotate(-osg::PI/2.0f,1,0,0);
_orientation = roll*_orientation;
_orientation.getRotate(angle,axis);
std::cout<<"_position "<<_position[0]<<", "<<_position[1]<<", "<<_position[2]<<" speed "<<_speed<<" angle "<<osg::RadiansToDegrees(angle)<<" axis "<<axis<<std::endl;
#endif
if (getRecordingAnimationPath() && getAnimationPath())
{
if (getAnimationPath()->empty()) _recordingStartTime = _frameStamp->getReferenceTime();
getAnimationPath()->insert(_frameStamp->getReferenceTime()-_recordingStartTime,osg::AnimationPath::ControlPoint(osg::Vec3(_position[0],_position[1],_position[2]),_orientation));
}
if (done() && getWriteImageWhenDone())
{
for(EventHandlerList::iterator itr = getEventHandlerList().begin();
itr != getEventHandlerList().end();
++itr)
{
ViewerEventHandler* viewerEventHandler = dynamic_cast<ViewerEventHandler*>(itr->get());
if (viewerEventHandler)
{
osg::notify(osg::NOTICE)<<"Need to write image"<<std::endl;
viewerEventHandler->setWriteImageOnNextFrame(true);
}
}
}
OsgCameraGroup::frame();
if (osg::Referenced::getDeleteHandler())
{
osg::Referenced::getDeleteHandler()->flush();
}
}
bool Viewer::computePixelCoords(float x,float y,unsigned int cameraNum,float& pixel_x,float& pixel_y)
{
Producer::KeyboardMouse* km = getKeyboardMouse();
if (!km) return false;
if (cameraNum>=getNumberOfCameras()) return false;
Producer::Camera* camera=getCamera(cameraNum);
Producer::RenderSurface* rs = camera->getRenderSurface();
//std::cout << "checking camara "<<i<<std::endl;
if (km->computePixelCoords(x,y,rs,pixel_x,pixel_y))
{
//std::cout << " compute pixel coords "<<pixel_x<<" "<<pixel_y<<std::endl;
int pr_wx, pr_wy;
unsigned int pr_width, pr_height;
camera->getProjectionRectangle( pr_wx, pr_wy, pr_width, pr_height );
int rs_wx, rs_wy;
unsigned int rs_width, rs_height;
rs->getWindowRectangle( rs_wx, rs_wy, rs_width, rs_height );
pixel_x -= (float)rs_wx;
pixel_y -= (float)rs_wy;
//std::cout << " wx = "<<pr_wx<<" wy = "<<pr_wy<<" width="<<pr_width<<" height="<<pr_height<<std::endl;
if (pixel_x<(float)pr_wx) return false;
if (pixel_x>(float)(pr_wx+pr_width)) return false;
if (pixel_y<(float)pr_wy) return false;
if (pixel_y>(float)(pr_wy+pr_height)) return false;
return true;
}
return false;
}
bool Viewer::computeNearFarPoints(float x,float y,unsigned int cameraNum,osg::Vec3& near_point, osg::Vec3& far_point)
{
if (cameraNum>=getSceneHandlerList().size()) return false;
OsgSceneHandler* scenehandler = getSceneHandlerList()[cameraNum].get();
osgUtil::SceneView* sv = scenehandler->getSceneView();
float pixel_x,pixel_y;
if (computePixelCoords(x,y,cameraNum,pixel_x,pixel_y))
{
pixel_x-=sv->getViewport()->x();
pixel_y-=sv->getViewport()->y();
return sv->projectWindowXYIntoObject((int)(pixel_x+0.5f),(int)(pixel_y+0.5f),near_point,far_point);
}
return false;
}
bool Viewer::computeIntersections(float x,float y,unsigned int cameraNum,osg::Node* node,osgUtil::IntersectVisitor::HitList& hits,osg::Node::NodeMask traversalMask)
{
float pixel_x,pixel_y;
if (node && computePixelCoords(x,y,cameraNum,pixel_x,pixel_y))
{
Producer::Camera* camera=getCamera(cameraNum);
osgProducer::OsgSceneHandler* sh = dynamic_cast<osgProducer::OsgSceneHandler*>(camera->getSceneHandler());
osgUtil::SceneView* sv = sh ? sh->getSceneView() : 0;
osg::Matrixd proj;
osg::Matrixd view;
const osg::Viewport* viewport = 0;
osg::Node* rootNode = 0;
if (sv!=0)
{
viewport = sv->getViewport();
proj = sv->getProjectionMatrix();
view = sv->getViewMatrix();
rootNode = sv->getSceneData();
}
else
{
viewport = 0;
proj = osg::Matrixd(camera->getProjectionMatrix());
view = osg::Matrixd(camera->getViewMatrix());
}
unsigned int numHitsBefore = hits.size();
osg::NodePathList parentNodePaths = node->getParentalNodePaths(rootNode);
for(unsigned int i=0;i<parentNodePaths.size();++i)
{
osg::NodePath& nodePath = parentNodePaths[i];
// remove the intersection node from the nodePath as it'll be accounted for
// in the PickVisitor traversal, so we don't double account for its transform.
if (!nodePath.empty()) nodePath.pop_back();
osg::Matrixd modelview(view);
// modify the view matrix so that it accounts for this nodePath's accumulated transform
if (!nodePath.empty()) modelview.preMult(computeLocalToWorld(nodePath));
osgUtil::PickVisitor pick(viewport, proj, modelview, pixel_x, pixel_y);
pick.setTraversalMask(traversalMask);
node->accept(pick);
// copy all the hits across to the external hits list
for(osgUtil::PickVisitor::LineSegmentHitListMap::iterator itr = pick.getSegHitList().begin();
itr != pick.getSegHitList().end();
++itr)
{
hits.insert(hits.end(),itr->second.begin(), itr->second.end());
}
}
// return true if we now have more hits than before
return hits.size()>numHitsBefore;
}
return false;
}
bool Viewer::computeIntersections(float x,float y,unsigned int cameraNum,osgUtil::IntersectVisitor::HitList& hits,osg::Node::NodeMask traversalMask)
{
return computeIntersections(x,y,cameraNum,getTopMostSceneData(),hits,traversalMask);
}
bool Viewer::computeIntersections(float x,float y,osg::Node *node,osgUtil::IntersectVisitor::HitList& hits,osg::Node::NodeMask traversalMask)
{
bool hitFound = false;
for(unsigned int i=0;i<getNumberOfCameras();++i)
{
if (computeIntersections(x,y,i,node,hits,traversalMask)) hitFound = true;
}
return hitFound;
}
bool Viewer::computeIntersections(float x,float y,osgUtil::IntersectVisitor::HitList& hits,osg::Node::NodeMask traversalMask)
{
return computeIntersections(x,y,getTopMostSceneData(),hits,traversalMask);
}
void Viewer::selectCameraManipulator(unsigned int no)
{
if (_keyswitchManipulator.valid())
{
_keyswitchManipulator->selectMatrixManipulator(no);
// keyswitch manipulator doesn't yet force manipulators to init themselves
// so we'll do this mannually. Note pretty, and needs replacing by a refactor
// of MatrixMinpulators in the longer term.
osg::ref_ptr<osgGA::GUIEventAdapter> ea = new osgGA::GUIEventAdapter;
double time = _kbmcb.valid() ? _kbmcb->getTime() : 0.0;
ea->setTime(time);
ea->setEventType(osgGA::GUIEventAdapter::KEYDOWN);
ea->setKey(osgGA::GUIEventAdapter::KEY_KP_1+no);
_keyswitchManipulator->init(*ea, *this);
}
}
void Viewer::getCameraManipulatorNameList( std::list<std::string> &nameList )
{
osgGA::KeySwitchMatrixManipulator *ksm = getKeySwitchMatrixManipulator();
osgGA::KeySwitchMatrixManipulator::KeyManipMap &kmmap = ksm->getKeyManipMap();
osgGA::KeySwitchMatrixManipulator::KeyManipMap::iterator p;
for( p = kmmap.begin(); p != kmmap.end(); p++ )
{
osgGA::KeySwitchMatrixManipulator::NamedManipulator nm = (*p).second;
nameList.push_back( nm.first );
}
}
bool Viewer::selectCameraManipulatorByName( const std::string &name )
{
unsigned int num = 0xFFFF;
osgGA::KeySwitchMatrixManipulator *ksm = getKeySwitchMatrixManipulator();
osgGA::KeySwitchMatrixManipulator::KeyManipMap &kmmap = ksm->getKeyManipMap();
osgGA::KeySwitchMatrixManipulator::KeyManipMap::iterator p;
for( p = kmmap.begin(); p != kmmap.end(); p++ )
{
int key = (*p).first;
osgGA::KeySwitchMatrixManipulator::NamedManipulator nm = (*p).second;
if( nm.first == name )
num = key - '1';
}
if( num == 0xFFFF )
return false;
selectCameraManipulator(num);
return true;
}
osgGA::MatrixManipulator *Viewer::getCameraManipulatorByName( const std::string &name )
{
osgGA::KeySwitchMatrixManipulator *ksm = getKeySwitchMatrixManipulator();
osgGA::KeySwitchMatrixManipulator::KeyManipMap &kmmap = ksm->getKeyManipMap();
osgGA::KeySwitchMatrixManipulator::KeyManipMap::iterator p;
for( p = kmmap.begin(); p != kmmap.end(); p++ )
{
osgGA::KeySwitchMatrixManipulator::NamedManipulator nm = (*p).second;
if( nm.first == name )
return nm.second.get();
}
return 0L;
}
void Viewer::requestRedraw()
{
//osg::notify(osg::INFO)<<"Viewer::requestRedraw() called"<<std::endl;
}
void Viewer::requestContinuousUpdate(bool)
{
//osg::notify(osg::INFO)<<"Viewer::requestContinuousUpdate("<<flag<<") called"<<std::endl;
}
void Viewer::requestWarpPointer(float x,float y)
{
if (_kbmcb.valid() && isRealized())
{
osg::notify(osg::INFO) << "requestWarpPointer x= "<<x<<" y="<<y<<std::endl;
getEventQueue()->mouseWarped(x,y);
_kbmcb->getKeyboardMouse()->positionPointer(x,y);
return;
}
}
void Viewer::getUsage(osg::ApplicationUsage& usage) const
{
if (_kbmcb.valid() && _kbmcb->getEscapeSetDone())
{
usage.addKeyboardMouseBinding("Escape","Exit the application");
}
for(EventHandlerList::const_iterator itr=_eventHandlerList.begin();
itr!=_eventHandlerList.end();
++itr)
{
(*itr)->getUsage(usage);
}
}
void Viewer::cleanup_frame()
{
for(EventHandlerList::iterator itr = _eventHandlerList.begin();
itr != _eventHandlerList.end();
++itr)
{
(*itr)->releaseGLObjects();
ViewerEventHandler* veh = dynamic_cast<ViewerEventHandler*>(itr->get());
if (veh)
{
// switch off stats so it doesn't try to redraw them.
veh->setFrameStatsMode(ViewerEventHandler::NO_STATS);
veh->setDisplayHelp(false);
veh->setWriteImageOnNextFrame(false);
}
}
OsgCameraGroup::cleanup_frame();
}

File diff suppressed because it is too large Load Diff

View File

@@ -11,8 +11,10 @@
#include <osgIntrospection/Attributes>
#include <osg/Camera>
#include <osg/CopyOp>
#include <osg/Matrix>
#include <osg/Matrixd>
#include <osg/Object>
#include <osg/Stats>
#include <osg/View>
@@ -25,10 +27,39 @@
#endif
BEGIN_OBJECT_REFLECTOR(osg::View)
I_VirtualBaseType(osg::Referenced);
I_BaseType(osg::Object);
I_Constructor0(____View,
"",
"");
I_ConstructorWithDefaults2(IN, const osg::View &, view, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
____View__C5_osg_View_R1__C5_osg_CopyOp_R1,
"",
"");
I_Method0(osg::Object *, cloneType,
Properties::VIRTUAL,
__osg_Object_P1__cloneType,
"Clone the type of an object, with Object* return type. ",
"Must be defined by derived classes. ");
I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, copyop,
Properties::VIRTUAL,
__osg_Object_P1__clone__C5_osg_CopyOp_R1,
"Clone an object, with Object* return type. ",
"Must be defined by derived classes. ");
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
Properties::VIRTUAL,
__bool__isSameKindAs__C5_osg_Object_P1,
"",
"");
I_Method0(const char *, libraryName,
Properties::VIRTUAL,
__C5_char_P1__libraryName,
"return the name of the object's library. ",
"Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. ");
I_Method0(const char *, className,
Properties::VIRTUAL,
__C5_char_P1__className,
"return the name of the object's class type. ",
"Must be defined by derived classes. ");
I_Method1(void, setStats, IN, osg::Stats *, stats,
Properties::NON_VIRTUAL,
__void__setStats__osg_Stats_P1,

View File

@@ -10,6 +10,7 @@
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/Camera>
#include <osg/Matrix>
#include <osg/Node>
#include <osg/Vec2>
@@ -51,7 +52,7 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::CompositeDragger)
__void__setParentDragger__Dragger_P1,
"Set/Get parent dragger. ",
"For simple draggers parent points to itself. For composite draggers parent points to the parent dragger that uses this dragger.");
I_Method3(bool, handle, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, aa,
I_Method3(bool, handle, IN, const osgManipulator::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, aa,
Properties::VIRTUAL,
__bool__handle__C5_PointerInfo_R1__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1,
"",
@@ -151,7 +152,7 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::Dragger)
__CompositeDragger_P1__getComposite,
"Returns 0 if this Dragger is not a CompositeDragger. ",
"");
I_Method3(bool, handle, IN, const osgManipulator::Dragger::PointerInfo &, x, IN, const osgGA::GUIEventAdapter &, x, IN, osgGA::GUIActionAdapter &, x,
I_Method3(bool, handle, IN, const osgManipulator::PointerInfo &, x, IN, const osgGA::GUIEventAdapter &, x, IN, osgGA::GUIActionAdapter &, x,
Properties::VIRTUAL,
__bool__handle__C5_PointerInfo_R1__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1,
"",
@@ -167,15 +168,24 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::Dragger)
__void__setParentDragger__Dragger_P1);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osgManipulator::Dragger::PointerInfo)
TYPE_NAME_ALIAS(std::pair< osg::NodePath COMMA osg::Vec3 >, osgManipulator::PointerInfo::NodePathIntersectionPair);
TYPE_NAME_ALIAS(std::list< osgManipulator::PointerInfo::NodePathIntersectionPair >, osgManipulator::PointerInfo::IntersectionList);
BEGIN_VALUE_REFLECTOR(osgManipulator::PointerInfo)
I_Constructor0(____PointerInfo,
"",
"");
I_Constructor1(IN, const osgManipulator::Dragger::PointerInfo &, rhs,
I_Constructor1(IN, const osgManipulator::PointerInfo &, rhs,
Properties::NON_EXPLICIT,
____PointerInfo__C5_PointerInfo_R1,
"",
"");
I_Method0(void, reset,
Properties::NON_VIRTUAL,
__void__reset,
"",
"");
I_Method0(bool, completed,
Properties::NON_VIRTUAL,
__bool__completed,
@@ -206,6 +216,11 @@ BEGIN_VALUE_REFLECTOR(osgManipulator::Dragger::PointerInfo)
__bool__projectWindowXYIntoObject__osg_Vec3_R1__osg_Vec3_R1,
"",
"");
I_Method2(bool, projectObjectIntoWindow, IN, const osg::Vec3 &, object, IN, osg::Vec3 &, window,
Properties::NON_VIRTUAL,
__bool__projectObjectIntoWindow__C5_osg_Vec3_R1__osg_Vec3_R1,
"",
"");
I_Method0(const osg::Matrix &, getViewMatrix,
Properties::NON_VIRTUAL,
__C5_osg_Matrix_R1__getViewMatrix,
@@ -216,17 +231,37 @@ BEGIN_VALUE_REFLECTOR(osgManipulator::Dragger::PointerInfo)
__bool__contains__C5_osg_Node_P1,
"",
"");
I_Method1(void, setCamera, IN, osg::Camera *, camera,
Properties::NON_VIRTUAL,
__void__setCamera__osg_Camera_P1,
"",
"");
I_Method2(void, addIntersection, IN, const osg::NodePath &, nodePath, IN, osg::Vec3, intersectionPoint,
Properties::NON_VIRTUAL,
__void__addIntersection__C5_osg_NodePath_R1__osg_Vec3,
"",
"");
I_Method2(void, setMousePosition, IN, int, pixel_x, IN, int, pixel_y,
Properties::NON_VIRTUAL,
__void__setMousePosition__int__int,
"",
"");
I_SimpleProperty(osg::Camera *, Camera,
0,
__void__setCamera__osg_Camera_P1);
I_SimpleProperty(osg::Vec3, LocalIntersectPoint,
__osg_Vec3__getLocalIntersectPoint,
0);
I_SimpleProperty(const osg::Matrix &, ViewMatrix,
__C5_osg_Matrix_R1__getViewMatrix,
0);
I_PublicMemberProperty(int, pixel_x);
I_PublicMemberProperty(int, pixel_y);
I_PublicMemberProperty(osgUtil::SceneView *, sv);
I_PublicMemberProperty(osgUtil::IntersectVisitor::HitList, hitList);
I_PublicMemberProperty(osgUtil::IntersectVisitor::HitList::iterator, hitIter);
I_PublicMemberProperty(int, _pixel_x);
I_PublicMemberProperty(int, _pixel_y);
I_PublicMemberProperty(osg::Camera *, _camera);
I_PublicMemberProperty(osgManipulator::PointerInfo::IntersectionList, _hitList);
I_PublicMemberProperty(osgManipulator::PointerInfo::IntersectionList::iterator, _hitIter);
I_PublicMemberProperty(osg::Matrix, _MVPW);
I_PublicMemberProperty(osg::Matrix, _inverseMVPW);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgManipulator::Dragger >)
@@ -268,5 +303,9 @@ BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgManipulator::Dragger >)
0);
END_REFLECTOR
STD_LIST_REFLECTOR(std::list< osgManipulator::PointerInfo::NodePathIntersectionPair >);
STD_PAIR_REFLECTOR(std::pair< osg::NodePath COMMA osg::Vec3 >);
STD_VECTOR_REFLECTOR(std::vector< osg::ref_ptr< osgManipulator::Dragger > >);

View File

@@ -36,9 +36,9 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::CylinderPlaneProjector)
____CylinderPlaneProjector__osg_Cylinder_P1,
"",
"");
I_Method2(bool, project, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
I_Method2(bool, project, IN, const osgManipulator::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
Properties::VIRTUAL,
__bool__project__C5_Dragger_PointerInfo_R1__osg_Vec3_R1,
__bool__project__C5_PointerInfo_R1__osg_Vec3_R1,
"Calculates the object coordinates (projectedPoint) of a window coordinate (pointToProject) when projected onto the given plane. ",
"Returns true on successful projection.");
I_Method0(bool, isProjectionOnCylinder,
@@ -73,14 +73,14 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::CylinderProjector)
__C5_osg_Cylinder_P1__getCylinder,
"",
"");
I_Method2(bool, project, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
I_Method2(bool, project, IN, const osgManipulator::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
Properties::VIRTUAL,
__bool__project__C5_Dragger_PointerInfo_R1__osg_Vec3_R1,
__bool__project__C5_PointerInfo_R1__osg_Vec3_R1,
"Calculates the object coordinates (projectedPoint) of a window coordinate (pointToProject) when projected onto the given plane. ",
"Returns true on successful projection.");
I_Method2(bool, isPointInFront, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, const osg::Matrix &, localToWorld,
I_Method2(bool, isPointInFront, IN, const osgManipulator::PointerInfo &, pi, IN, const osg::Matrix &, localToWorld,
Properties::NON_VIRTUAL,
__bool__isPointInFront__C5_Dragger_PointerInfo_R1__C5_osg_Matrix_R1,
__bool__isPointInFront__C5_PointerInfo_R1__C5_osg_Matrix_R1,
"Returns true is the point is in front of the cylinder given the eye direction. ",
"");
I_Method1(void, setFront, IN, bool, front,
@@ -130,9 +130,9 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::LineProjector)
__osg_Vec3_R1__getLineEnd,
"",
"");
I_Method2(bool, project, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
I_Method2(bool, project, IN, const osgManipulator::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
Properties::VIRTUAL,
__bool__project__C5_Dragger_PointerInfo_R1__osg_Vec3_R1,
__bool__project__C5_PointerInfo_R1__osg_Vec3_R1,
"Calculates the object coordinates (projectedPoint) of a window coordinate (pointToProject) when projected onto the given line. ",
"Returns true on successful projection.");
I_SimpleProperty(osg::Vec3 &, LineEnd,
@@ -163,9 +163,9 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::PlaneProjector)
__C5_osg_Plane_R1__getPlane,
"",
"");
I_Method2(bool, project, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
I_Method2(bool, project, IN, const osgManipulator::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
Properties::VIRTUAL,
__bool__project__C5_Dragger_PointerInfo_R1__osg_Vec3_R1,
__bool__project__C5_PointerInfo_R1__osg_Vec3_R1,
"Calculates the object coordinates (projectedPoint) of a window coordinate (pointToProject) when projected onto the given plane. ",
"Returns true on successful projection.");
I_SimpleProperty(const osg::Plane &, Plane,
@@ -178,9 +178,9 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgManipulator::Projector)
I_Constructor0(____Projector,
"",
"");
I_Method2(bool, project, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
I_Method2(bool, project, IN, const osgManipulator::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
Properties::PURE_VIRTUAL,
__bool__project__C5_Dragger_PointerInfo_R1__osg_Vec3_R1,
__bool__project__C5_PointerInfo_R1__osg_Vec3_R1,
"Calculates the object/world coordinates (projectedPoint) of a window coordinate (pointToProject) when projected onto some shape or geometry (implemented in derived classes). ",
"SceneView in used for i projecting window coordinates into object coordinates and vice versa. Returns true on successful projection.");
I_Method1(void, setLocalToWorld, IN, const osg::Matrix &, localToWorld,
@@ -216,9 +216,9 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::SpherePlaneProjector)
____SpherePlaneProjector__osg_Sphere_P1,
"",
"");
I_Method2(bool, project, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
I_Method2(bool, project, IN, const osgManipulator::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
Properties::VIRTUAL,
__bool__project__C5_Dragger_PointerInfo_R1__osg_Vec3_R1,
__bool__project__C5_PointerInfo_R1__osg_Vec3_R1,
"Calculates the object coordinates (projectedPoint) of a window coordinate (pointToProject) when projected onto the given sphere. ",
"Returns true on successful projection.");
I_Method0(bool, isProjectionOnSphere,
@@ -253,14 +253,14 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::SphereProjector)
__C5_osg_Sphere_P1__getSphere,
"",
"");
I_Method2(bool, project, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
I_Method2(bool, project, IN, const osgManipulator::PointerInfo &, pi, IN, osg::Vec3 &, projectedPoint,
Properties::VIRTUAL,
__bool__project__C5_Dragger_PointerInfo_R1__osg_Vec3_R1,
__bool__project__C5_PointerInfo_R1__osg_Vec3_R1,
"Calculates the object coordinates (projectedPoint) of a window coordinate (pointToProject) when projected onto the given sphere. ",
"Returns true on successful projection.");
I_Method2(bool, isPointInFront, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, const osg::Matrix &, localToWorld,
I_Method2(bool, isPointInFront, IN, const osgManipulator::PointerInfo &, pi, IN, const osg::Matrix &, localToWorld,
Properties::NON_VIRTUAL,
__bool__isPointInFront__C5_Dragger_PointerInfo_R1__C5_osg_Matrix_R1,
__bool__isPointInFront__C5_PointerInfo_R1__C5_osg_Matrix_R1,
"Returns true is the point is in front of the cylinder given the eye direction. ",
"");
I_Method1(void, setFront, IN, bool, front,

View File

@@ -29,7 +29,7 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::RotateCylinderDragger)
I_Constructor0(____RotateCylinderDragger,
"",
"");
I_Method3(bool, handle, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
I_Method3(bool, handle, IN, const osgManipulator::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
Properties::VIRTUAL,
__bool__handle__C5_PointerInfo_R1__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1,
"Handle pick events on dragger and generate TranslateInLine commands. ",

View File

@@ -29,7 +29,7 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::RotateSphereDragger)
I_Constructor0(____RotateSphereDragger,
"",
"");
I_Method3(bool, handle, IN, const osgManipulator::Dragger::PointerInfo &, x, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
I_Method3(bool, handle, IN, const osgManipulator::PointerInfo &, x, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
Properties::VIRTUAL,
__bool__handle__C5_PointerInfo_R1__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1,
"Handle pick events on dragger and generate TranslateInLine commands. ",

View File

@@ -37,7 +37,7 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::Scale1DDragger)
____Scale1DDragger__ScaleMode,
"",
"");
I_Method3(bool, handle, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
I_Method3(bool, handle, IN, const osgManipulator::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
Properties::VIRTUAL,
__bool__handle__C5_PointerInfo_R1__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1,
"Handle pick events on dragger and generate TranslateInLine commands. ",

View File

@@ -38,7 +38,7 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::Scale2DDragger)
____Scale2DDragger__ScaleMode,
"",
"");
I_Method3(bool, handle, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
I_Method3(bool, handle, IN, const osgManipulator::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
Properties::VIRTUAL,
__bool__handle__C5_PointerInfo_R1__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1,
"Handle pick events on dragger and generate TranslateInLine commands. ",

View File

@@ -29,7 +29,7 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::TabPlaneDragger)
I_Constructor0(____TabPlaneDragger,
"",
"");
I_Method3(bool, handle, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
I_Method3(bool, handle, IN, const osgManipulator::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
Properties::VIRTUAL,
__bool__handle__C5_PointerInfo_R1__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1,
"",

View File

@@ -34,7 +34,7 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::Translate1DDragger)
____Translate1DDragger__C5_osg_Vec3_R1__C5_osg_Vec3_R1,
"",
"");
I_Method3(bool, handle, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
I_Method3(bool, handle, IN, const osgManipulator::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
Properties::VIRTUAL,
__bool__handle__C5_PointerInfo_R1__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1,
"Handle pick events on dragger and generate TranslateInLine commands. ",

View File

@@ -35,7 +35,7 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::Translate2DDragger)
____Translate2DDragger__C5_osg_Plane_R1,
"",
"");
I_Method3(bool, handle, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
I_Method3(bool, handle, IN, const osgManipulator::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
Properties::VIRTUAL,
__bool__handle__C5_PointerInfo_R1__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1,
"Handle pick events on dragger and generate TranslateInLine commands. ",

View File

@@ -31,7 +31,7 @@ BEGIN_OBJECT_REFLECTOR(osgManipulator::TranslatePlaneDragger)
I_Constructor0(____TranslatePlaneDragger,
"",
"");
I_Method3(bool, handle, IN, const osgManipulator::Dragger::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
I_Method3(bool, handle, IN, const osgManipulator::PointerInfo &, pi, IN, const osgGA::GUIEventAdapter &, ea, IN, osgGA::GUIActionAdapter &, us,
Properties::VIRTUAL,
__bool__handle__C5_PointerInfo_R1__C5_osgGA_GUIEventAdapter_R1__osgGA_GUIActionAdapter_R1,
"",

View File

@@ -1,22 +0,0 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osgProducer/Export>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif

View File

@@ -1,21 +0,0 @@
TOPDIR = ../../..
include $(TOPDIR)/Make/makedefs
CXXFILES =\
Export.cpp\
GraphicsContextImplementation.cpp\
KeyboardMouseCallback.cpp\
OsgCameraGroup.cpp\
OsgSceneHandler.cpp\
Viewer.cpp\
ViewerEventHandler.cpp\
LIBS += -losgProducer -losg -losgIntrospection -losgUtil -losgDB -lProducer -losgGA -losgText $(GL_LIBS) $(OTHER_LIBS)
OPTF = -O
TARGET_BASENAME = osgProducer
include $(TOPDIR)/Make/cygwin_wrapper_def
WRAPPER = $(WRAPPER_PREFIX)$(TARGET_BASENAME).$(PLUGIN_EXT)
include $(TOPDIR)/Make/makerules

View File

@@ -1,95 +0,0 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/GraphicsContext>
#include <osgProducer/GraphicsContextImplementation>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgProducer::GraphicsContextImplementation)
I_BaseType(osg::GraphicsContext);
I_Constructor1(IN, osg::GraphicsContext::Traits *, traits,
Properties::NON_EXPLICIT,
____GraphicsContextImplementation__Traits_P1,
"Construct a graphics context to specified traits. ",
"");
I_Constructor1(IN, Producer::RenderSurface *, rs,
Properties::NON_EXPLICIT,
____GraphicsContextImplementation__Producer_RenderSurface_P1,
"Construct a graphics context with specified RenderSurface. ",
"");
I_Method0(Producer::RenderSurface *, getRenderSurface,
Properties::NON_VIRTUAL,
__Producer_RenderSurface_P1__getRenderSurface,
"Return the RenderSurface that implements the graphics context. ",
"");
I_Method0(const Producer::RenderSurface *, getRenderSurface,
Properties::NON_VIRTUAL,
__C5_Producer_RenderSurface_P1__getRenderSurface,
"Return the const RenderSurface that implements the graphics context. ",
"");
I_Method0(bool, valid,
Properties::VIRTUAL,
__bool__valid,
"Return whether a valid and usable GraphicsContext has been created - assume success. ",
"");
I_Method0(bool, realizeImplementation,
Properties::VIRTUAL,
__bool__realizeImplementation,
"Realise the GraphicsContext. ",
"");
I_Method0(bool, isRealizedImplementation,
Properties::VIRTUAL,
__bool__isRealizedImplementation,
"Return true if the graphics context has been realised and is ready to use. ",
"");
I_Method0(void, closeImplementation,
Properties::VIRTUAL,
__void__closeImplementation,
"Close the graphics context. ",
"");
I_Method0(bool, makeCurrentImplementation,
Properties::VIRTUAL,
__bool__makeCurrentImplementation,
"Make this graphics context current. ",
"");
I_Method1(bool, makeContextCurrentImplementation, IN, osg::GraphicsContext *, readContext,
Properties::VIRTUAL,
__bool__makeContextCurrentImplementation__osg_GraphicsContext_P1,
"Make this graphics context current with specified read context. ",
"");
I_Method0(bool, releaseContextImplementation,
Properties::VIRTUAL,
__bool__releaseContextImplementation,
"Release the graphics context. ",
"");
I_Method1(void, bindPBufferToTextureImplementation, IN, GLenum, buffer,
Properties::VIRTUAL,
__void__bindPBufferToTextureImplementation__GLenum,
"Bind the graphics context to associated texture. ",
"");
I_Method0(void, swapBuffersImplementation,
Properties::VIRTUAL,
__void__swapBuffersImplementation,
"swap the front and back buffers. ",
"");
I_SimpleProperty(Producer::RenderSurface *, RenderSurface,
__Producer_RenderSurface_P1__getRenderSurface,
0);
END_REFLECTOR

View File

@@ -1,195 +0,0 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osgGA/EventQueue>
#include <osgGA/GUIEventAdapter>
#include <osgProducer/KeyboardMouseCallback>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
TYPE_NAME_ALIAS(osgGA::EventQueue::Events, osgProducer::KeyboardMouseCallback::EventQueue);
BEGIN_OBJECT_REFLECTOR(osgProducer::KeyboardMouseCallback)
I_ConstructorWithDefaults3(IN, Producer::KeyboardMouse *, keyboardMouse, , IN, bool &, done, , IN, bool, escapeKeySetsDone, true,
____KeyboardMouseCallback__Producer_KeyboardMouse_P1__bool_R1__bool,
"",
"");
I_Method1(void, mouseScroll, IN, Producer::KeyboardMouseCallback::ScrollingMotion, sm,
Properties::VIRTUAL,
__void__mouseScroll__Producer_KeyboardMouseCallback_ScrollingMotion,
"",
"");
I_Method2(void, mouseScroll2D, IN, float, x, IN, float, x,
Properties::VIRTUAL,
__void__mouseScroll2D__float__float,
"",
"");
I_Method1(void, penPressure, IN, float, pressure,
Properties::VIRTUAL,
__void__penPressure__float,
"",
"");
I_Method2(void, penProximity, IN, Producer::KeyboardMouseCallback::TabletPointerType, x, IN, bool, x,
Properties::VIRTUAL,
__void__penProximity__Producer_KeyboardMouseCallback_TabletPointerType__bool,
"",
"");
I_Method2(void, mouseMotion, IN, float, mx, IN, float, my,
Properties::VIRTUAL,
__void__mouseMotion__float__float,
"",
"");
I_Method2(void, passiveMouseMotion, IN, float, mx, IN, float, my,
Properties::VIRTUAL,
__void__passiveMouseMotion__float__float,
"",
"");
I_Method2(void, mouseWarp, IN, float, mx, IN, float, my,
Properties::VIRTUAL,
__void__mouseWarp__float__float,
"",
"");
I_Method3(void, buttonPress, IN, float, mx, IN, float, my, IN, unsigned int, mbutton,
Properties::VIRTUAL,
__void__buttonPress__float__float__unsigned_int,
"",
"");
I_Method3(void, doubleButtonPress, IN, float, mx, IN, float, my, IN, unsigned int, mbutton,
Properties::VIRTUAL,
__void__doubleButtonPress__float__float__unsigned_int,
"",
"");
I_Method3(void, buttonRelease, IN, float, mx, IN, float, my, IN, unsigned int, mbutton,
Properties::VIRTUAL,
__void__buttonRelease__float__float__unsigned_int,
"",
"");
I_Method1(void, keyPress, IN, Producer::KeyCharacter, key,
Properties::VIRTUAL,
__void__keyPress__Producer_KeyCharacter,
"",
"");
I_Method1(void, keyRelease, IN, Producer::KeyCharacter, key,
Properties::VIRTUAL,
__void__keyRelease__Producer_KeyCharacter,
"",
"");
I_Method1(void, specialKeyPress, IN, Producer::KeyCharacter, key,
Properties::VIRTUAL,
__void__specialKeyPress__Producer_KeyCharacter,
"",
"");
I_Method1(void, specialKeyRelease, IN, Producer::KeyCharacter, key,
Properties::VIRTUAL,
__void__specialKeyRelease__Producer_KeyCharacter,
"",
"");
I_Method4(void, windowConfig, IN, int, x, IN, int, y, IN, unsigned int, width, IN, unsigned int, height,
Properties::VIRTUAL,
__void__windowConfig__int__int__unsigned_int__unsigned_int,
"",
"");
I_Method0(void, shutdown,
Properties::VIRTUAL,
__void__shutdown,
"",
"");
I_Method1(void, setEscapeSetDone, IN, bool, esc,
Properties::NON_VIRTUAL,
__void__setEscapeSetDone__bool,
"",
"");
I_Method0(bool, getEscapeSetDone,
Properties::NON_VIRTUAL,
__bool__getEscapeSetDone,
"",
"");
I_Method1(void, setEventQueue, IN, osgGA::EventQueue *, eventQueue,
Properties::NON_VIRTUAL,
__void__setEventQueue__osgGA_EventQueue_P1,
"",
"");
I_Method0(osgGA::EventQueue *, getEventQueue,
Properties::NON_VIRTUAL,
__osgGA_EventQueue_P1__getEventQueue,
"",
"");
I_Method1(bool, takeEventQueue, IN, osgProducer::KeyboardMouseCallback::EventQueue &, queue,
Properties::NON_VIRTUAL,
__bool__takeEventQueue__EventQueue_R1,
"",
"");
I_Method1(bool, copyEventQueue, IN, osgProducer::KeyboardMouseCallback::EventQueue &, queue,
Properties::NON_VIRTUAL,
__bool__copyEventQueue__EventQueue_R1,
"",
"");
I_Method1(void, setEventQueue, IN, osgProducer::KeyboardMouseCallback::EventQueue &, queue,
Properties::NON_VIRTUAL,
__void__setEventQueue__EventQueue_R1,
"",
"");
I_Method1(void, appendEventQueue, IN, osgProducer::KeyboardMouseCallback::EventQueue &, queue,
Properties::NON_VIRTUAL,
__void__appendEventQueue__EventQueue_R1,
"",
"");
I_Method0(bool, done,
Properties::NON_VIRTUAL,
__bool__done,
"",
"");
I_Method0(double, getTime,
Properties::NON_VIRTUAL,
__double__getTime,
"",
"");
I_Method0(Producer::KeyboardMouse *, getKeyboardMouse,
Properties::NON_VIRTUAL,
__Producer_KeyboardMouse_P1__getKeyboardMouse,
"",
"");
I_Method0(const Producer::KeyboardMouse *, getKeyboardMouse,
Properties::NON_VIRTUAL,
__C5_Producer_KeyboardMouse_P1__getKeyboardMouse,
"",
"");
I_Method0(osgGA::GUIEventAdapter *, createEventAdapter,
Properties::NON_VIRTUAL,
__osgGA_GUIEventAdapter_P1__createEventAdapter,
"",
"");
I_Method0(void, updateWindowSize,
Properties::NON_VIRTUAL,
__void__updateWindowSize,
"",
"");
I_SimpleProperty(bool, EscapeSetDone,
__bool__getEscapeSetDone,
__void__setEscapeSetDone__bool);
I_SimpleProperty(osgGA::EventQueue *, EventQueue,
__osgGA_EventQueue_P1__getEventQueue,
__void__setEventQueue__osgGA_EventQueue_P1);
I_SimpleProperty(Producer::KeyboardMouse *, KeyboardMouse,
__Producer_KeyboardMouse_P1__getKeyboardMouse,
0);
I_SimpleProperty(double, Time,
__double__getTime,
0);
END_REFLECTOR

View File

@@ -1,408 +0,0 @@
// ***************************************************************************
//
// 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 <osg/ArgumentParser>
#include <osg/CullSettings>
#include <osg/DisplaySettings>
#include <osg/FrameStamp>
#include <osg/Group>
#include <osg/Matrixd>
#include <osg/Node>
#include <osg/StateSet>
#include <osg/Vec4>
#include <osgProducer/GraphicsContextImplementation>
#include <osgProducer/OsgCameraGroup>
#include <osgProducer/OsgSceneHandler>
#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(Producer::CameraGroup::ThreadModel, osgProducer::OsgCameraGroup::ThreadingModel);
TYPE_NAME_ALIAS(std::vector< osg::ref_ptr< osgProducer::GraphicsContextImplementation > >, osgProducer::OsgCameraGroup::GraphicsContextList);
TYPE_NAME_ALIAS(std::vector< Producer::ref_ptr< osgProducer::OsgSceneHandler > >, osgProducer::OsgCameraGroup::SceneHandlerList);
BEGIN_VALUE_REFLECTOR(osgProducer::OsgCameraGroup)
I_Constructor0(____OsgCameraGroup,
"",
"");
I_Constructor1(IN, Producer::CameraConfig *, cfg,
Properties::NON_EXPLICIT,
____OsgCameraGroup__Producer_CameraConfig_P1,
"",
"");
I_Constructor1(IN, const std::string &, configFile,
Properties::NON_EXPLICIT,
____OsgCameraGroup__C5_std_string_R1,
"",
"");
I_Constructor1(IN, osg::ArgumentParser &, arguments,
Properties::NON_EXPLICIT,
____OsgCameraGroup__osg_ArgumentParser_R1,
"",
"");
I_Method1(void, setApplicationUsage, IN, osg::ApplicationUsage *, au,
Properties::NON_VIRTUAL,
__void__setApplicationUsage__osg_ApplicationUsage_P1,
"",
"");
I_Method0(osg::ApplicationUsage *, getApplicationUsage,
Properties::NON_VIRTUAL,
__osg_ApplicationUsage_P1__getApplicationUsage,
"",
"");
I_Method0(const osg::ApplicationUsage *, getApplicationUsage,
Properties::NON_VIRTUAL,
__C5_osg_ApplicationUsage_P1__getApplicationUsage,
"",
"");
I_Method1(void, setGraphicsContextList, IN, osgProducer::OsgCameraGroup::GraphicsContextList &, gcList,
Properties::NON_VIRTUAL,
__void__setGraphicsContextList__GraphicsContextList_R1,
"",
"");
I_Method0(osgProducer::OsgCameraGroup::GraphicsContextList &, getGraphicsContextList,
Properties::NON_VIRTUAL,
__GraphicsContextList_R1__getGraphicsContextList,
"",
"");
I_Method0(const osgProducer::OsgCameraGroup::GraphicsContextList &, getGraphicsContextList,
Properties::NON_VIRTUAL,
__C5_GraphicsContextList_R1__getGraphicsContextList,
"",
"");
I_Method0(osgProducer::OsgCameraGroup::SceneHandlerList &, getSceneHandlerList,
Properties::NON_VIRTUAL,
__SceneHandlerList_R1__getSceneHandlerList,
"",
"");
I_Method0(const osgProducer::OsgCameraGroup::SceneHandlerList &, getSceneHandlerList,
Properties::NON_VIRTUAL,
__C5_SceneHandlerList_R1__getSceneHandlerList,
"",
"");
I_Method1(void, setSceneData, IN, osg::Node *, scene,
Properties::NON_VIRTUAL,
__void__setSceneData__osg_Node_P1,
"Set the scene data to be rendered. ",
" param scene The node to be used as the starting point during the rendering traversal of the scene graph. ");
I_Method0(osg::Node *, getSceneData,
Properties::NON_VIRTUAL,
__osg_Node_P1__getSceneData,
"Get the scene data being used for rendering. ",
"The node being used as the starting point during the rendering traversal of the scene graph. ");
I_Method0(const osg::Node *, getSceneData,
Properties::NON_VIRTUAL,
__C5_osg_Node_P1__getSceneData,
"",
"");
I_Method1(void, setSceneDecorator, IN, osg::Group *, decorator,
Properties::NON_VIRTUAL,
__void__setSceneDecorator__osg_Group_P1,
"",
"");
I_Method0(osg::Group *, getSceneDecorator,
Properties::NON_VIRTUAL,
__osg_Group_P1__getSceneDecorator,
"",
"");
I_Method0(const osg::Group *, getSceneDecorator,
Properties::NON_VIRTUAL,
__C5_osg_Group_P1__getSceneDecorator,
"",
"");
I_Method0(osg::Node *, getTopMostSceneData,
Properties::NON_VIRTUAL,
__osg_Node_P1__getTopMostSceneData,
"",
"");
I_Method0(const osg::Node *, getTopMostSceneData,
Properties::NON_VIRTUAL,
__C5_osg_Node_P1__getTopMostSceneData,
"",
"");
I_Method0(void, updatedSceneData,
Properties::VIRTUAL,
__void__updatedSceneData,
"Update internal structures w.r.t updated scene data. ",
"");
I_Method1(void, setDisplaySettings, IN, osg::DisplaySettings *, ds,
Properties::NON_VIRTUAL,
__void__setDisplaySettings__osg_DisplaySettings_P1,
"",
"");
I_Method0(osg::DisplaySettings *, getDisplaySettings,
Properties::NON_VIRTUAL,
__osg_DisplaySettings_P1__getDisplaySettings,
"",
"");
I_Method0(const osg::DisplaySettings *, getDisplaySettings,
Properties::NON_VIRTUAL,
__C5_osg_DisplaySettings_P1__getDisplaySettings,
"",
"");
I_Method1(void, setCullSettings, IN, const osg::CullSettings &, cs,
Properties::NON_VIRTUAL,
__void__setCullSettings__C5_osg_CullSettings_R1,
"",
"");
I_Method0(osg::CullSettings &, getCullSettings,
Properties::NON_VIRTUAL,
__osg_CullSettings_R1__getCullSettings,
"",
"");
I_Method0(const osg::CullSettings &, getCullSettings,
Properties::NON_VIRTUAL,
__C5_osg_CullSettings_R1__getCullSettings,
"",
"");
I_Method1(void, setFrameStamp, IN, osg::FrameStamp *, fs,
Properties::NON_VIRTUAL,
__void__setFrameStamp__osg_FrameStamp_P1,
"",
"");
I_Method0(osg::FrameStamp *, getFrameStamp,
Properties::NON_VIRTUAL,
__osg_FrameStamp_P1__getFrameStamp,
"",
"");
I_Method0(const osg::FrameStamp *, getFrameStamp,
Properties::NON_VIRTUAL,
__C5_osg_FrameStamp_P1__getFrameStamp,
"",
"");
I_Method1(void, setGlobalStateSet, IN, osg::StateSet *, sset,
Properties::NON_VIRTUAL,
__void__setGlobalStateSet__osg_StateSet_P1,
"",
"");
I_Method0(osg::StateSet *, getGlobalStateSet,
Properties::NON_VIRTUAL,
__osg_StateSet_P1__getGlobalStateSet,
"",
"");
I_Method0(const osg::StateSet *, getGlobalStateSet,
Properties::NON_VIRTUAL,
__C5_osg_StateSet_P1__getGlobalStateSet,
"",
"");
I_Method1(void, setClearColor, IN, const osg::Vec4 &, clearColor,
Properties::NON_VIRTUAL,
__void__setClearColor__C5_osg_Vec4_R1,
"",
"");
I_Method0(const osg::Vec4 &, getClearColor,
Properties::NON_VIRTUAL,
__C5_osg_Vec4_R1__getClearColor,
"",
"");
I_Method1(void, setLODScale, IN, float, scale,
Properties::NON_VIRTUAL,
__void__setLODScale__float,
"",
"");
I_Method0(float, getLODScale,
Properties::NON_VIRTUAL,
__float__getLODScale,
"",
"");
I_MethodWithDefaults2(void, setFusionDistance, IN, osgUtil::SceneView::FusionDistanceMode, mode, , IN, float, value, 1.0f,
Properties::NON_VIRTUAL,
__void__setFusionDistance__osgUtil_SceneView_FusionDistanceMode__float,
"",
"");
I_Method1(void, setRealizeSceneViewOptions, IN, unsigned int, options,
Properties::NON_VIRTUAL,
__void__setRealizeSceneViewOptions__unsigned_int,
"Set the options to set up SceneView with, see osgUtil::SceneView::Options for available options. ",
"");
I_Method0(unsigned int, getRealizeSceneViewOptions,
Properties::NON_VIRTUAL,
__unsigned_int__getRealizeSceneViewOptions,
"Get the options to set up SceneView with. ",
"");
I_Method1(void, setEnableProcessorAffinityHint, IN, bool, enableProccessAffinityHint,
Properties::NON_VIRTUAL,
__void__setEnableProcessorAffinityHint__bool,
"Set whether processor affinity should be enable where supported by hardware. ",
"");
I_Method0(bool, getEnableProcessorAffinityHint,
Properties::NON_VIRTUAL,
__bool__getEnableProcessorAffinityHint,
"Get whether processor affinity should be enable where supported by hardware. ",
"");
I_Method1(void, setRealizeCallback, IN, osgProducer::OsgCameraGroup::RealizeCallback *, cb,
Properties::NON_VIRTUAL,
__void__setRealizeCallback__RealizeCallback_P1,
"Set the realize callback to use when once the render surfaces are realized. ",
"");
I_Method0(osgProducer::OsgCameraGroup::RealizeCallback *, getRealizeCallback,
Properties::NON_VIRTUAL,
__RealizeCallback_P1__getRealizeCallback,
"Get the realize callback. ",
"");
I_Method0(const osgProducer::OsgCameraGroup::RealizeCallback *, getRealizeCallback,
Properties::NON_VIRTUAL,
__C5_RealizeCallback_P1__getRealizeCallback,
"Get the const realize callback. ",
"");
I_Method0(void, advance,
Properties::NON_VIRTUAL,
__void__advance,
"",
"");
I_Method1(bool, realize, IN, osgProducer::OsgCameraGroup::ThreadingModel, thread_model,
Properties::VIRTUAL,
__bool__realize__ThreadingModel,
"Set the threading model and then call realize(). ",
"");
I_Method0(bool, realize,
Properties::VIRTUAL,
__bool__realize,
"Realize the render surfaces (OpenGL graphics) and various threads, and call any realize callbacks. ",
"");
I_Method1(void, setView, IN, const osg::Matrixd &, matrix,
Properties::VIRTUAL,
__void__setView__C5_osg_Matrixd_R1,
"Set the model view matrix of the camera group, by individually set all the camera groups's camera. ",
"");
I_Method0(osg::Matrixd, getViewMatrix,
Properties::NON_VIRTUAL,
__osg_Matrixd__getViewMatrix,
"Get the model view martrix of the camera group, taking its value for camera 0. ",
"");
I_Method0(void, sync,
Properties::VIRTUAL,
__void__sync,
"",
"");
I_Method0(void, frame,
Properties::VIRTUAL,
__void__frame,
"Dispatch the cull and draw for each of the Camera's for this frame. ",
"");
I_Method0(void, cleanup_frame,
Properties::VIRTUAL,
__void__cleanup_frame,
"Dispatch a clean up frame that should be called before closing a OsgCameraGroup, i.e. ",
"on exit from an app. The clean up frame first release all GL objects associated with all the graphics context associated with the camera group, then runs a special frame that does the actual OpenGL deletion of GL objects for each graphics context. ");
I_SimpleProperty(osg::ApplicationUsage *, ApplicationUsage,
__osg_ApplicationUsage_P1__getApplicationUsage,
__void__setApplicationUsage__osg_ApplicationUsage_P1);
I_SimpleProperty(const osg::Vec4 &, ClearColor,
__C5_osg_Vec4_R1__getClearColor,
__void__setClearColor__C5_osg_Vec4_R1);
I_SimpleProperty(const osg::CullSettings &, CullSettings,
__C5_osg_CullSettings_R1__getCullSettings,
__void__setCullSettings__C5_osg_CullSettings_R1);
I_SimpleProperty(osg::DisplaySettings *, DisplaySettings,
__osg_DisplaySettings_P1__getDisplaySettings,
__void__setDisplaySettings__osg_DisplaySettings_P1);
I_SimpleProperty(bool, EnableProcessorAffinityHint,
__bool__getEnableProcessorAffinityHint,
__void__setEnableProcessorAffinityHint__bool);
I_SimpleProperty(osg::FrameStamp *, FrameStamp,
__osg_FrameStamp_P1__getFrameStamp,
__void__setFrameStamp__osg_FrameStamp_P1);
I_SimpleProperty(osg::StateSet *, GlobalStateSet,
__osg_StateSet_P1__getGlobalStateSet,
__void__setGlobalStateSet__osg_StateSet_P1);
I_SimpleProperty(osgProducer::OsgCameraGroup::GraphicsContextList &, GraphicsContextList,
__GraphicsContextList_R1__getGraphicsContextList,
__void__setGraphicsContextList__GraphicsContextList_R1);
I_SimpleProperty(float, LODScale,
__float__getLODScale,
__void__setLODScale__float);
I_SimpleProperty(osgProducer::OsgCameraGroup::RealizeCallback *, RealizeCallback,
__RealizeCallback_P1__getRealizeCallback,
__void__setRealizeCallback__RealizeCallback_P1);
I_SimpleProperty(unsigned int, RealizeSceneViewOptions,
__unsigned_int__getRealizeSceneViewOptions,
__void__setRealizeSceneViewOptions__unsigned_int);
I_SimpleProperty(osg::Node *, SceneData,
__osg_Node_P1__getSceneData,
__void__setSceneData__osg_Node_P1);
I_SimpleProperty(osg::Group *, SceneDecorator,
__osg_Group_P1__getSceneDecorator,
__void__setSceneDecorator__osg_Group_P1);
I_SimpleProperty(osgProducer::OsgCameraGroup::SceneHandlerList &, SceneHandlerList,
__SceneHandlerList_R1__getSceneHandlerList,
0);
I_SimpleProperty(osg::Node *, TopMostSceneData,
__osg_Node_P1__getTopMostSceneData,
0);
I_SimpleProperty(const osg::Matrixd &, View,
0,
__void__setView__C5_osg_Matrixd_R1);
I_SimpleProperty(osg::Matrixd, ViewMatrix,
__osg_Matrixd__getViewMatrix,
0);
END_REFLECTOR
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgProducer::OsgCameraGroup::RealizeCallback)
I_BaseType(osg::Referenced);
I_Constructor0(____RealizeCallback,
"",
"");
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgProducer::GraphicsContextImplementation >)
I_Constructor0(____ref_ptr,
"",
"");
I_Constructor1(IN, osgProducer::GraphicsContextImplementation *, ptr,
Properties::NON_EXPLICIT,
____ref_ptr__T_P1,
"",
"");
I_Constructor1(IN, const osg::ref_ptr< osgProducer::GraphicsContextImplementation > &, rp,
Properties::NON_EXPLICIT,
____ref_ptr__C5_ref_ptr_R1,
"",
"");
I_Method0(osgProducer::GraphicsContextImplementation *, get,
Properties::NON_VIRTUAL,
__T_P1__get,
"",
"");
I_Method0(bool, valid,
Properties::NON_VIRTUAL,
__bool__valid,
"",
"");
I_Method0(osgProducer::GraphicsContextImplementation *, release,
Properties::NON_VIRTUAL,
__T_P1__release,
"",
"");
I_Method1(void, swap, IN, osg::ref_ptr< osgProducer::GraphicsContextImplementation > &, rp,
Properties::NON_VIRTUAL,
__void__swap__ref_ptr_R1,
"",
"");
I_SimpleProperty(osgProducer::GraphicsContextImplementation *, ,
__T_P1__get,
0);
END_REFLECTOR
STD_VECTOR_REFLECTOR(std::vector< Producer::ref_ptr< osgProducer::OsgSceneHandler > >);
STD_VECTOR_REFLECTOR(std::vector< osg::ref_ptr< osgProducer::GraphicsContextImplementation > >);

View File

@@ -1,199 +0,0 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/DisplaySettings>
#include <osgProducer/OsgSceneHandler>
#include <osgUtil/SceneView>
#include <osgUtil/Statistics>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
BEGIN_OBJECT_REFLECTOR(osgProducer::OsgSceneHandler)
I_ConstructorWithDefaults1(IN, osg::DisplaySettings *, ds, NULL,
Properties::NON_EXPLICIT,
____OsgSceneHandler__osg_DisplaySettings_P1,
"",
"");
I_Method1(void, setSceneView, IN, osgUtil::SceneView *, sceneView,
Properties::NON_VIRTUAL,
__void__setSceneView__osgUtil_SceneView_P1,
"set the scene view to which will manage rendering of the OSG scene. ",
"");
I_Method0(osgUtil::SceneView *, getSceneView,
Properties::NON_VIRTUAL,
__osgUtil_SceneView_P1__getSceneView,
"get the scene view. ",
"");
I_Method0(const osgUtil::SceneView *, getSceneView,
Properties::NON_VIRTUAL,
__C5_osgUtil_SceneView_P1__getSceneView,
"get the const scene view. ",
"");
I_Method0(void, init,
Properties::VIRTUAL,
__void__init,
"override the init method to force it be run one at a time. ",
"");
I_Method1(void, clear, IN, Producer::Camera &, camera,
Properties::VIRTUAL,
__void__clear__Producer_Camera_R1,
"",
"");
I_Method1(void, clearImplementation, IN, Producer::Camera &, camera,
Properties::VIRTUAL,
__void__clearImplementation__Producer_Camera_R1,
"",
"");
I_Method1(void, setClearCallback, IN, osgProducer::OsgSceneHandler::Callback *, callback,
Properties::NON_VIRTUAL,
__void__setClearCallback__Callback_P1,
"",
"");
I_Method0(osgProducer::OsgSceneHandler::Callback *, getClearCallback,
Properties::NON_VIRTUAL,
__Callback_P1__getClearCallback,
"",
"");
I_Method0(const osgProducer::OsgSceneHandler::Callback *, getClearCallback,
Properties::NON_VIRTUAL,
__C5_Callback_P1__getClearCallback,
"",
"");
I_Method1(void, cull, IN, Producer::Camera &, camera,
Properties::VIRTUAL,
__void__cull__Producer_Camera_R1,
"",
"");
I_Method1(void, cullImplementation, IN, Producer::Camera &, camera,
Properties::VIRTUAL,
__void__cullImplementation__Producer_Camera_R1,
"",
"");
I_Method1(void, setCullCallback, IN, osgProducer::OsgSceneHandler::Callback *, callback,
Properties::NON_VIRTUAL,
__void__setCullCallback__Callback_P1,
"",
"");
I_Method0(osgProducer::OsgSceneHandler::Callback *, getCullCallback,
Properties::NON_VIRTUAL,
__Callback_P1__getCullCallback,
"",
"");
I_Method0(const osgProducer::OsgSceneHandler::Callback *, getCullCallback,
Properties::NON_VIRTUAL,
__C5_Callback_P1__getCullCallback,
"",
"");
I_Method1(void, draw, IN, Producer::Camera &, camera,
Properties::VIRTUAL,
__void__draw__Producer_Camera_R1,
"",
"");
I_Method1(void, drawImplementation, IN, Producer::Camera &, camera,
Properties::VIRTUAL,
__void__drawImplementation__Producer_Camera_R1,
"",
"");
I_Method1(void, setDrawCallback, IN, osgProducer::OsgSceneHandler::Callback *, callback,
Properties::NON_VIRTUAL,
__void__setDrawCallback__Callback_P1,
"",
"");
I_Method0(osgProducer::OsgSceneHandler::Callback *, getDrawCallback,
Properties::NON_VIRTUAL,
__Callback_P1__getDrawCallback,
"",
"");
I_Method0(const osgProducer::OsgSceneHandler::Callback *, getDrawCallback,
Properties::NON_VIRTUAL,
__C5_Callback_P1__getDrawCallback,
"",
"");
I_Method1(void, setCollectStats, IN, bool, collectStats,
Properties::NON_VIRTUAL,
__void__setCollectStats__bool,
"",
"");
I_Method0(bool, getCollectStats,
Properties::NON_VIRTUAL,
__bool__getCollectStats,
"",
"");
I_Method1(bool, getStats, IN, osgUtil::Statistics &, primStats,
Properties::NON_VIRTUAL,
__bool__getStats__osgUtil_Statistics_R1,
"",
"");
I_Method1(void, setContextID, IN, int, id,
Properties::NON_VIRTUAL,
__void__setContextID__int,
"",
"");
I_Method1(void, setFlushOfAllDeletedGLObjectsOnNextFrame, IN, bool, flag,
Properties::NON_VIRTUAL,
__void__setFlushOfAllDeletedGLObjectsOnNextFrame__bool,
"",
"");
I_Method0(bool, getFlushOfAllDeletedGLObjectsOnNextFrame,
Properties::NON_VIRTUAL,
__bool__getFlushOfAllDeletedGLObjectsOnNextFrame,
"",
"");
I_Method1(void, setCleanUpOnNextFrame, IN, bool, flag,
Properties::NON_VIRTUAL,
__void__setCleanUpOnNextFrame__bool,
"",
"");
I_Method0(bool, getCleanUpOnNextFrame,
Properties::NON_VIRTUAL,
__bool__getCleanUpOnNextFrame,
"",
"");
I_SimpleProperty(bool, CleanUpOnNextFrame,
__bool__getCleanUpOnNextFrame,
__void__setCleanUpOnNextFrame__bool);
I_SimpleProperty(osgProducer::OsgSceneHandler::Callback *, ClearCallback,
__Callback_P1__getClearCallback,
__void__setClearCallback__Callback_P1);
I_SimpleProperty(bool, CollectStats,
__bool__getCollectStats,
__void__setCollectStats__bool);
I_SimpleProperty(int, ContextID,
0,
__void__setContextID__int);
I_SimpleProperty(osgProducer::OsgSceneHandler::Callback *, CullCallback,
__Callback_P1__getCullCallback,
__void__setCullCallback__Callback_P1);
I_SimpleProperty(osgProducer::OsgSceneHandler::Callback *, DrawCallback,
__Callback_P1__getDrawCallback,
__void__setDrawCallback__Callback_P1);
I_SimpleProperty(bool, FlushOfAllDeletedGLObjectsOnNextFrame,
__bool__getFlushOfAllDeletedGLObjectsOnNextFrame,
__void__setFlushOfAllDeletedGLObjectsOnNextFrame__bool);
I_SimpleProperty(osgUtil::SceneView *, SceneView,
__osgUtil_SceneView_P1__getSceneView,
__void__setSceneView__osgUtil_SceneView_P1);
END_REFLECTOR
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgProducer::OsgSceneHandler::Callback)
I_BaseType(osg::Referenced);
I_Constructor0(____Callback,
"",
"");
END_REFLECTOR

View File

@@ -1,526 +0,0 @@
// ***************************************************************************
//
// Generated automatically by genwrapper.
// Please DO NOT EDIT this file!
//
// ***************************************************************************
#include <osgIntrospection/ReflectionMacros>
#include <osgIntrospection/TypedMethodInfo>
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <osg/AnimationPath>
#include <osg/ApplicationUsage>
#include <osg/ArgumentParser>
#include <osg/Node>
#include <osg/NodeVisitor>
#include <osg/Quat>
#include <osg/Vec3>
#include <osgGA/EventQueue>
#include <osgGA/EventVisitor>
#include <osgGA/GUIEventHandler>
#include <osgGA/KeySwitchMatrixManipulator>
#include <osgGA/MatrixManipulator>
#include <osgProducer/KeyboardMouseCallback>
#include <osgProducer/OsgCameraGroup>
#include <osgProducer/Viewer>
#include <osgUtil/IntersectVisitor>
// 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 > >, osgProducer::Viewer::EventHandlerList);
BEGIN_ENUM_REFLECTOR(osgProducer::Viewer::ViewerOptions)
I_EnumLabel(osgProducer::Viewer::NO_EVENT_HANDLERS);
I_EnumLabel(osgProducer::Viewer::TRACKBALL_MANIPULATOR);
I_EnumLabel(osgProducer::Viewer::DRIVE_MANIPULATOR);
I_EnumLabel(osgProducer::Viewer::FLIGHT_MANIPULATOR);
I_EnumLabel(osgProducer::Viewer::TERRAIN_MANIPULATOR);
I_EnumLabel(osgProducer::Viewer::UFO_MANIPULATOR);
I_EnumLabel(osgProducer::Viewer::STATE_MANIPULATOR);
I_EnumLabel(osgProducer::Viewer::HEAD_LIGHT_SOURCE);
I_EnumLabel(osgProducer::Viewer::SKY_LIGHT_SOURCE);
I_EnumLabel(osgProducer::Viewer::STATS_MANIPULATOR);
I_EnumLabel(osgProducer::Viewer::VIEWER_MANIPULATOR);
I_EnumLabel(osgProducer::Viewer::ESCAPE_SETS_DONE);
I_EnumLabel(osgProducer::Viewer::STANDARD_SETTINGS);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osgProducer::Viewer)
I_BaseType(osgProducer::OsgCameraGroup);
I_BaseType(osgGA::GUIActionAdapter);
I_Constructor0(____Viewer,
"",
"");
I_Constructor1(IN, Producer::CameraConfig *, cfg,
Properties::NON_EXPLICIT,
____Viewer__Producer_CameraConfig_P1,
"",
"");
I_Constructor1(IN, const std::string &, configFile,
Properties::NON_EXPLICIT,
____Viewer__C5_std_string_R1,
"",
"");
I_Constructor1(IN, osg::ArgumentParser &, arguments,
Properties::NON_EXPLICIT,
____Viewer__osg_ArgumentParser_R1,
"",
"");
I_MethodWithDefaults1(void, setUpViewer, IN, unsigned int, options, osgProducer::Viewer::STANDARD_SETTINGS,
Properties::NON_VIRTUAL,
__void__setUpViewer__unsigned_int,
"Set up the viewer, allowing to control some aspects of its behavior. ",
" param options One or more of the options defined by the ViewerOptions enumeration, combined using the bitwise OR operator (``|''). ");
I_Method1(void, setDoneAtElapsedTime, IN, double, elapsedTime,
Properties::NON_VIRTUAL,
__void__setDoneAtElapsedTime__double,
"Set the viewer so it sets done to true once the refrence time equals or exceeds specified elapsed time. ",
"Automatically does a setDoneAtElapsedTimeEnabled(true). ");
I_Method0(double, getDoneAtElapsedTime,
Properties::NON_VIRTUAL,
__double__getDoneAtElapsedTime,
"Get the elapsed time that will cause done to be set to be true. ",
"");
I_Method1(void, setDoneAtElapsedTimeEnabled, IN, bool, enabled,
Properties::NON_VIRTUAL,
__void__setDoneAtElapsedTimeEnabled__bool,
"Set whether to use a elapsed time to limit the run of the viewer. ",
"");
I_Method0(bool, getDoneAtElapsedTimeEnabled,
Properties::NON_VIRTUAL,
__bool__getDoneAtElapsedTimeEnabled,
"Get whether to use a elapsed time to limit the run of the viewer. ",
"");
I_Method1(void, setDoneAtFrameNumber, IN, unsigned int, frameNumber,
Properties::NON_VIRTUAL,
__void__setDoneAtFrameNumber__unsigned_int,
"Set the viewer so it sets done to true once the frame number equals or exceeds specified frame number. ",
"Automatically does a setDoneAtFrameNumberEnabled(true). ");
I_Method0(unsigned int, getDoneAtFrameNumber,
Properties::NON_VIRTUAL,
__unsigned_int__getDoneAtFrameNumber,
"Get the frame number that will cause done to be set to be true. ",
"");
I_Method1(void, setDoneAtFrameNumberEnabled, IN, bool, enabled,
Properties::NON_VIRTUAL,
__void__setDoneAtFrameNumberEnabled__bool,
"Set whether to use a frame number to limit the run of the viewer. ",
"");
I_Method0(bool, getDoneAtFrameNumberEnabled,
Properties::NON_VIRTUAL,
__bool__getDoneAtFrameNumberEnabled,
"Get whether to use a frame number to limit the run of the viewer. ",
"");
I_Method1(void, setDone, IN, bool, done,
Properties::NON_VIRTUAL,
__void__setDone__bool,
"Set the done flag signalling that the viewer exit. ",
"");
I_Method0(bool, getDone,
Properties::NON_VIRTUAL,
__bool__getDone,
"Get the done flag which signals that the viewer exit. ",
"");
I_Method0(bool, done,
Properties::VIRTUAL,
__bool__done,
"Return true if the application is done and should exit. ",
"");
I_Method1(void, setWriteImageWhenDone, IN, bool, enabled,
Properties::NON_VIRTUAL,
__void__setWriteImageWhenDone__bool,
"Set the viewer to take an image snapshot on the last frame() when done is enabled. ",
"");
I_Method0(bool, getWriteImageWhenDone,
Properties::NON_VIRTUAL,
__bool__getWriteImageWhenDone,
"Set the viewer to take an image snapshot on the last frame() when done is enabled. ",
"");
I_Method1(void, setWriteImageFileName, IN, const std::string &, filename,
Properties::NON_VIRTUAL,
__void__setWriteImageFileName__C5_std_string_R1,
"Set the filename to write to when the viewer takes an image snapshot on the last frame() when done is enabled. ",
"");
I_Method0(const std::string &, getWriteImageFileName,
Properties::NON_VIRTUAL,
__C5_std_string_R1__getWriteImageFileName,
"Get the filename to write to when the viewer takes an image snapshot on the last frame() when done is enabled. ",
"");
I_Method1(void, setViewByMatrix, IN, const Producer::Matrix &, pm,
Properties::VIRTUAL,
__void__setViewByMatrix__C5_Producer_Matrix_R1,
"Override the Producer::CameraGroup::setViewByMatrix to catch all changes to view. ",
"");
I_Method1(bool, realize, IN, osgProducer::OsgCameraGroup::ThreadingModel, thread_model,
Properties::VIRTUAL,
__bool__realize__ThreadingModel,
"Set the threading model and then call realize(). ",
"");
I_Method0(bool, realize,
Properties::VIRTUAL,
__bool__realize,
"Realize the render surfaces (OpenGL graphics) and various threads, and call any realize callbacks. ",
"");
I_Method0(void, update,
Properties::VIRTUAL,
__void__update,
"Updated the scene. ",
"Handle any queued up events, do an update traversal and set the CameraGroup's setViewByMatrix if any camera manipulators are active. ");
I_Method1(void, setUpdateVisitor, IN, osg::NodeVisitor *, nv,
Properties::NON_VIRTUAL,
__void__setUpdateVisitor__osg_NodeVisitor_P1,
"Set the update visitor which does the update traversal of the scene graph. ",
"Automatically called by the update() method. ");
I_Method0(osg::NodeVisitor *, getUpdateVisitor,
Properties::NON_VIRTUAL,
__osg_NodeVisitor_P1__getUpdateVisitor,
"Get the update visitor. ",
"");
I_Method0(const osg::NodeVisitor *, getUpdateVisitor,
Properties::NON_VIRTUAL,
__C5_osg_NodeVisitor_P1__getUpdateVisitor,
"Get the const update visitor. ",
"");
I_Method1(void, setEventVisitor, IN, osgGA::EventVisitor *, nv,
Properties::NON_VIRTUAL,
__void__setEventVisitor__osgGA_EventVisitor_P1,
"Set the update visitor which does the event traversal of the scene graph. ",
"Automatically called by the update() method. ");
I_Method0(osgGA::EventVisitor *, getEventVisitor,
Properties::NON_VIRTUAL,
__osgGA_EventVisitor_P1__getEventVisitor,
"Get the update visitor. ",
"");
I_Method0(const osgGA::EventVisitor *, getEventVisitor,
Properties::NON_VIRTUAL,
__C5_osgGA_EventVisitor_P1__getEventVisitor,
"Get the const update visitor. ",
"");
I_Method0(void, computeActiveCoordinateSystemNodePath,
Properties::NON_VIRTUAL,
__void__computeActiveCoordinateSystemNodePath,
"",
"");
I_Method1(void, setCoordinateSystemNodePath, IN, const osg::NodePath &, nodePath,
Properties::NON_VIRTUAL,
__void__setCoordinateSystemNodePath__C5_osg_NodePath_R1,
"",
"");
I_Method0(osg::NodePath, getCoordinateSystemNodePath,
Properties::NON_VIRTUAL,
__osg_NodePath__getCoordinateSystemNodePath,
"",
"");
I_Method0(void, frame,
Properties::VIRTUAL,
__void__frame,
"Dispatch the cull and draw for each of the Camera's for this frame. ",
"");
I_Method0(void, requestRedraw,
Properties::VIRTUAL,
__void__requestRedraw,
"requestRedraw() requests a single redraw. ",
"");
I_Method1(void, requestContinuousUpdate, IN, bool, x,
Properties::VIRTUAL,
__void__requestContinuousUpdate__bool,
"requestContinousUpdate(bool) is for en/disabling a throw or idle callback to be requested by a GUIEventHandler (typically a MatrixManipulator, though other GUIEventHandler's may also provide functionality). ",
"GUI toolkits can respond to this immediately by registering an idle/timed callback, or can delay setting the callback and update at their own leisure.");
I_Method2(void, requestWarpPointer, IN, float, x, IN, float, y,
Properties::VIRTUAL,
__void__requestWarpPointer__float__float,
"requestWarpPointer(int,int) is requesting a repositioning of the mouse pointer to a specified x,y location on the window. ",
"This is used by some camera manipulators to initialise the mouse pointer when mouse position relative to a controls neutral mouse position is required, i.e when mimicking a aircrafts joystick.");
I_Method5(bool, computePixelCoords, IN, float, x, IN, float, y, IN, unsigned int, cameraNum, IN, float &, pixel_x, IN, float &, pixel_y,
Properties::NON_VIRTUAL,
__bool__computePixelCoords__float__float__unsigned_int__float_R1__float_R1,
"Compute, from normalized mouse coords, for sepecified Camera, the pixel coords relative to that Camera's RenderSurface. ",
"");
I_Method5(bool, computeNearFarPoints, IN, float, x, IN, float, y, IN, unsigned int, cameraNum, IN, osg::Vec3 &, near, IN, osg::Vec3 &, far,
Properties::NON_VIRTUAL,
__bool__computeNearFarPoints__float__float__unsigned_int__osg_Vec3_R1__osg_Vec3_R1,
"Compute, from normalized mouse coords, for sepecified Camera, the near and far points in worlds coords. ",
"");
I_MethodWithDefaults6(bool, computeIntersections, IN, float, x, , IN, float, y, , IN, unsigned int, cameraNum, , IN, osg::Node *, node, , IN, osgUtil::IntersectVisitor::HitList &, hits, , IN, osg::Node::NodeMask, traversalMask, 0xffffffff,
Properties::NON_VIRTUAL,
__bool__computeIntersections__float__float__unsigned_int__osg_Node_P1__osgUtil_IntersectVisitor_HitList_R1__osg_Node_NodeMask,
"Compute, from normalized mouse coords, for all Cameras, intersections with the specified subgraph. ",
"");
I_MethodWithDefaults5(bool, computeIntersections, IN, float, x, , IN, float, y, , IN, unsigned int, cameraNum, , IN, osgUtil::IntersectVisitor::HitList &, hits, , IN, osg::Node::NodeMask, traversalMask, 0xffffffff,
Properties::NON_VIRTUAL,
__bool__computeIntersections__float__float__unsigned_int__osgUtil_IntersectVisitor_HitList_R1__osg_Node_NodeMask,
"Compute, from normalized mouse coords, for sepecified Camera, intersections with the scene. ",
"");
I_MethodWithDefaults5(bool, computeIntersections, IN, float, x, , IN, float, y, , IN, osg::Node *, node, , IN, osgUtil::IntersectVisitor::HitList &, hits, , IN, osg::Node::NodeMask, traversalMask, 0xffffffff,
Properties::NON_VIRTUAL,
__bool__computeIntersections__float__float__osg_Node_P1__osgUtil_IntersectVisitor_HitList_R1__osg_Node_NodeMask,
"Compute, from normalized mouse coords, for all Cameras, intersections with specified subgraph. ",
"");
I_MethodWithDefaults4(bool, computeIntersections, IN, float, x, , IN, float, y, , IN, osgUtil::IntersectVisitor::HitList &, hits, , IN, osg::Node::NodeMask, traversalMask, 0xffffffff,
Properties::NON_VIRTUAL,
__bool__computeIntersections__float__float__osgUtil_IntersectVisitor_HitList_R1__osg_Node_NodeMask,
"Compute, from normalized mouse coords, for all Cameras, intersections with the scene. ",
"");
I_Method1(void, setEventQueue, IN, osgGA::EventQueue *, eventQueue,
Properties::NON_VIRTUAL,
__void__setEventQueue__osgGA_EventQueue_P1,
"Set the EventQueue - a thread safe queue for registering events. ",
"");
I_Method0(osgGA::EventQueue *, getEventQueue,
Properties::NON_VIRTUAL,
__osgGA_EventQueue_P1__getEventQueue,
"Get the EventQueue. ",
"");
I_Method1(void, setKeyboardMouse, IN, Producer::KeyboardMouse *, kbm,
Properties::NON_VIRTUAL,
__void__setKeyboardMouse__Producer_KeyboardMouse_P1,
"",
"");
I_Method0(Producer::KeyboardMouse *, getKeyboardMouse,
Properties::NON_VIRTUAL,
__Producer_KeyboardMouse_P1__getKeyboardMouse,
"",
"");
I_Method0(const Producer::KeyboardMouse *, getKeyboardMouse,
Properties::NON_VIRTUAL,
__C5_Producer_KeyboardMouse_P1__getKeyboardMouse,
"",
"");
I_Method1(void, setKeyboardMouseCallback, IN, osgProducer::KeyboardMouseCallback *, kbmcb,
Properties::NON_VIRTUAL,
__void__setKeyboardMouseCallback__osgProducer_KeyboardMouseCallback_P1,
"",
"");
I_Method0(osgProducer::KeyboardMouseCallback *, getKeyboardMouseCallback,
Properties::NON_VIRTUAL,
__osgProducer_KeyboardMouseCallback_P1__getKeyboardMouseCallback,
"",
"");
I_Method0(const osgProducer::KeyboardMouseCallback *, getKeyboardMouseCallback,
Properties::NON_VIRTUAL,
__C5_osgProducer_KeyboardMouseCallback_P1__getKeyboardMouseCallback,
"",
"");
I_Method0(osgProducer::Viewer::EventHandlerList &, getEventHandlerList,
Properties::NON_VIRTUAL,
__EventHandlerList_R1__getEventHandlerList,
"",
"");
I_Method0(const osgProducer::Viewer::EventHandlerList &, getEventHandlerList,
Properties::NON_VIRTUAL,
__C5_EventHandlerList_R1__getEventHandlerList,
"",
"");
I_Method0(osgGA::KeySwitchMatrixManipulator *, getKeySwitchMatrixManipulator,
Properties::NON_VIRTUAL,
__osgGA_KeySwitchMatrixManipulator_P1__getKeySwitchMatrixManipulator,
"",
"");
I_Method0(const osgGA::KeySwitchMatrixManipulator *, getKeySwitchMatrixManipulator,
Properties::NON_VIRTUAL,
__C5_osgGA_KeySwitchMatrixManipulator_P1__getKeySwitchMatrixManipulator,
"",
"");
I_Method1(unsigned int, addCameraManipulator, IN, osgGA::MatrixManipulator *, cm,
Properties::NON_VIRTUAL,
__unsigned_int__addCameraManipulator__osgGA_MatrixManipulator_P1,
"",
"");
I_Method1(void, selectCameraManipulator, IN, unsigned int, no,
Properties::NON_VIRTUAL,
__void__selectCameraManipulator__unsigned_int,
"",
"");
I_Method1(void, getCameraManipulatorNameList, IN, std::list< std::string > &, nameList,
Properties::NON_VIRTUAL,
__void__getCameraManipulatorNameList__std_listT1_std_string__R1,
"",
"");
I_Method1(bool, selectCameraManipulatorByName, IN, const std::string &, name,
Properties::NON_VIRTUAL,
__bool__selectCameraManipulatorByName__C5_std_string_R1,
"",
"");
I_Method1(osgGA::MatrixManipulator *, getCameraManipulatorByName, IN, const std::string &, name,
Properties::NON_VIRTUAL,
__osgGA_MatrixManipulator_P1__getCameraManipulatorByName__C5_std_string_R1,
"",
"");
I_Method1(void, setRecordingAnimationPath, IN, bool, on,
Properties::NON_VIRTUAL,
__void__setRecordingAnimationPath__bool,
"",
"");
I_Method0(bool, getRecordingAnimationPath,
Properties::NON_VIRTUAL,
__bool__getRecordingAnimationPath,
"",
"");
I_Method1(void, setAnimationPath, IN, osg::AnimationPath *, path,
Properties::NON_VIRTUAL,
__void__setAnimationPath__osg_AnimationPath_P1,
"",
"");
I_Method0(osg::AnimationPath *, getAnimationPath,
Properties::NON_VIRTUAL,
__osg_AnimationPath_P1__getAnimationPath,
"",
"");
I_Method0(const osg::AnimationPath *, getAnimationPath,
Properties::NON_VIRTUAL,
__C5_osg_AnimationPath_P1__getAnimationPath,
"",
"");
I_Method0(const double *, getPosition,
Properties::NON_VIRTUAL,
__C5_double_P1__getPosition,
"",
"");
I_Method0(double, getSpeed,
Properties::NON_VIRTUAL,
__double__getSpeed,
"",
"");
I_Method0(osg::Quat, getOrientation,
Properties::NON_VIRTUAL,
__osg_Quat__getOrientation,
"",
"");
I_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage,
Properties::VIRTUAL,
__void__getUsage__osg_ApplicationUsage_R1,
"Get the keyboard and mouse usage of this viewer. ",
"");
I_Method0(void, updatedSceneData,
Properties::VIRTUAL,
__void__updatedSceneData,
"Update internal structures w.r.t updated scene data. ",
"");
I_Method0(void, cleanup_frame,
Properties::VIRTUAL,
__void__cleanup_frame,
"Dispatch a clean up frame that should be called before closing a OsgCameraGroup, i.e. ",
"on exit from an app. The clean up frame first release all GL objects associated with all the graphics context associated with the camera group, then runs a special frame that does the actual OpenGL deletion of GL objects for each graphics context. ");
I_StaticMethod0(const char *, getDefaultImageFileName,
__C5_char_P1__getDefaultImageFileName_S,
"Get the default filename for writing an image snapshot. ",
"");
I_SimpleProperty(osg::AnimationPath *, AnimationPath,
__osg_AnimationPath_P1__getAnimationPath,
__void__setAnimationPath__osg_AnimationPath_P1);
I_SimpleProperty(osg::NodePath, CoordinateSystemNodePath,
__osg_NodePath__getCoordinateSystemNodePath,
__void__setCoordinateSystemNodePath__C5_osg_NodePath_R1);
I_SimpleProperty(bool, Done,
__bool__getDone,
__void__setDone__bool);
I_SimpleProperty(double, DoneAtElapsedTime,
__double__getDoneAtElapsedTime,
__void__setDoneAtElapsedTime__double);
I_SimpleProperty(bool, DoneAtElapsedTimeEnabled,
__bool__getDoneAtElapsedTimeEnabled,
__void__setDoneAtElapsedTimeEnabled__bool);
I_SimpleProperty(unsigned int, DoneAtFrameNumber,
__unsigned_int__getDoneAtFrameNumber,
__void__setDoneAtFrameNumber__unsigned_int);
I_SimpleProperty(bool, DoneAtFrameNumberEnabled,
__bool__getDoneAtFrameNumberEnabled,
__void__setDoneAtFrameNumberEnabled__bool);
I_SimpleProperty(osgProducer::Viewer::EventHandlerList &, EventHandlerList,
__EventHandlerList_R1__getEventHandlerList,
0);
I_SimpleProperty(osgGA::EventQueue *, EventQueue,
__osgGA_EventQueue_P1__getEventQueue,
__void__setEventQueue__osgGA_EventQueue_P1);
I_SimpleProperty(osgGA::EventVisitor *, EventVisitor,
__osgGA_EventVisitor_P1__getEventVisitor,
__void__setEventVisitor__osgGA_EventVisitor_P1);
I_SimpleProperty(osgGA::KeySwitchMatrixManipulator *, KeySwitchMatrixManipulator,
__osgGA_KeySwitchMatrixManipulator_P1__getKeySwitchMatrixManipulator,
0);
I_SimpleProperty(Producer::KeyboardMouse *, KeyboardMouse,
__Producer_KeyboardMouse_P1__getKeyboardMouse,
__void__setKeyboardMouse__Producer_KeyboardMouse_P1);
I_SimpleProperty(osgProducer::KeyboardMouseCallback *, KeyboardMouseCallback,
__osgProducer_KeyboardMouseCallback_P1__getKeyboardMouseCallback,
__void__setKeyboardMouseCallback__osgProducer_KeyboardMouseCallback_P1);
I_SimpleProperty(osg::Quat, Orientation,
__osg_Quat__getOrientation,
0);
I_SimpleProperty(const double *, Position,
__C5_double_P1__getPosition,
0);
I_SimpleProperty(bool, RecordingAnimationPath,
__bool__getRecordingAnimationPath,
__void__setRecordingAnimationPath__bool);
I_SimpleProperty(double, Speed,
__double__getSpeed,
0);
I_SimpleProperty(unsigned int, UpViewer,
0,
__void__setUpViewer__unsigned_int);
I_SimpleProperty(osg::NodeVisitor *, UpdateVisitor,
__osg_NodeVisitor_P1__getUpdateVisitor,
__void__setUpdateVisitor__osg_NodeVisitor_P1);
I_SimpleProperty(const Producer::Matrix &, ViewByMatrix,
0,
__void__setViewByMatrix__C5_Producer_Matrix_R1);
I_SimpleProperty(const std::string &, WriteImageFileName,
__C5_std_string_R1__getWriteImageFileName,
__void__setWriteImageFileName__C5_std_string_R1);
I_SimpleProperty(bool, WriteImageWhenDone,
__bool__getWriteImageWhenDone,
__void__setWriteImageWhenDone__bool);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgGA::GUIEventHandler >)
I_Constructor0(____ref_ptr,
"",
"");
I_Constructor1(IN, osgGA::GUIEventHandler *, ptr,
Properties::NON_EXPLICIT,
____ref_ptr__T_P1,
"",
"");
I_Constructor1(IN, const osg::ref_ptr< osgGA::GUIEventHandler > &, rp,
Properties::NON_EXPLICIT,
____ref_ptr__C5_ref_ptr_R1,
"",
"");
I_Method0(osgGA::GUIEventHandler *, get,
Properties::NON_VIRTUAL,
__T_P1__get,
"",
"");
I_Method0(bool, valid,
Properties::NON_VIRTUAL,
__bool__valid,
"",
"");
I_Method0(osgGA::GUIEventHandler *, release,
Properties::NON_VIRTUAL,
__T_P1__release,
"",
"");
I_Method1(void, swap, IN, osg::ref_ptr< osgGA::GUIEventHandler > &, rp,
Properties::NON_VIRTUAL,
__void__swap__ref_ptr_R1,
"",
"");
I_SimpleProperty(osgGA::GUIEventHandler *, ,
__T_P1__get,
0);
END_REFLECTOR
STD_LIST_REFLECTOR(std::list< osg::ref_ptr< osgGA::GUIEventHandler > >);
STD_LIST_REFLECTOR(std::list< std::string >);

View File

@@ -1,131 +0,0 @@
// ***************************************************************************
//
// 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 <osg/State>
#include <osgGA/GUIActionAdapter>
#include <osgGA/GUIEventAdapter>
#include <osgProducer/OsgCameraGroup>
#include <osgProducer/ViewerEventHandler>
// Must undefine IN and OUT macros defined in Windows headers
#ifdef IN
#undef IN
#endif
#ifdef OUT
#undef OUT
#endif
BEGIN_ENUM_REFLECTOR(osgProducer::ViewerEventHandler::FrameStatsMode)
I_EnumLabel(osgProducer::ViewerEventHandler::NO_STATS);
I_EnumLabel(osgProducer::ViewerEventHandler::FRAME_RATE);
I_EnumLabel(osgProducer::ViewerEventHandler::CAMERA_STATS);
I_EnumLabel(osgProducer::ViewerEventHandler::SCENE_STATS);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osgProducer::ViewerEventHandler)
I_BaseType(osgGA::GUIEventHandler);
I_Constructor1(IN, osgProducer::OsgCameraGroup *, cg,
Properties::NON_EXPLICIT,
____ViewerEventHandler__OsgCameraGroup_P1,
"",
"");
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_Method1(void, getUsage, IN, osg::ApplicationUsage &, usage,
Properties::VIRTUAL,
__void__getUsage__osg_ApplicationUsage_R1,
"Get the keyboard and mouse usage of this manipulator. ",
"");
I_Method0(osgProducer::OsgCameraGroup *, getOsgCameraGroup,
Properties::NON_VIRTUAL,
__OsgCameraGroup_P1__getOsgCameraGroup,
"",
"");
I_Method0(const osgProducer::OsgCameraGroup *, getOsgCameraGroup,
Properties::NON_VIRTUAL,
__C5_OsgCameraGroup_P1__getOsgCameraGroup,
"",
"");
I_Method1(void, setWriteNodeFileName, IN, const std::string &, filename,
Properties::NON_VIRTUAL,
__void__setWriteNodeFileName__C5_std_string_R1,
"",
"");
I_Method0(const std::string &, getWriteNodeFileName,
Properties::NON_VIRTUAL,
__C5_std_string_R1__getWriteNodeFileName,
"",
"");
I_Method1(void, setDisplayHelp, IN, bool, displayHelp,
Properties::NON_VIRTUAL,
__void__setDisplayHelp__bool,
"",
"");
I_Method0(bool, getDisplayHelp,
Properties::NON_VIRTUAL,
__bool__getDisplayHelp,
"",
"");
I_Method1(void, setFrameStatsMode, IN, osgProducer::ViewerEventHandler::FrameStatsMode, mode,
Properties::NON_VIRTUAL,
__void__setFrameStatsMode__FrameStatsMode,
"",
"");
I_Method0(osgProducer::ViewerEventHandler::FrameStatsMode, getFrameStatsMode,
Properties::NON_VIRTUAL,
__FrameStatsMode__getFrameStatsMode,
"",
"");
I_Method1(void, setWriteImageOnNextFrame, IN, bool, writeImageOnNextFrame,
Properties::NON_VIRTUAL,
__void__setWriteImageOnNextFrame__bool,
"",
"");
I_Method1(void, setWriteImageFileName, IN, const std::string &, filename,
Properties::NON_VIRTUAL,
__void__setWriteImageFileName__C5_std_string_R1,
"",
"");
I_Method0(const std::string &, getWriteImageFileName,
Properties::NON_VIRTUAL,
__C5_std_string_R1__getWriteImageFileName,
"",
"");
I_MethodWithDefaults1(void, releaseGLObjects, IN, osg::State *, x, 0,
Properties::VIRTUAL,
__void__releaseGLObjects__osg_State_P1,
"release OpenGL objects in specified graphics context if State object is passed, otherwise release OpenGL objexts for all graphics context if State object pointer NULL. ",
"");
I_SimpleProperty(bool, DisplayHelp,
__bool__getDisplayHelp,
__void__setDisplayHelp__bool);
I_SimpleProperty(osgProducer::ViewerEventHandler::FrameStatsMode, FrameStatsMode,
__FrameStatsMode__getFrameStatsMode,
__void__setFrameStatsMode__FrameStatsMode);
I_SimpleProperty(osgProducer::OsgCameraGroup *, OsgCameraGroup,
__OsgCameraGroup_P1__getOsgCameraGroup,
0);
I_SimpleProperty(const std::string &, WriteImageFileName,
__C5_std_string_R1__getWriteImageFileName,
__void__setWriteImageFileName__C5_std_string_R1);
I_SimpleProperty(bool, WriteImageOnNextFrame,
0,
__void__setWriteImageOnNextFrame__bool);
I_SimpleProperty(const std::string &, WriteNodeFileName,
__C5_std_string_R1__getWriteNodeFileName,
__void__setWriteNodeFileName__C5_std_string_R1);
END_REFLECTOR

View File

@@ -173,3 +173,44 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgViewer::SimpleViewer)
0);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgGA::GUIEventHandler >)
I_Constructor0(____ref_ptr,
"",
"");
I_Constructor1(IN, osgGA::GUIEventHandler *, ptr,
Properties::NON_EXPLICIT,
____ref_ptr__T_P1,
"",
"");
I_Constructor1(IN, const osg::ref_ptr< osgGA::GUIEventHandler > &, rp,
Properties::NON_EXPLICIT,
____ref_ptr__C5_ref_ptr_R1,
"",
"");
I_Method0(osgGA::GUIEventHandler *, get,
Properties::NON_VIRTUAL,
__T_P1__get,
"",
"");
I_Method0(bool, valid,
Properties::NON_VIRTUAL,
__bool__valid,
"",
"");
I_Method0(osgGA::GUIEventHandler *, release,
Properties::NON_VIRTUAL,
__T_P1__release,
"",
"");
I_Method1(void, swap, IN, osg::ref_ptr< osgGA::GUIEventHandler > &, rp,
Properties::NON_VIRTUAL,
__void__swap__ref_ptr_R1,
"",
"");
I_SimpleProperty(osgGA::GUIEventHandler *, ,
__T_P1__get,
0);
END_REFLECTOR
STD_LIST_REFLECTOR(std::list< osg::ref_ptr< osgGA::GUIEventHandler > >);

View File

@@ -11,8 +11,10 @@
#include <osgIntrospection/Attributes>
#include <osg/Camera>
#include <osg/CopyOp>
#include <osg/DisplaySettings>
#include <osg/Node>
#include <osg/Object>
#include <osg/State>
#include <osgGA/EventQueue>
#include <osgGA/GUIEventHandler>
@@ -74,6 +76,35 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::View)
I_Constructor0(____View,
"",
"");
I_ConstructorWithDefaults2(IN, const osgViewer::View &, view, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
____View__C5_osgViewer_View_R1__C5_osg_CopyOp_R1,
"",
"");
I_Method0(osg::Object *, cloneType,
Properties::VIRTUAL,
__osg_Object_P1__cloneType,
"Clone the type of an object, with Object* return type. ",
"Must be defined by derived classes. ");
I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, copyop,
Properties::VIRTUAL,
__osg_Object_P1__clone__C5_osg_CopyOp_R1,
"Clone an object, with Object* return type. ",
"Must be defined by derived classes. ");
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
Properties::VIRTUAL,
__bool__isSameKindAs__C5_osg_Object_P1,
"",
"");
I_Method0(const char *, libraryName,
Properties::VIRTUAL,
__C5_char_P1__libraryName,
"return the name of the object's library. ",
"Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. ");
I_Method0(const char *, className,
Properties::VIRTUAL,
__C5_char_P1__className,
"return the name of the object's class type. ",
"Must be defined by derived classes. ");
I_Method0(osgViewer::Scene *, getScene,
Properties::NON_VIRTUAL,
__Scene_P1__getScene,