GL Studio SCECpp Runtime Library
gls_text.h
Go to the documentation of this file.
1 #ifndef _GLS_TEXT_H
2 #define _GLS_TEXT_H
3 
4 /*! \file gls_text.h
5 
6 \brief This header defines the GlsText base class
7  in the GL Studio DO-178B Runtime Library.
8 
9 \par Copyright Information
10 Copyright (C) 1999-2012 The DiSTI Corporation<br>
11 Orlando, FL USA<br>
12 All rights reserved.<br>
13 
14  This file is copyrighted software and contains proprietary trade secrets of
15 DiSTI, and embodies substantial creative efforts as well as confidential
16 information, ideas, and expressions.
17 
18  Permission to use, and copy this software and its documentation for any
19 purpose is hereby granted per the Distribution Agreement and/or the Licensing
20 Agreement signed with DiSTI. This permission is granted provided that:
21  1. The above copyright notice appears in all copies.
22  2. That both the copyright notice and this permission notice appear in
23  the supporting documentation.
24  3. That the names DiSTI and GL Studio not be used in advertising or
25  publicity pertaining to distribution of the software without specific,
26  written prior permission of DiSTI.
27 
28  Permission to modify the software is granted, but not the right to
29 distribute the source code whether modified, or non-modified. Modifying the
30 software might invalidate the DO-178B certification package.
31 
32  Permission to distribute binaries produced by compiling source code, or
33 modified source code is granted, provided you:
34  1. Provide your name and address as the primary contact for the support
35  of your modified version.
36  2. Retain our contact information in regard to use of the base software.
37 
38  DiSTI does not provide warranty for this software or guarantee that it
39 satisfies any specification or requirement unless otherwise stated in a
40 specific contractual arrangement between the customer and DiSTI.
41 
42 */
43 
44 #include "gls_include.h"
45 #include "gls_render_object.h"
47 #include "gls_string.h"
48 #include "gls_font_base.h"
49 #include "gls_class_invariant.h"
50 
51 // forward ref
52 class GlsPolygon;
53 
54 /** This class serves as a base class for text displays
55  * \invariant base class invariant holds,
56  * _rows > 0u, _cellWidth >= 0.0f, _cellHeight >= 0.0f,
57  * _font invariant holds,
58  * _haloColor.IsValid(),
59  * GlsTextJustificationIsValid( _justification ),
60  * ( -1.0f <= _shadowDistance ) && ( _shadowDistance <= 1.0f ),
61  * _shadowColor.IsValid(),
62  * _str invariant holds,
63  * GlsFloatIsValid( _rowOffset ), GlsFloatIsValid( _textWidth ),
64  * GlsFloatIsValid( _textHeight ),
65  * GLS_NULL != _backgroundPoly, _backgroundPoly invariant holds,
66  * GLMatrixAffineFIsValid( _textRotationMatrix ),
67  * _underlineStrikeThruRenderers invariant holds,
68  * invariant holds for each element in the _underlineStrikeThruRenderers array
69  * GLS_NULL != _rowInfo,
70  * Each element in the _rowInfo array has valid members
71  */
72 class GlsText : public GlsRenderObject
73 {
74 public:
76 
77  /** text justification modes */
79  {
80  JUSTIFICATION_LEFT, /**< left justify text */
81  JUSTIFICATION_CENTER, /**< center justify text */
82  JUSTIFICATION_RIGHT, /**< right justify text */
83 
84  #if defined( GLS_DEBUG )
85  JUSTIFICATION_INVALID /**< invalid text justification ( GLS_DEBUG only ) */
86  #endif // GLS_DEBUG
87  };
88 
89  /** Attributes for a character in the text display */
91  {
92  GlsFloat32 baselineShift; /**< amount of cell height to baseline shift,
93  * -1.0f <= baselineShift <= 1.0f */
94  GlsColor bgColor; /**< background color */
95  GlsColor fgColor; /**< text color */
96  GlsBool fauxBold; /**< GLS_TRUE if bold is enabled GLS_FALSE */
97  GlsBool inverse; /**< GLS_TRUE if inverse video enabled else GLS_FALSE */
98  GlsFloat32 scale; /**< scale for character cell, 0.0f < scale <= 1.0f */
99  GlsFloat32 spacing; /**< amount of character width to space the char, spacing >= 0.0f */
100  GlsBool strikeThru; /**< GLS_TRUE if strike thru is enabled else GLS_FALSE */
101  GlsBool underline; /**< GLS_TRUE if underline is enabled */
102 
103  #if defined( GLS_DEBUG )
104  /** Determine if the char attribute is valid
105  * \return GLS_TRUE if valid else GLS_FALSE
106  * \pre none
107  * \post none
108  */
109  GlsBool IsValid( void ) const;
110  #endif // GLS_DEBUG
111  };
112 
113  /** initialization parameters for a GlsText object */
115  {
116  const GlsRenderObject::InitParameters renderInitParameters; /**< base class initialization parameters */
117 
118  const GlsTextureVertexArray::InitParameters verticesInitParameters; /**< vertices for background poly */
119 
120  const GlsUInt32 rows; /**< number of rows of text ( > 0 ) */
121  const GlsUInt32 border; /**< size of border in logical units */
122  const GlsFloat32 cellWidth; /**< width of character cell in logical units ( >= 0.0f ) */
123  const GlsFloat32 cellHeight; /**< height of character cell in logical units ( >= 0.0f ) */
124  const GlsFontBase* const *font; /**< font for text display */
125  const GlsBool halo; /**< GLS_TRUE if halo is enabled else GLS_FALSE */
126  const GlsColor haloColor; /**< initial halo color */
127  const Justification justification; /**< text justification mode */
128  const GlsFloat32 lineSpacing; /**< amount of cell height used to space lines of text,
129  * ( lineSpacing >= 0.0f ) */
130  const GlsUInt32 numChars; /**< number of characters the text object can hold */
131  const GlsChar* const str; /**< initial string value for text */
132  const GlsBool shadow; /**< GLS_TRUE if shadow effect is on else GLS_FALSE */
133  const GlsFloat32 shadowDistance; /**< amount of cell width for offset of shadow effect,
134  * ( -1.0f <= shadowDistance <= 1.0f ) */
135  const GlsColor shadowColor; /**< initial color of the shadow effect behind the characters */
136 
137  const GlsBool uppercase; /**< GLS_TRUE if all text is displayed in uppercase else GLS_FALSE */
138  const GlsBool wrapText; /**< GLS_TRUE if text is wrapped else GLS_FALSE */
139  const CharAttribute charAttribute; /**< initial character attribute for all characters */
140 
141  #if defined( GLS_DEBUG )
142  /** Determine if the initialization parameteres are valid ( GLS_DEBUG only )
143  * \return GLS_TRUE if valid else GLS_FALSE
144  * \pre none
145  * \post none
146  */
147  GlsBool IsValid( void ) const;
148  #endif // GLS_DEBUG
149  };
150 
151  /** Draws the text object
152  * \param gl GL State manager for OpenGL into which text object is drawn
153  * \param time the elaspsed time in seconds since program start
154  * \pre time >= 0.0
155  * \post text object is drawn to OpenGL if visible and not blinked off
156  */
157  virtual void Draw( GlsStateManager &gl, const GlsFloat64 time );
158 
159  /** Set the alpha mode
160  * \param alphaMode desired alpha mode
161  * \pre GlsAlphaModeIsValid( alphaMode )
162  * \post object has new alpha mode
163  */
164  virtual void SetAlphaMode( const GlsAlphaMode alphaMode );
165 
166  /** Set the fill color
167  * \param fillColor desired fill color
168  * \pre fillColor.IsValid()
169  * \post object has new fill color
170  */
171  virtual void SetFillColor( const GlsColor &fillColor );
172 
173  /** Set the line color
174  * \param lineColor desired line color
175  * \pre lineColor.IsValid()
176  * \post object has new line color
177  */
178  virtual void SetLineColor( const GlsColor &lineColor );
179 
180  /** Set the line width
181  * \param lineWidth new line width,
182  * GlsRenderObject::LINE_WIDTH_MIN <= lineWidth <= GlsRenderObject::LINE_WIDTH_MAX
183  * \pre GlsLineWidthIsValid( lineWidth )
184  * \post object has new line width
185  */
186  virtual void SetLineWidth( const GlsFloat32 lineWidth );
187 
188  /** Set the polygon mode
189  * \param polygonMode new polygon mode
190  * \pre GlsPolygonModeIsValid( polygonMode )
191  * \post object has new polygon mode
192  */
193  virtual void SetPolygonMode( const GlsPolygonMode polygonMode );
194 
195  /** Set the desired texture index
196  * \param textureIndex desired texture index into palette else GlsTexturePalette::NO_TEXTURE
197  * \pre textureIndex is less than the size of the texture palette, else GlsTexturePalette::NO_TEXTURE,
198  * object's texture palette must have a valid texture (not an empty palette entry) at textureIndex
199  * if textureIndex != GlsTexturePalette::NO_TEXTURE
200  * \post object has new texture index or is untextured if textureIndex == GlsTexturePalette::NO_TEXTURE
201  */
202  virtual void SetTextureIndex( const GlsUInt32 textureIndex );
203 
204  /** Offset the texture on the object
205  * \param offset x, y offset for texture
206  * \pre offset.IsValid()
207  * \post offset is added to the texture coordinates
208  */
209  virtual void OffsetTexture( const GlsVector2D &offset );
210 
211  /** Set the display string. Will truncate to size of string buffer if str will not fit
212  * in buffer.
213  * \param str desired display string
214  * \pre str != GLS_NULL
215  * \post display string updated
216  */
217  void SetString( const GlsChar* const str );
218 
219  /** Set the halo color
220  * \param haloColor new halo color
221  * \pre haloColor.IsValid()
222  * \post object has new halo olor
223  */
224  void SetHaloColor( const GlsColor &haloColor );
225 
226  /** Set the shadow color
227  * \param shadowColor new shadow color
228  * \pre shadowColor.IsValid()
229  * \post object has new shadow color
230  */
231  void SetShadowColor( const GlsColor &shadowColor );
232 
233  /** Set the character attributes for the text ( pure virtual )
234  * \param charAttribute new character attributes for the text
235  * \pre charAttribue.IsValid()
236  * \post text has new character attribute
237  */
238  virtual void SetCharAttributes( const CharAttribute &charAttribute ) = 0;
239 
240 protected:
241  static const GlsUInt32 NUM_VERTS_BACKGROUND_POLY = 4u; /**< required number of verts in background poly */
242  static const GlsChar NEW_LINE_CHAR; /**< new line character constant */
243  static const GlsChar SPACE_CHAR; /**< space character constant */
244 
245  /** Helper class for processing underline and strike-thru when drawing text
246  * \invariant GlsFloatIsValid( _cellWidth ), GlsFloatIsValid( _cellHeight ),
247  * GlsFloatIsValid( _shadowDistance ),
248  * _shadowColor.IsValid(),
249  * GlsFloatIsValid( _underlineOffset ), GlsFloatIsValid( _underlineSize ),
250  * GlsFloatIsValid( _underlineX1 ), GlsFloatIsValid( _underlineX2 ),
251  * GlsFloatIsValid( _underlineY ), GlsFloatIsValid( _underlineScale ),
252  * _underlineColor.IsValid(),
253  * GlsFloatIsValid( _strikeX1 ), GlsFloatIsValid( _strikeX2 ),
254  * GlsFloatIsValid( _strikeY ), GlsFloatIsValid( _strikeScale ),
255  * _strikeColor.IsValid(),
256  * _maxNumLineSegments > 0u, _numLineSegments <= _maxNumLineSegments,
257  * GLS_NULL != _lineSegments,
258  * each element in the _lineSegments array is valid
259  */
261  {
262  public:
264 
265  /** describes one line segment in an underline or strikethru */
266  struct LineSegment
267  {
268  GlsFloat32 x1; /**< starting x coordinate of line segment */
269  GlsFloat32 x2; /**< ending x coordinate of line segment */
270  GlsFloat32 y; /**< y coordinate of line segment */
271  GlsFloat32 thickness; /**< thickness of line segment */
272  GlsFloat32 shadowOffset; /**< y offset of shadowed version of line segment */
273  GlsColor segmentColor; /**< color of the line segment */
274 
275  #if defined( GLS_DEBUG )
276  /** Determine if the line segment is valid ( GLS_DEBUG only )
277  * \return GLS_TRUE if valid else GLS_FALSE
278  * \pre none
279  * \post none
280  */
281  GlsBool IsValid( void ) const;
282  #endif // GLS_DEBUG
283  };
284 
285 
286  /** Constructor - create an instance
287  * \param numLineSegments number of line segments supported by renderer (>0)
288  * \param cellWidth width of a character cell
289  * \param cellHeight height of a character cell
290  * \param shadow GLS_TRUE if text has shadow enabled else GLS_FALSE
291  * \param shadowDistance distance for shadow
292  * \param shadowColor color of shadow
293  * \param underlineOffset offset of underline
294  * \param underlineSize size of underline
295  * \pre numLineSegments > 0, GlsFloatIsValid() for all floating point arguments,
296  * shadowColor.IsValid()
297  * \post instance created
298  */
299  UnderlineStrikeThruRenderer( const GlsUInt32 numLineSegments, const GlsFloat32 cellWidth,
300  const GlsFloat32 cellHeight, const GlsBool shadow,
301  const GlsFloat32 shadowDistance, const GlsColor &shadowColor,
302  const GlsFloat32 underlineOffset, const GlsFloat32 underlineSize );
303 
304  /** Set the shadow color associated with the renderer
305  * \param shadowColor new shadow color
306  * \pre shadowColor.IsValid()
307  * \post renderer has new shadow color
308  */
309  void SetShadowColor( const GlsColor &shadowColor );
310 
311  /** Invalidate all line segments in the renderer
312  * \pre none
313  * \post all line segments are invalidated, IsUpToDate() == GLS_FALSE
314  */
315  void Reset( void );
316 
317  /** Pre Process the given character attribute
318  * \param charAttribute character attribute in question
319  * \param cellX x coord of character
320  * \param charY y coord of character
321  * \pre charAttribute.IsValid(), GlsFloatIsValid( cellX ), GlsFloatIsValid( charY ),
322  * IsUpToDate() == GLS_FALSE
323  * \post given character attribute is preprocessed for underline / strikethru processing
324  */
325  void PreProcessCharacter( const GlsText::CharAttribute &charAttribute, const GlsFloat32 cellX,
326  const GlsFloat32 charY );
327 
328  /** Post Process the given character attributes
329  * \param charAttribute character attribute in question
330  * \param cellX x coord of character cell one past the given character
331  * \param charY y coord of character
332  * \param endOfLine GLS_TRUE if character is the end of the current line else GLS_FALSE
333  * \pre charAttribute.IsValid(), GlsFloatIsValid( cellX ), GlsFloatIsValid( charY ),
334  * IsUpToDate() == GLS_FALSE
335  * \post given character attribute is postprocessed for underline / strikethru processing,
336  * if endOfLine then IsUpToDate() == GLS_TRUE
337  */
338  void PostProcessCharacter( const GlsText::CharAttribute& charAttribute,
339  const GlsFloat32 cellX, const GlsFloat32 charY, const GlsBool endOfLine );
340 
341  /** Render the line segments for the underline / strikethru
342  * \param gl OpenGL state manager to render into
343  * \pre none
344  * \post line segments are rendered to GL
345  */
346  void RenderLineSegments( GlsStateManager &gl ) const;
347 
348  /** Determine if the line segments in the renderer are up to date
349  * \pre none
350  * \post none
351  * \return GLS_TRUE if the line segments are up to date,
352  * GLS_FALSE if the line segments need to be recomputed
353  */
354  GlsBool IsUpToDate( void ) const;
355 
356  protected:
357  const GlsFloat32 _cellWidth; /**< width of one character cell */
358  const GlsFloat32 _cellHeight; /**< height of one character cell */
359  const GlsBool _shadow; /**< GLS_TRUE if shadowing is enabled else GLS_FALSE */
360  const GlsFloat32 _shadowDistance; /**< distance of shadow line segment from primary line segment */
361  GlsColor _shadowColor; /**< color of shadow */
362  const GlsFloat32 _underlineOffset; /**< offset of underline line segment */
363  const GlsFloat32 _underlineSize; /**< size of underline segment */
364 
365  // state vars for underline processing
366  GlsFloat32 _underlineX1; /**< starting x coord for next underline line segment */
367  GlsFloat32 _underlineX2; /**< ending x x coord for next underline line segment */
368  GlsFloat32 _underlineY; /**< y coord for next underline line segment */
369  GlsFloat32 _underlineScale; /**< character scaling applied to the next underline line segment */
370  GlsColor _underlineColor; /**< color of next underline line segment */
371  GlsBool _underlineOn; /**< GLS_TRUE if underlining is currently on when processing characters */
372 
373  // state vars for strike-thru processing
374  GlsFloat32 _strikeX1; /**< starting x coord for next strikethru line segment */
375  GlsFloat32 _strikeX2; /**< ending x x coord for next strikethru line segment */
376  GlsFloat32 _strikeY; /**< y coord for next strikethru line segment */
377  GlsFloat32 _strikeScale; /**< character scaling applied to the next strikethru line segment */
378  GlsColor _strikeColor; /**< color of next strikethru line segment */
379  GlsBool _strikeOn; /**< GLS_TRUE if strikethru is currently on when processing characters */
380 
381  // line segments to draw
382  const GlsUInt32 _maxNumLineSegments; /**< maximum number of line segments the renderer can hold */
383  GlsUInt32 _numLineSegments; /**< current number of line segments in the _lineSegments array
384  * ( <= _maxNumLineSegments ) */
385  LineSegment* const _lineSegments; /**< array of line segments to render
386  * ( _maxNumLineSegments number of elements )*/
387  GlsBool _isUpToDate; /**< GLS_TRUE if _lineSegments is up to date,
388  * else GLS_FALSE if the line segments need to be recomputed */
389 
390  /** Draw a line by rendering a filled polygon with a line around it so that the thickness
391  * of the line can be varied and antialiasing occurs if enabled
392  * \param gl GL state manager to draw into
393  * \param x1 x coord of first corner of the line poly
394  * \param y1 y coord of first corner of the line poly
395  * \param x2 x coord of opposite corner of the line poly
396  * \param y2 y coord of opposite corner of the line poly
397  * \pre GlsFloatIsValid( x1 ), GlsFloatIsValid( y1 ),
398  * GlsFloatIsValid( x2 ), GlsFloatIsValid( y2 )
399  * \post line is drawn to OpenGL
400  */
401  void DrawScalableLine( GlsStateManager &gl, const GlsFloat32 x1, const GlsFloat32 y1,
402  const GlsFloat32 x2, const GlsFloat32 y2 ) const;
403 
404  /** Destructor - shall never be called
405  * \pre none
406  * \post none
407  */
409 
410  private:
411  // Disable implicit generated Members
414  };
415 
416  /** info for one row of text in the display */
417  struct RowInfo
418  {
419  GlsUInt32 startingIndex; /**< starting text index into the display for row
420  * else GLSUINT32_MAX if row has no characters */
421  GlsUInt32 length; /**< the number of characters in row */
422  GlsFloat32 pixelWidth; /**< the width of row in pixels */
423  };
424 
425  const GlsUInt32 _rows; /**< number of rows of text( > 0 ) */
426  const GlsUInt32 _border; /**< size of border in logical units */
427  const GlsFloat32 _cellWidth; /**< width of character cell in logical units ( >= 0.0f ) */
428  const GlsFloat32 _cellHeight; /**< height of character cell in logical units ( >= 0.0f ) */
429  const GlsFontBase &_font; /**< font for text display */
430  const GlsBool _halo; /**< GLS_TRUE if halo is enabled else GLS_FALSE */
431  GlsColor _haloColor; /**< halo color */
432  const Justification _justification; /**< text justification mode */
433  const GlsBool _shadow; /**< GLS_TRUE if shadow effect is on else GLS_FALSE */
434  const GlsFloat32 _shadowDistance; /**< amount of cell width for offset of shadow effect,
435  * ( -1.0f <= shadowDistance <= 1.0f ) */
436  GlsColor _shadowColor; /**< color of the shadow effect behind the characters */
437  GlsString _str; /**< string value to display */
438  const GlsBool _uppercase; /**< GLS_TRUE if all characters will display as uppercase
439  * else GLS_FALSE */
440  const GlsBool _wrapText; /**< GLS_TRUE if text wrapping is enabled else GLS_FALSE */
441  const GlsFloat32 _rowOffset; /**< row offset when drawing chars */
442  const GlsFloat32 _textWidth; /**< text object width when drawing */
443  const GlsFloat32 _textHeight; /**< text object height when drawing */
444 
445  GlsPolygon *_backgroundPoly; /**< background polygon */
446  GlsMatrixAffineD::GLMatrixAffineF _textRotationMatrix; /**< additional rotation matrix for text cells */
447  GlsBool _textRotationMatrixIsIdentity; /**< GLS_TRUE if _textRotationMatrix is identity
448  * else GLS_FALSE */
449  RowInfo* const _rowInfo; /**< array ( _rows number of elements ) of RowInfo */
450  GlsPointerArray _underlineStrikeThruRenderers; /**< array ( _rows number of elements ) where element i is
451  * the underline strike thru renderer for row i */
452 
453  /** Constructor - create an instance
454  * \param initParameters initialization parameters
455  * \param maxNumLineSegmentsPerRow maximum nubmer of line segments required per row to render
456  * underline / strike thru line segments (>0)
457  * \param eventDispatcher event dispatcher for this object else GLS_NULL
458  * \pre initParameters.IsValid(), maxNumLineSegmentsPerRow > 0
459  * \post instance created
460  */
461  GlsText( const InitParameters &initParameters, const GlsUInt32 maxNumLineSegmentsPerRow,
462  GlsEventDispatcher* const eventDispatcher );
463 
464  /** Get the justification offset in pixels for the given row
465  * \param row row in question
466  * \return the justification offset in pixels for the given row
467  * \pre row < _rows
468  * \post none
469  */
470  GlsFloat32 JustificationOffset( const GlsUInt32 row ) const;
471 
472  /** Draw the characters associated with the text object
473  * \param gl GL state manager to draw into
474  * \pre all necessary GL matrix adjustments have been applied,
475  * the font texture has been bound to GL with GlsFontBase::BindFontTexture()
476  * and its texture filter settings have been setup
477  * \post text characters are drawn to GL
478  */
479  virtual void DrawCharacters( GlsStateManager &gl ) = 0;
480 
481  /** Populate the _rowInfo array based on the current display string
482  * \pre none
483  * \post _rowInfo array is populated based on the current display string
484  */
485  virtual void CalculateRowData( void ) = 0;
486 
487  /** Reset all of the line underline / strikethru renderers in the text objecy
488  * all of the underline and strikethru line segments to be recomputed the next time
489  * the text object is drawn
490  * \pre none
491  * \post all of the underline / strikethru renderers are reset
492  */
494 
495  /** Destructor -- shall never be called
496  * \pre none
497  * \post none
498  */
499  virtual ~GlsText();
500 
501 private:
502  typedef GlsRenderObject _BaseClass; /**< base class alias */
503 
504  // Disable implicit generated Members
505  GlsText& operator=( const GlsText &rhs );
506  GlsText( const GlsText &src );
507 };
508 
509 #if defined( GLS_DEBUG )
510 #pragma BullseyeCoverage save off
511 /** Determine if the given text justification mode is valid ( GLS_DEBUG only )
512  * \param justification justification mode in question
513  * \return GLS_TRUE if valid else GLS_FALSE
514  * \pre none
515  * \post none
516  */
517 inline GlsBool GlsTextJustificationIsValid( const GlsText::Justification justification )
518 {
519  return( ( GlsText::JUSTIFICATION_LEFT == justification ) ||
520  ( GlsText::JUSTIFICATION_CENTER == justification ) ||
521  ( GlsText::JUSTIFICATION_RIGHT == justification ) );
522 }
523 #pragma BullseyeCoverage restore
524 #endif // GLS_DEBUG
525 
526 #endif // _GLS_TEXT_H
virtual void SetLineWidth(const GlsFloat32 lineWidth)
virtual void SetCharAttributes(const CharAttribute &charAttribute)=0
GlsFloat32 scale
Definition: gls_text.h:98
const GlsChar *const str
Definition: gls_text.h:131
const Justification justification
Definition: gls_text.h:127
Definition: gls_text.h:81
const GlsBool _wrapText
Definition: gls_text.h:440
Definition: gls_render_object.h:69
GlsColor bgColor
Definition: gls_text.h:94
GlsBool _isUpToDate
Definition: gls_text.h:387
Definition: gls_color.h:47
bool GlsBool
Definition: gls_types.h:96
void ResetUnderineStrikeThruRenderers(void)
GlsFloat32 _underlineScale
Definition: gls_text.h:369
Definition: gls_text.h:80
GlsFloat32 pixelWidth
Definition: gls_text.h:422
static const GlsChar SPACE_CHAR
Definition: gls_text.h:243
GlsFloat32 _strikeX2
Definition: gls_text.h:375
GlsUInt32 _numLineSegments
Definition: gls_text.h:383
const GlsFontBase & _font
Definition: gls_text.h:429
#define GLS_CLASS_INVARIANT_DECLARATION(ClassName)
Definition: gls_class_invariant.h:80
GlsUInt32 length
Definition: gls_text.h:421
const GlsColor shadowColor
Definition: gls_text.h:135
char GlsChar
Definition: gls_types.h:54
const GlsFloat32 _shadowDistance
Definition: gls_text.h:360
Definition: gls_state_manager.h:63
virtual void SetFillColor(const GlsColor &fillColor)
Justification
Definition: gls_text.h:78
GlsColor segmentColor
Definition: gls_text.h:273
const GlsUInt32 numChars
Definition: gls_text.h:130
Definition: gls_texture_vertex_array.h:61
GlsColor _haloColor
Definition: gls_text.h:431
GlsFloat32 thickness
Definition: gls_text.h:271
This header defines GlsTextureVertexArray which encapsulates an array of GlsTextureVertex 's in the G...
GlsBool inverse
Definition: gls_text.h:97
const GlsFloat32 _cellWidth
Definition: gls_text.h:357
This header defines the GlsFontBase class in the GL Studio DO-178B Runtime Library.
const GlsFloat32 _textWidth
Definition: gls_text.h:442
const GlsBool shadow
Definition: gls_text.h:132
const GlsFontBase *const * font
Definition: gls_text.h:124
RowInfo *const _rowInfo
Definition: gls_text.h:449
void DrawScalableLine(GlsStateManager &gl, const GlsFloat32 x1, const GlsFloat32 y1, const GlsFloat32 x2, const GlsFloat32 y2) const
const GlsBool halo
Definition: gls_text.h:125
const GlsTextureVertexArray::InitParameters verticesInitParameters
Definition: gls_text.h:118
GlsBool _underlineOn
Definition: gls_text.h:371
Definition: gls_pointer_array.h:51
GlsFloat32 _strikeY
Definition: gls_text.h:376
static const GlsUInt32 NUM_VERTS_BACKGROUND_POLY
Definition: gls_text.h:241
GlsBool fauxBold
Definition: gls_text.h:96
Definition: gls_text.h:260
const GlsUInt32 border
Definition: gls_text.h:121
virtual ~GlsText()
virtual void SetLineColor(const GlsColor &lineColor)
virtual void OffsetTexture(const GlsVector2D &offset)
unsigned int GlsUInt32
Definition: gls_types.h:73
static const GlsChar NEW_LINE_CHAR
Definition: gls_text.h:242
GlsFloat32 _strikeX1
Definition: gls_text.h:374
GlsBool strikeThru
Definition: gls_text.h:100
Definition: gls_string.h:52
GlsColor _strikeColor
Definition: gls_text.h:378
GlsAlphaMode
Definition: gls_render_settings.h:162
Definition: gls_event.h:304
This header defines any preprocessor defines needed to configure the GL Studio DO-178B Runtime Librar...
const GlsFloat32 _cellHeight
Definition: gls_text.h:358
GlsColor _shadowColor
Definition: gls_text.h:436
virtual void Draw(GlsStateManager &gl, const GlsFloat64 time)
const CharAttribute charAttribute
Definition: gls_text.h:139
void SetShadowColor(const GlsColor &shadowColor)
This header defines the GlsString class in the GL Studio DO-178B Runtime Library. ...
GlsBool _strikeOn
Definition: gls_text.h:379
GlsBool underline
Definition: gls_text.h:101
const GlsFloat32 _textHeight
Definition: gls_text.h:443
const GlsUInt32 _rows
Definition: gls_text.h:425
UnderlineStrikeThruRenderer(const GlsUInt32 numLineSegments, const GlsFloat32 cellWidth, const GlsFloat32 cellHeight, const GlsBool shadow, const GlsFloat32 shadowDistance, const GlsColor &shadowColor, const GlsFloat32 underlineOffset, const GlsFloat32 underlineSize)
void SetString(const GlsChar *const str)
GLfloat GLMatrixAffineF[DIMENSION *DIMENSION]
Definition: gls_matrix_affine_double.h:63
Definition: gls_text.h:417
This header defines an abstract class for a display object that is directly rendered to OpenGL (not a...
const GlsBool wrapText
Definition: gls_text.h:138
GlsFloat32 x2
Definition: gls_text.h:269
virtual void DrawCharacters(GlsStateManager &gl)=0
void RenderLineSegments(GlsStateManager &gl) const
float GlsFloat32
Definition: gls_types.h:78
const GlsFloat32 _shadowDistance
Definition: gls_text.h:434
Definition: gls_font_base.h:56
const GlsRenderObject::InitParameters renderInitParameters
Definition: gls_text.h:116
GlsFloat32 _underlineY
Definition: gls_text.h:368
const GlsFloat32 _underlineSize
Definition: gls_text.h:363
const GlsBool _shadow
Definition: gls_text.h:433
const GlsUInt32 _maxNumLineSegments
Definition: gls_text.h:382
Definition: gls_display_object.h:64
This header defines a GLS_DEBUG only macro for facilitating evaluating class invariants in the GL Stu...
GlsFloat32 _underlineX2
Definition: gls_text.h:367
const GlsBool uppercase
Definition: gls_text.h:137
GlsPointerArray _underlineStrikeThruRenderers
Definition: gls_text.h:450
void PreProcessCharacter(const GlsText::CharAttribute &charAttribute, const GlsFloat32 cellX, const GlsFloat32 charY)
const GlsFloat32 _cellWidth
Definition: gls_text.h:427
virtual void SetAlphaMode(const GlsAlphaMode alphaMode)
GlsFloat32 baselineShift
Definition: gls_text.h:92
const GlsFloat32 cellWidth
Definition: gls_text.h:122
virtual void SetPolygonMode(const GlsPolygonMode polygonMode)
const GlsUInt32 _border
Definition: gls_text.h:426
GlsUInt32 startingIndex
Definition: gls_text.h:419
const GlsFloat32 lineSpacing
Definition: gls_text.h:128
GlsFloat32 shadowOffset
Definition: gls_text.h:272
double GlsFloat64
Definition: gls_types.h:87
Definition: gls_render_object.h:82
Definition: gls_vertex.h:49
GlsFloat32 _underlineX1
Definition: gls_text.h:366
GlsFloat32 spacing
Definition: gls_text.h:99
virtual void SetTextureIndex(const GlsUInt32 textureIndex)
const Justification _justification
Definition: gls_text.h:432
const GlsFloat32 cellHeight
Definition: gls_text.h:123
const GlsBool _halo
Definition: gls_text.h:430
GlsBool _textRotationMatrixIsIdentity
Definition: gls_text.h:447
GlsPolygonMode
Definition: gls_render_settings.h:131
void SetHaloColor(const GlsColor &haloColor)
GlsString _str
Definition: gls_text.h:437
void PostProcessCharacter(const GlsText::CharAttribute &charAttribute, const GlsFloat32 cellX, const GlsFloat32 charY, const GlsBool endOfLine)
GlsFloat32 y
Definition: gls_text.h:270
const GlsColor haloColor
Definition: gls_text.h:126
const GlsUInt32 rows
Definition: gls_text.h:120
Definition: gls_polygon.h:55
Definition: gls_text.h:90
GlsColor fgColor
Definition: gls_text.h:95
const GlsFloat32 _cellHeight
Definition: gls_text.h:428
GlsFloat32 _strikeScale
Definition: gls_text.h:377
const GlsFloat32 shadowDistance
Definition: gls_text.h:133
GlsFloat32 JustificationOffset(const GlsUInt32 row) const
const GlsBool _shadow
Definition: gls_text.h:359
GlsPolygon * _backgroundPoly
Definition: gls_text.h:445
GlsFloat32 x1
Definition: gls_text.h:268
Definition: gls_text.h:114
const GlsFloat32 _rowOffset
Definition: gls_text.h:441
void SetShadowColor(const GlsColor &shadowColor)
Definition: gls_text.h:72
GlsMatrixAffineD::GLMatrixAffineF _textRotationMatrix
Definition: gls_text.h:446
const GlsFloat32 _underlineOffset
Definition: gls_text.h:362
GlsColor _underlineColor
Definition: gls_text.h:370
virtual void CalculateRowData(void)=0
Definition: gls_text.h:82
GlsText(const InitParameters &initParameters, const GlsUInt32 maxNumLineSegmentsPerRow, GlsEventDispatcher *const eventDispatcher)
GlsColor _shadowColor
Definition: gls_text.h:361
const GlsBool _uppercase
Definition: gls_text.h:438
LineSegment *const _lineSegments
Definition: gls_text.h:385