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,
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 )
#define GLVIEWER_API
Macro for exports.
Definition: GLViewer.h:37
DisplayTextFormat
Display Text Format of Objects.
Definition: GLViewer_Defs.h:47
@ DTF_BITMAP
Definition: GLViewer_Defs.h:50
void drawText(GLuint theTextList, const char *theText, GLdouble thePosition[3], GLfloat theColor[3])
Definition: OCCViewer_Trihedron.cxx:161
const QString const bool const double theScale
Definition: OCCViewer_ViewModel.cxx:954
Class implementing mathematical model of 2D coordinate system.
Definition: GLViewer_CoordSystem.h:45
Definition: GLViewer_Drawer.h:193
int getPriority() const
Returns object priority.
Definition: GLViewer_Drawer.h:242
virtual void clear()
Clears drawer display list.
Definition: GLViewer_Drawer.h:236
QString getObjectType() const
Returns object type (needs for dynamic search of right drawer )
Definition: GLViewer_Drawer.h:239
GLuint myTextList
List generated textures.
Definition: GLViewer_Drawer.h:434
@ GLText_Left
Definition: GLViewer_Drawer.h:199
@ GLText_Top
Definition: GLViewer_Drawer.h:201
@ GLText_Right
Definition: GLViewer_Drawer.h:200
virtual void addObject(GLViewer_Object *theObject)
Adds object to drawer display list.
Definition: GLViewer_Drawer.h:234
GLfloat textScale() const
Returns a text string displaying scale factor.
Definition: GLViewer_Drawer.h:399
virtual void create(float xScale, float yScale, bool onlyUpdate)=0
Main method which drawing object in GLViewer.
void setFont(const QFont &font)
Sets a default font to be used by drawGLText method.
Definition: GLViewer_Drawer.h:378
QList< GLViewer_Object * > myObjects
List of objects.
Definition: GLViewer_Drawer.h:432
GLfloat myTextScale
Scale factor for text string draw, by default 0.125 (used only with text format DTF_TEXTURE_SCALABLE)
Definition: GLViewer_Drawer.h:448
QFont font() const
Returns a default font used by drawGLText method.
Definition: GLViewer_Drawer.h:381
DisplayTextFormat myTextFormat
Default text displaying format for drawGLText() method.
Definition: GLViewer_Drawer.h:444
void setTextScale(const GLfloat factor)
Sets a text string displaying scale factor (used only with text format DTF_TEXTURE_SCALABLE)
Definition: GLViewer_Drawer.h:396
QFont myFont
Default font for drawGLText() method.
Definition: GLViewer_Drawer.h:442
int myPriority
Dislay priority.
Definition: GLViewer_Drawer.h:439
QString myObjectType
Type of supporting object.
Definition: GLViewer_Drawer.h:437
float myYScale
Y scale factor.
Definition: GLViewer_Drawer.h:429
void setTextFormat(const DisplayTextFormat format)
Sets a default text displaying format to be used by drawGLText method.
Definition: GLViewer_Drawer.h:387
float myXScale
X Scale factor.
Definition: GLViewer_Drawer.h:427
DisplayTextFormat textFormat() const
Returns a default text displaying format used by drawGLText method.
Definition: GLViewer_Drawer.h:390
Definition: GLViewer_Object.h:65
Definition: GLViewer_Geom.h:69
Definition: GLViewer_Drawer.h:112
int * myWidths
Array of letter width.
Definition: GLViewer_Drawer.h:164
QFont myQFont
Pointer to base font.
Definition: GLViewer_Drawer.h:168
GLuint myMinMagFilter
Min/mag filter.
Definition: GLViewer_Drawer.h:180
int myFontHeight
Font height.
Definition: GLViewer_Drawer.h:182
static QMap< GLViewer_TexFindId, GLuint > BitmapFontCache
Map for strorage generated bitmaps fonts.
Definition: GLViewer_Drawer.h:154
int myMaxRowWidth
Diagnostic information.
Definition: GLViewer_Drawer.h:184
static QMap< GLViewer_TexFindId, GLViewer_TexIdStored > TexFontBase
Map for strorage generated texture fonts.
Definition: GLViewer_Drawer.h:152
int getSeparator()
Returns separator between letters.
Definition: GLViewer_Drawer.h:139
bool myIsResizeable
Flag controlling scalability of this texmapped font.
Definition: GLViewer_Drawer.h:178
int myTexFontWidth
Font texture width.
Definition: GLViewer_Drawer.h:172
int * myPositions
Array of letter positions in texture.
Definition: GLViewer_Drawer.h:166
GLuint myTexFont
Font texture ID.
Definition: GLViewer_Drawer.h:170
void setSeparator(int theSeparator)
Installing separator between letters.
Definition: GLViewer_Drawer.h:141
int myTexFontHeight
Font texture height.
Definition: GLViewer_Drawer.h:174
int myNbSymbols
Number of characters in the font texture.
Definition: GLViewer_Drawer.h:162
int mySeparator
Separator between letters.
Definition: GLViewer_Drawer.h:176
Quantity_Color color(const QColor &)
Convert QColor object to Quantity_Color object.
Definition: OCCViewer.cxx:28
Definition: GLViewer_Drawer.h:75
bool myIsBold
Bold parameter.
Definition: GLViewer_Drawer.h:79
long myViewPortId
View Port ID.
Definition: GLViewer_Drawer.h:87
bool myIsItal
Italic parameter.
Definition: GLViewer_Drawer.h:81
bool myIsUndl
Underline parameter.
Definition: GLViewer_Drawer.h:83
int myPointSize
Font Size.
Definition: GLViewer_Drawer.h:85
QString myFontFamily
Font family description.
Definition: GLViewer_Drawer.h:77
Definition: GLViewer_Drawer.h:61
int myTexFontHeight
texture height
Definition: GLViewer_Drawer.h:67
GLuint myTexFontId
Texture ID.
Definition: GLViewer_Drawer.h:63
int myTexFontWidth
Texture width.
Definition: GLViewer_Drawer.h:65