#include <OSGCylinderVolume.h>
Inheritance diagram for osg::CylinderVolume:

Public Member Functions | |
| bool | operator== (const Volume &other) const |
| bool | operator!= (const Volume &other) const |
Constructors | |
| * | CylinderVolume (void) |
| CylinderVolume (const Pnt3f &p, const Vec3f &d, Real32 r) | |
| CylinderVolume (const CylinderVolume &c) | |
Destructors | |
| * | ~CylinderVolume (void) |
Get | |
| *void | getAxis (Pnt3f &apos, Vec3f &adir) const |
| Real32 | getRadius (void) const |
| virtual void | getCenter (Pnt3f ¢er) const |
| virtual Real32 | getScalarVolume (void) const |
| virtual void | getBounds (Pnt3f &min, Pnt3f &max) const |
Set | |
| *void | setValue (const Pnt3f &p, const Vec3f &d, Real32 r) |
| void | setAxis (const Pnt3f &p, const Vec3f &d) |
| void | setRadius (Real32 r) |
Extend | |
| *virtual void | extendBy (const Pnt3f &pt) |
| virtual void | extendBy (const Volume &volume) |
| void | extendBy (const CylinderVolume &obj) |
Intersect | |
| *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 CylinderVolume &volume) const |
| virtual bool | isOnSurface (const Pnt3f &point) const |
Transform | |
| *virtual void | transform (const Matrix &mat) |
Output | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
| print the volume | |
Protected Attributes | |
| UInt16 | _state |
Private Attributes | |
| Pnt3f | _axisPos |
| Vec3f | _axisDir |
| Real32 | _radius |
Definition at line 54 of file OSGCylinderVolume.h.
|
|
Definition at line 51 of file OSGCylinderVolume.inl. 00051 : 00052 Volume() 00053 { 00054 }
|
|
||||||||||||||||
|
Definition at line 58 of file OSGCylinderVolume.inl. References osg::Volume::setEmpty(). 00060 : 00061 Volume ( ), 00062 _axisPos(p), 00063 _axisDir(d), 00064 _radius (r) 00065 { 00066 setEmpty(false); 00067 }
|
|
|
Definition at line 71 of file OSGCylinderVolume.inl. 00071 : 00072 Volume (c ), 00073 _axisPos(c._axisPos), 00074 _axisDir(c._axisDir), 00075 _radius (c._radius ) 00076 { 00077 }
|
|
|
Definition at line 81 of file OSGCylinderVolume.inl.
|
|
||||||||||||
|
Definition at line 87 of file OSGCylinderVolume.inl. References _axisDir, and _axisPos. Referenced by osg::Line::intersect().
|
|
|
Definition at line 95 of file OSGCylinderVolume.inl. References _radius. Referenced by osg::Line::intersect(). 00096 { 00097 return _radius; 00098 }
|
|
|
Implements osg::Volume. Definition at line 56 of file OSGCylinderVolume.cpp. References _axisDir, and _axisPos.
|
|
|
Implements osg::Volume. Definition at line 62 of file OSGCylinderVolume.cpp. References _axisDir, _radius, osg::Volume::isEmpty(), osg::VectorInterface< ValueTypeT, StorageInterfaceT >::length(), and osg::Pi.
|
|
||||||||||||
|
gives the boundaries of the volume Implements osg::Volume. Definition at line 69 of file OSGCylinderVolume.cpp. References _axisDir, _axisPos, and _radius. 00070 { 00071 // this is rather simpleminded, but good enough for now 00072 00073 if(_axisDir[0] < 0) 00074 { 00075 min[0] = _axisPos[0] + _axisDir[0] - _radius; 00076 max[0] = _axisPos[0] - _axisDir[0] + _radius; 00077 } 00078 else 00079 { 00080 min[0] = _axisPos[0] - _axisDir[0] - _radius; 00081 max[0] = _axisPos[0] + _axisDir[0] + _radius; 00082 } 00083 00084 if(_axisDir[1] < 0) 00085 { 00086 min[1] = _axisPos[1] + _axisDir[1] - _radius; 00087 max[1] = _axisPos[1] - _axisDir[1] + _radius; 00088 } 00089 else 00090 { 00091 min[1] = _axisPos[1] - _axisDir[1] - _radius; 00092 max[1] = _axisPos[1] + _axisDir[1] + _radius; 00093 } 00094 00095 if(_axisDir[2] < 0) 00096 { 00097 min[2] = _axisPos[2] + _axisDir[2] - _radius; 00098 max[2] = _axisPos[2] - _axisDir[2] + _radius; 00099 } 00100 else 00101 { 00102 min[2] = _axisPos[2] - _axisDir[2] - _radius; 00103 max[2] = _axisPos[2] + _axisDir[2] + _radius; 00104 } 00105 }
|
|
||||||||||||||||
|
Definition at line 102 of file OSGCylinderVolume.inl. References _axisDir, _axisPos, and _radius.
|
|
||||||||||||
|
Definition at line 111 of file OSGCylinderVolume.inl. References _axisDir, and _axisPos.
|
|
|
Definition at line 119 of file OSGCylinderVolume.inl. References _radius. 00120 { 00121 _radius = r; 00122 }
|
|
|
extends (if necessary) to contain the given 3D point Implements osg::Volume. Definition at line 115 of file OSGCylinderVolume.cpp.
|
|
|
extends (if necessary) to contain the given 3D point Implements osg::Volume. Definition at line 121 of file OSGCylinderVolume.cpp. References osg::extend(). 00122 { 00123 OSG::extend(*this, volume); 00124 }
|
|
|
extends (if necessary) to contain the given 3D point Definition at line 126 of file OSGCylinderVolume.inl. References osg::extend(). 00127 { 00128 OSG::extend(*this, volume); 00129 }
|
|
|
Returns true if intersection of given point and CylinderVolume is not empty Implements osg::Volume. Definition at line 137 of file OSGCylinderVolume.cpp. References _axisDir, _axisPos, _radius, and osg::Plane::isInHalfSpace(). 00138 { 00139 Real32 dist = Line(_axisPos, _axisDir).distance(point); 00140 00141 if(dist > _radius) 00142 return false; 00143 00144 Plane bottom( _axisDir, _axisPos ); 00145 Plane top (-_axisDir, _axisPos + _axisDir); 00146 00147 bool inspace = bottom.isInHalfSpace(point) && top.isInHalfSpace(point); 00148 00149 return inspace; 00150 }
|
|
|
intersect the CylinderVolume with the given Line Implements osg::Volume. Definition at line 155 of file OSGCylinderVolume.cpp. References osg::Line::intersect(). 00156 { 00157 return line.intersect(*this); 00158 }
|
|
||||||||||||||||
|
intersect the volume with the given Line Implements osg::Volume. Definition at line 162 of file OSGCylinderVolume.cpp. References osg::Line::intersect(). 00165 { 00166 return line.intersect(*this, enter, exit); 00167 }
|
|
|
Returns true if intersection of given point and CylinderVolume is not empty Implements osg::Volume. Definition at line 169 of file OSGCylinderVolume.cpp. References osg::intersect(). 00170 { 00171 return OSG::intersect(*this,volume); 00172 }
|
|
|
Returns true if intersection of given point and CylinderVolume is not empty Definition at line 133 of file OSGCylinderVolume.inl. References osg::intersect(). 00134 { 00135 return OSG::intersect(*this, volume); 00136 }
|
|
|
Returns true if intersection of given point and CylinderVolume is not empty Implements osg::Volume. Definition at line 175 of file OSGCylinderVolume.cpp. References _axisDir, _axisPos, _radius, osg::Eps, osg::Plane::isOnPlane(), and osg::osgabs(). 00176 { 00177 Real32 dist = Line(_axisPos, _axisDir).distance(point); 00178 00179 if(dist > _radius) 00180 return false; 00181 00182 Plane bottom(-_axisDir, _axisPos ); 00183 Plane top ( _axisDir, _axisPos + _axisDir); 00184 00185 bool onplane = bottom.isOnPlane(point) || top.isOnPlane(point); 00186 00187 return ( onplane && dist <= _radius ) || 00188 (!onplane && osgabs(dist - _radius) < Eps); 00189 }
|
|
|
transform volume by the given matrix Implements osg::Volume. Definition at line 199 of file OSGCylinderVolume.cpp.
|
|
||||||||||||
|
Implements osg::Volume. Definition at line 210 of file OSGCylinderVolume.cpp. References _axisDir, _axisPos, _radius, and PLOG. 00212 { 00213 PLOG << "Cylinder(" 00214 << _axisPos 00215 << "|" 00216 << _axisDir 00217 << "|" 00218 << _radius 00219 << ")"; 00220 }
|
|
|
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(), CylinderVolume(), osg::ParticleBSPTree::doBuild(), osg::SphereVolume::extendBy(), osg::BoxVolume::extendBy(), osg::BoxVolume::setBounds(), osg::BoxVolume::setBoundsByCenterAndSize(), osg::SphereVolume::setValue(), osg::SphereVolume::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 osg::SphereVolume::extendBy(), osg::BoxVolume::extendBy(), osg::BoxVolume::getCenter(), osg::SphereVolume::getScalarVolume(), 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 osg::SphereVolume::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 148 of file OSGCylinderVolume.h. Referenced by dump(), getAxis(), getBounds(), getCenter(), intersect(), isOnSurface(), setAxis(), and setValue(). |
|
|
Definition at line 149 of file OSGCylinderVolume.h. Referenced by dump(), getAxis(), getBounds(), getCenter(), getScalarVolume(), intersect(), isOnSurface(), setAxis(), and setValue(). |
|
|
Definition at line 150 of file OSGCylinderVolume.h. Referenced by dump(), getBounds(), getRadius(), getScalarVolume(), intersect(), isOnSurface(), setRadius(), and setValue(). |
|
1.4.3