Bounding_Box< bb_type > Class Template Reference

#include <Bounding_Box.h>

List of all members.

Public Member Functions

virtual ~Bounding_Box ()
virtual unsigned int getDimension () const=0
virtual void become (const bb_type *bb)=0
virtual bool lineIntersect (const vector< double > &start, const vector< double > &end) const=0
virtual bool intersects (const bb_type &x) const =0
virtual bool contains (const Point &x) const =0
virtual bool contains (const bb_type &other) const=0
virtual bb_type unionWith (const bb_type &other) const=0
virtual void unite (const bb_type *other)=0
virtual bb_type intersect (const bb_type &other) const=0
virtual bool isEmpty () const=0
virtual string toString () const=0
virtual void clear ()=0
virtual void writeToFile (ofstream &ofs) const =0
virtual void getCenterCoordinate (vector< double > *into) const=0
virtual bool isDefining (bb_type *other) const =0
 Bounding_Box ()
 Bounding_Box (bb_type *bb)

Static Public Member Functions

static Ordering< bb_type > * getDefaultOrdering ()
static vector< Ordering< bb_type > * > getOrderings ()


Detailed Description

template<typename bb_type>
class Bounding_Box< bb_type >

This class defines a bounding box of arbitrary shape. It also defines which operations can be executed on bounding boxes. An arbitrary shape is generically modelled as a Polytope.

Definition at line 25 of file Bounding_Box.h.


Constructor & Destructor Documentation

template<typename bb_type>
virtual Bounding_Box< bb_type >::~Bounding_Box (  )  [inline, virtual]

Base deconstructor. Does nothing.

Definition at line 53 of file Bounding_Box.h.

template<typename bb_type>
Bounding_Box< bb_type >::Bounding_Box (  )  [inline]

Base constructor. Does nothing.

Definition at line 179 of file Bounding_Box.h.

template<typename bb_type>
Bounding_Box< bb_type >::Bounding_Box ( bb_type *  bb  )  [inline]

Copy constructor.

Parameters:
bb Pointer to the bounding box to be copied.

Definition at line 186 of file Bounding_Box.h.


Member Function Documentation

template<typename bb_type>
static Ordering< bb_type >* Bounding_Box< bb_type >::getDefaultOrdering (  )  [inline, static]

Function which returns the default ordering used on this type of bounding box.

Returns:
Pointer to the default ordering.
Note that we cannot define an ordering on an abstract bounding box; this method will therefore only print an error to stderr and exit.

Reimplemented in Cubic_Bounding_Box, and Cubic_Bounding_Box_Container.

Definition at line 40 of file Bounding_Box.h.

template<typename bb_type>
static vector< Ordering< bb_type > * > Bounding_Box< bb_type >::getOrderings (  )  [inline, static]

Function which returns all orderings defined on this type of bounding box.

Returns:
A vector containing a set of pointers to possible orderings.
Note that we cannot define an ordering on an abstract bounding box; this method will therefore only print an error to stderr and exit.

Reimplemented in Cubic_Bounding_Box, and Cubic_Bounding_Box_Container.

Definition at line 50 of file Bounding_Box.h.

template<typename bb_type>
virtual unsigned int Bounding_Box< bb_type >::getDimension (  )  const [pure virtual]

Gets the dimension of the current bounding box. Since this may be calculated or stored differently depending on the type of bounding box, this method is defined purely virtual.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual void Bounding_Box< bb_type >::become ( const bb_type *  bb  )  [pure virtual]

Become equal to a given other bounding box of the same type. Since we do not know any specifics about the exact (non-abstract) type of the bounding box to be copied, this method is defined purely virtual.

Parameters:
bb A pointer to the bounding box to which the current bounding box has to become equal to.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual bool Bounding_Box< bb_type >::lineIntersect ( const vector< double > &  start,
const vector< double > &  end 
) const [pure virtual]

Function which checks for intersection with a line segment defined by two coordinates. Since the algorithm needed to do this of course will depend on the exact type of bounding box, this function is declared purely virtual.

Parameters:
start Pointer to the starting coordinate of the line segment.
end Pointer to the ending coordinate of the line segment.
Returns:
A boolean indicating whether or not the line segment intersects this bounding box.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual bool Bounding_Box< bb_type >::intersects ( const bb_type &  x  )  const [pure virtual]

Function which checks for intersection with another bounding box of the same type.

Parameters:
x A pointer to the other bounding box to check for intersection with.
Returns:
A boolean indicating whether or not the other bounding box intersects this bounding box.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual bool Bounding_Box< bb_type >::contains ( const Point x  )  const [pure virtual]

Function which checks if a given point is contained within the current bounding box.

Parameters:
x A pointer to the point to check for.
Returns:
A boolean indicating whether or not the given point is contained within this box.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual bool Bounding_Box< bb_type >::contains ( const bb_type &  other  )  const [pure virtual]

Function which checks if a given other bounding box of the same type is contained *entirely* within this bounding box.

Parameters:
other A pointer to the bounding box to check for.
Returns:
A boolean indicating containment.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual bb_type Bounding_Box< bb_type >::unionWith ( const bb_type &  other  )  const [pure virtual]

Function which unites two bounding boxes of the same type.

Parameters:
other A pointer to the other bounding box to unite the current one with.
Returns:
A bounding box denoting the union of the two bounding boxes.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual void Bounding_Box< bb_type >::unite ( const bb_type *  other  )  [pure virtual]

Function which unites the current bounding box with a given bounding box of the same time.

Note that, unlike unionWith, this method updates the current bounding box.

Parameters:
other A pointer to the other bounding box to unite the current one with.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual bb_type Bounding_Box< bb_type >::intersect ( const bb_type &  other  )  const [pure virtual]

Function which returns the intersection of two bounding boxes.

Parameters:
other Pointer to the other bounding box to intersect with.
Returns:
The intersection between this and the given bounding box.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual bool Bounding_Box< bb_type >::isEmpty (  )  const [pure virtual]

Function used to check if the current bounding box is empty, or rather, uninitialised.

Returns:
Whether or not the bounding box is empty

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual string Bounding_Box< bb_type >::toString (  )  const [pure virtual]

Returns a string representation of the current bounding box.

Returns:
A string representation of the current bounding box.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual void Bounding_Box< bb_type >::clear (  )  [pure virtual]

Clears and sets empty the current bounding box.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual void Bounding_Box< bb_type >::writeToFile ( ofstream &  ofs  )  const [pure virtual]

Method to write (serialise) the bounding box in ASCII format to a given output stream.

Parameters:
ofs Reference to the output stream.

Implemented in Cubic_Bounding_Box, and Cubic_Bounding_Box_Container.

template<typename bb_type>
virtual void Bounding_Box< bb_type >::getCenterCoordinate ( vector< double > *  into  )  const [pure virtual]

Gets the center coordinate of this bounding box.

Parameters:
into Pointer to where the center coordinate is to be stored.

Implemented in Cubic_Bounding_Box.

template<typename bb_type>
virtual bool Bounding_Box< bb_type >::isDefining ( bb_type *  other  )  const [pure virtual]

Returns whether a given BB is defining for the current BB, assuming the current BB is the MBR of some set. With defining, we mean that the MBR of a set S would change if x in S is left out. I.e., x in S is defining for MBR(S) iff MBR(S) is not equal to MBR(S \ {x}).

Parameters:
other The MBR to compare to (MBR(S) in the above).
Returns:
Whether or not the current bounding box is defining.

Implemented in Cubic_Bounding_Box.


The documentation for this class was generated from the following file:
Generated on Sat Oct 13 17:34:43 2007 for R-Tree by  doxygen 1.5.2