1.3.64
 
Loading...
Searching...
No Matches
helios::Material Struct Reference

Material data structure. More...

#include <Context.h>

Public Member Functions

 Material ()
 Default constructor.
 
 Material (uint ID, const std::string &lbl, const RGBAcolor &c, const std::string &tex, bool override, uint twosided=1)
 Constructor with parameters.
 
template<typename T >
void setMaterialData (const char *label, const T &data)
 Add scalar data value associated with this material.
 
template<typename T >
void setMaterialData (const char *label, const std::vector< T > &data)
 Add vector data associated with this material.
 
template<typename T >
void getMaterialData (const char *label, T &data) const
 Get scalar data associated with this material.
 
template<typename T >
void getMaterialData (const char *label, std::vector< T > &data) const
 Get vector data associated with this material.
 
bool doesMaterialDataExist (const char *label) const
 Check if material data 'label' exists.
 
HeliosDataType getMaterialDataType (const char *label) const
 Get the Helios data type of material data.
 
uint getMaterialDataSize (const char *label) const
 Get the size/length of material data.
 
void clearMaterialData (const char *label)
 Clear the material data for this material.
 
std::vector< std::string > listMaterialData () const
 Return labels for all material data for this particular material.
 

Data Fields

uint materialID
 Unique identifier for this material (internal use)
 
std::string label
 String label for this material (user-facing identifier)
 
RGBAcolor color
 Diffuse RGBA color of the material.
 
std::string texture_file
 Path to texture image file (empty string if no texture)
 
bool texture_color_overridden
 Flag indicating whether texture color should be overridden with the color value.
 
uint twosided_flag
 Flag indicating one-sided (0) or two-sided (1) radiation absorption/emission.
 
uint reference_count
 Reference count - number of primitives currently using this material.
 
std::map< std::string, HeliosDataTypematerial_data_types
 Material primitive data storage - type registry.
 
std::map< std::string, std::vector< int > > material_data_int
 Material primitive data storage - integer data.
 
std::map< std::string, std::vector< uint > > material_data_uint
 Material primitive data storage - unsigned integer data.
 
std::map< std::string, std::vector< float > > material_data_float
 Material primitive data storage - float data.
 
std::map< std::string, std::vector< double > > material_data_double
 Material primitive data storage - double data.
 
std::map< std::string, std::vector< vec2 > > material_data_vec2
 Material primitive data storage - vec2 data.
 
std::map< std::string, std::vector< vec3 > > material_data_vec3
 Material primitive data storage - vec3 data.
 
std::map< std::string, std::vector< vec4 > > material_data_vec4
 Material primitive data storage - vec4 data.
 
std::map< std::string, std::vector< int2 > > material_data_int2
 Material primitive data storage - int2 data.
 
std::map< std::string, std::vector< int3 > > material_data_int3
 Material primitive data storage - int3 data.
 
std::map< std::string, std::vector< int4 > > material_data_int4
 Material primitive data storage - int4 data.
 
std::map< std::string, std::vector< std::string > > material_data_string
 Material primitive data storage - string data.
 
std::map< std::string, std::vector< bool > > material_data_bool
 Material primitive data storage - bool data.
 

Detailed Description

Material data structure.

Structure to store surface rendering properties that can be shared across multiple primitives.

Materials store visualization properties such as color and texture information. Multiple primitives can reference the same material to reduce memory usage when many primitives share the same appearance properties.

Each material is assigned a unique string label that users use to reference the material. Internally, materials also have a numeric ID for efficient primitive storage.

Definition at line 129 of file Context.h.

Constructor & Destructor Documentation

◆ Material() [1/2]

helios::Material::Material ( )
inline

Default constructor.

Definition at line 183 of file Context.h.

◆ Material() [2/2]

helios::Material::Material ( uint  ID,
const std::string &  lbl,
const RGBAcolor c,
const std::string &  tex,
bool  override,
uint  twosided = 1 
)
inline

Constructor with parameters.

Definition at line 187 of file Context.h.

Member Function Documentation

◆ clearMaterialData()

void helios::Material::clearMaterialData ( const char *  label)
inline

Clear the material data for this material.

Parameters
[in]labelName/label associated with data

Definition at line 523 of file Context.h.

◆ doesMaterialDataExist()

bool helios::Material::doesMaterialDataExist ( const char *  label) const
inline

Check if material data 'label' exists.

Parameters
[in]labelName/label associated with data
Returns
True if data exists, false otherwise

Definition at line 466 of file Context.h.

◆ getMaterialData() [1/2]

template<typename T >
void helios::Material::getMaterialData ( const char *  label,
std::vector< T > &  data 
) const
inline

Get vector data associated with this material.

Template Parameters
TMaterial data type
Parameters
[in]labelName/label associated with data
[out]dataMaterial data structure

Definition at line 382 of file Context.h.

◆ getMaterialData() [2/2]

template<typename T >
void helios::Material::getMaterialData ( const char *  label,
T &  data 
) const
inline

Get scalar data associated with this material.

Template Parameters
TMaterial data type
Parameters
[in]labelName/label associated with data
[out]dataMaterial data structure

