Alphabetical Class Index   Class Hierarchy   Compound Members   File Members   File List  

TK_Color Class Reference

Handles the TKE_Color opcode. More...

#include <BOpcodeHandler.h>

Classes

class  channel
 

Public Member Functions

TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
 
char const * GetBumpName () const
 
char alterGetBumpName () alter
 
int GetChannels () const
 
float const * GetDiffuse () const
 
char const * GetDiffuseName () const
 
char alterGetDiffuseName () alter
 
float const * GetEmission () const
 
char const * GetEmissionName () const
 
char alterGetEmissionName () alter
 
char const * GetEnvironmentName () const
 
char alterGetEnvironmentName () alter
 
int GetGeometry () const
 
float GetGloss () const
 
float GetIndex () const
 
float const * GetMirror () const
 
char const * GetMirrorName () const
 
char alterGetMirrorName () alter
 
float const * GetSpecular () const
 
char const * GetSpecularName () const
 
char alterGetSpecularName () alter
 
float const * GetTransmission () const
 
char const * GetTransmissionName () const
 
char alterGetTransmissionName () alter
 
TK_Status Read (BStreamFileToolkit &tk) alter
 
TK_Status ReadAscii (BStreamFileToolkit &tk) alter
 Deprecated.
 
void Reset () alter
 
void SetBumpName (char const *name) alter
 
void SetBumpName (int length) alter
 
void SetChannels (int c) alter
 
void SetDiffuse (float r, float g, float b) alter
 
void SetDiffuse (float const *rgb) alter
 
void SetDiffuseName (char const *name) alter
 
void SetDiffuseName (int length) alter
 
void SetEmission (float r, float g, float b) alter
 
void SetEmission (float const *rgb) alter
 
void SetEmissionName (char const *name) alter
 
void SetEmissionName (int length) alter
 
void SetEnvironmentName (char const *name) alter
 
void SetEnvironmentName (int length) alter
 
void SetGeometry (int m) alter
 
void SetGloss (float g) alter
 
void SetIndex (float i) alter
 
void SetMirror (float r, float g, float b) alter
 
void SetMirror (float const *rgb) alter
 
void SetMirrorName (char const *name) alter
 
void SetMirrorName (int length) alter
 
void SetSpecular (float r, float g, float b) alter
 
void SetSpecular (float const *rgb) alter
 
void SetSpecularName (char const *name) alter
 
void SetSpecularName (int length) alter
 
void SetTransmission (float r, float g, float b) alter
 
void SetTransmission (float const *rgb) alter
 
void SetTransmissionName (char const *name) alter
 
void SetTransmissionName (int length) alter
 
TK_Status Write (BStreamFileToolkit &tk) alter
 
TK_Status WriteAscii (BStreamFileToolkit &tk) alter
 Deprecated.
 
- Public Member Functions inherited from BBaseOpcodeHandler
 BBaseOpcodeHandler (int op)
 
virtual TK_Status Execute (BStreamFileToolkit &tk) alter
 
char const * GetLoggingString () const
 
char alterGetLoggingString () alter
 
virtual TK_Status Interpret (BStreamFileToolkit &tk, ID_Key key, int variant=0) alter
 
virtual TK_Status Interpret (BStreamFileToolkit &tk, ID_Key key, char const *special) alter
 
void LogDebug (BStreamFileToolkit &tk, char const *string=0) alter
 
virtual bool Match_Instance (BStreamFileToolkit const &tk, Recorded_Instance alter *instance) alter
 
virtual bool NeedsContext (BStreamFileToolkit &tk) const
 
bool NeedsTag () const
 
unsigned char Opcode () const
 
int Pass (BStreamFileToolkit &tk) const
 
void SetLoggingString (char const *segment) alter
 
void SetLoggingString (int length) alter
 
void SetNeedsTag (bool n) alter
 
TK_Status Tag (BStreamFileToolkit &tk, int variant=-1) const
 
bool Tagging (BStreamFileToolkit &tk) const
 
- Public Member Functions inherited from BControlledMemoryObject
void operator delete (void *p)
 force deallocation to happen in the stream toolkit's scope
 
