Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

Public Member Functions | Protected Member Functions | Protected Attributes
TK_Text Class Reference

Handles the TKE_Text and TKE_Text_With_Encoding opcodes. More...

#include <BOpcodeHandler.h>

List of all members.

Public Member Functions

TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
double const * GetDPosition () const
int GetEncoding () const
float const * GetPosition () const
char const * GetString () const
char * GetString ()
int GetTextRegionCount () const
int GetTextRegionFitting () const
int GetTextRegionOptions () const
float const * GetTextRegionPoints () const
TK_Status Read (BStreamFileToolkit &tk)
TK_Status ReadAscii (BStreamFileToolkit &tk)
 Deprecated.
void Reset ()
void SetDPosition (double x, double y, double z)
void SetDPosition (double const p[])
void SetEncoding (int e)
void SetPosition (float x, float y, float z)
void SetPosition (float const p[])
void SetString (char const *string)
void SetString (unsigned short const *string)
void SetString (unsigned int const *string)
void SetString (int length)
void SetTextRegion (int c, float const p[], int o=0, int f=0)
 TK_Text (unsigned char opcode)
TK_Status Write (BStreamFileToolkit &tk)
TK_Status WriteAscii (BStreamFileToolkit &tk)
 Deprecated.

Protected Member Functions

void set_string (char const *string)
 for internal use only
void set_string (int length)
 for internal use only

Protected Attributes

int m_allocated
TK_Character_Attributem_character_attributes
int m_count
double m_dposition [3]
unsigned char m_encoding
int m_length
unsigned char m_options
float m_position [3]
float m_region [4 *3]
unsigned char m_region_count
unsigned char m_region_fit
unsigned char m_region_options
char * m_string
int m_substage
int m_tmp

Detailed Description

Handles the TKE_Text and TKE_Text_With_Encoding opcodes.

TK_Text provides support for writing/reading the TKE_Text and TKE_Text_With_Encoding opcode objects to/from an HSF file.

The HOOPS/3dGS scene-graph can contain 'text' primitives which are defined by a position and character string, and possibly by an encoding value for multibyte (non-ASCII) text.


Constructor & Destructor Documentation

TK_Text::TK_Text ( unsigned char  opcode)

constructor


Member Function Documentation

TK_Status TK_Text::Clone ( BStreamFileToolkit tk,
BBaseOpcodeHandler **  handler 
) const [virtual]

Copies the opcode handler

Parameters:
tkA reference to the BStreamFileToolkit object.
handlerA pointer to the opcode handler object. Passed by reference.
Returns:
The result of the function call.

Reimplemented from BBaseOpcodeHandler.

double const* TK_Text::GetDPosition ( ) const [inline]

Returns the text position as the address of a double triplet

int TK_Text::GetEncoding ( ) const [inline]

Returns the type of encoding for this string. Encodings are specified by TKO_Text_Encodings.

float const* TK_Text::GetPosition ( ) const [inline]

Returns the text position as the address of a float triplet

char const* TK_Text::GetString ( ) const [inline]

Returns the text string (if encoding is a form of Unicode, the pointer should be recast to the correct type)

char* TK_Text::GetString ( ) [inline]

Returns the text string buffer, which may be modified directly (if encoding is a form of Unicode, the pointer should be recast to the correct type)

int TK_Text::GetTextRegionCount ( ) const [inline]

Returns the number of points defining the text region.

int TK_Text::GetTextRegionFitting ( ) const [inline]

Returns the fit options for the text region.

int TK_Text::GetTextRegionOptions ( ) const [inline]

Returns the options for the text region.

float const* TK_Text::GetTextRegionPoints ( ) const [inline]

Returns the points defining the text region.

TK_Status TK_Text::Read ( BStreamFileToolkit tk) [virtual]

Reads data from the toolkit buffer, decodes/decompresses it, and maps it to the opcode handlers data members. User-defined classes which need to write out custom data should utilize one of the available GetData() methods.

Parameters:
tkA reference to the BStreamFileToolkit object.
Returns:
The result of the function call.

Implements BBaseOpcodeHandler.

void TK_Text::Reset ( ) [virtual]

Resets the current opcode handler. This is called by the toolkit when it is done processing an opcode. This method reinitializes any opcode handler variables and frees up temporary data.

Reimplemented from BBaseOpcodeHandler.

void TK_Text::SetDPosition ( double  x,
double  y,
double  z 
) [inline]

Sets the text position using discrete double values

void TK_Text::SetDPosition ( double const  p[]) [inline]

Sets the text position using a double triplet

References SetDPosition().

Referenced by SetDPosition().

void TK_Text::SetEncoding ( int  e) [inline]

Set the type of encoding for this string. Encodings are specified by TKO_Text_Encodings.

void TK_Text::SetPosition ( float  x,
float  y,
float  z 
) [inline]

Sets the text position using discrete float values

void TK_Text::SetPosition ( float const  p[]) [inline]

Sets the text position using a float triplet

References SetPosition().

Referenced by SetPosition().

void TK_Text::SetString ( char const *  string) [inline]

Sets the text string. Allocates the buffer and copies the string

void TK_Text::SetString ( unsigned short const *  string)

Sets the text string using Unicode data. Allocates the buffer and copies the string, and sets encoding

void TK_Text::SetString ( unsigned int const *  string)

Sets the text string using wide Unicode data. Allocates the buffer and copies the string, and sets encoding

void TK_Text::SetString ( int  length) [inline]

Sets the text string buffer. Allocates a buffer large enough to hold a string of 'length' bytes

void TK_Text::SetTextRegion ( int  c,
float const  p[],
int  o = 0,
int  f = 0 
)

Set the text region for this string.

TK_Status TK_Text::Write ( BStreamFileToolkit tk) [virtual]

Encodes/compresses data and writes data to the toolkit buffer. User-defined classes which need to write out custom data should utilize one of the available PutData() methods, and first write out the opcode associated with the group of binary data followed by the data itself.

Parameters:
tkA reference to the BStreamFileToolkit object.
Returns:
The result of the function call.

Implements BBaseOpcodeHandler.


Member Data Documentation

int TK_Text::m_allocated [protected]

internal use; Size of allocated string buffer

internal use: Character Attribute array

int TK_Text::m_count [protected]

internal use: Number of characters (length is number of bytes to store)

double TK_Text::m_dposition[3] [protected]

internal use; Insertion point

unsigned char TK_Text::m_encoding [protected]

internal use; Encoding of characters (only used by TKE_Text_With_Encoding)

int TK_Text::m_length [protected]

internal use; Length of text string

unsigned char TK_Text::m_options [protected]

internal use: Additional options such as attached Text_Region

float TK_Text::m_position[3] [protected]

internal use; Insertion point

float TK_Text::m_region[4 *3] [protected]

internal use: Text Region Points

unsigned char TK_Text::m_region_count [protected]

internal use: Text Region Point Count

unsigned char TK_Text::m_region_fit [protected]

internal use: packed Text Region fit options

unsigned char TK_Text::m_region_options [protected]

internal use: Text Region Controls

char* TK_Text::m_string [protected]

internal use; Text string

int TK_Text::m_substage [protected]

internal use: write/read progress

int TK_Text::m_tmp [protected]

internal use: temp value


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