# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CTextContext Class Reference

CTextContext. More...

#include <text_context.h>

Collaboration diagram for NL3D::CTextContext:

Collaboration graph
[legend]
List of all members.

Public Methods

 CTextContext ()
 Constructor. More...

void init (IDriver *drv, CFontManager *fmg)
 set the driver. More...

void setFontGenerator (const std::string fontFileName, const std::string fontExFileName = "")
 init the font generator. More...

void setColor (NLMISC::CRGBA color)
 set the font color. More...

void setFontSize (uint32 fontSize)
 set the font size. More...

uint32 getFontSize () const
 get the font size. More...

void setHotSpot (NL3D::CComputedString::THotSpot hotSpot)
 set the hot spot. More...

void setScaleX (float scaleX)
 set the X scale. More...

void setScaleZ (float scaleZ)
 set the Z scale. More...

float getScaleX () const
float getScaleZ () const
void setShaded (bool b)
 set the shade states. More...

bool getShaded () const
void setShadeExtent (float shext)
 set the shadow's size. More...

NL3D::CComputedString::THotSpot getHotSpot () const
 get the hot spot. More...

uint32 textPush (const char *format, ...)
 compute and add a string to the stack. More...

uint32 textPush (ucstring str)
 computes an ucstring and adds the result to the stack. More...

void erase (uint32 i)
 remove a string from the list. More...

void clear ()
 empty the map. More...

void printAt (float x, float z, uint32 i)
 print a string of the list (rq : it leaves the string in the stack). More...

void printAt (float x, float z, ucstring ucstr)
 compute and print a ucstring at the location. More...

void printfAt (float x, float z, const char * format, ...)
 compute and print a string at the location. More...

CComputedStringoperator[] (uint32 i)
 operator[]. More...

CComputedStringgetComputedString (uint32 i)
 operator[]. More...

void computeString (const std::string& s, CComputedString& output)
 Compute a string as primitive blocks using the font manager's method computeString. More...

void computeString (const ucstring& s, CComputedString& output)
 Compute a ucstring as primitive blocks using the font manager's method computeString. More...

float getLastXBound () const
 Return max x coordinate of last string printed. More...

void setKeep800x600Ratio (bool keep)
 set to true if you want that CFontManager look at Driver window size, and resize fontSize so it keeps same size than if it was in 800x600... More...

bool getKeep800x600Ratio () const
 return keep800x600Ratio state. More...

 ~CTextContext ()
 destructor. More...


Private Attributes

IDriver_Driver
 Driver. More...

NL3D::CFontManager_FontManager
 font manager. More...

NL3D::CFontGenerator_FontGen
 font generator. More...

uint32 _FontSize
 font size;. More...

NLMISC::CRGBA _Color
 current text color. More...

NL3D::CComputedString::THotSpot _HotSpot
 hotspot. More...

float _ScaleX
 X scale. More...

float _ScaleZ
 Z scale. More...

float _RotateY
 Y axe rotation angle. More...

std::map<uint32,CComputedString_StringList
 computed strings map. More...

float _XBound
 max x coordinate of last string printed. More...

sint32 _MaxIndex
 maximum index reached. More...

bool _Shaded
 true if text is shaded. More...

float _ShadeExtent
 shade's extent. More...

bool _Keep800x600Ratio
 resize fontSize??? More...

CComputedString _TempString
 for printAt() and printfAt(). This prevents from creating VBdrvinfos each time they are called (N*each frame!!). More...

CComputedString _TempShadowString

Detailed Description

CTextContext.

Author(s):
Stephane Coutelas , Nevrax France
Date:
2000

Definition at line 44 of file text_context.h.


Constructor & Destructor Documentation

NL3D::CTextContext::CTextContext ( ) [inline]
 

Constructor.

Definition at line 100 of file text_context.h.

NL3D::CTextContext::~CTextContext ( ) [inline]
 

destructor.

Definition at line 436 of file text_context.h.