void * operator new (size_t size)
 force allocation to happen in the stream toolkit's scope
 

Protected Member Functions

void set_channel_name (channel alter &c, char const *name, int which_channel=-1) alter
 internal use
 
void set_channel_name (channel alter &c, int length, int which_channel=-1) alter
 internal use
 
void set_channel_rgb (channel alter &c, float r, float g, float b, int which_channel=-1) alter
 internal use
 
- Protected Member Functions inherited from BBaseOpcodeHandler
void add_segment (BStreamFileToolkit &tk, ID_Key key) alter
 for internal use only
 
void adjust_written (BStreamFileToolkit &tk, int count) alter
 for internal use only
 
void bytes_to_floats (unsigned char const *in, float alter *out, int count) const
 for internal use only
 
void decrease_nesting (BStreamFileToolkit &tk, int amount=1) alter
 for internal use only
 
bool Find_Instance (BStreamFileToolkit &tk, int val1, int val2, int val3) alter
 
bool Find_Item (BStreamFileToolkit &tk, ID_Key key) const
 
void fix (int *i, int n)
 for internal use only
 
void fix (short *s, int n)
 for internal use only
 
void fix_in (float *f, int n)
 for internal use only
 
void fix_out (float *f, int n)
 for internal use only
 
short flip (short s)
 for internal use only
 
int flip (int i)
 for internal use only
 
void floats_to_bytes (float const *in, unsigned char alter *out, int count) const
 for internal use only
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, int *rInts, unsigned int n) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned char &value) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, char &value) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned short &value) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, short &value) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, int &value) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, float &value) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, float *rFloats, unsigned int n) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, char *m_string, unsigned int n) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned char *m_string, unsigned int n) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, int *rInts, unsigned int n) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, short *rShorts, unsigned int n) alter
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned short *rShorts, unsigned int n) alter
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, unsigned char &value) alter
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, int &value) alter
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, char &value) alter
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, unsigned short &value) alter
 
TK_Status GetAsciiImageData (BStreamFileToolkit &tk, const char *tag, unsigned char *rValues, unsigned int n) alter
 
TK_Status GetData (BStreamFileToolkit &tk, char *b, int n) alter
 
TK_Status GetData (BStreamFileToolkit &tk, short *s, int n) alter
 
TK_Status GetData (BStreamFileToolkit &tk, int *i, int n) alter
 
TK_Status GetData (BStreamFileToolkit &tk, float *f, int n) alter
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned char *b, int n) alter
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned short *s, int n) alter
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned int *i, int n) alter
 
TK_Status GetData (BStreamFileToolkit &tk, char &c) alter
 
TK_Status GetData (BStreamFileToolkit &tk, short &s) alter
 
TK_Status GetData (BStreamFileToolkit &tk, int &i) alter
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned char &b) alter
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned short &s) alter
 
TK_Status GetData (BStreamFileToolkit &tk, unsigned int &i) alter
 
TK_Status GetData (BStreamFileToolkit &tk, float &f) alter
 
void increase_nesting (BStreamFileToolkit &tk, int amount=1) alter
 for internal use only
 
ID_Key last_key (BStreamFileToolkit &tk) const
 obsolete
 
void log_opcode (BStreamFileToolkit &tk, unsigned int sequence, unsigned char opcode) alter
 for internal use only
 
TK_Status LookatData (BStreamFileToolkit &tk, unsigned char &b) alter
 
BBaseOpcodeHandler alterOpcode_Handler (BStreamFileToolkit &tk, unsigned char op) const
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, char const *b, int n) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, short const *s, int n) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, int const *i, int n) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, float const *f, int n) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned char const *b, int n) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned short const *s, int n) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned int const *i, int n) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, char const &c) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, short const &s) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, int const &i) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned char const &b) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned short const &s) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned int const &i) alter
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, float const &f) alter
 
TK_Status PutAsciiFlag (BStreamFileToolkit &tk, char const *tag, int const &i) alter
 
TK_Status PutAsciiHex (BStreamFileToolkit &tk, char const *tag, int const &i) alter
 
TK_Status PutAsciiMask (BStreamFileToolkit &tk, char const *tag, int const &i) alter
 
TK_Status PutAsciiOpcode (BStreamFileToolkit &tk, int adjust=1, bool is_end=false, bool want_newline=true) alter
 
TK_Status PutData (BStreamFileToolkit &tk, char const *b, int n) alter
 
TK_Status PutData (BStreamFileToolkit &tk, short const *s, int n) alter
 
TK_Status PutData (BStreamFileToolkit &tk, int const *i, int n) alter
 
TK_Status PutData (BStreamFileToolkit &tk, float const *f, int n) alter
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned char const *b, int n) alter
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned short const *s, int n) alter
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned int const *i, int n) alter
 
TK_Status PutData (BStreamFileToolkit &tk, char const &c) alter
 
TK_Status PutData (BStreamFileToolkit &tk, short const &s) alter
 
TK_Status PutData (BStreamFileToolkit &tk, int const &i) alter
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned char const &b) alter
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned short const &s) alter
 
TK_Status PutData (BStreamFileToolkit &tk, unsigned int const &i) alter
 
TK_Status PutData (BStreamFileToolkit &tk, float const &f) alter
 
TK_Status PutEndXMLTag (BStreamFileToolkit &tk, char const *tag) alter
 
TK_Status PutOpcode (BStreamFileToolkit &tk, int adjust=1) alter
 
TK_Status PutStartXMLTag (BStreamFileToolkit &tk, char const *tag) alter
 
TK_Status Read_Referenced_Segment (BStreamFileToolkit &tk, int &i_progress) alter
 
TK_Status ReadAsciiLine (BStreamFileToolkit &tk, unsigned int *readSize=0) alter
 
TK_Status ReadAsciiWord (BStreamFileToolkit &tk, unsigned int *readSize=0) alter
 
TK_Status ReadEndOpcode (BStreamFileToolkit &tk) alter
 
void Record_Instance (BStreamFileToolkit &tk, ID_Key key, int variant, int val1, int val2, int val3) const
 
void Remember_Item (BStreamFileToolkit &tk, ID_Key key) const
 
ID_Key remove_segment (BStreamFileToolkit &tk) alter
 for internal use only
 
bool RemoveAngularBrackets (char *string) alter
 
bool RemoveQuotes (char *string) alter
 
void Revisit (BStreamFileToolkit &tk, float priority=0.0f, int variant=0) const
 
void set_last_key (BStreamFileToolkit &tk, ID_Key key) alter
 sets the given key as "most recent" on the toolkit for the purposes of associating keys with indices
 
TK_Status SkipNewlineAndTabs (BStreamFileToolkit &tk, unsigned int *readSize=0) alter
 
bool validate_count (int count, int limit=1<< 24) const
 

Protected Attributes

channel m_bump
 internal use
 
short m_channels
 internal use
 
channel m_diffuse
 internal use
 
channel m_emission
 internal use
 
channel m_environment
 internal use; note: environment & bump are never a simple RGB type color
 
float m_gloss
 internal use
 
float m_index
 internal use
 
int m_mask
 internal use
 
channel m_mirror
 internal use
 
channel m_specular
 internal use
 
int m_substage
 internal use; To track the subcases
 
channel m_transmission
 internal use
 
- Protected Attributes inherited from BBaseOpcodeHandler
char * m_ascii_buffer
 
int m_ascii_length
 
int m_ascii_progress
 Tracks the amount of data that has been read/written so far by GetAscii functions.
 
int m_ascii_size
 
int m_ascii_stage
 
unsigned char m_byte
 temporary
 
char m_char
 temporary
 
int m_debug_allocated
 
int m_debug_length
 
char * m_debug_string
 
int m_int
 temporary
 
bool m_needs_tag
 Indicate if this object explicitly needs tagging.
 
unsigned char m_opcode
 The opcode being handled by this particular object.
 
int m_progress
 Tracks the amount of data that has been read/written so far.
 
int m_stage
 The writing stage.
 
unsigned short m_unsigned_short
 temporary
 

Additional Inherited Members

- Static Protected Member Functions inherited from BBaseOpcodeHandler
static float read_float (char const *cp, char const *alter *newcpp=0)
 
