1 // File: GLViewer_Text.h
2 // Created: November, 2004
4 // Copyright (C) CEA 2004
6 #ifndef GLVIEWER_TEXT_H
7 #define GLVIEWER_TEXT_H
14 #include "GLViewer_Defs.h"
21 #include <qfontmetrics.h>
24 #pragma warning( disable:4251 )
27 // Class: GLViewer_Text
28 // Descr: Substitution of Prs3d_Text for OpenGL
30 class GLVIEWER_API GLViewer_Text
33 GLViewer_Text( const QString&, float xPos = 0.0, float yPos = 0.0, const QColor& color = QColor( 0, 255, 0 ) );
34 GLViewer_Text( const QString&, float xPos, float yPos, const QColor& , QFont, int );
37 void setText( const QString& text ) { myText = text; }
38 QString getText() const { return myText; }
40 void setPosition( float xPos, float yPos ) { myXPos = xPos; myYPos = yPos; }
41 void getPosition( float& xPos, float& yPos ) { xPos = myXPos; yPos = myYPos; }
43 void setColor( const QColor& color ) { myColor = color; }
44 QColor getColor() const { return myColor; }
46 void setFont( const QFont theQFont) { myQFont = theQFont; }
47 QFont getFont() const { return myQFont; }
49 int getSeparator(){ return mySeparator; }
50 void setSeparator( int theSep ){ mySeparator = theSep; }
55 QByteArray getByteCopy() const;
57 static GLViewer_Text* fromByteCopy( QByteArray );
59 DisplayTextFormat getDisplayTextFormat() const { return myDTF; }
60 void setTextDisplayFormat( DisplayTextFormat theDTF ) { myDTF = theDTF; }
69 DisplayTextFormat myDTF;
73 #pragma warning ( default:4251 )