# 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::CTextContextUser Class Reference

UTextContext implementation. More...

#include <text_context_user.h>

Inheritance diagram for NL3D::CTextContextUser:

NL3D::UTextContext List of all members.

Public Methods

 CTextContextUser (const std::string fontFileName, const std::string fontExFileName, CDriverUser *drv, CFontManager *fmg)
 Constructor. More...

virtual ~CTextContextUser ()
void dumpCacheTexture (const char *filename)
 Used for debug. More...

Text look.
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 (THotSpot hotSpot)
 set the hot spot. More...

THotSpot getHotSpot () const
 get the hot spot. More...

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

void setScaleY (float scaleY)
 set the Y scale. More...

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

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

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

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

Rendering.
uint32 textPush (const char *format,...)
uint32 textPush (const ucstring &str)
 computes an ucstring and adds the result to the stack. More...

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

virtual CStringInfo getStringInfo (uint32 i)
 Get a string information from the list. More...

virtual CStringInfo getStringInfo (const ucstring &ucstr)
 Get a string information from the ucstring The returned string info is in pixel size per default. More...

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

void printAt (float x, float y, uint32 i)
 print a string of the list (2D method). More...

void printClipAt (float x, float y, uint32 i, float xmin, float ymin, float xmax, float ymax)
void printAt (float x, float y, ucstring ucstr)
 compute and print a ucstring at the location (2D method) x/y E [0,1]. More...

void printfAt (float x, float y, const char *format,...)
 compute and print a string at the location (2D method) x/y E [0,1]. More...

void render3D (const CMatrix &mat, ucstring ucstr)
void render3D (const CMatrix &mat, const char *format,...)
float getLastXBound () const
 Return max x coordinate of last string printed. More...


Private Attributes

CTextContext _TextContext
CDriverUser_DriverUser
IDriver_Driver
CComputedString _CacheString

Detailed Description

UTextContext implementation.

Author:
Lionel Berenguier , Nevrax France
Date:
2001

Definition at line 46 of file text_context_user.h.


Constructor & Destructor Documentation

NL3D::CTextContextUser::CTextContextUser const std::string    fontFileName,
const std::string    fontExFileName,
CDriverUser   drv,
CFontManager   fmg
[inline]
 

Constructor.

Definition at line 57 of file text_context_user.h.

References _Driver, _DriverUser, _TextContext, NL3D_MEM_TEXT_CONTEXT, and nlassert.

virtual NL3D::CTextContextUser::~CTextContextUser   [inline, virtual]
 

Definition at line 70 of file text_context_user.h.

References NL3D_MEM_TEXT_CONTEXT.


Member Function Documentation

void NL3D::CTextContextUser::clear   [virtual]
 

empty the map.

Implements NL3D::UTextContext.

Definition at line 245 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

void NL3D::CTextContextUser::dumpCacheTexture const char *    filename [virtual]
 

Used for debug.

Implements NL3D::UTextContext.

Definition at line 323 of file text_context_user.cpp.

References _TextContext, and NL3D_MEM_TEXT_CONTEXT.

void NL3D::CTextContextUser::erase uint32    i [virtual]
 

remove a string from the list.

Implements NL3D::UTextContext.

Definition at line 219 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

uint32 NL3D::CTextContextUser::getFontSize   const [virtual]
 

get the font size.

Returns:
the font size

Implements NL3D::UTextContext.

Definition at line 115 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

UTextContext::THotSpot NL3D::CTextContextUser::getHotSpot   const [virtual]
 

get the hot spot.

Returns:
the hot spot

Implements NL3D::UTextContext.

Definition at line 129 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

bool NL3D::CTextContextUser::getKeep800x600Ratio   const [virtual]
 

return keep800x600Ratio state.

Implements NL3D::UTextContext.

Definition at line 192 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

float NL3D::CTextContextUser::getLastXBound   const [virtual]
 

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

Implements NL3D::UTextContext.

Definition at line 314 of file text_context_user.cpp.

References NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

float NL3D::CTextContextUser::getScaleX   const [virtual]
 

Returns:
the X scale

Implements NL3D::UTextContext.

Definition at line 150 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

float NL3D::CTextContextUser::getScaleY   const [virtual]
 

Returns:
the Y scale

Implements NL3D::UTextContext.

Definition at line 157 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

bool NL3D::CTextContextUser::getShaded   const [virtual]
 

Returns:
the shade state

Implements NL3D::UTextContext.

Definition at line 171 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

UTextContext::CStringInfo NL3D::CTextContextUser::getStringInfo const ucstring   ucstr [virtual]
 

Get a string information from the ucstring The returned string info is in pixel size per default.

Implements NL3D::UTextContext.

Definition at line 237 of file text_context_user.cpp.

References _CacheString, _TextContext, NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

UTextContext::CStringInfo NL3D::CTextContextUser::getStringInfo uint32    i [virtual]
 

Get a string information from the list.

return CStringInfo(0,0) if not found. The returned string info is in pixel size per default.

Implements NL3D::UTextContext.

Definition at line 226 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

void NL3D::CTextContextUser::printAt float    x,
float    y,
ucstring    ucstr
[virtual]
 

compute and print a ucstring at the location (2D method) x/y E [0,1].

Implements NL3D::UTextContext.

Definition at line 268 of file text_context_user.cpp.

