Added Stats::collectStats(string,bool) controls, getAveragedAttribute methods into osg::Stats class, and
related support into osgViewer::Viewer and osgViewer::StatsHandler. Added lazy updating of text in StatsHandler HUD to minimize the impact of slow text updating on observed frame rates.
This commit is contained in:
@@ -438,6 +438,26 @@ BEGIN_OBJECT_REFLECTOR(osg::State)
|
||||
__bool__getAbortRendering,
|
||||
"Get flag for early termination of the draw traversal, if true steps should be taken to complete rendering early. ",
|
||||
"");
|
||||
I_Method1(void, setDynamicObjectRenderingCompletedCallback, IN, osg::State::DynamicObjectRenderingCompletedCallback *, cb,
|
||||
__void__setDynamicObjectRenderingCompletedCallback__DynamicObjectRenderingCompletedCallback_P1,
|
||||
"Set the callback to be called when the dynamic object count hits 0. ",
|
||||
"");
|
||||
I_Method0(osg::State::DynamicObjectRenderingCompletedCallback *, getDynamicObjectRenderingCompletedCallback,
|
||||
__DynamicObjectRenderingCompletedCallback_P1__getDynamicObjectRenderingCompletedCallback,
|
||||
"Get the callback to be called when the dynamic object count hits 0. ",
|
||||
"");
|
||||
I_MethodWithDefaults2(void, setDynamicObjectCount, IN, unsigned int, count, , IN, bool, callCallbackOnZero, false,
|
||||
__void__setDynamicObjectCount__unsigned_int__bool,
|
||||
"Set the number of dynamic objects that will be rendered in this graphics context this frame. ",
|
||||
"");
|
||||
I_Method0(unsigned int, getDynamicObjectCount,
|
||||
__unsigned_int__getDynamicObjectCount,
|
||||
"Get the number of dynamic objects that will be rendered in this graphics context this frame. ",
|
||||
"");
|
||||
I_Method0(void, decrementDynamicObjectCount,
|
||||
__void__decrementDynamicObjectCount,
|
||||
"Decrement the number of dynamic objects left to render this frame, and once the count goes to zero call the DynamicObjectRenderingCompletedCallback to inform of completion. ",
|
||||
"");
|
||||
I_Method1(void, setCheckForGLErrors, IN, osg::State::CheckForGLErrors, check,
|
||||
__void__setCheckForGLErrors__CheckForGLErrors,
|
||||
"Set whether and how often OpenGL errors should be checked for. ",
|
||||
@@ -482,6 +502,12 @@ BEGIN_OBJECT_REFLECTOR(osg::State)
|
||||
I_SimpleProperty(osg::DisplaySettings *, DisplaySettings,
|
||||
0,
|
||||
__void__setDisplaySettings__DisplaySettings_P1);
|
||||
I_SimpleProperty(unsigned int, DynamicObjectCount,
|
||||
__unsigned_int__getDynamicObjectCount,
|
||||
0);
|
||||
I_SimpleProperty(osg::State::DynamicObjectRenderingCompletedCallback *, DynamicObjectRenderingCompletedCallback,
|
||||
__DynamicObjectRenderingCompletedCallback_P1__getDynamicObjectRenderingCompletedCallback,
|
||||
__void__setDynamicObjectRenderingCompletedCallback__DynamicObjectRenderingCompletedCallback_P1);
|
||||
I_SimpleProperty(osg::FrameStamp *, FrameStamp,
|
||||
0,
|
||||
__void__setFrameStamp__FrameStamp_P1);
|
||||
@@ -529,5 +555,16 @@ BEGIN_OBJECT_REFLECTOR(osg::State)
|
||||
0);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::State::DynamicObjectRenderingCompletedCallback)
|
||||
I_BaseType(osg::Referenced);
|
||||
I_Constructor0(____DynamicObjectRenderingCompletedCallback,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, completed, IN, osg::State *, x,
|
||||
__void__completed__osg_State_P1,
|
||||
"",
|
||||
"");
|
||||
END_REFLECTOR
|
||||
|
||||
STD_VECTOR_REFLECTOR(std::vector< const osg::StateSet * >);
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ BEGIN_ENUM_REFLECTOR(osgUtil::Optimizer::OptimizationOptions)
|
||||
I_EnumLabel(osgUtil::Optimizer::MERGE_GEODES);
|
||||
I_EnumLabel(osgUtil::Optimizer::FLATTEN_BILLBOARDS);
|
||||
I_EnumLabel(osgUtil::Optimizer::TEXTURE_ATLAS_BUILDER);
|
||||
I_EnumLabel(osgUtil::Optimizer::STATIC_OBJECT_DETECTION);
|
||||
I_EnumLabel(osgUtil::Optimizer::DEFAULT_OPTIMIZATIONS);
|
||||
I_EnumLabel(osgUtil::Optimizer::ALL_OPTIMIZATIONS);
|
||||
END_REFLECTOR
|
||||
@@ -500,6 +501,22 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::Optimizer::StateVisitor)
|
||||
"");
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgUtil::Optimizer::StaticObjectDetectionVisitor)
|
||||
I_BaseType(osgUtil::BaseOptimizerVisitor);
|
||||
I_ConstructorWithDefaults1(IN, osgUtil::Optimizer *, optimizer, 0,
|
||||
____StaticObjectDetectionVisitor__Optimizer_P1,
|
||||
"default to traversing all children. ",
|
||||
"");
|
||||
I_Method1(void, apply, IN, osg::Node &, node,
|
||||
__void__apply__osg_Node_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, apply, IN, osg::Geode &, geode,
|
||||
__void__apply__osg_Geode_R1,
|
||||
"",
|
||||
"");
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(std::set< osg::Group * >, osgUtil::Optimizer::TessellateVisitor::GroupList);
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgUtil::Optimizer::TessellateVisitor)
|
||||
|
||||
@@ -217,6 +217,10 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::RenderBin)
|
||||
__bool__getStats__Statistics_R1,
|
||||
"Extract stats for current draw list. ",
|
||||
"");
|
||||
I_Method0(unsigned int, computeNumberOfDynamicRenderLeaves,
|
||||
__unsigned_int__computeNumberOfDynamicRenderLeaves,
|
||||
"Compute the number of dynamic RenderLeaves. ",
|
||||
"");
|
||||
I_Method0(void, copyLeavesFromStateGraphListToRenderLeafList,
|
||||
__void__copyLeavesFromStateGraphListToRenderLeafList,
|
||||
"",
|
||||
|
||||
@@ -48,5 +48,6 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::RenderLeaf)
|
||||
I_PublicMemberProperty(osg::ref_ptr< osg::RefMatrix >, _projection);
|
||||
I_PublicMemberProperty(osg::ref_ptr< osg::RefMatrix >, _modelview);
|
||||
I_PublicMemberProperty(float, _depth);
|
||||
I_PublicMemberProperty(bool, _dynamic);
|
||||
END_REFLECTOR
|
||||
|
||||
|
||||
@@ -306,6 +306,10 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::RenderStage)
|
||||
__bool__getStats__Statistics_R1,
|
||||
"Extract stats for current draw list. ",
|
||||
"");
|
||||
I_Method0(unsigned int, computeNumberOfDynamicRenderLeaves,
|
||||
__unsigned_int__computeNumberOfDynamicRenderLeaves,
|
||||
"Compute the number of dynamic RenderLeaves. ",
|
||||
"");
|
||||
I_Method2(void, attach, IN, osg::Camera::BufferComponent, buffer, IN, osg::Image *, image,
|
||||
__void__attach__osg_Camera_BufferComponent__osg_Image_P1,
|
||||
"",
|
||||
|
||||
@@ -123,6 +123,7 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::StateGraph)
|
||||
I_PublicMemberProperty(float, _averageDistance);
|
||||
I_PublicMemberProperty(float, _minimumDistance);
|
||||
I_PublicMemberProperty(osg::ref_ptr< osg::Referenced >, _userData);
|
||||
I_PublicMemberProperty(bool, _dynamic);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osg::ref_ptr< osgUtil::RenderLeaf >)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <osg/Camera>
|
||||
#include <osg/FrameStamp>
|
||||
#include <osg/GraphicsThread>
|
||||
#include <osg/Timer>
|
||||
#include <osgGA/EventQueue>
|
||||
#include <osgViewer/CompositeViewer>
|
||||
@@ -203,17 +204,25 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::CompositeViewer)
|
||||
__void__getScenes__Scenes_R1__bool,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setRealizeOperation, IN, osg::GraphicsOperation *, op,
|
||||
__void__setRealizeOperation__osg_GraphicsOperation_P1,
|
||||
"Set the graphics operation to call on realization of the viewers graphics windows. ",
|
||||
"");
|
||||
I_Method0(osg::GraphicsOperation *, getRealizeOperation,
|
||||
__osg_GraphicsOperation_P1__getRealizeOperation,
|
||||
"Get the graphics operation to call on realization of the viewers graphics windows. ",
|
||||
"");
|
||||
I_Method0(void, stopThreading,
|
||||
__void__stopThreading,
|
||||
"",
|
||||
"Stop any threads begin run by viewer. ",
|
||||
"");
|
||||
I_Method0(void, startThreading,
|
||||
__void__startThreading,
|
||||
"",
|
||||
"Start any threads required by the viewer, as per viewers ThreadingModel. ",
|
||||
"");
|
||||
I_Method0(void, setUpRenderingSupport,
|
||||
__void__setUpRenderingSupport,
|
||||
"",
|
||||
"Set up the GraphicsOperations to render the various viewer cameras on the viewers graphics windows. ",
|
||||
"");
|
||||
I_SimpleProperty(osg::Camera *, CameraWithFocus,
|
||||
__osg_Camera_P1__getCameraWithFocus,
|
||||
@@ -236,6 +245,9 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::CompositeViewer)
|
||||
I_SimpleProperty(bool, QuitEventSetsDone,
|
||||
__bool__getQuitEventSetsDone,
|
||||
__void__setQuitEventSetsDone__bool);
|
||||
I_SimpleProperty(osg::GraphicsOperation *, RealizeOperation,
|
||||
__osg_GraphicsOperation_P1__getRealizeOperation,
|
||||
__void__setRealizeOperation__osg_GraphicsOperation_P1);
|
||||
I_SimpleProperty(double, ReferenceTime,
|
||||
0,
|
||||
__void__setReferenceTime__double);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <osg/Camera>
|
||||
#include <osg/DisplaySettings>
|
||||
#include <osg/Node>
|
||||
#include <osg/State>
|
||||
#include <osgGA/EventQueue>
|
||||
#include <osgGA/GUIEventHandler>
|
||||
#include <osgGA/MatrixManipulator>
|
||||
@@ -28,6 +29,29 @@
|
||||
#undef OUT
|
||||
#endif
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgViewer::EndOfDynamicDrawBlock)
|
||||
I_BaseType(osg::State::DynamicObjectRenderingCompletedCallback);
|
||||
I_Constructor0(____EndOfDynamicDrawBlock,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, completed, IN, osg::State *, state,
|
||||
__void__completed__osg_State_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, block,
|
||||
__void__block,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, release,
|
||||
__void__release,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, set, IN, unsigned int, blockCount,
|
||||
__void__set__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(std::list< osg::ref_ptr< osgGA::GUIEventHandler > >, osgViewer::View::EventHandlers);
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgViewer::View)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <osg/Camera>
|
||||
#include <osg/FrameStamp>
|
||||
#include <osg/GraphicsThread>
|
||||
#include <osg/Node>
|
||||
#include <osg/Timer>
|
||||
#include <osgViewer/Viewer>
|
||||
@@ -96,6 +97,14 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::Viewer)
|
||||
__ThreadingModel__getThreadingModel,
|
||||
"Get the threading model the rendering traversals will use. ",
|
||||
"");
|
||||
I_Method1(void, setUseMainThreadForRenderingTraversals, IN, bool, flag,
|
||||
__void__setUseMainThreadForRenderingTraversals__bool,
|
||||
"Set whether the main thread, calling frame(), should be used for the rendering traversals. ",
|
||||
"");
|
||||
I_Method0(bool, getUseMainThreadForRenderingTraversals,
|
||||
__bool__getUseMainThreadForRenderingTraversals,
|
||||
"Get whether the main thread, calling frame(), should be used for the rendering traversals. ",
|
||||
"");
|
||||
I_Method1(void, setEndBarrierPosition, IN, osgViewer::Viewer::BarrierPosition, bp,
|
||||
__void__setEndBarrierPosition__BarrierPosition,
|
||||
"Set the position of the end barrier. ",
|
||||
@@ -164,17 +173,25 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::Viewer)
|
||||
__void__getWindows__Windows_R1__bool,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setRealizeOperation, IN, osg::GraphicsOperation *, op,
|
||||
__void__setRealizeOperation__osg_GraphicsOperation_P1,
|
||||
"Set the graphics operation to call on realization of the viewers graphics windows. ",
|
||||
"");
|
||||
I_Method0(osg::GraphicsOperation *, getRealizeOperation,
|
||||
__osg_GraphicsOperation_P1__getRealizeOperation,
|
||||
"Get the graphics operation to call on realization of the viewers graphics windows. ",
|
||||
"");
|
||||
I_Method0(void, stopThreading,
|
||||
__void__stopThreading,
|
||||
"",
|
||||
"Stop any threads begin run by viewer. ",
|
||||
"");
|
||||
I_Method0(void, startThreading,
|
||||
__void__startThreading,
|
||||
"",
|
||||
"Start any threads required by the viewer, as per viewers ThreadingModel. ",
|
||||
"");
|
||||
I_Method0(void, setUpRenderingSupport,
|
||||
__void__setUpRenderingSupport,
|
||||
"",
|
||||
"Set up the GraphicsOperations to render the various viewer cameras on the viewers graphics windows. ",
|
||||
"");
|
||||
I_SimpleProperty(osg::Camera *, CameraWithFocus,
|
||||
__osg_Camera_P1__getCameraWithFocus,
|
||||
@@ -194,6 +211,9 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::Viewer)
|
||||
I_SimpleProperty(bool, QuitEventSetsDone,
|
||||
__bool__getQuitEventSetsDone,
|
||||
__void__setQuitEventSetsDone__bool);
|
||||
I_SimpleProperty(osg::GraphicsOperation *, RealizeOperation,
|
||||
__osg_GraphicsOperation_P1__getRealizeOperation,
|
||||
__void__setRealizeOperation__osg_GraphicsOperation_P1);
|
||||
I_SimpleProperty(double, ReferenceTime,
|
||||
0,
|
||||
__void__setReferenceTime__double);
|
||||
@@ -206,5 +226,8 @@ BEGIN_OBJECT_REFLECTOR(osgViewer::Viewer)
|
||||
I_SimpleProperty(osgViewer::Viewer::ThreadingModel, ThreadingModel,
|
||||
__ThreadingModel__getThreadingModel,
|
||||
__void__setThreadingModel__ThreadingModel);
|
||||
I_SimpleProperty(bool, UseMainThreadForRenderingTraversals,
|
||||
__bool__getUseMainThreadForRenderingTraversals,
|
||||
__void__setUseMainThreadForRenderingTraversals__bool);
|
||||
END_REFLECTOR
|
||||
|
||||
|
||||
Reference in New Issue
Block a user