diff --git a/include/osg/Fog b/include/osg/Fog index 24d888c45..dc8ada290 100644 --- a/include/osg/Fog +++ b/include/osg/Fog @@ -67,7 +67,7 @@ class SG_EXPORT Fog : public StateAttribute EXP2 = GL_EXP2 }; - inline void setMode( const Mode mode ) { _mode = mode; } + inline void setMode( Mode mode ) { _mode = mode; } inline Mode getMode() const { return _mode; } inline void setDensity( float density ) { _density = density; } diff --git a/include/osg/Node b/include/osg/Node index f0c6b12f7..870873b15 100644 --- a/include/osg/Node +++ b/include/osg/Node @@ -133,10 +133,10 @@ class SG_EXPORT Node : public Object /** Set cull node callback, called during cull traversal. */ void setCullCallback(NodeCallback* nc) { _cullCallback = nc; } - /** Get app node callback, called during app traversal. */ + /** Get cull node callback, called during cull traversal. */ inline NodeCallback* getCullCallback() { return _cullCallback.get(); } - /** Get const app node callback, called during app traversal. */ + /** Get const cull node callback, called during cull traversal. */ inline const NodeCallback* getCullCallback() const { return _cullCallback.get(); } /** Set the view frustum/small feature culling of this node to be active or inactive. diff --git a/include/osg/NodeVisitor b/include/osg/NodeVisitor index f73bc7154..e71097426 100644 --- a/include/osg/NodeVisitor +++ b/include/osg/NodeVisitor @@ -137,7 +137,7 @@ class SG_EXPORT NodeVisitor : public Referenced NodeVisitor has been attached via setTraverseVisitor() and the new mode is not TRAVERSE_VISITOR then the attached visitor is detached. Default mode is TRAVERSE_NONE.*/ - void setTraversalMode(const TraversalMode mode); + void setTraversalMode(TraversalMode mode); /** Get the traversal mode.*/ inline TraversalMode getTraversalMode() const { return _traversalMode; } diff --git a/include/osg/Object b/include/osg/Object index 2a537f527..8caaa199c 100644 --- a/include/osg/Object +++ b/include/osg/Object @@ -72,10 +72,10 @@ class SG_EXPORT Object : public Referenced * Can be set to either STATIC for values that do not change over the lifetime of the object, * or DYNAMIC for values that vary over the lifetime of the object. The DataVariance value * can be used be routines such as optimzation codes that wish to share static data.*/ - inline void setDataVariance(const DataVariance dv) { _dataVariance = dv; } + inline void setDataVariance(DataVariance dv) { _dataVariance = dv; } /** Get the data variance of this object.*/ - inline const DataVariance getDataVariance() const { return _dataVariance; } + inline DataVariance getDataVariance() const { return _dataVariance; } /** diff --git a/include/osg/ShadeModel b/include/osg/ShadeModel index 6c028e444..ebf3a44dc 100644 --- a/include/osg/ShadeModel +++ b/include/osg/ShadeModel @@ -44,9 +44,9 @@ class SG_EXPORT ShadeModel : public StateAttribute SMOOTH = GL_SMOOTH }; - inline void setMode(const Mode mode) { _mode = mode; } + inline void setMode(Mode mode) { _mode = mode; } - inline const Mode getMode() const { return _mode; } + inline Mode getMode() const { return _mode; } virtual void apply(State& state) const; diff --git a/include/osg/Shape b/include/osg/Shape index 46fdf9633..8c6b59798 100644 --- a/include/osg/Shape +++ b/include/osg/Shape @@ -518,7 +518,15 @@ class CompositeShape : public Shape /** find the index number of child, if child is not found then it returns getNumChildren(), * so should be used in similar sytle of STL's result!=end().*/ - unsigned int findChildNo(Shape* shape); + unsigned int findChildNo(Shape* shape) const + { + for (unsigned int childNo=0;childNo<_children.size();++childNo) + { + if (_children[childNo]==shape) return childNo; + } + return _children.size(); // node not found. + + } protected: diff --git a/include/osg/Stencil b/include/osg/Stencil index ad7029922..22e13714b 100644 --- a/include/osg/Stencil +++ b/include/osg/Stencil @@ -69,18 +69,18 @@ class SG_EXPORT Stencil : public StateAttribute ALWAYS = GL_ALWAYS }; - inline void setFunction(const Function func,int ref,uint mask) + inline void setFunction(Function func,int ref,uint mask) { _func = func; _funcRef = ref; _funcMask = mask; } - inline const Function getFunction() const { return _func; } + inline Function getFunction() const { return _func; } inline int getFunctionRef() const { return _funcRef; } - inline const uint getFunctionMask() const { return _funcMask; } + inline uint getFunctionMask() const { return _funcMask; } enum Operation @@ -100,7 +100,7 @@ class SG_EXPORT Stencil : public StateAttribute * third parameter controls the operation when both the stencil test * and depth pass. Ordering of parameter is the same as if using * glStencilOp(,,).*/ - inline void setOperation(const Operation sfail, const Operation zfail, const Operation zpass) + inline void setOperation(Operation sfail, Operation zfail, Operation zpass) { _sfail = sfail; _zfail = zfail; @@ -108,18 +108,18 @@ class SG_EXPORT Stencil : public StateAttribute } /** get the operation when the stencil test fails.*/ - inline const Operation getStencilFailOperation() const { return _sfail; } + inline Operation getStencilFailOperation() const { return _sfail; } /** get the operation when the stencil test passes but the depth test fails*/ - inline const Operation getStencilPassAndDepthFailOperation() const { return _zfail; } + inline Operation getStencilPassAndDepthFailOperation() const { return _zfail; } /** get the operation when both the stencil test and the depth test pass*/ - inline const Operation getStencilPassAndDepthPassOperation() const { return _zpass; } + inline Operation getStencilPassAndDepthPassOperation() const { return _zpass; } inline void setWriteMask(uint mask) { _writeMask = mask; } - inline const uint getWriteMask() const { return _writeMask; } + inline uint getWriteMask() const { return _writeMask; } virtual void apply(State& state) const; diff --git a/include/osg/TexEnv b/include/osg/TexEnv index cbe65a9c1..407d35b0e 100644 --- a/include/osg/TexEnv +++ b/include/osg/TexEnv @@ -51,9 +51,9 @@ class SG_EXPORT TexEnv : public StateAttribute ADD = GL_ADD }; - void setMode( const Mode mode ) { _mode = mode; } + void setMode( Mode mode ) { _mode = mode; } - const Mode getMode() const { return _mode; } + Mode getMode() const { return _mode; } void setColor( const Vec4& color ) { _color = color; }