From 59ad441be18a8f3208ec663144b82144a7315eb7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 9 Feb 2006 12:20:42 +0000 Subject: [PATCH] Added BlenColour(Vec4) constructor and updated wrappers. --- include/osg/BlendColor | 2 ++ src/osg/BlendColor.cpp | 7 ++++++- src/osgWrappers/osg/BlendColor.cpp | 1 + src/osgWrappers/osgDB/DatabasePager.cpp | 4 ++++ src/osgWrappers/osgUtil/Simplifier.cpp | 11 ++++++++++- 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/include/osg/BlendColor b/include/osg/BlendColor index 41d2f506f..5fcfbdb28 100644 --- a/include/osg/BlendColor +++ b/include/osg/BlendColor @@ -30,6 +30,8 @@ class OSG_EXPORT BlendColor : public StateAttribute BlendColor(); + BlendColor(const osg::Vec4& constantColor); + /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ BlendColor(const BlendColor& trans,const CopyOp& copyop=CopyOp::SHALLOW_COPY): StateAttribute(trans,copyop), diff --git a/src/osg/BlendColor.cpp b/src/osg/BlendColor.cpp index 6be885b15..7cffb25d9 100644 --- a/src/osg/BlendColor.cpp +++ b/src/osg/BlendColor.cpp @@ -20,7 +20,12 @@ using namespace osg; BlendColor::BlendColor() : - _constantColor(0.0f,0.0f,0.0f,0.0f) + _constantColor(0.0f,0.0f,0.0f,0.0f) +{ +} + +BlendColor::BlendColor(const osg::Vec4& constantColor): + _constantColor(constantColor) { } diff --git a/src/osgWrappers/osg/BlendColor.cpp b/src/osgWrappers/osg/BlendColor.cpp index 59cfb673a..83104b8dc 100644 --- a/src/osgWrappers/osg/BlendColor.cpp +++ b/src/osgWrappers/osg/BlendColor.cpp @@ -27,6 +27,7 @@ BEGIN_OBJECT_REFLECTOR(osg::BlendColor) I_BaseType(osg::StateAttribute); I_Constructor0(); + I_Constructor1(IN, const osg::Vec4 &, constantColor); I_ConstructorWithDefaults2(IN, const osg::BlendColor &, trans, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY); I_Method0(osg::Object *, cloneType); I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, copyop); diff --git a/src/osgWrappers/osgDB/DatabasePager.cpp b/src/osgWrappers/osgDB/DatabasePager.cpp index ed5936079..dbf4f58a6 100644 --- a/src/osgWrappers/osgDB/DatabasePager.cpp +++ b/src/osgWrappers/osgDB/DatabasePager.cpp @@ -92,13 +92,17 @@ BEGIN_OBJECT_REFLECTOR(osgDB::DatabasePager) I_Method1(bool, getCompileGLObjectsForContextID, IN, unsigned int, contextID); I_Method0(bool, requiresCompileGLObjects); I_Method2(void, compileGLObjects, IN, osg::State &, state, IN, double &, availableTime); + I_Method0(unsigned int, getFileRequestListSize); + I_Method0(unsigned int, getDataToCompileListSize); I_Property(bool, AcceptNewDatabaseRequests); I_IndexedProperty1(bool, CompileGLObjectsForContextID, unsigned int, contextID); + I_ReadOnlyProperty(unsigned int, DataToCompileListSize); I_Property(bool, DatabasePagerThreadPause); I_Property(bool, DeleteRemovedSubgraphsInDatabaseThread); I_Property(bool, DoPreCompile); I_Property(osgDB::DatabasePager::DrawablePolicy, DrawablePolicy); I_Property(double, ExpiryDelay); + I_ReadOnlyProperty(unsigned int, FileRequestListSize); I_ReadOnlyProperty(osg::Block *, FrameBlock); I_Property(unsigned int, MaximumNumOfObjectsToCompilePerFrame); I_Property(double, MinimumTimeAvailableForGLCompileAndDeletePerFrame); diff --git a/src/osgWrappers/osgUtil/Simplifier.cpp b/src/osgWrappers/osgUtil/Simplifier.cpp index 5a9fb42e1..97648d8e9 100644 --- a/src/osgWrappers/osgUtil/Simplifier.cpp +++ b/src/osgWrappers/osgUtil/Simplifier.cpp @@ -25,11 +25,17 @@ TYPE_NAME_ALIAS(std::vector< unsigned int >, osgUtil::Simplifier::IndexList); BEGIN_OBJECT_REFLECTOR(osgUtil::Simplifier) I_BaseType(osg::NodeVisitor); - I_ConstructorWithDefaults2(IN, float, sampleRatio, 1.0f, IN, float, maximumError, 0.0f); + I_ConstructorWithDefaults3(IN, float, sampleRatio, 1.0f, IN, float, maximumError, FLT_MAX, IN, float, maximumLength, 0.0); I_Method1(void, setSampleRatio, IN, float, sampleRatio); I_Method0(float, getSampleRatio); I_Method1(void, setMaximumError, IN, float, error); I_Method0(float, getMaximumError); + I_Method1(void, setMaximumLength, IN, float, length); + I_Method0(float, getMaximumLength); + I_Method1(void, setDoTriStrip, IN, bool, on); + I_Method0(bool, getDoTriStrip); + I_Method1(void, setSmoothing, IN, bool, on); + I_Method0(bool, getSmoothing); I_Method1(void, setContinueSimplificationCallback, IN, osgUtil::Simplifier::ContinueSimplificationCallback *, cb); I_Method0(osgUtil::Simplifier::ContinueSimplificationCallback *, getContinueSimplificationCallback); I_Method0(const osgUtil::Simplifier::ContinueSimplificationCallback *, getContinueSimplificationCallback); @@ -39,8 +45,11 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::Simplifier) I_Method1(void, simplify, IN, osg::Geometry &, geometry); I_Method2(void, simplify, IN, osg::Geometry &, geometry, IN, const osgUtil::Simplifier::IndexList &, protectedPoints); I_Property(osgUtil::Simplifier::ContinueSimplificationCallback *, ContinueSimplificationCallback); + I_Property(bool, DoTriStrip); I_Property(float, MaximumError); + I_Property(float, MaximumLength); I_Property(float, SampleRatio); + I_Property(bool, Smoothing); END_REFLECTOR BEGIN_OBJECT_REFLECTOR(osgUtil::Simplifier::ContinueSimplificationCallback)