Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GLViewer_TextDrawer Class Reference

#include <GLViewer_BaseDrawers.h>

Inheritance diagram for GLViewer_TextDrawer:
Inheritance graph

Public Member Functions

 GLViewer_TextDrawer ()
 
 ~GLViewer_TextDrawer ()
 
virtual void create (float, float, bool)
 Redefined method. More...
 
void updateObjects ()
 Updates objects after updating font. More...
 
- Public Member Functions inherited from GLViewer_Drawer
 GLViewer_Drawer ()
 A constructor. More...
 
virtual ~GLViewer_Drawer ()
 A destructor. More...
 
virtual void addObject (GLViewer_Object *theObject)
 Adds object to drawer display list. More...
 
virtual void clear ()
 Clears drawer display list. More...
 
QString getObjectType () const
 Returns object type (needs for dynamic search of right drawer ) More...
 
int getPriority () const
 Returns object priority. More...
 
void setAntialiasing (const bool on)
 The function enables and disables antialiasing in Open GL (for points, lines and polygons). More...
 
virtual bool translateToHPGL (QFile &hFile, GLViewer_CoordSystem *aViewerCS, GLViewer_CoordSystem *aHPGLCS)
 A function translate object in to HPGL file on disk. More...
 
virtual bool translateToPS (QFile &hFile, GLViewer_CoordSystem *aViewerCS, GLViewer_CoordSystem *aPSCS)
 A function translate object in to PostScript file on disk. More...
 
void drawTexture (GLuint texture, GLint size, GLfloat x, GLfloat y)
 Draw square texture. More...
 
void drawTexture (GLuint texture, GLint x_size, GLint y_size, GLfloat x, GLfloat y)
 Draw texture. More...
 
void drawTexturePart (GLuint texture, GLfloat x_ratio, GLfloat y_ratio, GLfloat x_size, GLfloat y_size, GLfloat x, GLfloat y, GLfloat scale=0)
 Draw texture part. More...
 
void drawText (const QString &text, GLfloat xPos, GLfloat yPos, const QColor &color, QFont *aFont, int theSeparator, DisplayTextFormat=DTF_BITMAP)
 Draw text string. More...
 
void drawGLText (QString text, float x, float y, int hPosition=GLText_Center, int vPosition=GLText_Center, QColor color=Qt::black, bool smallFont=false)
 Draw text string. More...
 
void setFont (const QFont &font)
 Sets a default font to be used by drawGLText method. More...
 
QFont font () const
 Returns a default font used by drawGLText method. More...
 
void setTextFormat (const DisplayTextFormat format)
 Sets a default text displaying format to be used by drawGLText method. More...
 
DisplayTextFormat textFormat () const
 Returns a default text displaying format used by drawGLText method. More...
 
void setTextScale (const GLfloat factor)
 Sets a text string displaying scale factor (used only with text format DTF_TEXTURE_SCALABLE) More...
 
GLfloat textScale () const
 Returns a text string displaying scale factor. More...
 
GLViewer_Rect textRect (const QString &) const
 Returns a rectangle of text (without viewer scale) More...
 

Additional Inherited Members

- Public Types inherited from GLViewer_Drawer
enum  {
  GLText_Center = 0, GLText_Left, GLText_Right, GLText_Top,
  GLText_Bottom
}
 Text position relatively object. More...
 
- Static Public Member Functions inherited from GLViewer_Drawer
static void destroyAllTextures ()
 Clears all generated textures. More...
 
static GLuint loadTexture (const QString &fileName, GLint *x_size=0, GLint *y_size=0, GLint *t_size=0)
 Loads texture from file. More...
 
static void drawRectangle (GLViewer_Rect *theRect, QColor=Qt::black)
 Draw rectangle with predefined color. More...
 
- Protected Member Functions inherited from GLViewer_Drawer
virtual void drawText (GLViewer_Object *theObject)
 Draw object text. More...
 
- Static Protected Member Functions inherited from GLViewer_Drawer
static void drawRectangle (GLViewer_Rect *, GLfloat, GLfloat=0, QColor=Qt::black, bool=false, QColor=Qt::white)
 Draw basic primitives: rectangle, contour, polygon, vertex, cross, arrow. More...
 
static void drawContour (GLViewer_Rect *, QColor, GLfloat, GLushort, bool)
 
static void drawContour (const GLViewer_PntList &, QColor, GLfloat)
 
static void drawPolygon (GLViewer_Rect *, QColor, GLushort, bool)
 
static void drawPolygon (const GLViewer_PntList &, QColor)
 
static void drawVertex (GLfloat, GLfloat, QColor)
 
static void drawCross (GLfloat, GLfloat, QColor)
 
static void drawArrow (const GLfloat red, const GLfloat green, const GLfloat blue, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLboolean=GL_FALSE)
 
- Protected Attributes inherited from GLViewer_Drawer
float myXScale
 X Scale factor. More...
 
float myYScale
 Y scale factor. More...
 
QList< GLViewer_Object * > myObjects
 List of objects. More...
 
GLuint myTextList
 List generated textures. More...
 
QString myObjectType
 Type of supporting object. More...
 
int myPriority
 Dislay priority. More...
 
QFont myFont
 Default font for drawGLText() method. More...
 
DisplayTextFormat myTextFormat
 Default text displaying format for drawGLText() method. More...
 
GLfloat myTextScale
 Scale factor for text string draw, by default 0.125 (used only with text format DTF_TEXTURE_SCALABLE) More...
 

Detailed Description

Drawer for GLViewer_Text

Constructor & Destructor Documentation

GLViewer_TextDrawer::GLViewer_TextDrawer ( )

Default constructor

References GLViewer_Drawer::myObjectType.

GLViewer_TextDrawer::~GLViewer_TextDrawer ( )

Destructor

Member Function Documentation

void GLViewer_TextDrawer::create ( float  xScale,
float  yScale,
bool  onlyUpdate 
)
virtual

Draws object in GLViewer

Parameters
xScale- current scale along X-direction
yScale- current scale along Y-direction
onlyUpdate- = true if only update highlight-select information

Implements GLViewer_Drawer.

References OCCViewer::color(), GLViewer_Drawer::drawText(), GLViewer_Object::getAspectLine(), GLViewer_AspectLine::getLineColors(), GLViewer_Object::isHighlighted(), GLViewer_Object::isSelected(), GLViewer_Drawer::myObjects, GLViewer_Drawer::myXScale, and GLViewer_Drawer::myYScale.

void GLViewer_TextDrawer::updateObjects ( )

Updates objects after updating font

References GLViewer_Drawer::myObjects.


The documentation for this class was generated from the following files: