TK_Color Class Reference

#include <BOpcodeHandler.h>

Inheritance diagram for TK_Color:

Inheritance graph
[legend]
Collaboration diagram for TK_Color:

Collaboration graph
[legend]
List of all members.

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")

Definition at line 1829 of file BOpcodeHandler.h.

Public Member Functions

 TK_Color (const TK_Color &rColor)
TK_Coloroperator= (const TK_Color &rColor)
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 SetGeometry (int m) alter
int GetGeometry (void) const
void SetChannels (int c) alter
int GetChannels (void) const
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
float const * GetDiffuse (void) const
char const * GetDiffuseName (void) const
char alter * GetDiffuseName (void) 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
float const * GetSpecular (void) const
char const * GetSpecularName (void) const
char alter * GetSpecularName (void) 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
float const * GetMirror (void) const
char const * GetMirrorName (void) const
char alter * GetMirrorName (void) 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
float const * GetTransmission (void) const
char const * GetTransmissionName (void) const
char alter * GetTransmissionName (void) 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
float const * GetEmission (void) const
char const * GetEmissionName (void) const
char alter * GetEmissionName (void) alter
void SetEnvironmentName (char const *name) alter
void SetEnvironmentName (int length) alter
char const * GetEnvironmentName (void) const
char alter * GetEnvironmentName (void) alter
void SetBumpName (char const *name) alter
void SetBumpName (int length) alter
char const * GetBumpName (void) const
char alter * GetBumpName (void) alter
void SetGloss (float g) alter
float GetGloss (void) const
void SetIndex (float i) alter
float GetIndex (void) const

Protected Member Functions

void set_channel_rgb (channel alter &c, float r, float g, float b, int which_channel=-1) alter
 internal use
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

Protected Attributes

int m_mask
 internal use
short m_channels
 internal use
channel m_diffuse
 internal use
channel m_specular
 internal use
channel m_mirror
 internal use
channel m_transmission
 internal use
channel m_emission
 internal use
channel m_environment
 internal use; note: environment & bump are never a simple RGB type color
channel m_bump
 internal use
float m_gloss
 internal use
float m_index
 internal use
int m_substage
 internal use; To track the subcases

Classes

class  channel


Member Function Documentation

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

char alter* TK_Color::GetBumpName void   )  [inline]
 

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

Definition at line 2195 of file BOpcodeHandler.h.

char const* TK_Color::GetBumpName void   )  const [inline]
 

Returns the address of the bump texture name string.

Definition at line 2193 of file BOpcodeHandler.h.

int TK_Color::GetChannels void   )  const [inline]
 

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

Definition at line 2102 of file BOpcodeHandler.h.

float const* TK_Color::GetDiffuse void   )  const [inline]
 

Returns the diffuse color as the address of a float triplet

Definition at line 2113 of file BOpcodeHandler.h.

char alter* TK_Color::GetDiffuseName void   )  [inline]
 

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

Definition at line 2117 of file BOpcodeHandler.h.

char const* TK_Color::GetDiffuseName void   )  const [inline]
 

Returns the address of the diffuse color name string.

Definition at line 2115 of file BOpcodeHandler.h.

float const* TK_Color::GetEmission void   )  const [inline]
 

Returns the emission color as the address of a float triplet

Definition at line 2173 of file BOpcodeHandler.h.

char alter* TK_Color::GetEmissionName void   )  [inline]
 

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

Definition at line 2177 of file BOpcodeHandler.h.

char const* TK_Color::GetEmissionName void   )  const [inline]
 

Returns the address of the emission color name string.

Definition at line 2175 of file BOpcodeHandler.h.

char alter* TK_Color::GetEnvironmentName void   )  [inline]
 

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

Definition at line 2186 of file BOpcodeHandler.h.

char const* TK_Color::GetEnvironmentName void   )  const [inline]
 

Returns the address of the environment texture name string.

Definition at line 2184 of file BOpcodeHandler.h.

int TK_Color::GetGeometry void   )  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.

Definition at line 2094 of file BOpcodeHandler.h.

float TK_Color::GetGloss void   )  const [inline]
 

Returns the gloss value

Definition at line 2200 of file BOpcodeHandler.h.

float TK_Color::GetIndex void   )  const [inline]
 

Returns the index of refraction

Definition at line 2204 of file BOpcodeHandler.h.

float const* TK_Color::GetMirror void   )  const [inline]
 

Returns the mirror color as the address of a float triplet

Definition at line 2143 of file BOpcodeHandler.h.

char alter* TK_Color::GetMirrorName void   )  [inline]
 

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

Definition at line 2147 of file BOpcodeHandler.h.

char const* TK_Color::GetMirrorName void   )  const [inline]
 

Returns the address of the mirror color name string.

Definition at line 2145 of file BOpcodeHandler.h.

float const* TK_Color::GetSpecular void   )  const [inline]
 

Returns the specular color as the address of a float triplet

Definition at line 2128 of file BOpcodeHandler.h.

char alter* TK_Color::GetSpecularName void   )  [inline]
 

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

Definition at line 2132 of file BOpcodeHandler.h.

char const* TK_Color::GetSpecularName void   )  const [inline]
 

Returns the address of the specular color name string.

Definition at line 2130 of file BOpcodeHandler.h.

float const* TK_Color::GetTransmission void   )  const [inline]
 

Returns the transmission color as the address of a float triplet

Definition at line 2158 of file BOpcodeHandler.h.

char alter* TK_Color::GetTransmissionName void   )  [inline]
 

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

Definition at line 2162 of file BOpcodeHandler.h.

char const* TK_Color::GetTransmissionName void   )  const [inline]
 

Returns the address of the transmission color name string.

Definition at line 2160 of file BOpcodeHandler.h.

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

Implements BBaseOpcodeHandler.

void TK_Color::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_Color::SetBumpName int  length  )  [inline]
 

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

Definition at line 2191 of file BOpcodeHandler.h.

void TK_Color::SetBumpName char const *  name  )  [inline]
 

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

Definition at line 2189 of file BOpcodeHandler.h.

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.

Definition at line 2096 of file BOpcodeHandler.h.

void TK_Color::SetDiffuse float const *  rgb  )  [inline]
 

Sets the diffuse color using a float triplet

Definition at line 2107 of file BOpcodeHandler.h.

void TK_Color::SetDiffuse float  r,
float  g,
float  b
[inline]
 

Sets the diffuse color using discrete rgb values

Definition at line 2105 of file BOpcodeHandler.h.

void TK_Color::SetDiffuseName int  length  )  [inline]
 

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

Definition at line 2111 of file BOpcodeHandler.h.

void TK_Color::SetDiffuseName char const *  name  )  [inline]
 

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

Definition at line 2109 of file BOpcodeHandler.h.

void TK_Color::SetEmission float const *  rgb  )  [inline]
 

Sets the emission color using a float triplet

Definition at line 2167 of file BOpcodeHandler.h.

void TK_Color::SetEmission float  r,
float  g,
float  b
[inline]
 

Sets the emission color using discrete rgb values

Definition at line 2165 of file BOpcodeHandler.h.

void TK_Color::SetEmissionName int  length  )  [inline]
 

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

Definition at line 2171 of file BOpcodeHandler.h.

void TK_Color::SetEmissionName char const *  name  )  [inline]
 

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

Definition at line 2169 of file BOpcodeHandler.h.

void TK_Color::SetEnvironmentName int  length  )  [inline]
 

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

Definition at line 2182 of file BOpcodeHandler.h.

void TK_Color::SetEnvironmentName char const *  name  )  [inline]
 

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

Definition at line 2180 of file BOpcodeHandler.h.

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.

Definition at line 2082 of file BOpcodeHandler.h.

void TK_Color::SetGloss float  g  )  [inline]
 

Sets the gloss value

Definition at line 2198 of file BOpcodeHandler.h.

void TK_Color::SetIndex float  i  )  [inline]
 

Sets the index of refraction

Definition at line 2202 of file BOpcodeHandler.h.

void TK_Color::SetMirror float const *  rgb  )  [inline]
 

Sets the mirror color using a float triplet

Definition at line 2137 of file BOpcodeHandler.h.

void TK_Color::SetMirror float  r,
float  g,
float  b
[inline]
 

Sets the mirror color using discrete rgb values

Definition at line 2135 of file BOpcodeHandler.h.

void TK_Color::SetMirrorName int  length  )  [inline]
 

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

Definition at line 2141 of file BOpcodeHandler.h.

void TK_Color::SetMirrorName char const *  name  )  [inline]
 

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

Definition at line 2139 of file BOpcodeHandler.h.

void TK_Color::SetSpecular float const *  rgb  )  [inline]
 

Sets the specular color using a float triplet

Definition at line 2122 of file BOpcodeHandler.h.

void TK_Color::SetSpecular float  r,
float  g,
float  b
[inline]
 

Sets the specular color using discrete rgb values

Definition at line 2120 of file BOpcodeHandler.h.

void TK_Color::SetSpecularName int  length  )  [inline]
 

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

Definition at line 2126 of file BOpcodeHandler.h.

void TK_Color::SetSpecularName char const *  name  )  [inline]
 

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

Definition at line 2124 of file BOpcodeHandler.h.

void TK_Color::SetTransmission float const *  rgb  )  [inline]
 

Sets the transmission color using a float triplet

Definition at line 2152 of file BOpcodeHandler.h.

void TK_Color::SetTransmission float  r,
float  g,
float  b
[inline]
 

Sets the transmission color using discrete rgb values

Definition at line 2150 of file BOpcodeHandler.h.

void TK_Color::SetTransmissionName int  length  )  [inline]
 

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

Definition at line 2156 of file BOpcodeHandler.h.

void TK_Color::SetTransmissionName char const *  name  )  [inline]
 

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

Definition at line 2154 of file BOpcodeHandler.h.

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:
tk A 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:
Generated on Tue Jan 6 22:41:41 2009 for Autodesk DWF 3D Toolkit by  doxygen 1.4.5