3Depict
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
DrawGLText Class Reference

A class to draw text obects using FTGL. More...

#include <drawables.h>

Inheritance diagram for DrawGLText:
Inheritance graph
[legend]
Collaboration diagram for DrawGLText:
Collaboration graph
[legend]

Public Member Functions

 DrawGLText (std::string fontFile, unsigned int ftglTextMode)
 Constructor (font file & text mode) More...
 
 DrawGLText (const DrawGLText &other)
 
virtual ~DrawGLText ()
 Destructor. More...
 
virtual unsigned int getType () const
 
void setSize (unsigned int size)
 Set the size of the text (in points (which may be GL units,. More...
 
void setDepth (unsigned int depth)
 Set the depth of the text (in points, may be GL units, unsure) More...
 
bool ok () const
 Returs true if the class data is good. More...
 
void setString (const std::string &str)
 Set the text string to be displayed. More...
 
void draw () const
 Render the text string. More...
 
void setUp (const Point3D &p)
 Set the up direction for the text. More...
 
void setOrigin (const Point3D &p)
 Set the origin. More...
 
void setReadDir (const Point3D &p)
 Set the reading direction. More...
 
void setTextDir (const Point3D &p)
 Set the text flow direction. More...
 
Point3D getOrigin () const
 Return the location of the lower-left of the text. More...
 
void setReadFromNorm (bool b)
 
void setColour (float r, float g, float b, float a)
 Set the colour (rgba) of the object. More...
 
void getBoundingBox (BoundCube &b) const
 Get the bounding box for the text. More...
 
void setAlignment (unsigned int mode)
 Set the text alignment (default is left) More...
 
void recomputeParams (const std::vector< Point3D > &vecs, const std::vector< float > &scalars, unsigned int mode)
 If we offer any kind of external pointer interface; use this to do a recomputation as needed. This is needed for selection binding behaviour. More...
 
- Public Member Functions inherited from DrawableObj
virtual bool isOverlay () const
 Is this an overlay? By default, no. More...
 
 DrawableObj ()
 Constructor. More...
 
virtual DrawableObjclone () const
 
virtual bool needsDepthSorting () const
 Do we need to do element based depth sorting? More...
 
virtual bool isExplodable () const
 Can we break this object down into constituent elements? More...
 
virtual void explode (std::vector< DrawableObj *> &simpleObjects)
 Break object down into simple elements. More...
 
virtual bool hasChanged () const
 
void setActive (bool active)
 Set the active state of the object. More...
 
void setInteract (bool canAct)
 Set if user can interact with object, needed for opengl hit testing. More...
 
virtual ~DrawableObj ()
 Drawable destructor. More...
 
virtual Point3D getCentroid () const
 Get the centre of the object. Only valid if object is simple. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DrawableObj
static void setUseAlphaBlending (bool willBlend)
 
static void setCurCamera (const Camera *c)
 Set the current camera. More...
 
static void setTexPool (TexturePool *t)
 Set the current camera. More...
 
static void clearTexPool ()
 
static void setWindowSize (unsigned int x, unsigned int y)
 
static void setBackgroundColour (float r, float g, float b)
 
- Public Attributes inherited from DrawableObj
bool canSelect
 Can be selected from openGL viewport interactively? More...
 
bool wantsLight
 Wants lighting calculations active during render? More...
 
- Static Protected Member Functions inherited from DrawableObj
static float getHighContrastValue ()
 
- Protected Attributes inherited from DrawableObj
bool active
 Is the drawable active? More...
 
bool haveChanged
 Is the object changed since last set? More...
 
- Static Protected Attributes inherited from DrawableObj
static const CameracurCamera = 0
 Pointer to current scene camera. More...
 
static float backgroundR
 
static float backgroundG
 
static float backgroundB
 
static TexturePooltexPool =0
 
static bool useAlphaBlend
 
static unsigned int winX
 
static unsigned int winY
 

Detailed Description

A class to draw text obects using FTGL.

Constructor & Destructor Documentation

◆ DrawGLText() [1/2]

DrawGLText::DrawGLText ( std::string  fontFile,
unsigned int  ftglTextMode 
)

Constructor (font file & text mode)

References ASSERT, DRAWTEXT_ALIGN_LEFT, FTGL_BITMAP, FTGL_EXTRUDE, FTGL_OUTLINE, FTGL_PIXMAP, FTGL_POLYGON, and FTGL_TEXTURE.

◆ DrawGLText() [2/2]

DrawGLText::DrawGLText ( const DrawGLText other)

◆ ~DrawGLText()

DrawGLText::~DrawGLText ( )
virtual

Destructor.

Member Function Documentation

◆ draw()

void DrawGLText::draw ( ) const
virtual

◆ getBoundingBox()

void DrawGLText::getBoundingBox ( BoundCube b) const
virtual

◆ getOrigin()

Point3D DrawGLText::getOrigin ( ) const
inline

Return the location of the lower-left of the text.

Referenced by AnnotateFilter::refresh().

Here is the caller graph for this function:

◆ getType()

virtual unsigned int DrawGLText::getType ( ) const
inlinevirtual

Implements DrawableObj.

References DRAW_TYPE_GLTEXT.

◆ ok()

bool DrawGLText::ok ( ) const
inline

Returs true if the class data is good.

◆ recomputeParams()

void DrawGLText::recomputeParams ( const std::vector< Point3D > &  vecs,
const std::vector< float > &  scalars,
unsigned int  mode 
)
virtual

If we offer any kind of external pointer interface; use this to do a recomputation as needed. This is needed for selection binding behaviour.

Reimplemented from DrawableObj.

References ASSERT, and DRAW_TEXT_BIND_ORIGIN.

◆ setAlignment()

void DrawGLText::setAlignment ( unsigned int  mode)

Set the text alignment (default is left)

References ASSERT, and DRAWTEXT_ALIGN_ENUM_END.

Referenced by BoundingBoxFilter::numBytesForCache(), and AnnotateFilter::refresh().

Here is the caller graph for this function:

◆ setColour()

void DrawGLText::setColour ( float  r,
float  g,
float  b,
float  a 
)

Set the colour (rgba) of the object.

Referenced by BoundingBoxFilter::numBytesForCache(), and AnnotateFilter::refresh().

Here is the caller graph for this function:

◆ setDepth()

void DrawGLText::setDepth ( unsigned int  depth)
inline

Set the depth of the text (in points, may be GL units, unsure)

◆ setOrigin()

void DrawGLText::setOrigin ( const Point3D p)
inline

Set the origin.

Referenced by BoundingBoxFilter::numBytesForCache(), and AnnotateFilter::refresh().

Here is the caller graph for this function:

◆ setReadDir()

void DrawGLText::setReadDir ( const Point3D p)
inline

Set the reading direction.

The reading direction is the direction from which the text should be legible This direction is important only if ensureReadFromNorm is set

◆ setReadFromNorm()

void DrawGLText::setReadFromNorm ( bool  b)
inline

◆ setSize()

void DrawGLText::setSize ( unsigned int  size)
inline

Set the size of the text (in points (which may be GL units,.

Referenced by BoundingBoxFilter::numBytesForCache(), and AnnotateFilter::refresh().

Here is the caller graph for this function:

◆ setString()

void DrawGLText::setString ( const std::string &  str)
inline

Set the text string to be displayed.

Referenced by BoundingBoxFilter::numBytesForCache(), and AnnotateFilter::refresh().

Here is the caller graph for this function:

◆ setTextDir()

void DrawGLText::setTextDir ( const Point3D p)
inline

Set the text flow direction.

This must be orthogonal to the up vector i.e. forms a right angle with

References Point3D::normalise().

Referenced by BoundingBoxFilter::numBytesForCache(), and AnnotateFilter::refresh().

Here is the caller graph for this function:

◆ setUp()

void DrawGLText::setUp ( const Point3D p)
inline

Set the up direction for the text.

Note that this must be orthogonal to the reading direction

References Point3D::normalise().

Referenced by BoundingBoxFilter::numBytesForCache(), and AnnotateFilter::refresh().

Here is the caller graph for this function:

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