diff --git a/include/osg/BoundingBox b/include/osg/BoundingBox index 35d433f8e..0f12d05d0 100644 --- a/include/osg/BoundingBox +++ b/include/osg/BoundingBox @@ -50,12 +50,8 @@ class SG_EXPORT BoundingBox _max.set(-FLT_MAX,-FLT_MAX,-FLT_MAX); } - /** return true if the bounding box contains valid values, - false if the bounding box is effectively unset/empty.*/ - inline const bool isValid() const - { - return _max.x()>=_min.x(); - } + /** deprecated, use valid() instead.*/ + inline const bool isValid() const { return _max.x()>=_min.x(); } inline const bool valid() const { @@ -139,7 +135,7 @@ class SG_EXPORT BoundingBox /** return true is vertex v is within the box.*/ inline const bool contains(const Vec3& v) const { - return isValid() && + return valid() && (v.x()>=_min.x() && v.x()<=_max.x()) && (v.y()>=_min.y() && v.y()<=_max.y()) && (v.z()>=_min.z() && v.z()<=_max.z()); diff --git a/include/osg/BoundingSphere b/include/osg/BoundingSphere index 1f39176ea..d865c8d59 100644 --- a/include/osg/BoundingSphere +++ b/include/osg/BoundingSphere @@ -38,8 +38,7 @@ class SG_EXPORT BoundingSphere _radius = -1.0f; } - /** return true if the bounding sphere contains valid values, - false if the bounding sphere is effectively unset.*/ + /** deprecated, use valid() instead.*/ inline const bool isValid() const { return _radius>=0.0f; } /** return true if the bounding sphere contains valid values, @@ -106,13 +105,13 @@ class SG_EXPORT BoundingSphere /** return true is vertex v is within the sphere.*/ inline const bool contains(const Vec3& v) const { - return isValid() && ((v-_center).length2()<=radius2()); + return valid() && ((v-_center).length2()<=radius2()); } /** return true if bounding sphere's intersect each other.*/ inline const bool intersects( const BoundingSphere& bs ) const { - return isValid() && bs.isValid() && + return valid() && bs.valid() && ((_center - bs._center).length2() <= (_radius + bs._radius)*(_radius + bs._radius)); } diff --git a/include/osg/CullStack b/include/osg/CullStack index 76730122e..789730e83 100644 --- a/include/osg/CullStack +++ b/include/osg/CullStack @@ -102,7 +102,7 @@ class SG_EXPORT CullStack inline bool isCulled(const BoundingBox& bb) { - return bb.isValid() && _modelviewCullingStack.back()->isCulled(bb); + return bb.valid() && _modelviewCullingStack.back()->isCulled(bb); } inline bool isCulled(const BoundingSphere& bs) diff --git a/include/osg/Node b/include/osg/Node index 881aa482c..d1e76ecbd 100644 --- a/include/osg/Node +++ b/include/osg/Node @@ -139,7 +139,7 @@ class SG_EXPORT Node : public Object /** Return true if this node can be culled by view frustum, occlusion or small feature culling during the cull traversal. * note, return true only if no children have culling disabled, and the local _cullingActive flag is true.*/ - inline const bool isCullingActive() const { return _numChildrenWithCullingDisabled==0 && _cullingActive && _bsphere.isValid(); } + inline const bool isCullingActive() const { return _numChildrenWithCullingDisabled==0 && _cullingActive && _bsphere.valid(); } /** Get the number of Children of this node which are or have OccluderNode's.*/ inline const int getNumChildrenWithOccluderNodes() const { return _numChildrenWithOccluderNodes; } diff --git a/src/Demos/osgimpostor/osgimpostor.cpp b/src/Demos/osgimpostor/osgimpostor.cpp index b0af8ec0b..f3b5a1385 100644 --- a/src/Demos/osgimpostor/osgimpostor.cpp +++ b/src/Demos/osgimpostor/osgimpostor.cpp @@ -92,7 +92,7 @@ int main( int argc, char **argv ) if (dynamic_cast(model)==0) { const osg::BoundingSphere& bs = model->getBound(); - if (bs.isValid()) + if (bs.valid()) { osg::Impostor* impostor = new osg::Impostor; diff --git a/src/osg/BoundingBox.cpp b/src/osg/BoundingBox.cpp index c313d623a..37f308c09 100644 --- a/src/osg/BoundingBox.cpp +++ b/src/osg/BoundingBox.cpp @@ -18,7 +18,7 @@ void BoundingBox::expandBy(const Vec3& v) void BoundingBox::expandBy(const BoundingBox& bb) { - if (!bb.isValid()) return; + if (!bb.valid()) return; if(bb._min.x()<_min.x()) _min.x() = bb._min.x(); if(bb._max.x()>_max.x()) _max.x() = bb._max.x(); @@ -33,7 +33,7 @@ void BoundingBox::expandBy(const BoundingBox& bb) void BoundingBox::expandBy(const BoundingSphere& sh) { - if (!sh.isValid()) return; + if (!sh.valid()) return; if(sh._center.x()-sh._radius<_min.x()) _min.x() = sh._center.x()-sh._radius; if(sh._center.x()+sh._radius>_max.x()) _max.x() = sh._center.x()+sh._radius; diff --git a/src/osg/Group.cpp b/src/osg/Group.cpp index c0970bc13..3eda3cfc1 100644 --- a/src/osg/Group.cpp +++ b/src/osg/Group.cpp @@ -236,7 +236,7 @@ const bool Group::computeBound() const } } - if (!bb.isValid()) return false; + if (!bb.valid()) return false; _bsphere._center = bb.center(); _bsphere._radius = 0.0f; diff --git a/src/osg/ImpostorSprite.cpp b/src/osg/ImpostorSprite.cpp index 946903dbc..e0ab02e5e 100644 --- a/src/osg/ImpostorSprite.cpp +++ b/src/osg/ImpostorSprite.cpp @@ -96,7 +96,7 @@ const bool ImpostorSprite::computeBound() const _bbox_computed=true; - if (!_bbox.isValid()) + if (!_bbox.valid()) { notify(WARN) << "******* ImpostorSprite::computeBound() problem"<getBound(); - if (bs.isValid()) + if (bs.valid()) { // take a copy of the original parent list @@ -133,7 +133,7 @@ void InsertImpostorsVisitor::insertImpostors() if (lod!=previousLOD) { const osg::BoundingSphere& bs = lod->getBound(); - if (bs.isValid()) + if (bs.valid()) { // take a copy of the original parent list diff --git a/src/osgUtil/IntersectVisitor.cpp b/src/osgUtil/IntersectVisitor.cpp index 9ff4ec429..7fdd51e46 100644 --- a/src/osgUtil/IntersectVisitor.cpp +++ b/src/osgUtil/IntersectVisitor.cpp @@ -256,7 +256,7 @@ void IntersectVisitor::popMatrix() bool IntersectVisitor::enterNode(Node& node) { const BoundingSphere& bs = node.getBound(); - if (bs.isValid()) + if (bs.valid()) { IntersectState* cis = _intersectStateStack.back().get(); IntersectState::LineSegmentmentMask sm=0xffffffff;