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