Definition at line 296 of file Context.h.

◆ getMaterialDataSize()

uint helios::Material::getMaterialDataSize ( const char *  label) const
inline

Get the size/length of material data.

Parameters
[in]labelName/label associated with data
Returns
Size/length of material data array

Definition at line 488 of file Context.h.

◆ getMaterialDataType()

HeliosDataType helios::Material::getMaterialDataType ( const char *  label) const
inline

Get the Helios data type of material data.

Parameters
[in]labelName/label associated with data
Returns
Helios data type of material data
See also
HeliosDataType

Definition at line 476 of file Context.h.

◆ listMaterialData()

std::vector< std::string > helios::Material::listMaterialData ( ) const
inline

Return labels for all material data for this particular material.

Definition at line 555 of file Context.h.

◆ setMaterialData() [1/2]

template<typename T >
void helios::Material::setMaterialData ( const char *  label,
const std::vector< T > &  data 
)
inline

Add vector data associated with this material.

Template Parameters
TMaterial data type
Parameters
[in]labelName/label associated with data
[in]dataMaterial data (vector)

Definition at line 248 of file Context.h.

◆ setMaterialData() [2/2]

template<typename T >
void helios::Material::setMaterialData ( const char *  label,
const T &  data 
)
inline

Add scalar data value associated with this material.

Template Parameters
TMaterial data type
Parameters
[in]labelName/label associated with data
[in]dataMaterial data value (scalar)

Definition at line 200 of file Context.h.

Field Documentation

◆ color

RGBAcolor helios::Material::color

Diffuse RGBA color of the material.

Definition at line 137 of file Context.h.

◆ label

std::string helios::Material::label

String label for this material (user-facing identifier)

Definition at line 134 of file Context.h.

◆ material_data_bool

std::map<std::string, std::vector<bool> > helios::Material::material_data_bool

Material primitive data storage - bool data.

Definition at line 180 of file Context.h.

◆ material_data_double

std::map<std::string, std::vector<double> > helios::Material::material_data_double

Material primitive data storage - double data.

Definition at line 164 of file Context.h.

◆ material_data_float

std::map<std::string, std::vector<float> > helios::Material::material_data_float

Material primitive data storage - float data.

Definition at line 162 of file Context.h.

◆ material_data_int

std::map<std::string, std::vector<int> > helios::Material::material_data_int

Material primitive data storage - integer data.

Definition at line 158 of file Context.h.

◆ material_data_int2

std::map<std::string, std::vector<int2> > helios::Material::material_data_int2

Material primitive data storage - int2 data.

Definition at line 172 of file Context.h.

◆ material_data_int3

std::map<std::string, std::vector<int3> > helios::Material::material_data_int3

Material primitive data storage - int3 data.

Definition at line 174 of file Context.h.

◆ material_data_int4

std::map<std::string, std::vector<int4> > helios::Material::material_data_int4

Material primitive data storage - int4 data.

Definition at line 176 of file Context.h.

◆ material_data_string

std::map<std::string, std::vector<std::string> > helios::Material::material_data_string

Material primitive data storage - string data.

Definition at line 178 of file Context.h.

◆ material_data_types

std::map<std::string, HeliosDataType> helios::Material::material_data_types

Material primitive data storage - type registry.

Definition at line 156 of file Context.h.

◆ material_data_uint

std::map<std::string, std::vector<uint> > helios::Material::material_data_uint

Material primitive data storage - unsigned integer data.

Definition at line 160 of file Context.h.

◆ material_data_vec2

std::map<std::string, std::vector<vec2> > helios::Material::material_data_vec2

Material primitive data storage - vec2 data.

Definition at line 166 of file Context.h.

◆ material_data_vec3

std::map<std::string, std::vector<vec3> > helios::Material::material_data_vec3

Material primitive data storage - vec3 data.

Definition at line 168 of file Context.h.

◆ material_data_vec4

std::map<std::string, std::vector<vec4> > helios::Material::material_data_vec4

Material primitive data storage - vec4 data.

Definition at line 170 of file Context.h.

◆ materialID

uint helios::Material::materialID

Unique identifier for this material (internal use)

Definition at line 131 of file Context.h.

◆ reference_count

uint helios::Material::reference_count
mutable

Reference count - number of primitives currently using this material.

Used for efficient copy-on-write material sharing

Definition at line 153 of file Context.h.

◆ texture_color_overridden

bool helios::Material::texture_color_overridden

Flag indicating whether texture color should be overridden with the color value.

If true, primitives will use the color value even when a texture is present

Definition at line 144 of file Context.h.

◆ texture_file

std::string helios::Material::texture_file

Path to texture image file (empty string if no texture)

Definition at line 140 of file Context.h.

◆ twosided_flag

uint helios::Material::twosided_flag

Flag indicating one-sided (0) or two-sided (1) radiation absorption/emission.

Value of 1 (default) means primitive absorbs/emits from both faces. Value of 0 means one-sided (absorb/emit from front face only).

Definition at line 149 of file Context.h.


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