Moved the code referencing osg::BoundingBox::isValid() and

osg::BoundingSphere::isValid() across to use the valid() methods, the later
being more consitent with other classes such as osg::ref_ptr<>.
This commit is contained in:
Robert Osfield
2002-07-11 14:32:21 +00:00
parent b015d80d68
commit c4c97a0f64
12 changed files with 19 additions and 24 deletions

View File

@@ -92,7 +92,7 @@ int main( int argc, char **argv )
if (dynamic_cast<osg::Group*>(model)==0)
{
const osg::BoundingSphere& bs = model->getBound();
if (bs.isValid())
if (bs.valid())
{
osg::Impostor* impostor = new osg::Impostor;

View File

@@ -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;

View File

@@ -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;

View File

@@ -96,7 +96,7 @@ const bool ImpostorSprite::computeBound() const
_bbox_computed=true;
if (!_bbox.isValid())
if (!_bbox.valid())
{
notify(WARN) << "******* ImpostorSprite::computeBound() problem"<<std::endl;
notify(WARN) << "******* = "<<_coords[0]<<std::endl;

View File

@@ -124,7 +124,7 @@ const bool LineSegment::intersectAndClip(Vec3& s,Vec3& e,const BoundingBox& bb)
const bool LineSegment::intersect(const BoundingBox& bb) const
{
if (!bb.isValid()) return false;
if (!bb.valid()) return false;
Vec3 s=_s,e=_e;
return intersectAndClip(s,e,bb);
@@ -133,7 +133,7 @@ const bool LineSegment::intersect(const BoundingBox& bb) const
const bool LineSegment::intersect(const BoundingBox& bb,float& r1,float& r2) const
{
if (!bb.isValid()) return false;
if (!bb.valid()) return false;
Vec3 s=_s,e=_e;
bool result = intersectAndClip(s,e,bb);

View File

@@ -710,7 +710,7 @@ ImpostorSprite* CullVisitor::createImpostorSprite(Impostor& node)
osg::Vec3 eye_local = getEyeLocal();
int eval = node.evaluate(eye_local,_LODBias);
if (!bs.isValid())
if (!bs.valid())
{
osg::notify(osg::WARN) << "bb invalid"<<&node<<std::endl;
return NULL;

View File

@@ -84,7 +84,7 @@ void InsertImpostorsVisitor::insertImpostors()
if (group!=previousGroup)
{
const BoundingSphere& bs = group->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

View File

@@ -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;