|
3Depict
|
A class to draw text obects using FTGL. More...
#include <drawables.h>


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 DrawableObj * | clone () 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 Camera * | curCamera = 0 |
| Pointer to current scene camera. More... | |
| static float | backgroundR |
| static float | backgroundG |
| static float | backgroundB |
| static TexturePool * | texPool =0 |
| static bool | useAlphaBlend |
| static unsigned int | winX |
| static unsigned int | winY |
A class to draw text obects using FTGL.
| 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::DrawGLText | ( | const DrawGLText & | other | ) |
References ASSERT, FTGL_BITMAP, FTGL_EXTRUDE, FTGL_OUTLINE, FTGL_PIXMAP, FTGL_POLYGON, and FTGL_TEXTURE.
|
virtual |
Destructor.
|
virtual |
Render the text string.
Implements DrawableObj.
References Point3D::angle(), ASSERT, Point3D::crossProd(), DrawableObj::curCamera, Point3D::dotProd(), DRAWTEXT_ALIGN_CENTRE, DRAWTEXT_ALIGN_LEFT, DRAWTEXT_ALIGN_RIGHT, FTGL_BITMAP, FTGL_TEXTURE, Point3f::fx, Point3f::fy, Point3f::fz, Camera::getOrigin(), Camera::getUpDirection(), M_PI, Point3D::normalise(), quat_rot(), and Point3D::sqrMag().
|
virtual |
Get the bounding box for the text.
Implements DrawableObj.
References Point3D::angle(), Point3D::crossProd(), Point3f::fx, Point3f::fy, Point3f::fz, BoundCube::getVertices(), M_PI, Point3D::normalise(), quat_rot(), quat_rot_array(), BoundCube::setBounds(), and BoundCube::setInverseLimits().
|
inline |
Return the location of the lower-left of the text.
Referenced by AnnotateFilter::refresh().

|
inlinevirtual |
Implements DrawableObj.
References DRAW_TYPE_GLTEXT.
|
inline |
Returs true if the class data is good.
|
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.
| 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().

| 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().

|
inline |
Set the depth of the text (in points, may be GL units, unsure)
|
inline |
Set the origin.
Referenced by BoundingBoxFilter::numBytesForCache(), and AnnotateFilter::refresh().

|
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
|
inline |
|
inline |
Set the size of the text (in points (which may be GL units,.
Referenced by BoundingBoxFilter::numBytesForCache(), and AnnotateFilter::refresh().

|
inline |
Set the text string to be displayed.
Referenced by BoundingBoxFilter::numBytesForCache(), and AnnotateFilter::refresh().

|
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().

|
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().

1.8.13