Updated wrappers

This commit is contained in:
Robert Osfield 2009-03-09 16:17:57 +00:00
parent 173357252b
commit f4b7a5b274
3 changed files with 313 additions and 0 deletions

View File

@ -268,6 +268,13 @@ void IncrementalCompileOperation::add(osg::Group* attachmentPoint, osg::Node* su
void IncrementalCompileOperation::add(CompileSet* compileSet, bool callBuildCompileMap)
{
if (!compileSet) return;
if (compileSet->_subgraphToCompile.valid())
{
// force a compute of the bound of the subgraph to avoid the update traversal from having to do this work
// and reducing the change of frame drop.
compileSet->_subgraphToCompile->getBound();
}
if (callBuildCompileMap) compileSet->buildCompileMap(_contexts);
@ -467,6 +474,8 @@ void IncrementalCompileOperation::operator () (osg::GraphicsContext* context)
osg::notify(osg::NOTICE)<<"cd._programs.size()="<<cd._programs.size()<<std::endl;
osg::Timer_t startTick = osg::Timer::instance()->tick();
// be extremely conservative right now during testing, just provide 1ms for doing compile.
double maxTimeAvailable = 0.001;
while(!cd._drawables.empty() &&

View File

@ -10,13 +10,17 @@
#include <osgIntrospection/StaticMethodInfo>
#include <osgIntrospection/Attributes>
#include <OpenThreads/Mutex>
#include <osg/Drawable>
#include <osg/Geode>
#include <osg/GraphicsContext>
#include <osg/Group>
#include <osg/Node>
#include <osg/Program>
#include <osg/RenderInfo>
#include <osg/State>
#include <osg/StateSet>
#include <osg/Texture>
#include <osgUtil/GLObjectsVisitor>
// Must undefine IN and OUT macros defined in Windows headers
@ -140,3 +144,289 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::GLObjectsVisitor)
__void__setState__osg_State_P1);
END_REFLECTOR
TYPE_NAME_ALIAS(std::vector< osg::GraphicsContext * >, osgUtil::IncrementalCompileOperation::Contexts)
TYPE_NAME_ALIAS(std::set< osg::GraphicsContext * >, osgUtil::IncrementalCompileOperation::ContextSet)
TYPE_NAME_ALIAS(std::map< osg::GraphicsContext * COMMA osgUtil::IncrementalCompileOperation::CompileData >, osgUtil::IncrementalCompileOperation::CompileMap)
TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osgUtil::IncrementalCompileOperation::CompileSet > >, osgUtil::IncrementalCompileOperation::CompileSets)
BEGIN_OBJECT_REFLECTOR(osgUtil::IncrementalCompileOperation)
I_DeclaringFile("osgUtil/GLObjectsVisitor");
I_BaseType(osg::GraphicsOperation);
I_Constructor0(____IncrementalCompileOperation,
"",
"");
I_Method1(void, assignContexts, IN, osgUtil::IncrementalCompileOperation::Contexts &, contexts,
Properties::NON_VIRTUAL,
__void__assignContexts__Contexts_R1,
"",
"");
I_Method1(void, removeContexts, IN, osgUtil::IncrementalCompileOperation::Contexts &, contexts,
Properties::NON_VIRTUAL,
__void__removeContexts__Contexts_R1,
"",
"");
I_Method1(void, addGraphicsContext, IN, osg::GraphicsContext *, gc,
Properties::NON_VIRTUAL,
__void__addGraphicsContext__osg_GraphicsContext_P1,
"",
"");
I_Method1(void, removeGraphicsContext, IN, osg::GraphicsContext *, gc,
Properties::NON_VIRTUAL,
__void__removeGraphicsContext__osg_GraphicsContext_P1,
"",
"");
I_Method0(void, mergeCompiledSubgraphs,
Properties::NON_VIRTUAL,
__void__mergeCompiledSubgraphs,
"Merge subgraphs that have been compiled. ",
"");
I_Method1(void, add, IN, osg::Node *, subgraphToCompile,
Properties::NON_VIRTUAL,
__void__add__osg_Node_P1,
"Add a subgraph to be compiled. ",
"");
I_Method2(void, add, IN, osg::Group *, attachmentPoint, IN, osg::Node *, subgraphToCompile,
Properties::NON_VIRTUAL,
__void__add__osg_Group_P1__osg_Node_P1,
"Add a subgraph to be compiled and add automatically to attachPoint on call to mergeCompiledSubgraphs. ",
"");
I_MethodWithDefaults2(void, add, IN, osgUtil::IncrementalCompileOperation::CompileSet *, compileSet, , IN, bool, callBuildCompileMap, true,
Properties::NON_VIRTUAL,
__void__add__CompileSet_P1__bool,
"Add a CompileSet to be compiled. ",
"");
I_Method0(OpenThreads::Mutex &, getToCompiledMutex,
Properties::NON_VIRTUAL,
__OpenThreads_Mutex_R1__getToCompiledMutex,
"",
"");
I_Method0(osgUtil::IncrementalCompileOperation::CompileSets &, getToCompile,
Properties::NON_VIRTUAL,
__CompileSets_R1__getToCompile,
"",
"");
I_Method0(OpenThreads::Mutex &, getCompiledMutex,
Properties::NON_VIRTUAL,
__OpenThreads_Mutex_R1__getCompiledMutex,
"",
"");
I_Method0(osgUtil::IncrementalCompileOperation::CompileSets &, getCompiled,
Properties::NON_VIRTUAL,
__CompileSets_R1__getCompiled,
"",
"");
I_SimpleProperty(osgUtil::IncrementalCompileOperation::CompileSets &, Compiled,
__CompileSets_R1__getCompiled,
0);
I_SimpleProperty(OpenThreads::Mutex &, CompiledMutex,
__OpenThreads_Mutex_R1__getCompiledMutex,
0);
I_SimpleProperty(osgUtil::IncrementalCompileOperation::CompileSets &, ToCompile,
__CompileSets_R1__getToCompile,
0);
I_SimpleProperty(OpenThreads::Mutex &, ToCompiledMutex,
__OpenThreads_Mutex_R1__getToCompiledMutex,
0);
END_REFLECTOR
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgUtil::IncrementalCompileOperation::CompileCompletedCallback)
I_DeclaringFile("osgUtil/GLObjectsVisitor");
I_BaseType(osg::Referenced);
I_Constructor0(____CompileCompletedCallback,
"",
"");
I_Method1(bool, compileCompleted, IN, osgUtil::IncrementalCompileOperation::CompileSet *, compileSet,
Properties::PURE_VIRTUAL,
__bool__compileCompleted__CompileSet_P1,
"",
"");
END_REFLECTOR
TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osg::Drawable > >, osgUtil::IncrementalCompileOperation::CompileData::Drawables)
TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osg::Texture > >, osgUtil::IncrementalCompileOperation::CompileData::Textures)
TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osg::Program > >, osgUtil::IncrementalCompileOperation::CompileData::Programs)
BEGIN_OBJECT_REFLECTOR(osgUtil::IncrementalCompileOperation::CompileData)
I_DeclaringFile("osgUtil/GLObjectsVisitor");
I_BaseType(osg::Referenced);
I_Constructor0(____CompileData,
"",
"");
I_Method0(bool, empty,
Properties::NON_VIRTUAL,
__bool__empty,
"",
"");
I_PublicMemberProperty(osgUtil::IncrementalCompileOperation::CompileData::Drawables, _drawables);
I_PublicMemberProperty(osgUtil::IncrementalCompileOperation::CompileData::Textures, _textures);
I_PublicMemberProperty(osgUtil::IncrementalCompileOperation::CompileData::Programs, _programs);
END_REFLECTOR
BEGIN_OBJECT_REFLECTOR(osgUtil::IncrementalCompileOperation::CompileSet)
I_DeclaringFile("osgUtil/GLObjectsVisitor");
I_BaseType(osg::Referenced);
I_Constructor0(____CompileSet,
"",
"");
I_Constructor1(IN, osg::Node *, subgraphToCompile,
Properties::NON_EXPLICIT,
____CompileSet__osg_Node_P1,
"",
"");
I_Constructor2(IN, osg::Group *, attachmentPoint, IN, osg::Node *, subgraphToCompile,
____CompileSet__osg_Group_P1__osg_Node_P1,
"",
"");
I_MethodWithDefaults2(void, buildCompileMap, IN, osgUtil::IncrementalCompileOperation::ContextSet &, context, , IN, osgUtil::GLObjectsVisitor::Mode, mode, osgUtil::GLObjectsVisitor::COMPILE_DISPLAY_LISTS|osgUtil::GLObjectsVisitor::COMPILE_STATE_ATTRIBUTES,
Properties::NON_VIRTUAL,
__void__buildCompileMap__ContextSet_R1__GLObjectsVisitor_Mode,
"",
"");
I_Method0(bool, compileCompleted,
Properties::NON_VIRTUAL,
__bool__compileCompleted,
"",
"");
I_PublicMemberProperty(osg::ref_ptr< osg::Group >, _attachmentPoint);
I_PublicMemberProperty(osg::ref_ptr< osg::Node >, _subgraphToCompile);
I_PublicMemberProperty(osg::ref_ptr< osgUtil::IncrementalCompileOperation::CompileCompletedCallback >, _compileCompletedCallback);
I_PublicMemberProperty(osgUtil::IncrementalCompileOperation::CompileMap, _compileMap);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osg::Program >)
I_DeclaringFile("osg/ref_ptr");
I_Constructor0(____ref_ptr,
"",
"");
I_Constructor1(IN, osg::Program *, ptr,
Properties::NON_EXPLICIT,
____ref_ptr__T_P1,
"",
"");
I_Constructor1(IN, const osg::ref_ptr< osg::Program > &, rp,
Properties::NON_EXPLICIT,
____ref_ptr__C5_ref_ptr_R1,
"",
"");
I_Method0(osg::Program *, get,
Properties::NON_VIRTUAL,
__T_P1__get,
"",
"");
I_Method0(bool, valid,
Properties::NON_VIRTUAL,
__bool__valid,
"",
"");
I_Method0(osg::Program *, release,
Properties::NON_VIRTUAL,
__T_P1__release,
"",
"");
I_Method1(void, swap, IN, osg::ref_ptr< osg::Program > &, rp,
Properties::NON_VIRTUAL,
__void__swap__ref_ptr_R1,
"",
"");
I_SimpleProperty(osg::Program *, ,
__T_P1__get,
0);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osg::Texture >)
I_DeclaringFile("osg/ref_ptr");
I_Constructor0(____ref_ptr,
"",
"");
I_Constructor1(IN, osg::Texture *, ptr,
Properties::NON_EXPLICIT,
____ref_ptr__T_P1,
"",
"");
I_Constructor1(IN, const osg::ref_ptr< osg::Texture > &, rp,
Properties::NON_EXPLICIT,
____ref_ptr__C5_ref_ptr_R1,
"",
"");
I_Method0(osg::Texture *, get,
Properties::NON_VIRTUAL,
__T_P1__get,
"",
"");
I_Method0(bool, valid,
Properties::NON_VIRTUAL,
__bool__valid,
"",
"");
I_Method0(osg::Texture *, release,
Properties::NON_VIRTUAL,
__T_P1__release,
"",
"");
I_Method1(void, swap, IN, osg::ref_ptr< osg::Texture > &, rp,
Properties::NON_VIRTUAL,
__void__swap__ref_ptr_R1,
"",
"");
I_SimpleProperty(osg::Texture *, ,
__T_P1__get,
0);
END_REFLECTOR
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgUtil::IncrementalCompileOperation::CompileSet >)
I_DeclaringFile("osg/ref_ptr");
I_Constructor0(____ref_ptr,
"",
"");
I_Constructor1(IN, osgUtil::IncrementalCompileOperation::CompileSet *, ptr,
Properties::NON_EXPLICIT,
____ref_ptr__T_P1,
"",
"");
I_Constructor1(IN, const osg::ref_ptr< osgUtil::IncrementalCompileOperation::CompileSet > &, rp,
Properties::NON_EXPLICIT,
____ref_ptr__C5_ref_ptr_R1,
"",
"");
I_Method0(osgUtil::IncrementalCompileOperation::CompileSet *, get,
Properties::NON_VIRTUAL,
__T_P1__get,
"",
"");
I_Method0(bool, valid,
Properties::NON_VIRTUAL,
__bool__valid,
"",
"");
I_Method0(osgUtil::IncrementalCompileOperation::CompileSet *, release,
Properties::NON_VIRTUAL,
__T_P1__release,
"",
"");
I_Method1(void, swap, IN, osg::ref_ptr< osgUtil::IncrementalCompileOperation::CompileSet > &, rp,
Properties::NON_VIRTUAL,
__void__swap__ref_ptr_R1,
"",
"");
I_SimpleProperty(osgUtil::IncrementalCompileOperation::CompileSet *, ,
__T_P1__get,
0);
END_REFLECTOR
STD_LIST_REFLECTOR(std::list< osg::ref_ptr< osg::Drawable > >)
STD_LIST_REFLECTOR(std::list< osg::ref_ptr< osg::Program > >)
STD_LIST_REFLECTOR(std::list< osg::ref_ptr< osg::Texture > >)
STD_LIST_REFLECTOR(std::list< osg::ref_ptr< osgUtil::IncrementalCompileOperation::CompileSet > >)
STD_MAP_REFLECTOR(std::map< osg::GraphicsContext * COMMA osgUtil::IncrementalCompileOperation::CompileData >)
STD_SET_REFLECTOR(std::set< osg::GraphicsContext * >)

