You.i Engine
YiRectangle.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_RECTANGLE_H_
3 #define _YI_RECTANGLE_H_
4 
5 #include "framework/YiPredef.h"
6 
7 struct YI_FLOAT_RECT_REL;
8 struct YI_RECT_REL;
9 
15 struct YI_RECT
16 {
17  YI_RECT();
18  YI_RECT(int32_t left, int32_t top, int32_t right, int32_t bottom);
19  YI_RECT(const YI_RECT_REL &rect);
20 
21  void Set(int32_t _left, int32_t _top, int32_t _right, int32_t _bottom);
22 
23  YI_RECT &operator=(const YI_RECT_REL &rect);
24 
25  bool operator<(const YI_RECT &rhs) const;
26  bool operator>(const YI_RECT &rhs) const;
27  bool operator<=(const YI_RECT &rhs) const;
28  bool operator>=(const YI_RECT &rhs) const;
29  bool operator==(const YI_RECT &rhs) const;
30  bool operator!=(const YI_RECT &rhs) const;
31 
32  int32_t left;
33  int32_t top;
34  int32_t right;
35  int32_t bottom;
36 };
37 
39 {
40  YI_RECT_REL();
41  YI_RECT_REL(int32_t x, int32_t y, int32_t width, int32_t height);
42  YI_RECT_REL(const YI_RECT &rect);
43 
44  void Set(int32_t _x, int32_t _y, int32_t _width, int32_t _height);
45 
46  YI_RECT_REL &operator=(const YI_RECT &rect);
47 
48  bool operator<(const YI_RECT_REL &rhs) const;
49  bool operator>(const YI_RECT_REL &rhs) const;
50  bool operator<=(const YI_RECT_REL &rhs) const;
51  bool operator>=(const YI_RECT_REL &rhs) const;
52  bool operator==(const YI_RECT_REL &rhs) const;
53  bool operator!=(const YI_RECT_REL &rhs) const;
54 
55  int32_t x;
56  int32_t y;
57  int32_t width;
58  int32_t height;
59 };
60 
62 {
63  YI_FLOAT_RECT();
64  YI_FLOAT_RECT(float left, float top, float right, float bottom);
65  YI_FLOAT_RECT(const YI_FLOAT_RECT_REL &rect);
66  explicit YI_FLOAT_RECT(const YI_RECT &rect);
67 
68  void Set(float _left, float _top, float _right, float _bottom);
69 
71  YI_FLOAT_RECT &operator=(const YI_RECT &rect);
72 
73  bool operator<(const YI_FLOAT_RECT &rhs) const;
74  bool operator>(const YI_FLOAT_RECT &rhs) const;
75  bool operator<=(const YI_FLOAT_RECT &rhs) const;
76  bool operator>=(const YI_FLOAT_RECT &rhs) const;
77  bool operator==(const YI_FLOAT_RECT &rhs) const;
78  bool operator!=(const YI_FLOAT_RECT &rhs) const;
79 
80  float left;
81  float top;
82  float right;
83  float bottom;
84 };
85 
87 {
89  YI_FLOAT_RECT_REL(float x, float y, float width, float height);
90  YI_FLOAT_RECT_REL(const YI_FLOAT_RECT &rect);
91  explicit YI_FLOAT_RECT_REL(const YI_RECT_REL &rect);
92 
93  void Set(float _x, float _y, float _width, float _height);
94 
97 
98  bool operator<(const YI_FLOAT_RECT_REL &rhs) const;
99  bool operator>(const YI_FLOAT_RECT_REL &rhs) const;
100  bool operator<=(const YI_FLOAT_RECT_REL &rhs) const;
101  bool operator>=(const YI_FLOAT_RECT_REL &rhs) const;
102  bool operator==(const YI_FLOAT_RECT_REL &rhs) const;
103  bool operator!=(const YI_FLOAT_RECT_REL &rhs) const;
104 
105  float x;
106  float y;
107  float width;
108  float height;
109 };
110 
113 #include "graphics/internal/YiRectangle.inl"
114 
115 #endif // _YI_RECTANGLE_H_
float x
Definition: YiRectangle.h:105
void Set(int32_t _left, int32_t _top, int32_t _right, int32_t _bottom)
bool operator<(const YI_RECT &rhs) const
float left
Definition: YiRectangle.h:80
Definition: YiRectangle.h:38
float width
Definition: YiRectangle.h:107
bool operator==(const YI_RECT &rhs) const
int32_t x
Definition: YiRectangle.h:55
Definition: YiRectangle.h:15
float top
Definition: YiRectangle.h:81
int32_t height
Definition: YiRectangle.h:58
bool operator<=(const YI_RECT &rhs) const
YI_RECT & operator=(const YI_RECT_REL &rect)
bool operator>(const YI_RECT &rhs) const
int32_t width
Definition: YiRectangle.h:57
int32_t bottom
Definition: YiRectangle.h:35
Definition: YiRectangle.h:61
int32_t top
Definition: YiRectangle.h:33
int32_t right
Definition: YiRectangle.h:34
float bottom
Definition: YiRectangle.h:83
float height
Definition: YiRectangle.h:108
int32_t left
Definition: YiRectangle.h:32
Definition: YiRectangle.h:86
bool operator!=(const YI_RECT &rhs) const
int32_t y
Definition: YiRectangle.h:56
float right
Definition: YiRectangle.h:82
float y
Definition: YiRectangle.h:106
bool operator>=(const YI_RECT &rhs) const