Introduction

Getting Started

Programming Guides

API Reference

Additional Resources

TK_PBR Class Reference

Handles the TKE_PBR opcode. More...

#include <BOpcodeHandler.h>

Public Member Functions

TK_Status Clone (BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const
 
float GetAlphaFactor () const
 
float const * GetBaseColorFactor () const
 
char const * GetBaseColorMap () const
 
char * GetBaseColorMap ()
 
char const * GetEmissiveMap () const
 
char * GetEmissiveMap ()
 
float GetMetalnessFactor () const
 
char const * GetMetalnessMap () const
 
char * GetMetalnessMap ()
 
int GetMetalnessMapChannel () const
 
float GetNormalFactor () const
 
char const * GetNormalMap () const
 
char * GetNormalMap ()
 
float GetOcclusionFactor () const
 
char const * GetOcclusionMap () const
 
char * GetOcclusionMap ()
 
int GetOcclusionMapChannel () const
 
int GetOptions () const
 
float GetRoughnessFactor () const
 
char const * GetRoughnessMap () const
 
char * GetRoughnessMap ()
 
int GetRoughnessMapChannel () const
 
TK_Status Read (BStreamFileToolkit &tk)
 
TK_Status ReadAscii (BStreamFileToolkit &tk)
 Deprecated.
 
void Reset ()
 
void SetAlphaFactor (float f)
 
void SetBaseColorFactor (float r, float g, float b, float a)
 
void SetBaseColorFactor (float const rgba[])
 
void SetBaseColorMap (char const *name)
 
void SetBaseColorMap (int length)
 
void SetEmissiveMap (char const *name)
 
void SetEmissiveMap (int length)
 
void SetMetalnessFactor (float f)
 
void SetMetalnessMap (char const *name)
 
void SetMetalnessMap (int length)
 
void SetMetalnessMapChannel (int c)
 
void SetNormalFactor (float f)
 
void SetNormalMap (char const *name)
 
void SetNormalMap (int length)
 
void SetOcclusionFactor (float f)
 
void SetOcclusionMap (char const *name)
 
void SetOcclusionMap (int length)
 
void SetOcclusionMapChannel (int c)
 
void SetOptions (int m)
 
void SetRoughnessFactor (float f)
 
void SetRoughnessMap (char const *name)
 
void SetRoughnessMap (int length)
 
void SetRoughnessMapChannel (int c)
 
TK_Status Write (BStreamFileToolkit &tk)
 
TK_Status WriteAscii (BStreamFileToolkit &tk)
 Deprecated.
 
- Public Member Functions inherited from BBaseOpcodeHandler
 BBaseOpcodeHandler (int op)
 
virtual TK_Status Execute (BStreamFileToolkit &tk)
 
unsigned char General_Flags () const
 
char const * GetLoggingString () const
 
char * GetLoggingString ()
 
virtual TK_Status Interpret (BStreamFileToolkit &tk, ID_Key key, int variant=0)
 
virtual TK_Status Interpret (BStreamFileToolkit &tk, ID_Key key, char const *special)
 
bool IsCollectionPart () const
 
void LogDebug (BStreamFileToolkit &tk, char const *string=0)
 
virtual bool Match_Instance (BStreamFileToolkit const &tk, Recorded_Instance *instance)
 
virtual bool NeedsContext (BStreamFileToolkit &tk) const
 
bool NeedsTag () const
 
unsigned char Opcode () const
 
int Pass (BStreamFileToolkit &tk) const
 
void Set_General_Flags (int f)
 
void SetCollectionPart (bool n)
 
void SetLoggingString (char const *segment)
 
void SetLoggingString (int length)
 
void SetNeedsTag (bool n)
 
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 reset_string (char *&s)
 internal use
 
void set_string (char *&s, int length)
 internal use
 
void set_string (char *&s, char const *name)
 internal use
 
- Protected Member Functions inherited from BBaseOpcodeHandler
void add_segment (BStreamFileToolkit &tk, ID_Key key)
 for internal use only
 
void adjust_written (BStreamFileToolkit &tk, int count)
 for internal use only
 
void bytes_to_floats (unsigned char const *in, float *out, int count) const
 for internal use only
 
void decrease_nesting (BStreamFileToolkit &tk, int amount=1)
 for internal use only
 
bool Find_Instance (BStreamFileToolkit &tk, int val1, int val2, int val3)
 
bool Find_Item (BStreamFileToolkit &tk, ID_Key key) const
 
void floats_to_bytes (float const *in, unsigned char *out, int count) const
 for internal use only
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, int *rInts, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned char &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, char &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned short &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, short &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, int &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, float &value)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, float *rFloats, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, char *m_string, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned char *m_string, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, int *rInts, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, short *rShorts, unsigned int n)
 
