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 * 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 theFont, int theSeparator);
38 void setText( const QString& text ) { myText = text; }
40 QString getText() const { return myText; }
42 //! Sets text position
43 void setPosition( float xPos, float yPos ) { myXPos = xPos; myYPos = yPos; }
44 //! Returns text position
45 void getPosition( float& xPos, float& yPos ) { xPos = myXPos; yPos = myYPos; }
48 void setColor( const QColor& color ) { myColor = color; }
49 //! Returns text color
50 QColor getColor() const { return myColor; }
53 void setFont( const QFont theQFont) { myQFont = theQFont; }
55 QFont getFont() const { return myQFont; }
57 //! Returns text separator
58 int getSeparator(){ return mySeparator; }
59 //! Sets text separator
60 void setSeparator( int theSep ){ mySeparator = theSep; }
62 //! Returns text width
64 //! Returns text height
67 //! A function for coding object to the byte copy
68 /*! A function is used for copy-past technollogy in copy method */
69 QByteArray getByteCopy() const;
71 //! A function for decoding object from the byte copy
72 /*! A function is used for copy-past technollogy in past method */
73 static GLViewer_Text* fromByteCopy( QByteArray );
75 //! Sets text format BITMAP or TEXTURE
76 DisplayTextFormat getDisplayTextFormat() const { return myDTF; }
77 //! Returns text format BITMAP or TEXTURE
78 void setTextDisplayFormat( DisplayTextFormat theDTF ) { myDTF = theDTF; }
87 DisplayTextFormat myDTF;
91 #pragma warning ( default:4251 )