View File

@ -15,6 +15,7 @@
#include <osg/OperationThread>
#include <osg/Stats>
#include <osgGA/EventVisitor>
#include <osgUtil/GLObjectsVisitor>
#include <osgUtil/UpdateVisitor>
#include <osgViewer/ViewerBase>
@ -250,6 +251,16 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgViewer::ViewerBase)
__osg_Operation_P1__getRealizeOperation,
"Get the graphics operation to call on realization of the viewers graphics windows. ",
"");
I_Method1(void, setIncrementalCompileOperation, IN, osgUtil::IncrementalCompileOperation *, ico,
Properties::NON_VIRTUAL,
__void__setIncrementalCompileOperation__osgUtil_IncrementalCompileOperation_P1,
"Set the incremental compile operation. ",
"Used to manage the OpenGL object compilation and merging of subgraphs in a way that avoids overloading the rendering of frame with too many new objects in one frame. ");
I_Method0(osgUtil::IncrementalCompileOperation *, getIncrementalCompileOperation,
Properties::NON_VIRTUAL,
__osgUtil_IncrementalCompileOperation_P1__getIncrementalCompileOperation,
"Get the incremental compile operation. ",
"");
I_Method0(void, checkWindowStatus,
Properties::NON_VIRTUAL,
__void__checkWindowStatus,
@ -362,6 +373,9 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgViewer::ViewerBase)
I_SimpleProperty(osgGA::EventVisitor *, EventVisitor,
__osgGA_EventVisitor_P1__getEventVisitor,
__void__setEventVisitor__osgGA_EventVisitor_P1);
I_SimpleProperty(osgUtil::IncrementalCompileOperation *, IncrementalCompileOperation,
__osgUtil_IncrementalCompileOperation_P1__getIncrementalCompileOperation,
__void__setIncrementalCompileOperation__osgUtil_IncrementalCompileOperation_P1);
I_SimpleProperty(int, KeyEventSetsDone,
__int__getKeyEventSetsDone,
__void__setKeyEventSetsDone__int);