TK_Text Class Reference

#include <BOpcodeHandler.h>

Inheritance diagram for TK_Text:

Inheritance graph
[legend]
Collaboration diagram for TK_Text:

Collaboration graph
[legend]
List of all members.

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.

Definition at line 6686 of file BOpcodeHandler.h.

Public Member Functions

 TK_Text (unsigned char opcode)
TK_Status Read (BStreamFileToolkit &tk) alter
TK_Status Write (BStreamFileToolkit &tk) alter
TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
void Reset (void) alter
void SetString (char const *string) alter
void SetString (unsigned short const *string) alter
void SetString (unsigned int const *string) alter
void SetString (int length) alter
char const * GetString (void) const
char alter * GetString (void) alter
void SetPosition (float x, float y, float z) alter
void SetPosition (float const *p) alter
float const * GetPosition (void) const
void SetEncoding (int e) alter
int GetEncoding (void) const
void SetTextRegion (int c, float const *p, int o=0) alter
int GetTextRegionCount (void) const
float const * GetTextRegionPoints (void) const
int GetTextRegionOptions (void) const

Protected Member Functions

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

Protected Attributes

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


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:
tk A reference to the BStreamFileToolkit object.
handler A pointer to the opcode handler object. Passed by reference.
Returns:
The result of the function call.

Reimplemented from BBaseOpcodeHandler.

int TK_Text::GetEncoding void   )  const [inline]
 

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

Definition at line 6748 of file BOpcodeHandler.h.

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

Returns the text position as the address of a float triplet

Definition at line 6743 of file BOpcodeHandler.h.

char alter* TK_Text::GetString void   )  [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)

Definition at line 6735 of file BOpcodeHandler.h.

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

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

Definition at line 6733 of file BOpcodeHandler.h.

int TK_Text::GetTextRegionCount void   )  const [inline]
 

Returns the number of points defining the text region.

Definition at line 6753 of file BOpcodeHandler.h.

int TK_Text::GetTextRegionOptions void   )  const [inline]
 

Returns the options for the text region.

Definition at line 6757 of file BOpcodeHandler.h.

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

Returns the points defining the text region.

Definition at line 6755 of file BOpcodeHandler.h.

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:
tk A reference to the BStreamFileToolkit object.
Returns:
The result of the function call.

Implements BBaseOpcodeHandler.

void TK_Text::Reset void   )  [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::SetEncoding int  e  )  [inline]
 

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

Definition at line 6746 of file BOpcodeHandler.h.

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

Sets the text position using a float triplet

Definition at line 6741 of file BOpcodeHandler.h.

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

Sets the text position using discrete float values

Definition at line 6738 of file BOpcodeHandler.h.

void TK_Text::SetString int  length  )  [inline]
 

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

Definition at line 6731 of file BOpcodeHandler.h.

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 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 char const *  string  )  [inline]
 

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

Definition at line 6725 of file BOpcodeHandler.h.

void TK_Text::SetTextRegion int  c,
float const *  p,
int  o = 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:
tk A 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

Definition at line 6694 of file BOpcodeHandler.h.

TK_Character_Attribute* TK_Text::m_character_attributes [protected]
 

internal use: Character Attribute array

Definition at line 6702 of file BOpcodeHandler.h.

int TK_Text::m_count [protected]
 

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

Definition at line 6701 of file BOpcodeHandler.h.

unsigned char TK_Text::m_encoding [protected]
 

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

Definition at line 6696 of file BOpcodeHandler.h.

int TK_Text::m_length [protected]
 

internal use; Length of text string

Definition at line 6693 of file BOpcodeHandler.h.

unsigned char TK_Text::m_options [protected]
 

internal use: Additional options such as attached Text_Region

Definition at line 6697 of file BOpcodeHandler.h.

float TK_Text::m_position[3] [protected]
 

internal use; Insertion point

Definition at line 6692 of file BOpcodeHandler.h.

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

internal use: Text Region Points

Definition at line 6700 of file BOpcodeHandler.h.

unsigned char TK_Text::m_region_count [protected]
 

internal use: Text Region Point Count

Definition at line 6699 of file BOpcodeHandler.h.

unsigned char TK_Text::m_region_options [protected]
 

internal use: Text Region Controls

Definition at line 6698 of file BOpcodeHandler.h.

char* TK_Text::m_string [protected]
 

internal use; Text string

Definition at line 6695 of file BOpcodeHandler.h.

int TK_Text::m_substage [protected]
 

internal use: write/read progress

Definition at line 6703 of file BOpcodeHandler.h.

int TK_Text::m_tmp [protected]
 

internal use: temp value

Definition at line 6704 of file BOpcodeHandler.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:41:47 2009 for Autodesk DWF 3D Toolkit by  doxygen 1.4.5