References _DriverUser, _TextContext, NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, NL3D_MEM_TEXT_CONTEXT, x, and y.

void NL3D::CTextContextUser::printAt float    x,
float    y,
uint32    i
[virtual]
 

print a string of the list (2D method).

x/y E [0,1] (rq : it leaves the string in the stack)

Implements NL3D::UTextContext.

Definition at line 252 of file text_context_user.cpp.

References _DriverUser, _TextContext, NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, NL3D_MEM_TEXT_CONTEXT, x, and y.

void NL3D::CTextContextUser::printClipAt float    x,
float    y,
uint32    i,
float    xmin,
float    ymin,
float    xmax,
float    ymax
[virtual]
 

Implements NL3D::UTextContext.

Definition at line 260 of file text_context_user.cpp.

References _DriverUser, _TextContext, NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, NL3D_MEM_TEXT_CONTEXT, x, and y.

void NL3D::CTextContextUser::printfAt float    x,
float    y,
const char *    format,
...   
[virtual]
 

compute and print a string at the location (2D method) x/y E [0,1].

Implements NL3D::UTextContext.

Definition at line 276 of file text_context_user.cpp.

References _DriverUser, _TextContext, format, NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, NL3D_MEM_TEXT_CONTEXT, NLMISC_CONVERT_VARGS, x, and y.

void NL3D::CTextContextUser::render3D const CMatrix &    mat,
const char *    format,
...   
 

Definition at line 300 of file text_context_user.cpp.

References _DriverUser, format, NL3D_HAUTO_RENDER_3D_TEXTCONTEXT, NL3D_MEM_TEXT_CONTEXT, NLMISC_CONVERT_VARGS, and render3D.

void NL3D::CTextContextUser::render3D const CMatrix &    mat,
ucstring    ucstr
 

Definition at line 288 of file text_context_user.cpp.

References _Driver, _DriverUser, _TextContext, NL3D_HAUTO_RENDER_3D_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

Referenced by render3D.

void NL3D::CTextContextUser::setColor NLMISC::CRGBA    color [virtual]
 

set the font color.

Parameters:
color  the font color

Implements NL3D::UTextContext.

Definition at line 101 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

void NL3D::CTextContextUser::setFontSize uint32    fontSize [virtual]
 

set the font size.

Should be called before the first print

Parameters:
fonSize  the font size

Implements NL3D::UTextContext.

Definition at line 108 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

void NL3D::CTextContextUser::setHotSpot THotSpot    hotSpot [virtual]
 

set the hot spot.

Parameters:
fonSize  the font size

Implements NL3D::UTextContext.

Definition at line 122 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

void NL3D::CTextContextUser::setKeep800x600Ratio bool    keep [virtual]
 

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

Implements NL3D::UTextContext.

Definition at line 185 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

void NL3D::CTextContextUser::setScaleX float    scaleX [virtual]
 

set the X scale.

Parameters:
scaleX  the X scale

Implements NL3D::UTextContext.

Definition at line 136 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

void NL3D::CTextContextUser::setScaleY float    scaleY [virtual]
 

set the Y scale.

Parameters:
scaleY  the Y scale

Implements NL3D::UTextContext.

Definition at line 143 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

void NL3D::CTextContextUser::setShaded bool    b [virtual]
 

set the shade states.

Parameters:
the  shade state

Implements NL3D::UTextContext.

Definition at line 164 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

void NL3D::CTextContextUser::setShadeExtent float    shext [virtual]
 

set the shadow's size.

Parameters:
the  shade extent

Implements NL3D::UTextContext.

Definition at line 178 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_UI_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

uint32 NL3D::CTextContextUser::textPush const ucstring   str [virtual]
 

computes an ucstring and adds the result to the stack.

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

Implements NL3D::UTextContext.

Definition at line 212 of file text_context_user.cpp.

References _TextContext, NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, and NL3D_MEM_TEXT_CONTEXT.

uint32 NL3D::CTextContextUser::textPush const char *    format,
...   
[virtual]
 

So verify your 2D/3D modes.

Implements NL3D::UTextContext.

Definition at line 202 of file text_context_user.cpp.

References _TextContext, format, NL3D_HAUTO_RENDER_2D_TEXTCONTEXT, NL3D_MEM_TEXT_CONTEXT, and NLMISC_CONVERT_VARGS.


Member Data Documentation

CComputedString NL3D::CTextContextUser::_CacheString [private]
 

Definition at line 52 of file text_context_user.h.

Referenced by getStringInfo.

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

Definition at line 51 of file text_context_user.h.

Referenced by CTextContextUser, and render3D.

CDriverUser* NL3D::CTextContextUser::_DriverUser [private]
 

Definition at line 50 of file text_context_user.h.

Referenced by CTextContextUser, printAt, printClipAt, printfAt, and render3D.

CTextContext NL3D::CTextContextUser::_TextContext [private]
 

Definition at line 49 of file text_context_user.h.

Referenced by clear, CTextContextUser, dumpCacheTexture, erase, getFontSize, getHotSpot, getKeep800x600Ratio, getScaleX, getScaleY, getShaded, getStringInfo, printAt, printClipAt, printfAt, render3D, setColor, setFontSize, setHotSpot, setKeep800x600Ratio, setScaleX, setScaleY, setShaded, setShadeExtent, and textPush.


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