Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef GLVIEWER_TEXT_H
00028 #define GLVIEWER_TEXT_H
00029
00030 #ifdef WIN32
00031 #include <windows.h>
00032 #endif
00033
00034 #include "GLViewer.h"
00035 #include "GLViewer_Defs.h"
00036
00037 #include <GL/gl.h>
00038
00039 #include <QFont>
00040 #include <QString>
00041 #include <QColor>
00042
00043 #ifdef WIN32
00044 #pragma warning( disable:4251 )
00045 #endif
00046
00051 class GLVIEWER_API GLViewer_Text
00052 {
00053 public:
00054 GLViewer_Text( const QString&, float xPos = 0.0, float yPos = 0.0, const QColor& color = QColor( 0, 255, 0 ) );
00055 GLViewer_Text( const QString&, float xPos, float yPos, const QColor& , QFont theFont, int theSeparator);
00056 ~GLViewer_Text();
00057
00059 void setText( const QString& text ) { myText = text; }
00061 QString getText() const { return myText; }
00062
00064 void setPosition( float xPos, float yPos ) { myXPos = xPos; myYPos = yPos; }
00066 void getPosition( float& xPos, float& yPos ) { xPos = myXPos; yPos = myYPos; }
00067
00069 void setColor( const QColor& color ) { myColor = color; }
00071 QColor getColor() const { return myColor; }
00072
00074 void setFont( const QFont theQFont) { myQFont = theQFont; }
00076 QFont getFont() const { return myQFont; }
00077
00079 int getSeparator(){ return mySeparator; }
00081 void setSeparator( int theSep ){ mySeparator = theSep; }
00082
00084 int getWidth();
00086 int getHeight();
00087
00089
00090 QByteArray getByteCopy() const;
00091
00093
00094 static GLViewer_Text* fromByteCopy( QByteArray );
00095
00097 DisplayTextFormat getDisplayTextFormat() const { return myDTF; }
00099 void setTextDisplayFormat( DisplayTextFormat theDTF ) { myDTF = theDTF; }
00100
00101 protected:
00102 QString myText;
00103 float myXPos;
00104 float myYPos;
00105 QColor myColor;
00106 QFont myQFont;
00107 int mySeparator;
00108 DisplayTextFormat myDTF;
00109 };
00110
00111 #ifdef WIN32
00112 #pragma warning ( default:4251 )
00113 #endif
00114
00115 #endif