27 #ifndef GLVIEWER_GEOM_H
28 #define GLVIEWER_GEOM_H
37 #pragma warning( disable:4251 )
48 GLViewer_Pnt( GLfloat theX, GLfloat theY ) : myX( theX ), myY( theY ) {}
50 GLfloat
x()
const {
return myX; }
51 GLfloat
y()
const {
return myY; }
52 void setX( GLfloat theX ) { myX = theX; }
53 void setY( GLfloat theY ) { myY = theY; }
54 void setXY( GLfloat theX, GLfloat theY ) { myX = theX; myY = theY; }
55 void move( GLfloat theDX, GLfloat theDY ) { myX += theDX; myY += theDY; }
72 GLViewer_Rect(
float theLeft,
float theRight,
float theTop,
float theBottom )
73 : myLeft(theLeft), myRight(theRight), myTop(theTop), myBottom(theBottom) {}
75 myLeft = ( float )theRect.left(); myRight = ( float )theRect.right();
76 myTop = ( float )theRect.top(); myBottom = ( float )theRect.bottom(); }
78 float left()
const {
return myLeft; }
79 float right()
const {
return myRight; }
80 float top()
const {
return myTop; }
81 float bottom()
const {
return myBottom; }
83 float width()
const {
return fabs( myRight - myLeft ); }
84 float height()
const {
return fabs( myTop - myBottom ); }
86 void setLeft(
float theLeft ) { myLeft = theLeft; }
87 void setRight(
float theRight ) { myRight = theRight; }
88 void setTop(
float theTop ) { myTop = theTop; }
89 void setBottom(
float theBottom ) { myBottom = theBottom; }
91 void setCoords(
float theLeft,
float theRight,
float theBottom,
float theTop )
92 { myLeft = theLeft; myRight = theRight; myBottom = theBottom; myTop = theTop; }
95 QRect
toQRect() {
return QRect( (
int )myLeft, (
int )myBottom,
96 (
int )( myRight - myLeft ),
97 (
int )( myTop - myBottom ) ); }
105 bool isNull()
const {
return myLeft == 0.0 && myRight == 0.0 && myBottom == 0.0 && myTop == 0.0; }
107 bool isValid()
const {
return ( myLeft < myRight && myBottom < myTop ); }
112 pnt.
y() > bottom() &&
115 void move(
const float x,
const float y )
148 const GLfloat theC );
176 int Count()
const {
return myPoints->count(); }
195 #pragma warning ( default:4251 )
#define GLVIEWER_API
Macro for exports.
Definition: GLViewer.h:37
QList< GLViewer_Pnt > GLViewer_PntList
Definition: GLViewer_Geom.h:62
Definition: GLViewer_Geom.h:167
int Count() const
Returns number of point.
Definition: GLViewer_Geom.h:176
void AddPoint(GLViewer_Pnt &pnt)
Adds point to polygon.
Definition: GLViewer_Geom.h:173
GLViewer_PntList * myPoints
Definition: GLViewer_Geom.h:191
Definition: GLViewer_Geom.h:69
bool isNull() const
Checks null status.
Definition: GLViewer_Geom.h:105
GLViewer_Rect()
Definition: GLViewer_Geom.h:71
void move(const float x, const float y)
Definition: GLViewer_Geom.h:115
float myLeft
Definition: GLViewer_Geom.h:124
void setTop(float theTop)
Definition: GLViewer_Geom.h:88
float myTop
Definition: GLViewer_Geom.h:126
GLViewer_Rect(QRect theRect)
Definition: GLViewer_Geom.h:74
void setLeft(float theLeft)
Definition: GLViewer_Geom.h:86
float top() const
Definition: GLViewer_Geom.h:80
float height() const
Definition: GLViewer_Geom.h:84
float myRight
Definition: GLViewer_Geom.h:125
float width() const
Definition: GLViewer_Geom.h:83
GLViewer_Rect(float theLeft, float theRight, float theTop, float theBottom)
Definition: GLViewer_Geom.h:72
float right() const
Definition: GLViewer_Geom.h:79
bool isEmpty() const
Checks empty status.
Definition: GLViewer_Geom.h:102
bool myIsEmpty
Definition: GLViewer_Geom.h:129
bool contains(GLViewer_Pnt pnt)
Checks staus of contains point.
Definition: GLViewer_Geom.h:110
float bottom() const
Definition: GLViewer_Geom.h:81
void setBottom(float theBottom)
Definition: GLViewer_Geom.h:89
void setCoords(float theLeft, float theRight, float theBottom, float theTop)
Definition: GLViewer_Geom.h:91
float left() const
Definition: GLViewer_Geom.h:78
QRect toQRect()
Definition: GLViewer_Geom.h:95
float myBottom
Definition: GLViewer_Geom.h:127
bool isValid() const
Checks valid status.
Definition: GLViewer_Geom.h:107
void setIsEmpty(bool on)
On/off empty status.
Definition: GLViewer_Geom.h:100
void setRight(float theRight)
Definition: GLViewer_Geom.h:87
Definition: GLViewer_Geom.h:137
GLViewer_Pnt myPnt2
Definition: GLViewer_Geom.h:156
GLViewer_Pnt myPnt1
Definition: GLViewer_Geom.h:155
GLfloat myB
Definition: GLViewer_Geom.h:158
GLfloat myC
Definition: GLViewer_Geom.h:159
GLfloat myA
Definition: GLViewer_Geom.h:157
Definition: GLViewer_Geom.h:45
GLViewer_Pnt()
Definition: GLViewer_Geom.h:47
void setX(GLfloat theX)
Definition: GLViewer_Geom.h:52
void setY(GLfloat theY)
Definition: GLViewer_Geom.h:53
GLfloat myY
Definition: GLViewer_Geom.h:59
GLfloat y() const
Definition: GLViewer_Geom.h:51
GLViewer_Pnt(GLfloat theX, GLfloat theY)
Definition: GLViewer_Geom.h:48
void setXY(GLfloat theX, GLfloat theY)
Definition: GLViewer_Geom.h:54
GLfloat myX
Definition: GLViewer_Geom.h:58
GLfloat x() const
Definition: GLViewer_Geom.h:50
void move(GLfloat theDX, GLfloat theDY)
Definition: GLViewer_Geom.h:55