SoBoundingBoxCache(3) Coin SoBoundingBoxCache(3)NAME
SoBoundingBoxCache -
The SoBoundingBoxCache class is used to cache bounding boxes.
SYNOPSIS
#include <Inventor/caches/SoBoundingBoxCache.h>
Inherits SoCache.
Public Member Functions
SoBoundingBoxCache (SoState *state)
virtual ~SoBoundingBoxCache ()
void set (const SbXfBox3f &boundingbox, SbBool centerset, const SbVec3f ¢erpoint)
const SbXfBox3f & getBox () const
const SbBox3f & getProjectedBox () const
SbBool isCenterSet () const
const SbVec3f & getCenter () const
SbBool hasLinesOrPoints (void) const
Static Public Member Functions
static void setHasLinesOrPoints (SoState *state)
Additional Inherited Members
Detailed Description
The SoBoundingBoxCache class is used to cache bounding boxes.
Constructor & Destructor Documentation
SoBoundingBoxCache::SoBoundingBoxCache (SoState *state)
Constructor with state being the current state.
SoBoundingBoxCache::~SoBoundingBoxCache () [virtual]
Destructor.
Member Function Documentation
void SoBoundingBoxCache::set (const SbXfBox3f &boundingbox, SbBoolcenterset, const SbVec3f ¢erpoint)
Sets the data for this cache. boundingBox is the node's bounding box, centerSet and centerPoints specifies the center of the geometry
inside boundingBox.
const SbXfBox3f & SoBoundingBoxCache::getBox (void) const
Returns the bounding box for this cache.
const SbBox3f & SoBoundingBoxCache::getProjectedBox (void) const
Returns the projected bounding box for this cache.
SbBool SoBoundingBoxCache::isCenterSet (void) const
Returns whether the center of the bounding box was set in the SoBoundingBoxCache::set() method.
See also:
SoBoundingBoxCache::getCenter()
const SbVec3f & SoBoundingBoxCache::getCenter (void) const
Returns the center of the bounding box. Should only be used if SoBoundingBoxCache::isCenterSet() returns TRUE.
void SoBoundingBoxCache::setHasLinesOrPoints (SoState *state) [static]
Sets the flag returned from SoBoundingBoxCache::hasLinesOrPoints() to TRUE for all open bounding box caches.
The reason bounding box caches keep a lines-or-points flag is to make it known to client code if the shape(s) they contain have any of
these primitives -- or are rendered with these primitives. The reason this is important to know for the client code is because it might
need to add an 'epsilon' slack value to the calculated bounding box to account for smoothing / anti-aliasing effects in the renderer, so
lines and points graphics is not accidently clipped by near and far clipping planes, for instance.
This method is a static method on the class. It will upon invocation scan through the state stack and set the flag for all open
SoBoundingBoxCache elements. It has been made to work like this so it can easily be invoked on all current bounding box cache instances
from the SoShape-type nodes using lines and / or point primitives.
See also:
hasLinesOrPoints()
SbBool SoBoundingBoxCache::hasLinesOrPoints (void) const
Return TRUE if the hasLinesOrPoints flag has been set.
See also:
setHasLinesOrPoints()
Author
Generated automatically by Doxygen for Coin from the source code.
Version 3.1.3 Wed May 23 2012 SoBoundingBoxCache(3)
Check Out this Related Man Page
SbSphere(3) Coin SbSphere(3)NAME
SbSphere -
The SbSphere class is a representation of a sphere.
This class is used within many other classes in Coin. It contains the data neccessary to represent a sphere (a 3D point and a radius).
SYNOPSIS
#include <Inventor/SbLinear.h>
Public Member Functions
SbSphere (void)
SbSphere (const SbVec3f ¢er, const float radius)
void setValue (const SbVec3f ¢er, const float radius)
void setCenter (const SbVec3f ¢er)
void setRadius (const float radius)
const SbVec3f & getCenter (void) const
float getRadius (void) const
void circumscribe (const SbBox3f &box)
SbBool intersect (const SbLine &l, SbVec3f &intersection) const
SbBool intersect (const SbLine &l, SbVec3f &enter, SbVec3f &exit) const
SbBool pointInside (const SbVec3f &p) const
void print (FILE *file) const
Detailed Description
The SbSphere class is a representation of a sphere.
This class is used within many other classes in Coin. It contains the data neccessary to represent a sphere (a 3D point and a radius).
See also:
SbCylinder
Constructor & Destructor Documentation
SbSphere::SbSphere (void)
The default constructor does nothing. The center point and the radius will be uninitialized.
SbSphere::SbSphere (const SbVec3f ¢erarg, const floatradiusarg)
Construct an SbSphere instance with the given center point and radius.
Member Function Documentation
void SbSphere::setValue (const SbVec3f ¢erarg, const floatradiusarg)
Set the sphere's center point and radius.
See also:
getCenter(), getRadius().
void SbSphere::setCenter (const SbVec3f ¢erarg)
Set the sphere's center point.
See also:
setValue(), setRadius() and getCenter().
void SbSphere::setRadius (const floatradiusarg)
Set the sphere's radius.
See also:
setValue(), setCenter() and getRadius().
const SbVec3f & SbSphere::getCenter (void) const
Returns an SbVec3f with the sphere's center point.
See also:
setCenter(), getRadius().
float SbSphere::getRadius (void) const
Returns the sphere's radius.
See also:
setRadius(), getCenter().
void SbSphere::circumscribe (const SbBox3f &box)
Make the sphere exactly contain box, i.e. the sphere center point will be the same as that of the box, and the radius will be the distance
from the box center point to any of the corners.
SbBool SbSphere::intersect (const SbLine &l, SbVec3f &intersection) const
Finds the intersection enter point for the given line l on the sphere.
If the line does not intersect the sphere, FALSE is returned.
SbBool SbSphere::intersect (const SbLine &l, SbVec3f &enter, SbVec3f &exit) const
Find the intersection points of the ray l on the sphere and return these in enter and exit. If the ray just 'grazes' the sphere, the enter
and exit points have equal values.
If the ray does not intersect the sphere, FALSE is returned, otherwise we will return TRUE.
SbBool SbSphere::pointInside (const SbVec3f &p) const
Returns TRUE of the given point p lies within the sphere.
void SbSphere::print (FILE *fp) const
Dump the state of this object to the file stream. Only works in debug version of library, method does nothing in an optimized compile.
Author
Generated automatically by Doxygen for Coin from the source code.
Version 3.1.3 Wed May 23 2012 SbSphere(3)