TK_Status GetAsciiData (BStreamFileToolkit &tk, const char *tag, unsigned short *rShorts, unsigned int n)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, unsigned char &value)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, int &value)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, char &value)
 
TK_Status GetAsciiHex (BStreamFileToolkit &tk, const char *tag, unsigned short &value)
 
TK_Status GetAsciiImageData (BStreamFileToolkit &tk, const char *tag, unsigned char *rValues, unsigned int n)
 
TK_Status GetGeneral (BStreamFileToolkit &tk)
 
void increase_nesting (BStreamFileToolkit &tk, int amount=1)
 for internal use only
 
ID_Key last_key (BStreamFileToolkit &tk) const
 obsolete
 
void log_opcode (BStreamFileToolkit &tk, unsigned int sequence, unsigned char opcode)
 for internal use only
 
BBaseOpcodeHandlerOpcode_Handler (BStreamFileToolkit &tk, unsigned char op) const
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, char const *b, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, short const *s, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, int const *i, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, float const *f, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned char const *b, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned short const *s, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned int const *i, int n)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, char const &c)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, short const &s)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned char const &b)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned short const &s)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, unsigned int const &i)
 
TK_Status PutAsciiData (BStreamFileToolkit &tk, char const *tag, float const &f)
 
TK_Status PutAsciiFlag (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiHex (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiMask (BStreamFileToolkit &tk, char const *tag, int const &i)
 
TK_Status PutAsciiOpcode (BStreamFileToolkit &tk, int adjust=1, bool is_end=false, bool want_newline=true)
 
TK_Status PutEndXMLTag (BStreamFileToolkit &tk, char const *tag)
 
TK_Status PutGeneral (BStreamFileToolkit &tk)
 
TK_Status PutOpcode (BStreamFileToolkit &tk, int adjust=1)
 
TK_Status PutStartXMLTag (BStreamFileToolkit &tk, char const *tag)
 
TK_Status Read_Referenced_Segment (BStreamFileToolkit &tk, int &i_progress)
 
TK_Status ReadAsciiLine (BStreamFileToolkit &tk, unsigned int *readSize=0)
 
TK_Status ReadAsciiWord (BStreamFileToolkit &tk, unsigned int *readSize=0)
 
TK_Status ReadEndOpcode (BStreamFileToolkit &tk)
 
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)
 for internal use only
 
bool RemoveAngularBrackets (char *string)
 
bool RemoveQuotes (char *string)
 
void Revisit (BStreamFileToolkit &tk, float priority=0.0f, int variant=0) const
 
void set_last_key (BStreamFileToolkit &tk, ID_Key key)
 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)
 
bool validate_count (int count, int limit=1<< 24) const
 

Protected Attributes

float m_alpha_factor
 
float m_base_color_factor [4]
 
char * m_base_color_map
 
char * m_emissive_map
 
float m_metalness_factor
 
char * m_metalness_map
 
char m_metalness_map_channel
 
float m_normal_factor
 
char * m_normal_map
 
float m_occlusion_factor
 
char * m_occlusion_map
 
char m_occlusion_map_channel
 
int m_options
 
float m_roughness_factor
 
