wxArt2D
Public Member Functions | Protected Attributes | List of all members
a2dBoundingBox Class Reference

The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject. More...

#include <bbox.h>

Public Member Functions

 a2dBoundingBox ()
 constructor
 
 a2dBoundingBox (const a2dBoundingBox &box)
 boundingbox constructor given another boundingbox
 
 a2dBoundingBox (const a2dPoint2D &point)
 boundingbox constructor given a point
 
 a2dBoundingBox (double x1, double y1, double x2, double y2)
 boundingbox constructor given two sets of coordinates
 
a2dBoundingBoxoperator+ (a2dBoundingBox &)
 And operation on two boxes.
 
const a2dBoundingBoxoperator+= (const a2dBoundingBox &box)
 OR box to this.
 
a2dBoundingBoxoperator= (const a2dBoundingBox &)
 set this boundingbox to another boundingbox
 
bool And (a2dBoundingBox *, double Marge=0)
 intersect the boundingbox with another, return true if the result is non zero
 
void Enlarge (const double Marge)
 enlarge with the given amount
 
void EnlargeXY (const double MargeX, const double MargeY)
 enlarge with the given amount
 
void Shrink (const double Marge)
 shrink with the given amount
 
void Expand (const a2dPoint2D &, const a2dPoint2D &)
 expand boundingbox width two points
 
void Expand (const a2dPoint2D &)
 expand boundingbox width one points
 
void Expand (double x, double y)
 expand boundingbox width one coordinate
 
void Expand (const a2dBoundingBox &bbox)
 expand boundingbox width another boundingbox
 
OVERLAP Intersect (const a2dBoundingBox &, double Marge=0) const
 
bool LineIntersect (const a2dPoint2D &begin, const a2dPoint2D &end) const
 
bool PointInBox (const a2dPoint2D &, double Marge=0) const
 is the point within the boundingbox
 
bool PointInBox (double x, double y, double Marge=0) const
 is the coordinate within the boundingbox
 
bool PointOnBox (double x, double y, double Marge) const
 is the coordinate on the border of the boundingbox
 
void Reset ()
 set invalid
 
const a2dBoundingBoxTranslate (a2dPoint2D &)
 translate with given vector
 
const a2dBoundingBoxTranslate (double x, double y)
 translate with given vector
 
void MapBbox (const a2dAffineMatrix &matrix)
 
double GetWidth () const
 returns width of the boundingbox
 
double GetHeight () const
 returns height of the boundingbox
 
bool GetValid () const
 returns true if boundingbox is calculated properly and therefore its valid flag is set.
 
void SetValid (bool)
 
void SetBoundingBox (const a2dPoint2D &a_point)
 set the bounding box to be this point
 
void SetMin (double px, double py)
 set the bounding box its maximum
 
void SetMax (double px, double py)
 set the bounding box its minimum
 
a2dPoint2D GetMin () const
 get the bounding box its minimum
 
a2dPoint2D GetMax () const
 get the bounding box its maximum
 
double GetMinX () const
 get minimum X of the boundingbox
 
double GetMinY () const
 get minimum Y of the boundingbox
 
double GetMaxX () const
 get maximum X of the boundingbox
 
double GetMaxY () const
 get maximum Y of the boundingbox
 
double GetSize ()
 
a2dPoint2D GetCentre () const
 get centre
 
void SetMinX (double minx)
 set the bounding box its minimum X, does not validate the box
 
void SetMinY (double miny)
 set the bounding box its minimum Y, does not validate the box
 
void SetMaxX (double maxx)
 set the bounding box its maximum X, does not validate the box
 
void SetMaxY (double maxy)
 set the bounding box its maximum Y, does not validate the box
 

Protected Attributes

double m_minx
 mininum X of bounding box in world coordinates
 
double m_miny
 mininum Y of bounding box in world coordinates
 
double m_maxx
 maximum X of bounding box in world coordinates
 
double m_maxy
 maximum Y of bounding box in world coordinates
 
bool m_validbbox
 true if boundingbox is valid
 

Detailed Description

The a2dBoundingBox class stores one a2dBoundingBox of a a2dCanvasObject.

The a2dBoundingBox is defined by two coordiates, a upperleft coordinate and a lowerright coordinate. It has a valid flag to tell if the boundingbox contains valid information or not.

Definition at line 39 of file bbox.h.

Member Function Documentation

OVERLAP a2dBoundingBox::Intersect ( const a2dBoundingBox other,
double  Marge = 0 
) const

check intersection

Returns
OVERLAP: _IN,_ON,_OUT

Definition at line 205 of file bbox.cpp.

bool a2dBoundingBox::LineIntersect ( const a2dPoint2D begin,
const a2dPoint2D end 
) const

intersection with a line

Returns
true if interseting

Definition at line 230 of file bbox.cpp.

void a2dBoundingBox::MapBbox ( const a2dAffineMatrix matrix)

map the boundingbox using the matrix. The boundingbox is first transformed, and at the new position and angle etc. recalculated.

Definition at line 445 of file bbox.cpp.

void a2dBoundingBox::SetValid ( bool  value)
See Also
GetValid()

Definition at line 364 of file bbox.cpp.


The documentation for this class was generated from the following files:
a2dBoundingBox Class Reference -- Sun Oct 12 2014 17:04:28 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation