Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

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 4376 of file BOpcodeHandler.h.

Public Member Functions

 TK_Text (unsigned char opcode)
TK_Status Read (BStreamFileToolkit &tk) alter
TK_Status Write (BStreamFileToolkit &tk) alter
void Reset (void) alter
void SetString (char const *string) alter
void SetString (unsigned short 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

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]
unsigned char m_encoding
int m_length
int m_allocated
char * m_string


Constructor & Destructor Documentation

TK_Text::TK_Text unsigned char  opcode  )  [inline]
 

constructor

Definition at line 4393 of file BOpcodeHandler.h.


Member Function Documentation

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 4425 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 4420 of file BOpcodeHandler.h.

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

Returns the text string buffer, which may be modified directly

Definition at line 4412 of file BOpcodeHandler.h.

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

Returns the text string

Definition at line 4410 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 4423 of file BOpcodeHandler.h.

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

Sets the text position using a float triplet

Definition at line 4418 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 4415 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 4408 of file BOpcodeHandler.h.

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 4404 of file BOpcodeHandler.h.

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 4385 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 4383 of file BOpcodeHandler.h.

int TK_Text::m_length [protected]
 

internal use; Lengths of text string

Definition at line 4384 of file BOpcodeHandler.h.

float TK_Text::m_position[3] [protected]
 

internal use; Insertion point

Definition at line 4382 of file BOpcodeHandler.h.

char* TK_Text::m_string [protected]
 

internal use; Text string

Definition at line 4386 of file BOpcodeHandler.h.


The documentation for this class was generated from the following file:
Generated on Tue May 17 12:06:15 2005 for Autodesk DWF 3D Toolkit by  doxygen 1.4.1