static float read_float (char const *cp, char alter *alter *newcpp)
 for internal use only
 
static char * write_float (char *buffer, double f)
 for internal use only
 

Detailed Description

Handles the TKE_Color opcode.

TK_Color provides support for writing/reading the TKE_Color opcode object to/from an HSF file.

The HOOPS/3dGS scene-graph segments can have a 'named' color (i.e. "faces = red, lines = blue")

Member Function Documentation

TK_Status TK_Color::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.

char const* TK_Color::GetBumpName ( ) const
inline

Returns the address of the bump texture name string.

char alter* TK_Color::GetBumpName ( )
inline

Returns the address of the bump texture name buffer, which may be modified directly.

int TK_Color::GetChannels ( ) const
inline

Returns the mask indicating which color/material components are valid. Color channels are specified by TKO_Color_Channels.

float const* TK_Color::GetDiffuse ( ) const
inline

Returns the diffuse color as the address of a float triplet

char const* TK_Color::GetDiffuseName ( ) const
inline

Returns the address of the diffuse color name string.

char alter* TK_Color::GetDiffuseName ( )
inline

Returns the address of the diffuse color name buffer, which may be modified directly.

float const* TK_Color::GetEmission ( ) const
inline

Returns the emission color as the address of a float triplet

char const* TK_Color::GetEmissionName ( ) const
inline

Returns the address of the emission color name string.

char alter* TK_Color::GetEmissionName ( )
inline

Returns the address of the emission color name buffer, which may be modified directly.

char const* TK_Color::GetEnvironmentName ( ) const
inline

Returns the address of the environment texture name string.

char alter* TK_Color::GetEnvironmentName ( )
inline

Returns the address of the environment texture name buffer, which may be modified directly.

int TK_Color::GetGeometry ( ) const
inline

Returns the mask value which indicates which types of geometry are affected by this color setting. Geometry types are specified by TKO_Geometry_Bits.

float TK_Color::GetGloss ( ) const
inline

Returns the gloss value

float TK_Color::GetIndex ( ) const
inline

Returns the index of refraction

float const* TK_Color::GetMirror ( ) const
inline

Returns the mirror color as the address of a float triplet

char const* TK_Color::GetMirrorName ( ) const
inline

Returns the address of the mirror color name string.

char alter* TK_Color::GetMirrorName ( )
inline

Returns the address of the mirror color name buffer, which may be modified directly.

float const* TK_Color::GetSpecular ( ) const
inline

Returns the specular color as the address of a float triplet

char const* TK_Color::GetSpecularName ( ) const
inline

Returns the address of the specular color name string.

char alter* TK_Color::GetSpecularName ( )
inline

Returns the address of the specular color name buffer, which may be modified directly.

float const* TK_Color::GetTransmission ( ) const
inline

Returns the transmission color as the address of a float triplet

char const* TK_Color::GetTransmissionName ( ) const
inline

Returns the address of the transmission color name string.

char alter* TK_Color::GetTransmissionName ( )
inline

Returns the address of the transmission color name buffer, which may be modified directly.

TK_Status TK_Color::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_Color::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_Color::SetBumpName ( char const *  name)
inline

Sets the bump texture as a string value. Allocates the buffer and copies the string

References TKO_Channel_Bump.

void TK_Color::SetBumpName ( int  length)
inline

Sets the bump texture string buffer. Allocates a buffer to hold a string of 'length' characters

References TKO_Channel_Bump.

void TK_Color::SetChannels ( int  c)
inline

Sets the mask indicating which color/material components are valid. Color channels are specified by TKO_Color_Channels. Note that TKO_Color_Channels are NOT bit masks, but rather indices, so you should pass (1<<TKO_Channel_Diffuse) here, for example.

References TKO_Channel_Extended, and TKO_Channel_Extended_Shift.

void TK_Color::SetDiffuse ( float  r,
float  g,
float  b 
)
inline

Sets the diffuse color using discrete rgb values

References TKO_Channel_Diffuse.

void TK_Color::SetDiffuse ( float const *  rgb)
inline

Sets the diffuse color using a float triplet

References SetDiffuse().

Referenced by SetDiffuse().

void TK_Color::SetDiffuseName ( char const *  name)
inline

Sets the diffuse color as a string value. Allocates the buffer and copies the string

References TKO_Channel_Diffuse.

void TK_Color::SetDiffuseName ( int  length)
inline

Sets the diffuse color string buffer. Allocates a buffer to hold a string of 'length' characters

References TKO_Channel_Diffuse.

void TK_Color::SetEmission ( float  r,
float  g,
float  b 
)
inline

Sets the emission color using discrete rgb values

References TKO_Channel_Emission.

void TK_Color::SetEmission ( float const *  rgb)
inline

Sets the emission color using a float triplet

References SetEmission().

Referenced by SetEmission().

void TK_Color::SetEmissionName ( char const *  name)
inline

Sets the emission color as a string value. Allocates the buffer and copies the string

References TKO_Channel_Emission.

void TK_Color::SetEmissionName ( int  length)
inline

Sets the emission color string buffer. Allocates a buffer to hold a string of 'length' characters

References TKO_Channel_Emission.

void TK_Color::SetEnvironmentName ( char const *  name)
inline

Sets the environment texture as a string value. Allocates the buffer and copies the string

References TKO_Channel_Environment.

void TK_Color::SetEnvironmentName ( int  length)
inline

Sets the environment texture string buffer. Allocates a buffer to hold a string of 'length' characters

References TKO_Channel_Environment.

void TK_Color::SetGeometry ( int  m)
inline

Sets the mask value which indicates which types of geometry are affected by this color setting. Geometry types are specified by TKO_Geometry_Bits.

References TKO_Geo_All_Colors, TKO_Geo_Extended, TKO_Geo_Extended2, TKO_Geo_Extended2_Mask, TKO_Geo_Extended_Colors, TKO_Geo_Extended_Colors_Mask, and TKO_Geo_Extended_Mask.

void TK_Color::SetGloss ( float  g)
inline

Sets the gloss value

References TKO_Channel_Gloss.

void TK_Color::SetIndex ( float  i)
inline

Sets the index of refraction

References TKO_Channel_Index.

void TK_Color::SetMirror ( float  r,
float  g,
float  b 
)
inline

Sets the mirror color using discrete rgb values

References TKO_Channel_Mirror.

void TK_Color::SetMirror ( float const *  rgb)
inline

Sets the mirror color using a float triplet

References SetMirror().

Referenced by SetMirror().

void TK_Color::SetMirrorName ( char const *  name)
inline

Sets the mirror color as a string value. Allocates the buffer and copies the string

References TKO_Channel_Mirror.

void TK_Color::SetMirrorName ( int  length)
inline

Sets the mirror color string buffer. Allocates a buffer to hold a string of 'length' characters

References TKO_Channel_Mirror.

void TK_Color::SetSpecular ( float  r,
float  g,
float  b 
)
inline

Sets the specular color using discrete rgb values

References TKO_Channel_Specular.

void TK_Color::SetSpecular ( float const *  rgb)
inline

Sets the specular color using a float triplet

References SetSpecular().

Referenced by SetSpecular().

void TK_Color::SetSpecularName ( char const *  name)
inline

Sets the specular color as a string value. Allocates the buffer and copies the string

References TKO_Channel_Specular.

void TK_Color::SetSpecularName ( int  length)
inline

Sets the specular color string buffer. Allocates a buffer to hold a string of 'length' characters

References TKO_Channel_Specular.

void TK_Color::SetTransmission ( float  r,
float  g,
float  b 
)
inline

Sets the transmission color using discrete rgb values

References TKO_Channel_Transmission.

void TK_Color::SetTransmission ( float const *  rgb)
inline

Sets the transmission color using a float triplet

References SetTransmission().

Referenced by SetTransmission().

void TK_Color::SetTransmissionName ( char const *  name)
inline

Sets the transmission color as a string value. Allocates the buffer and copies the string

References TKO_Channel_Transmission.

void TK_Color::SetTransmissionName ( int  length)
inline

Sets the transmission color string buffer. Allocates a buffer to hold a string of 'length' characters

References TKO_Channel_Transmission.

TK_Status TK_Color::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.


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