47 FXExtentd(FXdouble x,FXdouble y):lower(x,y),upper(x,y){}
50 FXExtentd(FXdouble xl,FXdouble xh,FXdouble yl,FXdouble yh):lower(xl,yl),upper(xh,yh){}
68 FXExtentd&
set(FXdouble x,FXdouble y){ lower.x=upper.x=x; lower.y=upper.y=y;
return *
this; }
71 FXExtentd&
set(FXdouble xl,FXdouble xh,FXdouble yl,FXdouble yh){ lower.
set(xl,yl); upper.
set(xh,yh);
return *
this; }
81 FXbool operator!=(
const FXExtentd& ext)
const {
return lower!=ext.lower || upper!=ext.upper;}
84 FXdouble
width()
const {
return upper.x-lower.x; }
87 FXdouble
height()
const {
return upper.y-lower.y; }
90 FXdouble
area()
const {
return width()*height(); }
93 FXdouble longest()
const;
96 FXdouble shortest()
const;
99 FXdouble diameter()
const;
102 FXdouble radius()
const;
111 FXbool empty()
const;
114 FXbool contains(FXdouble x,FXdouble y)
const;
117 FXbool contains(
const FXVec2d& p)
const;
120 FXbool contains(
const FXExtentd& ext)
const;
123 FXExtentd& include(FXdouble x,FXdouble y);
135 FXbool intersect(
const FXVec2d& pos,
const FXVec2d& dir,FXdouble hit[])
const;
146 extern FXAPI FXbool overlap(
const FXExtentd& a,
const FXExtentd& b);
149 extern FXAPI FXExtentd unite(
const FXExtentd& a,
const FXExtentd& b);
152 extern FXAPI FXExtentd intersect(
const FXExtentd& a,
const FXExtentd& b);
155 extern FXAPI FXStream& operator<<(FXStream& store,
const FXExtentd& ext);
158 extern FXAPI FXStream& operator>>(FXStream& store,FXExtentd& ext);
FXExtentd(FXdouble x, FXdouble y)
Initialize with a single point.
Definition: FXExtentd.h:47
FXExtentd(const FXExtentd &ext)
Copy constructor.
Definition: FXExtentd.h:38
FXExtentd(FXdouble xl, FXdouble xh, FXdouble yl, FXdouble yh)
Initialize with explicit values.
Definition: FXExtentd.h:50
FXVec2d & set(FXdouble dd)
Assign with constant.
Definition: FXVec2d.h:62
const FXVec2d & operator[](FXint i) const
Indexing with 0..1.
Definition: FXExtentd.h:77
FXVec2d corner(FXint c) const
Get corner number 0..3.
Definition: FXExtentd.h:138
FXdouble width() const
Width of box.
Definition: FXExtentd.h:84
FXExtentd(const FXVec2d &lo, const FXVec2d &hi)
Initialize from corner points.
Definition: FXExtentd.h:44
FXdouble height() const
Height of box.
Definition: FXExtentd.h:87
Extent.
Definition: FXExtentd.h:28
Definition: FX4Splitter.h:28
FXVec2d & operator[](FXint i)
Indexing with 0..1.
Definition: FXExtentd.h:74
Double-precision 2-element vector.
Definition: FXVec2d.h:28
FXExtentd & operator=(const FXVec2d &p)
Assign with vector.
Definition: FXExtentd.h:53
FXdouble area() const
Area.
Definition: FXExtentd.h:90
FXExtentd()
Default constructor; value is not initialized.
Definition: FXExtentd.h:35
~FXExtentd()
Destructor.
Definition: FXExtentd.h:141
FXbool operator==(const FXExtentd &ext) const
Comparison.
Definition: FXExtentd.h:80
FXExtentd & operator=(const FXExtentd &ext)
Assignment.
Definition: FXExtentd.h:56
FXExtentd(const FXVec2d &p)
Initialize with a single point.
Definition: FXExtentd.h:41