15 #include "uibasemod.h" 29 :
Geom::Size2D<int>( a ) {}
31 :
Geom::Size2D<int>(wdt,hgt) {}
33 inline int hNrPics()
const {
return width_; }
34 inline int vNrPics()
const {
return height_; }
48 static inline
bool isHor(
Side s ) {
return s > Right; }
52 inline uiRect(
int l = 0 ,
int t = 0,
int r = 0 ,
int b = 0 );
56 inline uiSize getPixelSize()
const;
59 inline bool topToAtLeast(
int ref );
60 inline void topTo(
int ref );
61 inline bool bottomToAtLeast(
int ref );
62 inline void bottomTo(
int ref );
63 inline bool leftToAtLeast(
int ref );
64 inline void leftTo(
int ref );
66 inline bool rightToAtLeast(
int ref );
67 inline void expandTo(
const uiRect& oth );
68 inline int hNrPics()
const;
69 inline int vNrPics()
const;
70 inline void setHNrPics(
int np );
71 inline void setVNrPics(
int np );
83 : lt_(l,t), rb_(r,b) {}
85 {
return lt_ == b.
lt_ && rb_ == b.
rb_; }
87 {
return !(*
this == b); }
89 int left()
const {
return lt_.width(); }
90 int right()
const {
return rb_.width(); }
91 int top()
const {
return lt_.height(); }
92 int bottom()
const {
return rb_.height(); }
93 void setLeft(
int i ) { lt_.setWidth(i); }
95 void setTop(
int i ) { lt_.setHeight(i); }
105 inline uiRect getRect(
const uiSize&,
int extrapix=0)
const;
106 inline uiRect getRect(
const uiRect&,
int extrapix=0)
const;
107 uiBorder& operator +=(
const uiBorder& b )
108 { lt_ += b.
lt_; rb_ += b.
rb_;
return *
this; }
113 :
Geom::PixRectangle<int>( l, t, r, b )
138 int hOffset = other.
left() -
left();
139 int vOffset = other.
top() -
top();
140 return uiRect( hOffset, vOffset,
147 int shift = ref -
top();
160 int shift = ref -
top();
168 int shift = ref -
bottom();
180 int shift = ref -
bottom();
188 int shift = ref -
left();
200 int shift = ref -
left();
208 int shift = ref -
right();
216 int shift = ref -
right();
262 #define mUIGeomImplSideFns(clss) \ 263 inline int clss::get( uiRect::Side s ) const \ 264 { return uiRect::isHor(s) ? (s == uiRect::Top ? top() : bottom()) \ 265 : (s == uiRect::Left ? left() : right() ); } \ 266 inline void clss::set( uiRect::Side s, int i ) \ 267 { uiRect::isHor(s) ? (s == uiRect::Top ? setTop(i) : setBottom(i)) \ 268 : (s == uiRect::Left ? setLeft(i) : setRight(i)); } 276 return uiPoint( relpt.x+lt_.width(), relpt.y+lt_.height());
282 return uiPoint( dpt.
x-lt_.width(), dpt.
y-lt_.height() );
288 return uiRect( lt_.width()+extr, lt_.height()+extr,
289 sz.
width()-rb_.width()-2*extr,
290 sz.
height()-rb_.height()-2*extr );
296 return uiRect( rect.
left()+lt_.width()+extr,rect.
top()+lt_.height()+extr,
297 rect.
right()-rb_.width()-2*extr,
298 rect.
bottom()-rb_.height()-2*extr );
301 #define mGoldenRatio 1.618034f 306 return inp > 0 ? (int)(val+.5f) : (int)(val - .5f);
313 return inp > 0 ? (int)(val+.5f) : (int)(val - .5f);
#define mExpClass(module)
Definition: commondefs.h:160
void bottomTo(int ref)
Definition: uigeom.h:178
T width() const
Definition: geometry.h:554
uiBorder(int l, int t, int r, int b)
Definition: uigeom.h:82
Definition: uilayout.h:22
T left() const
Definition: geometry.h:564
int right() const
Definition: uigeom.h:90
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
uiSize getPixelSize() const
Definition: uigeom.h:132
uiRect selectArea(const uiRect &other) const
Definition: uigeom.h:136
uiRect(int l=0, int t=0, int r=0, int b=0)
Definition: uigeom.h:112
void sortCorners(bool leftislow=true, bool topislow=true)
bool leftToAtLeast(int ref)
Definition: uigeom.h:186
PixRectangle(int l=0, int t=0, int r=0, int b=0)
void leftTo(int ref)
Definition: uigeom.h:198
bool bottomToAtLeast(int ref)
Definition: uigeom.h:166
void setVNrPics(int np)
nr of pics should be > 0
Definition: uigeom.h:251
void rightTo(int ref)
Definition: uigeom.h:206
Point2D< int > bottomright_
Definition: geometry.h:178
uiSize lt_
Definition: uigeom.h:100
T width() const
Definition: geometry.h:403
mDeclareEnumUtils(Side) static inline bool isHor(Side s)
Definition: uigeom.h:47
void setHNrPics(int np)
nr of pics should be > 0
Definition: uigeom.h:246
#define mMIN(x, y)
Definition: commondefs.h:49
void setHNrPics(int np)
nr of pics should be > 0
Definition: uigeom.h:36
bool rightToAtLeast(int ref)
Definition: uigeom.h:214
int left() const
Definition: uigeom.h:89
T height() const
Definition: geometry.h:559
int top() const
Definition: uigeom.h:91
int GetGoldenMajor(int inp)
Definition: uigeom.h:303
uiPoint relPt(const uiPoint &drawpt) const
Definition: uigeom.h:280
bool topToAtLeast(int ref)
Definition: uigeom.h:145
#define mUIGeomImplSideFns(clss)
Definition: uigeom.h:262
static const float cGoldenRatio
Definition: uigeom.h:309
int vNrPics() const
Definition: uigeom.h:34
void setRight(int i)
Definition: uigeom.h:94
T y
Definition: geometry.h:67
#define mGoldenRatio
Definition: uigeom.h:301
int bottom() const
Definition: uigeom.h:92
void setBottom(int i)
Definition: uigeom.h:96
uiSize rb_
Definition: uigeom.h:101
T top() const
Definition: geometry.h:569
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:62
void expandTo(const uiRect &oth)
Definition: uigeom.h:227
uiRect getRect(const uiSize &, int extrapix=0) const
Definition: uigeom.h:286
uiSize(const Geom::Size2D< int > &a)
Definition: uigeom.h:28
Geom::PosRectangle< double > uiWorldRect
Definition: uigeom.h:22
void setTop(int i)
Definition: uigeom.h:95
T x
Definition: geometry.h:66
Point2D< int > topleft_
Definition: geometry.h:177
void setLeft(int i)
Definition: uigeom.h:93
Geom::Point2D< double > uiWorldPoint
Definition: uigeom.h:21
Geom::Point2D< int > uiPoint
Definition: uigeom.h:20
int vNrPics() const
Definition: uigeom.h:242
int hNrPics() const
Definition: uigeom.h:239
Definition: geometry.h:19
uiSize(int wdt=0, int hgt=0)
Definition: uigeom.h:30
int hNrPics() const
Definition: uigeom.h:33
uiBorder(int i=0)
Definition: uigeom.h:81
LeftTo/RightTo allow extra horizonal distance.
Definition: uilayout.h:22
int GetGoldenMinor(int inp)
Definition: uigeom.h:310
void setVNrPics(int np)
nr of pics should be > 0
Definition: uigeom.h:38
T height() const
Definition: geometry.h:408
static uiRect::Side across(uiRect::Side)
Definition: uigeom.h:255
void topTo(int ref)
Definition: uigeom.h:158
static uiRect::Side clockWise(uiRect::Side)
Definition: uigeom.h:258
Side
Definition: uigeom.h:46
#define mMAX(x, y)
Definition: commondefs.h:48