#include <GeneralNSurfaceDelimitedBounds.h>
Public Types | |
typedef std::pair< const Surface *, SurfaceOrientation::Side > | SurfaceAndSide |
typedef std::vector < SurfaceAndSide > | SurfaceContainer |
Public Member Functions | |
virtual Bounds * | clone () const |
GeneralNSurfaceDelimitedBounds (const Surface *surf, const std::vector< SurfaceAndSide > &limits) | |
virtual bool | inside (const Local3DPoint &lp) const |
Determine if the point is inside the bounds. | |
virtual bool | inside (const Local3DPoint &, const LocalError &, float scale=1.f) const |
Determine if a point is inside the bounds, taking error into account. | |
virtual float | length () const |
virtual float | thickness () const |
virtual float | width () const |
Private Member Functions | |
bool | myInside (const Local3DPoint &lp, float tolerance) const |
Private Attributes | |
SurfaceContainer | theLimits |
const Surface * | theSurface |
Bounds for a surface of any type, delimited by N other surfaces of any type. A point is "inside" if it is on the correct side of all delimiting surfaces. This way of computing "inside" is relatively expensive, and should only be applied to situations where there is no specialized implementation for the concrete surface types.
Definition at line 16 of file GeneralNSurfaceDelimitedBounds.h.
typedef std::pair<const Surface*, SurfaceOrientation::Side> GeneralNSurfaceDelimitedBounds::SurfaceAndSide |
Definition at line 19 of file GeneralNSurfaceDelimitedBounds.h.
typedef std::vector<SurfaceAndSide> GeneralNSurfaceDelimitedBounds::SurfaceContainer |
Definition at line 20 of file GeneralNSurfaceDelimitedBounds.h.
GeneralNSurfaceDelimitedBounds::GeneralNSurfaceDelimitedBounds | ( | const Surface * | surf, |
const std::vector< SurfaceAndSide > & | limits | ||
) | [inline] |
Definition at line 22 of file GeneralNSurfaceDelimitedBounds.h.
Referenced by clone().
: theLimits( limits), theSurface(surf) {}
virtual Bounds* GeneralNSurfaceDelimitedBounds::clone | ( | void | ) | const [inline, virtual] |
Implements Bounds.
Definition at line 37 of file GeneralNSurfaceDelimitedBounds.h.
References GeneralNSurfaceDelimitedBounds().
{return new GeneralNSurfaceDelimitedBounds(*this);}
bool GeneralNSurfaceDelimitedBounds::inside | ( | const Local3DPoint & | , |
const LocalError & | , | ||
float | scale = 1.f |
||
) | const [virtual] |
Determine if a point is inside the bounds, taking error into account.
Implements Bounds.
Definition at line 6 of file GeneralNSurfaceDelimitedBounds.cc.
References myInside(), mathSSE::sqrt(), LocalError::xx(), and LocalError::yy().
virtual bool GeneralNSurfaceDelimitedBounds::inside | ( | const Local3DPoint & | ) | const [inline, virtual] |
Determine if the point is inside the bounds.
Implements Bounds.
Definition at line 31 of file GeneralNSurfaceDelimitedBounds.h.
References myInside().
{ return myInside(lp,0); }
virtual float GeneralNSurfaceDelimitedBounds::length | ( | ) | const [inline, virtual] |
"Lenght" of the bounded volume; refer to the concrete class documentation for the specific definition.
Implements Bounds.
Definition at line 26 of file GeneralNSurfaceDelimitedBounds.h.
{ return 0;}
bool GeneralNSurfaceDelimitedBounds::myInside | ( | const Local3DPoint & | lp, |
float | tolerance | ||
) | const [private] |
Definition at line 15 of file GeneralNSurfaceDelimitedBounds.cc.
References i, SurfaceOrientation::onSurface, theLimits, theSurface, and Surface::toGlobal().
Referenced by inside().
{ // cout << "GeneralNSurfaceDelimitedBounds::myInside called with local point " << lp << endl; Surface::GlobalPoint gp = theSurface->toGlobal(lp); // cout << "corresponding Global point " << gp << endl; for (SurfaceContainer::const_iterator i=theLimits.begin(); i!=theLimits.end(); i++) { // cout << "Local pos in boundary surface " << i->first->toLocal(gp) // << " side " << i->first->side(gp, tolerance) << " should be " // << i->second << endl; SurfaceOrientation::Side side = i->first->side(gp, tolerance); if (side != i->second && side != SurfaceOrientation::onSurface) return false; } return true; }
virtual float GeneralNSurfaceDelimitedBounds::thickness | ( | ) | const [inline, virtual] |
"Thickness" of the bound around the surface; refer to the concrete class documentation for the specific definition.
Implements Bounds.
Definition at line 28 of file GeneralNSurfaceDelimitedBounds.h.
{ return 0;}
virtual float GeneralNSurfaceDelimitedBounds::width | ( | ) | const [inline, virtual] |
"width" of the bounds; refer to the concrete class documentation for the specific definition.
Implements Bounds.
Definition at line 27 of file GeneralNSurfaceDelimitedBounds.h.
{ return 0;}
Definition at line 41 of file GeneralNSurfaceDelimitedBounds.h.
Referenced by myInside().
const Surface* GeneralNSurfaceDelimitedBounds::theSurface [private] |
Definition at line 42 of file GeneralNSurfaceDelimitedBounds.h.
Referenced by myInside().