Member Function Documentation

void NL3D::CTextContext::clear ( ) [inline]
 

empty the map.

Definition at line 296 of file text_context.h.

void NL3D::CTextContext::computeString ( const ucstring & s,
CComputedString & output ) [inline]
 

Compute a ucstring as primitive blocks using the font manager's method computeString.

Parameters:
an   ucstring
the   computed string

Definition at line 407 of file text_context.h.

void NL3D::CTextContext::computeString ( const std::string & s,
CComputedString & output ) [inline]
 

Compute a string as primitive blocks using the font manager's method computeString.

Parameters:
a   string
the   computed string

Definition at line 396 of file text_context.h.

void NL3D::CTextContext::erase ( uint32 i ) [inline]
 

remove a string from the list.

Definition at line 288 of file text_context.h.

CComputedString * NL3D::CTextContext::getComputedString ( uint32 i ) [inline]
 

operator[].

Returns:
the computed string, NULL if not found.

Definition at line 379 of file text_context.h.

uint32 NL3D::CTextContext::getFontSize ( ) const [inline]
 

get the font size.

Returns:
the font size

Definition at line 167 of file text_context.h.

NL3D::CComputedString::THotSpot NL3D::CTextContext::getHotSpot ( ) const [inline]
 

get the hot spot.

Returns:
the hot spot

Definition at line 245 of file text_context.h.

bool NL3D::CTextContext::getKeep800x600Ratio ( ) const [inline]
 

return keep800x600Ratio state.

Definition at line 432 of file text_context.h.

float NL3D::CTextContext::getLastXBound ( ) const [inline]
 

Return max x coordinate of last string printed.

Useful to know if a string goes out of the screen (screen limit is supposed at x==4/3, should actually depend on driver's frustum).

Returns:
x coordinate

Definition at line 418 of file text_context.h.

float NL3D::CTextContext::getScaleX ( ) const [inline]
 

Returns:
the X scale

Definition at line 202 of file text_context.h.

float NL3D::CTextContext::getScaleZ ( ) const [inline]
 

Returns:
the Z scale

Definition at line 210 of file text_context.h.

bool NL3D::CTextContext::getShaded ( ) const [inline]
 

Returns:
the shade state

Definition at line 227 of file text_context.h.

void NL3D::CTextContext::init ( IDriver * drv,
CFontManager * fmg ) [inline]
 

set the driver.

Definition at line 128 of file text_context.h.

CComputedString & NL3D::CTextContext::operator[] ( uint32 i ) [inline]
 

operator[].

Returns:
the computed string

Definition at line 367 of file text_context.h.

void NL3D::CTextContext::printAt ( float x,
float z,
ucstring ucstr ) [inline]
 

compute and print a ucstring at the location.

Definition at line 323 of file text_context.h.

void NL3D::CTextContext::printAt ( float x,
float z,
uint32 i ) [inline]
 

print a string of the list (rq : it leaves the string in the stack).

Definition at line 306 of file text_context.h.

void NL3D::CTextContext::printfAt ( float x,
float z,
const char * format,
... ) [inline]
 

compute and print a string at the location.

Definition at line 343 of file text_context.h.

void NL3D::CTextContext::setColor ( NLMISC::CRGBA color ) [inline]
 

set the font color.

Parameters:
color   the font color

Definition at line 149 of file text_context.h.

void NL3D::CTextContext::setFontGenerator ( const std::string fontFileName,
const std::string fontExFileName = "" ) [inline]
 

init the font generator.

Must be called before any print

Parameters:
cf   CFontGenerator constructor parameters)

Definition at line 139 of file text_context.h.

void NL3D::CTextContext::setFontSize ( uint32 fontSize ) [inline]
 

set the font size.

Should be called before the first print

Parameters:
fonSize   the font size

Definition at line 158 of file text_context.h.

void NL3D::CTextContext::setHotSpot ( NL3D::CComputedString::THotSpot hotSpot ) [inline]
 

