13 #include "uibasemod.h" 27 :
Geom::Size2D<int>( a ) {}
29 :
Geom::Size2D<int>(wdt,hgt) {}
31 inline int hNrPics()
const {
return width_; }
32 inline int vNrPics()
const {
return height_; }
46 static inline
bool isHor(
Side s ) {
return s > Right; }
50 inline uiRect(
int l = 0 ,
int t = 0,
int r = 0 ,
int b = 0 );
54 inline uiSize getPixelSize()
const;
57 inline bool topToAtLeast(
int ref );
58 inline void topTo(
int ref );
59 inline bool bottomToAtLeast(
int ref );
60 inline void bottomTo(
int ref );
61 inline bool leftToAtLeast(
int ref );
62 inline void leftTo(
int ref );
64 inline bool rightToAtLeast(
int ref );
65 inline void expandTo(
const uiRect& oth );
66 inline int hNrPics()
const;
67 inline int vNrPics()
const;
68 inline void setHNrPics(
int np );
69 inline void setVNrPics(
int np );
81 : lt_(l,t), rb_(r,b) {}
83 {
return lt_ == b.
lt_ && rb_ == b.
rb_; }
85 {
return !(*
this == b); }
87 int left()
const {
return lt_.width(); }
88 int right()
const {
return rb_.width(); }
89 int top()
const {
return lt_.height(); }
90 int bottom()
const {
return rb_.height(); }
91 void setLeft(
int i ) { lt_.setWidth(i); }
93 void setTop(
int i ) { lt_.setHeight(i); }
103 inline uiRect getRect(
const uiSize&,
int extrapix=0)
const;
104 inline uiRect getRect(
const uiRect&,
int extrapix=0)
const;
105 uiBorder& operator +=(
const uiBorder& b )
106 { lt_ += b.
lt_; rb_ += b.
rb_;
return *
this; }
111 :
Geom::PixRectangle<int>( l, t, r, b )
136 int hOffset = other.
left() -
left();
137 int vOffset = other.
top() -
top();
138 return uiRect( hOffset, vOffset,
145 int shift = ref -
top();
158 int shift = ref -
top();
166 int shift = ref -
bottom();
178 int shift = ref -
bottom();
186 int shift = ref -
left();
198 int shift = ref -
left();
206 int shift = ref -
right();
214 int shift = ref -
right();
255 return uiRect::isHor(s)
263 return uiRect::isHor(s)
268 #define mUIGeomImplSideFns(clss) \ 269 inline int clss::get( uiRect::Side s ) const \ 270 { return uiRect::isHor(s) ? (s == uiRect::Top ? top() : bottom()) \ 271 : (s == uiRect::Left ? left() : right() ); } \ 272 inline void clss::set( uiRect::Side s, int i ) \ 273 { uiRect::isHor(s) ? (s == uiRect::Top ? setTop(i) : setBottom(i)) \ 274 : (s == uiRect::Left ? setLeft(i) : setRight(i)); } 282 return uiPoint( relpt.x_+lt_.width(), relpt.y_+lt_.height());
288 return uiPoint( dpt.
x_-lt_.width(), dpt.
y_-lt_.height() );
294 return uiRect( lt_.width()+extr, lt_.height()+extr,
295 sz.
width()-1-rb_.width()-2*extr,
296 sz.
height()-1-rb_.height()-2*extr );
302 return uiRect( rect.
left()+lt_.width()+extr,rect.
top()+lt_.height()+extr,
303 rect.
right()-rb_.width()-2*extr,
304 rect.
bottom()-rb_.height()-2*extr );
307 #define mGoldenRatio 1.618034f 312 return inp > 0 ? (int)(val+.5f) : (int)(val - .5f);
318 return inp > 0 ? (int)(val+.5f) : (int)(val - .5f);
#define mExpClass(module)
Definition: commondefs.h:157
void bottomTo(int ref)
Definition: uigeom.h:176
T width() const
Definition: geometry.h:1100
uiBorder(int l, int t, int r, int b)
Definition: uigeom.h:80
Definition: uilayout.h:20
T left() const
Definition: geometry.h:1110
int right() const
Definition: uigeom.h:88
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:51
uiSize getPixelSize() const
Definition: uigeom.h:130
uiRect selectArea(const uiRect &other) const
Definition: uigeom.h:134
uiRect(int l=0, int t=0, int r=0, int b=0)
Definition: uigeom.h:110
void sortCorners(bool leftislow=true, bool topislow=true)
bool leftToAtLeast(int ref)
Definition: uigeom.h:184
PixRectangle(int l=0, int t=0, int r=0, int b=0)
void leftTo(int ref)
Definition: uigeom.h:196
bool bottomToAtLeast(int ref)
Definition: uigeom.h:164
void setVNrPics(int np)
nr of pics should be > 0
Definition: uigeom.h:249
void rightTo(int ref)
Definition: uigeom.h:204
Point2D< int > bottomright_
Definition: geometry.h:293
uiSize lt_
Definition: uigeom.h:98
T width() const
Definition: geometry.h:944
mDeclareEnumUtils(Side) static inline bool isHor(Side s)
Definition: uigeom.h:45
void setHNrPics(int np)
nr of pics should be > 0
Definition: uigeom.h:244
#define mMIN(x, y)
Definition: commondefs.h:52
void setHNrPics(int np)
nr of pics should be > 0
Definition: uigeom.h:34
bool rightToAtLeast(int ref)
Definition: uigeom.h:212
int left() const
Definition: uigeom.h:87
T height() const
Definition: geometry.h:1105
int top() const
Definition: uigeom.h:89
int GetGoldenMajor(int inp)
Definition: uigeom.h:309
uiPoint relPt(const uiPoint &drawpt) const
Definition: uigeom.h:286
bool topToAtLeast(int ref)
Definition: uigeom.h:143
#define mUIGeomImplSideFns(clss)
Definition: uigeom.h:268
int vNrPics() const
Definition: uigeom.h:32
void setRight(int i)
Definition: uigeom.h:92
#define mGoldenRatio
Definition: uigeom.h:307
int bottom() const
Definition: uigeom.h:90
void setBottom(int i)
Definition: uigeom.h:94
uiSize rb_
Definition: uigeom.h:99
T top() const
Definition: geometry.h:1115
T x_
Definition: geometry.h:80
bool operator!=(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:60
void expandTo(const uiRect &oth)
Definition: uigeom.h:225
uiRect getRect(const uiSize &, int extrapix=0) const
Definition: uigeom.h:292
uiSize(const Geom::Size2D< int > &a)
Definition: uigeom.h:26
Geom::PosRectangle< double > uiWorldRect
Definition: uigeom.h:20
void setTop(int i)
Definition: uigeom.h:93
Point2D< int > topleft_
Definition: geometry.h:292
void setLeft(int i)
Definition: uigeom.h:91
Geom::Point2D< double > uiWorldPoint
Definition: uigeom.h:19
Geom::Point2D< int > uiPoint
Definition: uigeom.h:18
int vNrPics() const
Definition: uigeom.h:240
int hNrPics() const
Definition: uigeom.h:237
Definition: commontypes.h:55
uiSize(int wdt=0, int hgt=0)
Definition: uigeom.h:28
int hNrPics() const
Definition: uigeom.h:31
uiBorder(int i=0)
Definition: uigeom.h:79
T y_
Definition: geometry.h:81
LeftTo/RightTo allow extra horizonal distance.
Definition: uilayout.h:20
int GetGoldenMinor(int inp)
Definition: uigeom.h:315
void setVNrPics(int np)
nr of pics should be > 0
Definition: uigeom.h:36
T height() const
Definition: geometry.h:949
static uiRect::Side across(uiRect::Side)
Definition: uigeom.h:253
void topTo(int ref)
Definition: uigeom.h:156
static uiRect::Side clockWise(uiRect::Side)
Definition: uigeom.h:261
Side
Definition: uigeom.h:44
#define mMAX(x, y)
Definition: commondefs.h:51