char * m_roughness_map
 
char m_roughness_map_channel
 
- 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
 
bool m_collection_part
 Indicates if this object is part of a LOD collection.
 
int m_debug_allocated
 
int m_debug_length
 
char * m_debug_string
 
unsigned char m_general_flags
 Basic flags common to many handlers.
 
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 void fix (int *i, int n)
 for internal use only
 
static void fix (short *s, int n)
 for internal use only
 
static void fix_in (float *f, int n)
 for internal use only
 
static void fix_in (double *d, int n)
 for internal use only
 
static void fix_out (float *f, int n)
 for internal use only
 
static void fix_out (double *d, int n)
 for internal use only
 
static short flip (short s)
 for internal use only
 
static int flip (int i)
 for internal use only
 
static TK_Status GetData (BStreamFileToolkit &tk, char *b, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, short *s, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, int *i, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, float *f, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, double *d, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned char *b, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned short *s, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned int *i, int n)
 
static TK_Status GetData (BStreamFileToolkit &tk, char &c)
 
static TK_Status GetData (BStreamFileToolkit &tk, short &s)
 
static TK_Status GetData (BStreamFileToolkit &tk, int &i)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned char &b)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned short &s)
 
static TK_Status GetData (BStreamFileToolkit &tk, unsigned int &i)
 
static TK_Status GetData (BStreamFileToolkit &tk, float &f)
 
static TK_Status GetData (BStreamFileToolkit &tk, double &d)
 
static TK_Status LookatData (BStreamFileToolkit &tk, unsigned char &b)
 
static TK_Status PutData (BStreamFileToolkit &tk, char const *b, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, short const *s, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, int const *i, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, float const *f, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, double const *d, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned char const *b, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned short const *s, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned int const *i, int n)
 
static TK_Status PutData (BStreamFileToolkit &tk, char const &c)
 
static TK_Status PutData (BStreamFileToolkit &tk, short const &s)
 
static TK_Status PutData (BStreamFileToolkit &tk, int const &i)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned char const &b)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned short const &s)
 
static TK_Status PutData (BStreamFileToolkit &tk, unsigned int const &i)
 
static TK_Status PutData (BStreamFileToolkit &tk, float const &f)
 
static TK_Status PutData (BStreamFileToolkit &tk, double const &d)
 
static float read_float (char const *cp, char const **newcpp=0)
 
static float read_float (char const *cp, char **newcpp)
 for internal use only
 
static char * write_float (char *buffer, double f)
 for internal use only
 

Detailed Description

Handles the TKE_PBR opcode.

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

The HOOPS/3dGS scene-graph segments can have a Physically Based Rendering material definition

Member Function Documentation

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

float TK_PBR::GetAlphaFactor ( ) const
inline

Returns the alpha factor

float const* TK_PBR::GetBaseColorFactor ( ) const
inline

Returns the base color factor as the address of a float quad

char const* TK_PBR::GetBaseColorMap ( ) const
inline

Returns the address of the base color map string.

char* TK_PBR::GetBaseColorMap ( )
inline

Returns the address of the base color map buffer, which may be modified directly.

char const* TK_PBR::GetEmissiveMap ( ) const
inline

Returns the address of the emissive map string.

char* TK_PBR::GetEmissiveMap ( )
inline

Returns the address of the emissive map buffer, which may be modified directly.

float TK_PBR::GetMetalnessFactor ( ) const
inline

Returns the metalness factor

char const* TK_PBR::GetMetalnessMap ( ) const
inline

Returns the address of the metalness map string.

char* TK_PBR::GetMetalnessMap ( )
inline

Returns the address of the metalness map buffer, which may be modified directly.

int TK_PBR::GetMetalnessMapChannel ( ) const
inline

Returns the metalness map channel

float TK_PBR::GetNormalFactor ( ) const
inline

Returns the normal factor

char const* TK_PBR::GetNormalMap ( ) const
inline

Returns the address of the normal map string.