set the hot spot.

Parameters:
fonSize   the font size

Definition at line 176 of file text_context.h.

void NL3D::CTextContext::setKeep800x600Ratio ( bool keep ) [inline]
 

set to true if you want that CFontManager look at Driver window size, and resize fontSize so it keeps same size than if it was in 800x600...

Definition at line 427 of file text_context.h.

void NL3D::CTextContext::setScaleX ( float scaleX ) [inline]
 

set the X scale.

Parameters:
scaleX   the X scale

Definition at line 185 of file text_context.h.

void NL3D::CTextContext::setScaleZ ( float scaleZ ) [inline]
 

set the Z scale.

Parameters:
scaleZ   the Z scale

Definition at line 194 of file text_context.h.

void NL3D::CTextContext::setShadeExtent ( float shext ) [inline]
 

set the shadow's size.

Parameters:
the   shade extent

Definition at line 236 of file text_context.h.

void NL3D::CTextContext::setShaded ( bool b ) [inline]
 

set the shade states.

Parameters:
the   shade state

Definition at line 219 of file text_context.h.

uint32 NL3D::CTextContext::textPush ( ucstring str ) [inline]
 

computes an ucstring and adds the result to the stack.

Parameters:
an   ucstring
Returns:
the index where computed string has been inserted

Definition at line 274 of file text_context.h.

uint32 NL3D::CTextContext::textPush ( const char * format,
... ) [inline]
 

compute and add a string to the stack.

Parameters:
a   string
Returns:
the index where string has been inserted

Definition at line 255 of file text_context.h.


Member Data Documentation

NLMISC::CRGBA NL3D::CTextContext::_Color [private]
 

current text color.

Definition at line 59 of file text_context.h.

IDriver * NL3D::CTextContext::_Driver [private]
 

Driver.

Definition at line 47 of file text_context.h.

NL3D::CFontGenerator * NL3D::CTextContext::_FontGen [private]
 

font generator.

Definition at line 53 of file text_context.h.

NL3D::CFontManager * NL3D::CTextContext::_FontManager [private]
 

font manager.

Definition at line 50 of file text_context.h.

uint32 NL3D::CTextContext::_FontSize [private]
 

font size;.

Definition at line 56 of file text_context.h.

NL3D::CComputedString::THotSpot NL3D::CTextContext::_HotSpot [private]
 

hotspot.

Definition at line 62 of file text_context.h.

bool NL3D::CTextContext::_Keep800x600Ratio [private]
 

resize fontSize???

Definition at line 89 of file text_context.h.

sint32 NL3D::CTextContext::_MaxIndex [private]
 

maximum index reached.

Definition at line 80 of file text_context.h.

float NL3D::CTextContext::_RotateY [private]
 

Y axe rotation angle.

Definition at line 71 of file text_context.h.

float NL3D::CTextContext::_ScaleX [private]
 

X scale.

Definition at line 65 of file text_context.h.

float NL3D::CTextContext::_ScaleZ [private]
 

Z scale.

Definition at line 68 of file text_context.h.

float NL3D::CTextContext::_ShadeExtent [private]
 

shade's extent.

Definition at line 86 of file text_context.h.

bool NL3D::CTextContext::_Shaded [private]
 

true if text is shaded.

Definition at line 83 of file text_context.h.

std::map< uint32,CComputedString > NL3D::CTextContext::_StringList [private]
 

computed strings map.

Definition at line 74 of file text_context.h.

CComputedString NL3D::CTextContext::_TempShadowString [private]
 

Definition at line 94 of file text_context.h.

CComputedString NL3D::CTextContext::_TempString [private]
 

for printAt() and printfAt(). This prevents from creating VBdrvinfos each time they are called (N*each frame!!).

Definition at line 93 of file text_context.h.

float NL3D::CTextContext::_XBound [private]
 

max x coordinate of last string printed.

Definition at line 77 of file text_context.h.


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