TK_PBR

class TK_PBR

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

Inherits from: BBaseOpcodeHandler

Methods

void TK_PBR::set_string(char *&s, int length)

protected

internal use

void TK_PBR::set_string(char *&s, char const *name)

protected

internal use

void TK_PBR::reset_string(char *&s)

protected

internal use

TK_PBR::TK_PBR()
TK_PBR::~TK_PBR()
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

tk: A reference to the BStreamFileToolkit object.

Returns

The result of the function call.
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

tk: A reference to the BStreamFileToolkit object.

Returns

The result of the function call.
TK_Status TK_PBR::Clone(BStreamFileToolkit &tk, BBaseOpcodeHandler **handler) const

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.
TK_Status TK_PBR::ReadAscii(BStreamFileToolkit &tk)

Deprecated.

TK_Status TK_PBR::WriteAscii(BStreamFileToolkit &tk)

Deprecated.

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.

void TK_PBR::SetOptions(int m)

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

int TK_PBR::GetOptions() const

const

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

void TK_PBR::SetBaseColorMap(char const *name)

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

void TK_PBR::SetBaseColorMap(int length)

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

char const *TK_PBR::GetBaseColorMap() const

const

Returns the address of the base color map string.

char *TK_PBR::GetBaseColorMap()

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

void TK_PBR::SetNormalMap(char const *name)

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

void TK_PBR::SetNormalMap(int length)

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

char const *TK_PBR::GetNormalMap() const

const

Returns the address of the normal map string.

char *TK_PBR::GetNormalMap()

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

void TK_PBR::SetEmissiveMap(char const *name)

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

void TK_PBR::SetEmissiveMap(int length)

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

char const *TK_PBR::GetEmissiveMap() const

const

Returns the address of the emissive map string.

char *TK_PBR::GetEmissiveMap()

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

void TK_PBR::SetMetalnessMap(char const *name)

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

void TK_PBR::SetMetalnessMap(int length)

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

char const *TK_PBR::GetMetalnessMap() const

const

Returns the address of the metalness map string.

char *TK_PBR::GetMetalnessMap()

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

void TK_PBR::SetRoughnessMap(char const *name)

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

void TK_PBR::SetRoughnessMap(int length)

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

char const *TK_PBR::GetRoughnessMap() const

const

Returns the address of the roughness map string.

char *TK_PBR::GetRoughnessMap()

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

void TK_PBR::SetOcclusionMap(char const *name)

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

void TK_PBR::SetOcclusionMap(int length)

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

char const *TK_PBR::GetOcclusionMap() const

const

Returns the address of the occlusion map string.

char *TK_PBR::GetOcclusionMap()

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

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

Sets the base color factor using discrete rgba values

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

Sets the base color factor using a float quad

float const *TK_PBR::GetBaseColorFactor() const

const

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

void TK_PBR::SetNormalFactor(float f)

Sets the normal factor

float TK_PBR::GetNormalFactor() const

const

Returns the normal factor

void TK_PBR::SetMetalnessFactor(float f)

Sets the metalness factor

float TK_PBR::GetMetalnessFactor() const

const

Returns the metalness factor

void TK_PBR::SetRoughnessFactor(float f)

Sets the roughness factor

float TK_PBR::GetRoughnessFactor() const

const

Returns the roughness factor

void TK_PBR::SetOcclusionFactor(float f)

Sets the occlusion factor

float TK_PBR::GetOcclusionFactor() const

const

Returns the occlusion factor

void TK_PBR::SetAlphaFactor(float f)

Sets the alpha factor

float TK_PBR::GetAlphaFactor() const

const

Returns the alpha factor

void TK_PBR::SetMetalnessMapChannel(int c)

Sets the metalness map channel

int TK_PBR::GetMetalnessMapChannel() const

const

Returns the metalness map channel

void TK_PBR::SetRoughnessMapChannel(int c)

Sets the roughness map channel

int TK_PBR::GetRoughnessMapChannel() const

const

Returns the roughness map channel

void TK_PBR::SetOcclusionMapChannel(int c)

Sets the occlusion map channel

int TK_PBR::GetOcclusionMapChannel() const

const

Returns the occlusion map channel

Variables

int TK_PBR::m_options

protected

int
char *TK_PBR::m_base_color_map

protected

char
char *TK_PBR::m_normal_map

protected

char
char *TK_PBR::m_emissive_map

protected

char
char *TK_PBR::m_metalness_map

protected

char
char *TK_PBR::m_roughness_map

protected

char
char *TK_PBR::m_occlusion_map

protected

char
float TK_PBR::m_base_color_factor[4]

protected

float
float TK_PBR::m_normal_factor

protected

float
float TK_PBR::m_metalness_factor

protected

float
float TK_PBR::m_roughness_factor

protected

float
float TK_PBR::m_occlusion_factor

protected

float
float TK_PBR::m_alpha_factor

protected

float
char TK_PBR::m_metalness_map_channel

protected

char
char TK_PBR::m_roughness_map_channel

protected

char
char TK_PBR::m_occlusion_map_channel

protected

char