char* TK_PBR::GetNormalMap ( )
inline

Returns the address of the normal map buffer, which may be modified directly.

float TK_PBR::GetOcclusionFactor ( ) const
inline

Returns the occlusion factor

char const* TK_PBR::GetOcclusionMap ( ) const
inline

Returns the address of the occlusion map string.

char* TK_PBR::GetOcclusionMap ( )
inline

Returns the address of the occlusion map buffer, which may be modified directly.

int TK_PBR::GetOcclusionMapChannel ( ) const
inline

Returns the occlusion map channel

int TK_PBR::GetOptions ( ) const
inline

Returns the options flags. Option types are specified by TKO_PBR_Options.

float TK_PBR::GetRoughnessFactor ( ) const
inline

Returns the roughness factor

char const* TK_PBR::GetRoughnessMap ( ) const
inline

Returns the address of the roughness map string.

char* TK_PBR::GetRoughnessMap ( )
inline

Returns the address of the roughness map buffer, which may be modified directly.

int TK_PBR::GetRoughnessMapChannel ( ) const
inline

Returns the roughness map channel

TK_Status TK_PBR::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_PBR::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_PBR::SetAlphaFactor ( float  f)
inline

Sets the alpha factor

void TK_PBR::SetBaseColorFactor ( float  r,
float  g,
float  b,
float  a 
)
inline

Sets the base color factor using discrete rgba values

void TK_PBR::SetBaseColorFactor ( float const  rgba[])
inline

Sets the base color factor using a float quad

void TK_PBR::SetBaseColorMap ( char const *  name)
inline

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

void TK_PBR::SetBaseColorMap ( int  length)
inline

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

void TK_PBR::SetEmissiveMap ( char const *  name)
inline

Sets the emissive map as a string value. Allocates the buffer and copies the string

void TK_PBR::SetEmissiveMap ( int  length)
inline

Sets the emissive map string buffer. Allocates a buffer to hold a string of 'length' characters

void TK_PBR::SetMetalnessFactor ( float  f)
inline

Sets the metalness factor

void TK_PBR::SetMetalnessMap ( char const *  name)
inline

Sets the metalness map as a string value. Allocates the buffer and copies the string

void TK_PBR::SetMetalnessMap ( int  length)
inline

Sets the metalness map string buffer. Allocates a buffer to hold a string of 'length' characters

void TK_PBR::SetMetalnessMapChannel ( int  c)
inline

Sets the metalness map channel

void TK_PBR::SetNormalFactor ( float  f)
inline

Sets the normal factor

void TK_PBR::SetNormalMap ( char const *  name)
inline

Sets the normal map as a string value. Allocates the buffer and copies the string

void TK_PBR::SetNormalMap ( int  length)
inline

Sets the normal map string buffer. Allocates a buffer to hold a string of 'length' characters

void TK_PBR::SetOcclusionFactor ( float  f)
inline

Sets the occlusion factor

void TK_PBR::SetOcclusionMap ( char const *  name)
inline

Sets the occlusion map as a string value. Allocates the buffer and copies the string

void TK_PBR::SetOcclusionMap ( int  length)
inline

Sets the occlusion map string buffer. Allocates a buffer to hold a string of 'length' characters

void TK_PBR::SetOcclusionMapChannel ( int  c)
inline

Sets the occlusion map channel

void TK_PBR::SetOptions ( int  m)
inline

Sets the options flags. Option types are specified by TKO_PBR_Options.

void TK_PBR::SetRoughnessFactor ( float  f)
inline

Sets the roughness factor

void TK_PBR::SetRoughnessMap ( char const *  name)
inline

Sets the roughness map as a string value. Allocates the buffer and copies the string

void TK_PBR::SetRoughnessMap ( int  length)
inline

Sets the roughness map string buffer. Allocates a buffer to hold a string of 'length' characters

void TK_PBR::SetRoughnessMapChannel ( int  c)
inline

Sets the roughness map channel

TK_Status TK_PBR::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: