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