All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | Friends | List of all members
geoalgo::AABox Class Reference

Representation of a 3D rectangular box which sides are aligned w/ coordinate axis. A representation of an Axis-Aligned-Boundary-Box, a simple & popular representation of
3D boundary box for collision detection. The concept was taken from the reference,
Real-Time-Collision-Detection (RTCD), and in particular Ch. 4.2 (page 77):
. More...

#include <GeoAABox.h>

Public Member Functions

 AABox ()
 Default constructor. More...
 
virtual ~AABox ()
 Default destructor. More...
 
 AABox (const double x_min, const double y_min, const double z_min, const double x_max, const double y_max, const double z_max)
 Alternative ctor (0) More...
 
 AABox (const Point_t &min, const Vector_t &max)
 Altenartive ctor (1) More...
 
const Point_tMin () const
 Minimum point getter. More...
 
const Point_tMax () const
 Maximum point getter. More...
 
void Min (const double x, const double y, const double z)
 Minimum point setter. More...
 
void Max (const double x, const double y, const double z)
 Maximum point setter. More...
 
bool Contain (const Point_t &pt) const
 Test if a point is contained within the box. More...
 
template<class T , class U >
 AABox (const T &min, const U &max)
 Alternative ctor using template (3) More...
 
 AABox ()
 Default constructor. More...
 
virtual ~AABox ()
 Default destructor. More...
 
 AABox (const double x_min, const double y_min, const double z_min, const double x_max, const double y_max, const double z_max)
 Alternative ctor (0) More...
 
 AABox (const Point_t &min, const Vector_t &max)
 Altenartive ctor (1) More...
 
const Point_tMin () const
 Minimum point getter. More...
 
const Point_tMax () const
 Maximum point getter. More...
 
void Min (const double x, const double y, const double z)
 Minimum point setter. More...
 
void Max (const double x, const double y, const double z)
 Maximum point setter. More...
 
bool Contain (const Point_t &pt) const
 Test if a point is contained within the box. More...
 
template<class T , class U >
 AABox (const T &min, const U &max)
 Alternative ctor using template (3) More...
 

Protected Attributes

Point_t _min
 Minimum point. More...
 
Point_t _max
 Maximum point. More...
 

Friends

std::ostream & operator<< (std::ostream &o,::geoalgo::AABox const &a)
 Streamer. More...
 

Detailed Description

Representation of a 3D rectangular box which sides are aligned w/ coordinate axis. A representation of an Axis-Aligned-Boundary-Box, a simple & popular representation of
3D boundary box for collision detection. The concept was taken from the reference,
Real-Time-Collision-Detection (RTCD), and in particular Ch. 4.2 (page 77):
.

Ref: http://realtimecollisiondetection.net

This class uses one of the simplest representation for AABox: "min-max" representation.
Though this method requires storing 6 floating point values, class attributes (i.e.
"min" and "max" points) store intuitive values for most UB analyzers. Also it simplifies
utility function implementations.

Definition at line 34 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.h.

Constructor & Destructor Documentation

geoalgo::AABox::AABox ( )

Default constructor.

Definition at line 6 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.cxx.

7  : _min(3)
8  , _max(3)
9  {}
virtual geoalgo::AABox::~AABox ( )
inlinevirtual

Default destructor.

Definition at line 42 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.h.

42 {};
geoalgo::AABox::AABox ( const double  x_min,
const double  y_min,
const double  z_min,
const double  x_max,
const double  y_max,
const double  z_max 
)

Alternative ctor (0)

Definition at line 11 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.cxx.

13  : _min ( x_min, y_min, z_min )
14  , _max ( x_max, y_max, z_max )
15  {}
geoalgo::AABox::AABox ( const Point_t min,
const Vector_t max 
)

Altenartive ctor (1)

Definition at line 17 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.cxx.

18  : _min ( min )
19  , _max ( max )
20  {
21  if(min.size()!=3 || max.size()!=3)
22  throw GeoAlgoException("AABox ctor accepts only 3D Point!");
23  }
template<class T , class U >
geoalgo::AABox::AABox ( const T &  min,
const U &  max 
)
inline

Alternative ctor using template (3)

Definition at line 71 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.h.

72  : AABox(Point_t(min), Point_t(max))
73  {}
geoalgo::AABox::AABox ( )

Default constructor.

virtual geoalgo::AABox::~AABox ( )
inlinevirtual

Default destructor.

Definition at line 42 of file sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoAABox.h.

42 {};
geoalgo::AABox::AABox ( const double  x_min,
const double  y_min,
const double  z_min,
const double  x_max,
const double  y_max,
const double  z_max 
)

Alternative ctor (0)

geoalgo::AABox::AABox ( const Point_t min,
const Vector_t max 
)

Altenartive ctor (1)

template<class T , class U >
geoalgo::AABox::AABox ( const T &  min,
const U &  max 
)
inline

Alternative ctor using template (3)

Definition at line 71 of file sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoAABox.h.

72  : AABox(Point_t(min), Point_t(max))
73  {}

Member Function Documentation

bool geoalgo::AABox::Contain ( const Point_t pt) const

Test if a point is contained within the box.

Definition at line 33 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.cxx.

33  {
34  return !( (pt[0] < _min[0] || _max[0] < pt[0]) || // point is outside X boundaries OR
35  (pt[1] < _min[1] || _max[1] < pt[1]) || // point is outside Y boundaries OR
36  (pt[2] < _min[2] || _max[2] < pt[2]) // point is outside Z boundaries
37  );
38  }
bool geoalgo::AABox::Contain ( const Point_t pt) const

Test if a point is contained within the box.

const Point_t & geoalgo::AABox::Max ( ) const

Maximum point getter.

Definition at line 26 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.cxx.

26 { return _max; }
const Point_t& geoalgo::AABox::Max ( ) const

Maximum point getter.

void geoalgo::AABox::Max ( const double  x,
const double  y,
const double  z 
)

Maximum point setter.

void geoalgo::AABox::Max ( const double  x,
const double  y,
const double  z 
)

Maximum point setter.

Definition at line 30 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.cxx.

31  { _max[0] = x; _max[1] = y; _max[2] = z; }
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
process_name opflash particleana ie ie y
const Point_t & geoalgo::AABox::Min ( ) const

Minimum point getter.

Definition at line 25 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.cxx.

25 { return _min; }
const Point_t& geoalgo::AABox::Min ( ) const

Minimum point getter.

void geoalgo::AABox::Min ( const double  x,
const double  y,
const double  z 
)

Minimum point setter.

Definition at line 28 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.cxx.

29  { _min[0] = x; _min[1] = y; _min[2] = z; }
process_name opflash particleana ie ie ie z
process_name opflash particleana ie x
process_name opflash particleana ie ie y
void geoalgo::AABox::Min ( const double  x,
const double  y,
const double  z 
)

Minimum point setter.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
::geoalgo::AABox const &  a 
)
friend

Streamer.

Definition at line 77 of file sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoAABox.h.

78  { o << "AABox Min " << a.Min() << " Max " << a.Max(); return o; }
process_name gaushit a

Member Data Documentation

Point_t geoalgo::AABox::_max
protected

Maximum point.

Definition at line 63 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.h.

Point_t geoalgo::AABox::_min
protected

Minimum point.

Definition at line 62 of file larcorealg/larcorealg/GeoAlgo/GeoAABox.h.


The documentation for this class was generated from the following files: