diff --git a/CMakeLists.txt b/CMakeLists.txt index a6adf30cd..3807dcc97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,9 +443,6 @@ MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGSPHERE) OPTION(OSG_USE_FLOAT_BOUNDINGBOX "Set to ON to build OpenSceneGraph with float BoundingBox instead of double." ON) MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGBOX) -OPTION(OSG_USE_BOUND "Set to ON to build OpenSceneGraph with Bound adapter class to help with porting applications between OSG-3.2 and 3.4 and later." ON) -MARK_AS_ADVANCED(OSG_USE_BOUND) - IF (WIN32) OPTION(OSG_USE_UTF8_FILENAME "Set to ON to use a UTF8 locale for filenames instead of the default locale." OFF) MARK_AS_ADVANCED(OSG_USE_UTF8_FILENAME) diff --git a/include/osg/BoundingSphere b/include/osg/BoundingSphere index eb93ac277..ab6e06c59 100644 --- a/include/osg/BoundingSphere +++ b/include/osg/BoundingSphere @@ -135,7 +135,6 @@ class BoundingSphereImpl return valid() && bs.valid() && ((_center - bs._center).length2() <= (_radius + bs._radius)*(_radius + bs._radius)); } - }; diff --git a/include/osg/Drawable b/include/osg/Drawable index fca8401a7..69e2a560e 100644 --- a/include/osg/Drawable +++ b/include/osg/Drawable @@ -123,19 +123,11 @@ class OSG_EXPORT Drawable : public Node /** Set the initial bounding volume to use when computing the overall bounding volume.*/ const BoundingBox& getInitialBound() const { return _initialBound; } -#ifdef OSG_USE_BOUND - virtual Bound getBound() const - { - if(!_boundingSphereComputed) getBoundingBox(); - return Bound(_boundingSphere, _boundingBox); - } -#else inline const BoundingSphere& getBound() const { if(!_boundingSphereComputed) getBoundingBox(); return _boundingSphere; } -#endif /** Get BoundingBox of Drawable. * If the BoundingBox is not up to date then its updated via an internal call to computeBond(). diff --git a/include/osg/Node b/include/osg/Node index 314299abe..8a7533905 100644 --- a/include/osg/Node +++ b/include/osg/Node @@ -52,45 +52,6 @@ typedef std::vector< NodePath > NodePathList; /** A vector of NodePath, typically used to describe all the paths from a node to the potential root nodes it has.*/ typedef std::vector< Matrix > MatrixList; -#ifdef OSG_USE_BOUND -struct Bound -{ - Bound(): - bb(0), - bs(0) {} - - Bound(const osg::BoundingSphere& bs): - bb(0), - bs(&bs) {} - - Bound(const osg::BoundingBox& bb): - bb(&bb), - bs(0) {} - - Bound(const osg::BoundingSphere& bs, const osg::BoundingBox& bb): - bb(&bb), - bs(&bs) {} - - const osg::BoundingBox* bb; - const osg::BoundingSphere* bs; - - bool valid() const { return bs ? bs->valid() : false; } - - const osg::Vec3& center() const { return bs->center(); } - float radius() const { return bs->radius(); } - - float xMin() const { return bb->xMin(); } - float yMin() const { return bb->yMin(); } - float zMin() const { return bb->zMin(); } - - float xMax() const { return bb->xMax(); } - float yMax() const { return bb->yMax(); } - float zMax() const { return bb->zMax(); } - - operator const osg::BoundingBox& () const { return *bb; } - operator const osg::BoundingSphere& () const { return *bs; } -}; -#endif /** META_Node macro define the standard clone, isSameKindAs, className * and accept methods. Use when subclassing from Node to make it @@ -450,24 +411,7 @@ class OSG_EXPORT Node : public Object Forcing it to be computed on the next call to getBound().*/ void dirtyBound(); - /** Get the bounding sphere of node. - Using lazy evaluation computes the bounding sphere if it is 'dirty'.*/ -#ifdef OSG_USE_BOUND - virtual Bound getBound() const - { - if(!_boundingSphereComputed) - { - _boundingSphere = _initialBound; - if (_computeBoundCallback.valid()) - _boundingSphere.expandBy(_computeBoundCallback->computeBound(*this)); - else - _boundingSphere.expandBy(computeBound()); - _boundingSphereComputed = true; - } - return Bound(_boundingSphere); - } -#else inline const BoundingSphere& getBound() const { if(!_boundingSphereComputed) @@ -482,7 +426,6 @@ class OSG_EXPORT Node : public Object } return _boundingSphere; } -#endif /** Compute the bounding sphere around Node's geometry or children. This method is automatically called by getBound() when the bounding diff --git a/include/osg/Plane b/include/osg/Plane index ff9481cd0..bb9b03342 100644 --- a/include/osg/Plane +++ b/include/osg/Plane @@ -22,10 +22,6 @@ #include #include -#ifdef OSG_USE_BOUND -#include -#endif - #include namespace osg { @@ -325,13 +321,6 @@ class OSG_EXPORT Plane } -#ifdef OSG_USE_BOUND - inline int intersect(const Bound& bound) const - { - if (bound.bb) return intersect(*bound.bb); - else return intersect(*bound.bs); - } -#endif /** Transform the plane by matrix. Note, this operation carries out * the calculation of the inverse of the matrix since a plane * must be multiplied by the inverse transposed to transform it. This diff --git a/include/osg/Polytope b/include/osg/Polytope index fb5791966..1e9c0c7a7 100644 --- a/include/osg/Polytope +++ b/include/osg/Polytope @@ -289,14 +289,6 @@ class OSG_EXPORT Polytope return true; } -#ifdef OSG_USE_BOUND - inline bool contains(const osg::Bound& bound) - { - if (bound.bb) return contains(*bound.bb); - else return contains(*bound.bs); - } -#endif - /** Check whether all of vertex list is contained with clipping set.*/ inline bool containsAllOf(const std::vector& vertices) { diff --git a/src/osg/Config.in b/src/osg/Config.in index dd695b6ab..0bc618c14 100644 --- a/src/osg/Config.in +++ b/src/osg/Config.in @@ -30,7 +30,6 @@ #cmakedefine OSG_USE_FLOAT_BOUNDINGBOX #cmakedefine OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION #cmakedefine OSG_USE_UTF8_FILENAME -#cmakedefine OSG_USE_BOUND #cmakedefine OSG_DISABLE_MSVC_WARNINGS #endif diff --git a/src/osg/Node.cpp b/src/osg/Node.cpp index f0cfd8b7a..2e3ff4383 100644 --- a/src/osg/Node.cpp +++ b/src/osg/Node.cpp @@ -53,6 +53,8 @@ namespace osg }; } + + Node::Node() :Object(true) {