#include <OSGSphereVolume.h>
Inheritance diagram for osg::SphereVolume:

Public Member Functions | |
| bool | operator== (const Volume &other) const |
| bool | operator!= (const Volume &other) const |
State | |
| *void | setValid (const bool value=true) |
| bool | isValid (void) const |
| void | setEmpty (const bool value=true) |
| bool | isEmpty (void) const |
| void | setStatic (const bool value=true) |
| bool | isStatic (void) const |
| void | setInfinite (const bool value=true) |
| bool | isInfinite (void) const |
| bool | isUntouchable (void) const |
| UInt16 | getState (void) const |
| void | setState (UInt16 state) |
Get Values | |
| Pnt3f | getMin (void) const |
| Pnt3f | getMax (void) const |
Constructor | |
| * | SphereVolume (void) |
| SphereVolume (const SphereVolume &obj) | |
| SphereVolume (const Pnt3f &c, Real32 r) | |
Destructor | |
| * | ~SphereVolume (void) |
Set Values | |
| *void | setValue (const Pnt3f &c, Real32 r) |
| void | setCenter (const Pnt3f &c) |
| void | setRadius (Real32 r) |
Get Values | |
| *const Pnt3f & | getCenter (void) const |
| Real32 | getRadius (void) const |
| virtual void | getCenter (Pnt3f ¢er) const |
| virtual Real32 | getScalarVolume (void) const |
| virtual void | getBounds (Pnt3f &min, Pnt3f &max) const |
Extending | |
| *virtual void | extendBy (const Pnt3f &pt) |
| virtual void | extendBy (const Volume &volume) |
| void | extendBy (const SphereVolume &bb) |
Intersection | |
| *virtual bool | intersect (const Pnt3f &point) const |
| virtual bool | intersect (const Line &line) const |
| virtual bool | intersect (const Line &line, Real32 &enter, Real32 &exit) const |
| virtual bool | intersect (const Volume &volume) const |
| bool | intersect (const SphereVolume &sphere) const |
| virtual bool | isOnSurface (const Pnt3f &point) const |
Transformation | |
| *virtual void | transform (const Matrix &mat) |
Output | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
State | |
| *void | setValid (const bool value=true) |
| bool | isValid (void) const |
| void | setEmpty (const bool value=true) |
| bool | isEmpty (void) const |
| void | setStatic (const bool value=true) |
| bool | isStatic (void) const |
| void | setInfinite (const bool value=true) |
| bool | isInfinite (void) const |
| bool | isUntouchable (void) const |
| UInt16 | getState (void) const |
| void | setState (UInt16 state) |
Get Values | |
| Pnt3f | getMin (void) const |
| Pnt3f | getMax (void) const |
Protected Attributes | |
| UInt16 | _state |
Private Attributes | |
| Pnt3f | _center |
| Real32 | _radius |
Definition at line 53 of file OSGSphereVolume.h.
|
|
Definition at line 50 of file OSGSphereVolume.inl.
|
|
|
Definition at line 58 of file OSGSphereVolume.inl. References osg::Volume::setEmpty(). 00058 : 00059 Volume( ), 00060 _center(obj._center), 00061 _radius(obj._radius) 00062 { 00063 setEmpty(false); 00064 }
|
|
||||||||||||
|
Definition at line 67 of file OSGSphereVolume.inl. References osg::Volume::setEmpty().
|
|
|
Definition at line 76 of file OSGSphereVolume.inl.
|
|
||||||||||||
|
Change the center and radius Definition at line 85 of file OSGSphereVolume.inl. References _center, _radius, and osg::Volume::setEmpty(). Referenced by osg::DynamicVolume::morphToType().
|
|
|
set just the center Definition at line 97 of file OSGSphereVolume.inl. References _center. Referenced by osg::FieldDataTraits< DynamicVolume >::copyFromBin(), and osg::FieldDataTraits< DynamicVolume >::getFromString(). 00098 { 00099 _center = c; 00100 }
|
|
|
set just the radius Definition at line 105 of file OSGSphereVolume.inl. References _radius. Referenced by osg::FieldDataTraits< DynamicVolume >::copyFromBin(), and osg::FieldDataTraits< DynamicVolume >::getFromString(). 00106 { 00107 _radius = r; 00108 }
|
|
|
Returns the center Definition at line 115 of file OSGSphereVolume.inl. References _center. Referenced by osg::FieldDataTraits< DynamicVolume >::copyToBin(), osg::Line::intersect(), and osg::FieldDataTraits< DynamicVolume >::putToString(). 00116 { 00117 return _center; 00118 }
|
|
|
Returns the radius Definition at line 123 of file OSGSphereVolume.inl. References _radius. Referenced by osg::FieldDataTraits< DynamicVolume >::copyToBin(), osg::Line::intersect(), and osg::FieldDataTraits< DynamicVolume >::putToString(). 00124 { 00125 return _radius; 00126 }
|
|
|
Returns the center Implements osg::Volume. Definition at line 72 of file OSGSphereVolume.cpp. References _center. 00073 { 00074 center = _center; 00075 }
|
|
|
Returns the center Implements osg::Volume. Definition at line 78 of file OSGSphereVolume.cpp. References _radius, osg::Volume::isEmpty(), and osg::Pi.
|
|
||||||||||||
|
Returns the center Implements osg::Volume. Definition at line 84 of file OSGSphereVolume.cpp. References _center, _radius, and osg::VecStorage3< ValueTypeT >::setValues(). 00085 { 00086 min.setValues(_center[0] - _radius, 00087 _center[1] - _radius, 00088 _center[2] - _radius); 00089 max.setValues(_center[0] + _radius, 00090 _center[1] + _radius, 00091 _center[2] + _radius); 00092 }
|
|
|
Implements osg::Volume. Definition at line 95 of file OSGSphereVolume.cpp. References _center, _radius, osg::Volume::isEmpty(), osg::Volume::isUntouchable(), and osg::Volume::setEmpty(). 00096 { 00097 if(isUntouchable() == true) 00098 return; 00099 00100 if(isEmpty() == true) 00101 { 00102 _center = pt; 00103 _radius = 0.f; 00104 00105 setEmpty(false); 00106 } 00107 else 00108 { 00109 Real32 d = (_center - pt).length(); 00110 00111 if(d > _radius) 00112 _radius = d; 00113 } 00114 }
|
|
|
Implements osg::Volume. Definition at line 117 of file OSGSphereVolume.cpp. References osg::extend(). 00118 { 00119 OSG::extend(*this, volume); 00120 }
|
|
|
Definition at line 131 of file OSGSphereVolume.inl. References osg::extend(). 00132 { 00133 OSG::extend(*this, volume); 00134 }
|
|
|
Returns true if intersection of given point and Volume is not empty Implements osg::Volume. Definition at line 126 of file OSGSphereVolume.cpp. References _center, and _radius. 00127 { 00128 Real32 d = (_center - point).length(); 00129 00130 if(d <= _radius) 00131 return true; 00132 else 00133 return false; 00134 }
|
|
|
intersect the SphereVolume with the given Line Implements osg::Volume. Definition at line 138 of file OSGSphereVolume.cpp. References osg::Line::intersect(). 00139 { 00140 return line.intersect(*this); 00141 }
|
|
||||||||||||||||
|
intersect the SphereVolume with the given Line Implements osg::Volume. Definition at line 145 of file OSGSphereVolume.cpp. References osg::Line::intersect(). 00148 { 00149 return line.intersect(*this, enter, exit); 00150 }
|
|
|
Returns true if intersection of given point and Volume is not empty Implements osg::Volume. Definition at line 153 of file OSGSphereVolume.cpp. References osg::intersect(). 00154 { 00155 return OSG::intersect(*this, volume); 00156 }
|
|
|
Returns true if intersection of given point and Volume is not empty Definition at line 139 of file OSGSphereVolume.inl. References osg::intersect(). 00140 { 00141 return OSG::intersect(*this, volume); 00142 }
|
|
|
Returns true if intersection of given point and Volume is not empty Implements osg::Volume. Definition at line 159 of file OSGSphereVolume.cpp. References _center, _radius, osg::Eps, and osg::osgabs(). 00160 { 00161 if(osgabs((point - _center).length() - _radius) < Eps) 00162 return true; 00163 else 00164 return false; 00165 }
|
|
|
Implements osg::Volume. Definition at line 174 of file OSGSphereVolume.cpp. References _center, _radius, and osg::TransformationMatrix< ValueTypeT >::mult(). 00175 { 00176 // assume uniform scaling, otherways we get an ellipsoid 00177 Pnt3f hull(_center); 00178 hull += Vec3f(0, _radius, 0); 00179 00180 mat.mult(_center); 00181 mat.mult(hull); 00182 _radius = (hull - _center).length(); 00183 00184 /* 00185 Vec3f translation, scaleFactor; 00186 Quaternion rotation, scaleOrientation; 00187 00188 mat.mult(_center); 00189 mat.getTransform(translation, rotation, scaleFactor, scaleOrientation); 00190 _radius *= scaleFactor[0]; 00191 */ 00192 }
|
|
||||||||||||
|
print the volume Implements osg::Volume. Definition at line 199 of file OSGSphereVolume.cpp. References _center, _radius, and PLOG.
|
|
|
set the volume to be valid Definition at line 82 of file OSGVolume.inl. References osg::Volume::_state, osg::Volume::isStatic(), and osg::Volume::OSGVALID. Referenced by osg::Surface::adjustVolume(), osg::Slices::adjustVolume(), osg::ProxyGroup::adjustVolume(), osg::Particles::adjustVolume(), osg::Geometry::adjustVolume(), osg::DVRVolume::adjustVolume(), osg::Node::invalidateVolume(), osg::BoxVolume::setBounds(), and osg::BoxVolume::setBoundsByCenterAndSize(). 00083 { 00084 if(!isStatic()) 00085 { 00086 if(value == true) 00087 _state |= OSGVALID; 00088 else 00089 _state &= ~OSGVALID; 00090 } 00091 }
|
|
|
Checks if the volume is valid Definition at line 96 of file OSGVolume.inl. References osg::Volume::_state, and osg::Volume::OSGVALID. Referenced by osg::Group::intersect(), osg::Geometry::intersect(), osg::DVRVolume::intersect(), and osg::Node::invalidateVolume().
|
|
|
set the volume to contain nothing Definition at line 104 of file OSGVolume.inl. References osg::Volume::_state, osg::Volume::OSGEMPTY, osg::Volume::OSGINFINITE, and osg::Volume::OSGVALID. Referenced by osg::Surface::adjustVolume(), osg::Slices::adjustVolume(), osg::ProxyGroup::adjustVolume(), osg::Particles::adjustVolume(), osg::Geometry::adjustVolume(), osg::DVRVolume::adjustVolume(), osg::BoxVolume::BoxVolume(), osg::CylinderVolume::CylinderVolume(), osg::ParticleBSPTree::doBuild(), extendBy(), osg::BoxVolume::extendBy(), osg::BoxVolume::setBounds(), osg::BoxVolume::setBoundsByCenterAndSize(), setValue(), SphereVolume(), and osg::Node::updateVolume(). 00105 { 00106 if(value == true) 00107 { 00108 _state |= OSGEMPTY; 00109 _state |= OSGVALID; 00110 _state &= ~OSGINFINITE; 00111 } 00112 else 00113 { 00114 _state &= ~OSGEMPTY; 00115 } 00116 }
|
|
|
Checks if the volume is empty Definition at line 121 of file OSGVolume.inl. References osg::Volume::_state, and osg::Volume::OSGEMPTY. Referenced by extendBy(), osg::BoxVolume::extendBy(), osg::BoxVolume::getCenter(), getScalarVolume(), osg::CylinderVolume::getScalarVolume(), osg::BoxVolume::getScalarVolume(), osg::BoxVolume::intersect(), and osg::BoxVolume::transform().
|
|
|
set the volume to be static Definition at line 63 of file OSGVolume.inl. References osg::Volume::_state, and osg::Volume::OSGSTATIC. 00064 { 00065 if(value == true) 00066 _state |= OSGSTATIC; 00067 else 00068 _state &= ~OSGSTATIC; 00069 }
|
|
|
Checks if the volume is static Definition at line 74 of file OSGVolume.inl. References osg::Volume::_state, and osg::Volume::OSGSTATIC. Referenced by osg::Node::invalidateVolume(), and osg::Volume::setValid().
|
|
|
set the volume to be infinite Definition at line 129 of file OSGVolume.inl. References osg::Volume::_state, osg::Volume::OSGEMPTY, osg::Volume::OSGINFINITE, and osg::Volume::OSGVALID. Referenced by osg::BoxVolume::setBounds(), and osg::BoxVolume::setBoundsByCenterAndSize(). 00130 { 00131 if(value == true) 00132 { 00133 _state |= OSGINFINITE; 00134 _state |= OSGVALID; 00135 _state &= ~OSGEMPTY; 00136 } 00137 else 00138 { 00139 _state &= ~OSGINFINITE; 00140 } 00141 }
|
|
|
Checks if the volume is infinite Definition at line 146 of file OSGVolume.inl. References osg::Volume::_state, and osg::Volume::OSGINFINITE. 00147 { 00148 return (_state & OSGINFINITE) ? true : false; 00149 }
|
|
|
Checks if the volume is untouchable, i.e. it's values should not be changed. Mainly used internally to speed up early outs in extendBy(). Definition at line 157 of file OSGVolume.inl. References osg::Volume::_state, osg::Volume::OSGINFINITE, osg::Volume::OSGSTATIC, and osg::Volume::OSGVALID. Referenced by extendBy(), and osg::BoxVolume::extendBy(). 00158 { 00159 return (_state & (OSGINFINITE | OSGVALID | OSGSTATIC)) != OSGVALID; 00160 }
|
|
|
get the volume's state Definition at line 166 of file OSGVolume.inl. References osg::Volume::_state. Referenced by osg::FieldDataTraits< DynamicVolume >::copyToBin(), and osg::DynamicVolume::instanceChanged(). 00167 { 00168 return _state; 00169 }
|
|
|
set the volume's state Definition at line 174 of file OSGVolume.inl. References osg::Volume::_state. Referenced by osg::FieldDataTraits< DynamicVolume >::copyFromBin(). 00175 { 00176 _state = val; 00177 }
|
|
|
Return the lowest point of the volume. Just a convience wrapper for getBounds() Reimplemented in osg::BoxVolume. Definition at line 184 of file OSGVolume.inl. References osg::Volume::getBounds(). 00185 { 00186 Pnt3f pmin; 00187 Pnt3f pmax; 00188 00189 getBounds(pmin, pmax); 00190 00191 return pmin; 00192 }
|
|
|
Return the highest point of the volume. Just a convience wrapper for getBounds() Reimplemented in osg::BoxVolume. Definition at line 199 of file OSGVolume.inl. References osg::Volume::getBounds(). 00200 { 00201 Pnt3f pmin; 00202 Pnt3f pmax; 00203 00204 getBounds(pmin, pmax); 00205 00206 return pmax; 00207 }
|
|
|
Definition at line 53 of file OSGVolume.cpp. References osg::Volume::_state. 00054 { 00055 return _state == other._state; 00056 }
|
|
|
Definition at line 58 of file OSGVolume.cpp.
|
|
|
Definition at line 144 of file OSGSphereVolume.h. Referenced by dump(), extendBy(), getBounds(), getCenter(), intersect(), isOnSurface(), setCenter(), setValue(), and transform(). |
|
|
Definition at line 145 of file OSGSphereVolume.h. Referenced by dump(), extendBy(), getBounds(), getRadius(), getScalarVolume(), intersect(), isOnSurface(), setRadius(), setValue(), and transform(). |
|
1.4.3