]>
git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/canvas/bbox.h
1 #ifndef __WXBOUNDINGBOX_H__
2 #define __WXBOUNDINGBOX_H__
4 #if defined(__GNUG__) && !defined(__APPLE__)
5 #pragma interface "bbox.cpp"
12 #include "wx/matrix.h"
13 #include "wx/geometry.h"
15 enum OVERLAP
{_IN
,_ON
,_OUT
};
17 //Purpose The wxBoundingBox class stores one wxBoundingBox.
18 //The wxBoundingBox is defined by two coordiates,
19 //a upperleft coordinate and a lowerright coordinate.
24 wxBoundingBox(const wxBoundingBox
&);
25 wxBoundingBox(const wxPoint2DDouble
&);
26 wxBoundingBox(double xmin
, double ymin
, double xmax
, double ymax
);
28 bool And(wxBoundingBox
*, double Marge
= 0);
30 void EnLarge(const double Marge
);
31 void Shrink(const double Marge
);
33 void Expand(const wxPoint2DDouble
& , const wxPoint2DDouble
&);
34 void Expand(const wxPoint2DDouble
&);
35 void Expand(double x
,double y
);
36 void Expand(const wxBoundingBox
& bbox
);
38 OVERLAP
Intersect( wxBoundingBox
&, double Marge
= 0);
39 bool LineIntersect(const wxPoint2DDouble
& begin
, const wxPoint2DDouble
& end
);
40 bool PointInBox( const wxPoint2DDouble
&, double Marge
= 0);
41 bool PointInBox( double, double, double Marge
= 0);
45 void Translate( wxPoint2DDouble
& );
46 void MapBbox( const wxTransformMatrix
& matrix
);
48 double GetWidth() {return m_maxx
-m_minx
;};
49 double GetHeight(){return m_maxy
-m_miny
;};
50 bool GetValid() const;
53 void SetBoundingBox(const wxPoint2DDouble
& a_point
);
55 void SetMin(double, double);
56 void SetMax(double, double);
57 inline wxPoint2DDouble
GetMin();
58 inline wxPoint2DDouble
GetMax();
59 inline double GetMinX(){return m_minx
;};
60 inline double GetMinY(){return m_miny
;};
61 inline double GetMaxX(){return m_maxx
;};
62 inline double GetMaxY(){return m_maxy
;};
64 wxBoundingBox
& operator+( wxBoundingBox
& );
65 wxBoundingBox
& operator=( const wxBoundingBox
& );
68 //bounding box in world