27 #ifndef GLVIEWER_DRAWER_H
28 #define GLVIEWER_DRAWER_H
40 #include <OpenGL/gl.h>
54 #pragma warning( disable:4251 )
95 else if ( myIsBold != theStruct.
myIsBold )
96 return myIsBold < theStruct.
myIsBold;
97 else if ( myIsItal != theStruct.
myIsItal )
98 return myIsItal < theStruct.
myIsItal;
99 else if ( myIsUndl != theStruct.
myIsUndl )
100 return myIsUndl < theStruct.
myIsUndl;
124 int theSeparator = 2,
125 bool theIsResizeable =
false,
126 GLuint theMinMagFilter = GL_LINEAR );
131 bool generateTexture();
133 void drawString( QString theStr,
136 GLfloat theScale = 1.0 );
144 int getStringWidth( QString theString );
146 int getStringHeight();
149 static void clearTextBases();
231 virtual void create(
float xScale,
float yScale,
bool onlyUpdate ) = 0;
236 virtual void clear(){ myObjects.clear(); }
245 void setAntialiasing(
const bool on);
248 static void destroyAllTextures();
285 static GLuint loadTexture(
const QString& fileName,
297 void drawTexture( GLuint texture,
310 void drawTexture( GLuint texture,
327 void drawTexturePart( GLuint texture,
366 void drawGLText( QString text,
369 int hPosition = GLText_Center,
370 int vPosition = GLText_Center,
371 QColor
color = Qt::black,
372 bool smallFont =
false );
378 inline void setFont(
const QFont& font ) { myFont = font; }
381 inline QFont
font()
const {
return myFont; }
396 inline void setTextScale(
const GLfloat factor ) { myTextScale = factor; }
399 inline GLfloat
textScale()
const {
return myTextScale; }
406 static void drawRectangle(
GLViewer_Rect* theRect, QColor = Qt::black );
411 static void drawRectangle(
GLViewer_Rect*, GLfloat, GLfloat = 0, QColor = Qt::black,
412 bool =
false, QColor = Qt::white );
413 static void drawContour(
GLViewer_Rect*, QColor, GLfloat, GLushort,
bool );
415 static void drawPolygon(
GLViewer_Rect*, QColor, GLushort,
bool );
417 static void drawVertex( GLfloat, GLfloat, QColor );
418 static void drawCross( GLfloat, GLfloat, QColor );
419 static void drawArrow(
const GLfloat red,
const GLfloat green,
const GLfloat blue,
420 GLfloat, GLfloat, GLfloat, GLfloat,
421 GLfloat, GLfloat, GLfloat, GLboolean = GL_FALSE );
452 #pragma warning ( default:4251 )
455 #endif // GLVIEWER_DRAWER_H