TK_Text
-
class
TK_Text Handles the TKE_Text and TKE_Text_With_Encoding opcodes.
TK_Textprovides 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.
Inherits from:
BBaseOpcodeHandlerIndex
Methods
Clone()GetDPosition()GetDTextLeaderCount()GetDTextLeaderFlags()GetDTextLeaderFlags()GetDTextLeaders()GetDTextLeaders()GetEncoding()GetPosition()GetString()GetString()GetStringCursorCount()GetStringCursors()GetStringCursors()GetTextLeaderCount()GetTextLeaderFlags()GetTextLeaderFlags()GetTextLeaders()GetTextLeaders()GetTextRegionCount()GetTextRegionDPoints()GetTextRegionFitting()GetTextRegionOptions()GetTextRegionPoints()Read()ReadAscii()Reset()set_string()set_string()SetDPosition()SetDPosition()SetDTextLeaders()SetEncoding()SetPosition()SetPosition()SetString()SetString()SetString()SetString()SetStringCursors()SetTextDRegion()SetTextLeaders()SetTextRegion()TK_Text()Write()WriteAscii()~TK_Text()
Variables
m_allocatedm_character_attributesm_countm_cursor_countm_cursorsm_dleader_countm_dleader_flagsm_dleadersm_dpositionm_dregionm_encodingm_leader_countm_leader_flagsm_leadersm_lengthm_optionsm_positionm_regionm_region_countm_region_fitm_region_optionsm_stringm_substagem_tmpm_written_length
Methods
-
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 theBStreamFileToolkitobject.Returns
The result of the function call.
-
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 theBStreamFileToolkitobject.Returns
The result of the function call.
-
TK_Status
TK_Text::Clone(BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const const virtual
Copies the opcode handler
Parameters
tk: A reference to the
BStreamFileToolkitobject.handler: A pointer to the opcode handler object. Passed by reference.
Returns
The result of the function call.
-
TK_Status
TK_Text::ReadAscii(BStreamFileToolkit &tk) Deprecated.
-
TK_Status
TK_Text::WriteAscii(BStreamFileToolkit &tk) Deprecated.
-
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.
-
void
TK_Text::SetString(char const *string) 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) Sets the text string buffer. Allocates a buffer large enough to hold a string of ‘length’ bytes
-
char const *
TK_Text::GetString() const const
Returns the text string (if encoding is a form of Unicode, the pointer should be recast to the correct type)
-
char *
TK_Text::GetString() 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)
-
void
TK_Text::SetPosition(float x, float y, float z) Sets the text position using discrete float values
-
float const *
TK_Text::GetPosition() const const
Returns the text position as the address of a float triplet
-
void
TK_Text::SetDPosition(double x, double y, double z) Sets the text position using discrete double values
-
double const *
TK_Text::GetDPosition() const const
Returns the text position as the address of a double triplet
-
void
TK_Text::SetEncoding(int e) Set the type of encoding for this string. Encodings are specified by
TKO_Text_Encodings.
-
int
TK_Text::GetEncoding() const const
Returns the type of encoding for this string. Encodings are specified by
TKO_Text_Encodings.
-
void
TK_Text::SetTextRegion(int c, float const p[], int o = 0, int f = 0) Set the text region for this string.
-
void
TK_Text::SetTextDRegion(int c, double const p[], int o = 0, int f = 0) Set the text region for this string.
-
int
TK_Text::GetTextRegionCount() const const
Returns the number of points defining the text region.
-
float const *
TK_Text::GetTextRegionPoints() const const
Returns the points defining the text region.
-
double const *
TK_Text::GetTextRegionDPoints() const const
Returns the points defining the text region.
-
void
TK_Text::SetStringCursors(int length, int *locations = 0) Sets the text string cursors. Allocates a buffer large enough to hold a ‘length’ row/column pairs, and optionally copies data
-
void
TK_Text::SetTextLeaders(int length, float *locations = 0, unsigned char *flags = 0) Sets the text leaders. Allocates a buffer large enough to hold a ‘length’ points & flags, and optionally copies data
-
unsigned char const *
TK_Text::GetTextLeaderFlags() const const
Returns the text leader flags buffer
-
unsigned char *
TK_Text::GetTextLeaderFlags() Returns the text leader flags buffer, which may be modified directly
-
void
TK_Text::SetDTextLeaders(int length, double *locations = 0, unsigned char *flags = 0) Sets the text leaders. Allocates a buffer large enough to hold a ‘length’ dpoints & flags, and optionally copies data
-
unsigned char const *
TK_Text::GetDTextLeaderFlags() const const
Returns the text leader flags buffer
-
unsigned char *
TK_Text::GetDTextLeaderFlags() Returns the text leader flags buffer, which may be modified directly
Variables
-
unsigned char
TK_Text::m_encoding protected
unsigned charinternal use; Encoding of characters (only used by TKE_Text_With_Encoding)
-
unsigned char
TK_Text::m_options protected
unsigned charinternal use: Additional options such as attached Text_Region
-
unsigned char
TK_Text::m_region_fit protected
unsigned charinternal use: packed Text Region fit options
-
unsigned char
TK_Text::m_region_count protected
unsigned charinternal use: Text Region Point Count
-
double *
TK_Text::m_dleaders protected
doubleinternal use: Text_Leader (double-precision) Positions
-
unsigned char *
TK_Text::m_dleader_flags protected
unsigned charinternal use: Text_Leader (double-precision) Flags
-
int
TK_Text::m_count protected
intinternal use: Number of characters (length is number of bytes to store)
-
TK_Character_Attribute *
TK_Text::m_character_attributes protected
internal use: Character Attribute array