API Documentation
Loading...
Searching...
No Matches
Material Class Reference

#include <Material.h>

Inheritance diagram for Material:
[legend]
Collaboration diagram for Material:
[legend]

Public Types

enum  ShadingModel {
  e_flat , e_gouraud , e_phong , e_phong_blinn ,
  e_toon , e_oren_nayar , e_minnaert , e_cook_torrance ,
  e_no_shading , e_fresnel , e_pbr , e_ibl ,
  e_water , e_background_gradiant , e_skybox , e_number_of_shading_models
}
 
enum  UVMode {
  e_none , e_solid_color , e_color_channel , e_scaled_channel ,
  e_color_by_model , e_background , e_background_contrast , e_background_contrast_plus_solid ,
  e_image , e_color_by_layer , e_highlight
}
 
enum  GridLineMode { e_no_linework , e_global_linework , e_modelspace_linework }
 
enum  TileTextureMode {
  e_tile_tex_undefined , e_tile_texture_wrap , e_tile_texture_clamp , e_tile_texture_decal ,
  e_tile_texture_mirror
}
 
enum  TextureCoordMode {
  e_tex_coord_undefined , e_use_mat_coordinates , e_project_sphere , e_project_cylinder ,
  e_project_box , e_project_plane
}
 
enum  MaterialProperties {
  e_two_sided , e_shading_model , e_opacity , e_bump_scale ,
  e_shininess , e_reflectivity , e_wireframe , e_smooth_normals ,
  e_pixel_thickness , e_grid_line_spacing , e_gridline_spacing_mode , e_is_dynamic_texture ,
  e_model_space_material , e_color_value_palette , e_draw_by_property_channel , e_extra_property_color_min ,
  e_extra_property_color_mid , e_extra_property_color_max , e_extra_property_value_min , e_extra_property_value_mid ,
  e_extra_property_value_max , e_override_parent_material , e_override_camera_material , e_tile_texture_mode ,
  e_texture_coord_mode , e_use_normal_for_tex_coord , e_ignore_depth , e_write_to_depth ,
  e_depth_bias , e_fade_render_distance , e_max_render_distance , e_ignore_color_channel_lighting
}
 
- Public Types inherited from DesignObject
enum  DesignObjectType {
  e_model = 0x00000001 , e_geometry = 0x00000002 , e_material = 0x00000004 , e_bone = 0x00000008 ,
  e_effect = 0x00000010 , e_layer = 0x00000020 , e_scene = 0x00000040 , e_camera = 0x00000080 ,
  e_selection = 0x00000100
}
 
enum  DesignProperty {
  e_guid , e_design_types , e_transform , e_bounding_box ,
  e_selection_box , e_name , e_description , e_editable_description ,
  e_creation_time , e_modified_time , e_asc_modified_time , e_desc_modified_time ,
  e_bounds_modified_time , e_author , e_creation_software , e_3D_visible ,
  e_tree_visible , e_icon , e_is_selected , e_is_focused ,
  e_allow_interactions , e_file , e_search_terms , e_category ,
  e_deletion_allowed , e_is_deleted , e_is_application_locked , e_is_application_owned ,
  e_bounds_ignored , e_selection_ignored , e_meta_data , e_untranslated_string_data ,
  e_translated_string_data , e_uncompressed_data , e_compressed_data , e_manager_visible ,
  e_library_id , e_is_frozen , e_applied_filters , e_design_property_size
}
 

Public Member Functions

 Material ()=default
 
 Material (uint04 index, DesignObjectBase *property_table)
 
 Material (DesignObjectBase *property_table)
 
 Material (const DesignObject &obj)
 
bool hasActiveImage () const
 
bool hasImageData () const
 
TranslatedString displayName () const
 
TranslatedString appearanceName () const
 
bool hasOpacity () const
 
void setupAsDefault ()
 
bool isSupportedByShadingModel (UVType type) const
 
void setShadingModel (ShadingModel model)
 
void setTextureCoordinateMode (const TextureCoordMode &mode)
 
TextureCoordMode getTextureCoordinateMode () const
 
void setTileTextureMode (const Vector< 3, TileTextureMode > &modes)
 
Vector< 3, TileTextureModegetTileTextureMode () const
 
ShadingModel getShadingModel () const
 
bool validate () const
 
template<class t_type >
t_type getMaterialProperty (MaterialProperties mat_index) const
 
template<class t_type >
void setMaterialProperty (MaterialProperties mat_index, const t_type &type)
 
template<class t_type >
void updateMaterialProperty (MaterialProperties mat_index, const t_type &type, const void *lock_ptr=nullptr)
 
void colorBy (const DesignParameterAccumulator &accumulator)
 
RGBColor convertValueToColor (fltp08 value) const
 
void copyFrom (const Material &mesh)
 
void combineFrom (const Material &mesh)
 
PrimitiveProperty defaultRenderProperty () const
 
template<class t_type >
void setUVImage (UVType uv_index, const t_type &type)
 
template<class t_type >
void setUVColor (const t_type &type)
 
template<class t_type >
void setUVColor (UVType uv_index, const t_type &type)
 
template<class t_type >
void updateUVColor (const t_type &type, const void *lock_ptr=nullptr)
 
template<class t_type >
void updateUVColor (UVType uv_index, const t_type &value, const void *lock_ptr=nullptr)
 
template<class t_type >
void setUVIntensity (UVType uv_index, const t_type &type)
 
template<class t_type >
void setUVLayer (UVType uv_index, const t_type &type)
 
void setUVMode (UVType uv_index, const UVMode &type)
 
String getUVImage (UVType uv_index) const
 
RGBColor getUVColor (UVType uv_index) const
 
fltp04 getUVIntensity (UVType uv_index) const
 
uint04 getUVLayer (UVType uv_index) const
 
UVMode getUVMode (UVType uv_index) const
 
bool hasActiveUVImage (UVType index) const
 
bool hasUVIntensity (UVType index) const
 
void cleanupMaterial ()
 
bool hasUVLayer (UVType index) const
 
bool hasUVColor (UVType index) const
 
bool hasPerVertexColoring (UVType type=UVType::e_KD) const
 
bool hasModelDependentColor (UVType type) const
 
bool hasModelDependentColor () const
 
RGBColor constantColor (Model model, RGBColor background_color=RGBColor(255, 255, 255), UVType type=UVType::e_KD) const
 
Buffer< RGBColorpalette () const
 
void setPalette (const Buffer< RGBColor > &palette)
 
void updateModifiedTime (const Time &time=Time::SystemTime())
 
- Public Member Functions inherited from DesignObject
 DesignObject ()=default
 
 DesignObject (DesignObjectBase *base)
 
 DesignObject (uint04 index, DesignObjectBase *base)
 
void setDesignType (DesignObjectType mode, bool is_type)
 
bool isDesignType (DesignObjectType mode) const
 
bool isDesignType (uint04 mode) const
 
bool validateDesignObject () const
 
JSONNode activeFilters () const
 
void setActiveFilters (const JSONNode &node)
 
template<class t_type >
void setProperty (DesignProperty property, const t_type &value)
 
template<>
void setProperty (DesignProperty property, const UUID &value)
 
template<>
void setProperty (DesignProperty property, const String &value)
 
File file () const
 
template<class t_type >
void updateProperty (DesignProperty property, const t_type &value, const void *lock=nullptr)
 
template<class t_type >
t_type getProperty (DesignProperty property) const
 
template<class t_type >
bool hasProperty (DesignProperty property) const
 
bool isProperty (DesignProperty property, const String &value) const
 
bool isProperty (DesignProperty property, const char *value) const
 
bool doesPropertyBeginWith (DesignProperty property, const String &value, bool ignore_case) const
 
bool doesPropertyBeginWith (DesignProperty property, const char *value, bool ignore_case) const
 
bool doesPropertyContain (DesignProperty property, const String &value, bool ignore_case) const
 
bool doesPropertyContain (DesignProperty property, const char *value, bool ignore_case) const
 
template<class t_type >
t_type getInheritedProperty (DesignProperty property) const
 
String getIcon () const
 
uint04 getDesignParentIndex () const
 
Time getModifiedTime () const
 
void updateDesignModifiedTime (Time time=Time::SystemTime())
 
void updateCreatedTime ()
 
void copyFrom (const DesignObject &object)
 
void actionDeletedIndex (uint04 index, uint04 size)
 
void addIndex (uint04 index, uint04 size)
 
void scale (Vector< 3, fltp08 > scale, Vertex< 3, fltp08 > center_of_scale=Constant< Vertex< 3, fltp08 > >::NaN)
 
void offset (const Vector< 3, fltp08 > &offset)
 
bool hasMetaData (const String &index) const
 
const JSONNodemetaData (const String &index) const
 
const JSONNodemetaData () const
 
void setMetaData (const JSONNode &node)
 
void setMetaData (const String &index, const JSONNode &node)
 
void setMetaData (const String &index, const String &data)
 
void setMetaData (const String &index, const bool &data)
 
void setMetaData (const String &index, const fltp08 &data)
 
void setMetaData (const String &index, const uint04 &data)
 
void clearMetaData (const String &index)
 
void updateMetaData (const String &index, const String &data, const void *lock_ptr=nullptr)
 
void updateMetaData (const String &index, const fltp08 &data, const void *lock_ptr=nullptr)
 
void updateMetaData (const String &index, const bool &data, const void *lock_ptr=nullptr)
 
void removeMetaData (const String &index, const void *lock_ptr=nullptr)
 
void appendData (const String &data, bool compressed)
 
uint04 index () const
 
uint04 designIndex () const
 
const DynamicPointer< Table > & propertyTable () const
 
DynamicPointer< Table > & propertyTable ()
 
bool operator== (const DesignObject &model) const
 
bool operator!= (const DesignObject &model) const
 
bool operator< (const DesignObject &model) const
 
bool operator> (const DesignObject &model) const
 
 operator bool () const
 
DesignObjectBasebase () const
 
UUID uuid () const
 
void updateDesignTransform (const Matrix< fltp08 > &transform, const void *lock=nullptr)
 
void setDesignVisible (bool is_visible)
 
void updateDesignVisible (bool is_visible, const void *lock=nullptr)
 
Matrix< fltp08getTransform () const
 
bool isValid () const
 
Scene getScene () const
 

Additional Inherited Members

- Static Public Member Functions inherited from DesignObject
static constexpr const char * FilePathDesignNameVariable ()
 
- Protected Member Functions inherited from DesignObject
void onNameChange (const String &new_name)
 
- Protected Attributes inherited from DesignObject
UUID m_uuid = Constant<UUID>::NaN
 
uint04 m_index = Constant<uint04>::NaN
 
uint04 m_design_index = Constant<uint04>::NaN
 
DesignObjectBasem_base = nullptr
 

Member Enumeration Documentation

◆ GridLineMode

Enumerator
e_no_linework 
e_global_linework 
e_modelspace_linework 

◆ MaterialProperties

Enumerator
e_two_sided 
e_shading_model 
e_opacity 
e_bump_scale 
e_shininess 
e_reflectivity 
e_wireframe 
e_smooth_normals 
e_pixel_thickness 
e_grid_line_spacing 
e_gridline_spacing_mode 
e_is_dynamic_texture 
e_model_space_material 
e_color_value_palette 
e_draw_by_property_channel 
e_extra_property_color_min 
e_extra_property_color_mid 
e_extra_property_color_max 
e_extra_property_value_min 
e_extra_property_value_mid 
e_extra_property_value_max 
e_override_parent_material 
e_override_camera_material 
e_tile_texture_mode 
e_texture_coord_mode 
e_use_normal_for_tex_coord 
e_ignore_depth 
e_write_to_depth 
e_depth_bias 
e_fade_render_distance 
e_max_render_distance 
e_ignore_color_channel_lighting 

◆ ShadingModel

Enumerator
e_flat 
e_gouraud 
e_phong 
e_phong_blinn 
e_toon 
e_oren_nayar 
e_minnaert 
e_cook_torrance 
e_no_shading 
e_fresnel 
e_pbr 
e_ibl 
e_water 
e_background_gradiant 
e_skybox 
e_number_of_shading_models 

◆ TextureCoordMode

Enumerator
e_tex_coord_undefined 
e_use_mat_coordinates 
e_project_sphere 
e_project_cylinder 
e_project_box 
e_project_plane 

◆ TileTextureMode

Enumerator
e_tile_tex_undefined 
e_tile_texture_wrap 
e_tile_texture_clamp 
e_tile_texture_decal 
e_tile_texture_mirror 

◆ UVMode

enum UVMode
Enumerator
e_none 
e_solid_color 
e_color_channel 
e_scaled_channel 
e_color_by_model 
e_background 
e_background_contrast 
e_background_contrast_plus_solid 
e_image 
e_color_by_layer 
e_highlight 

Constructor & Destructor Documentation

◆ Material() [1/4]

Material ( )
default

◆ Material() [2/4]

Material ( uint04 index,
DesignObjectBase * property_table )

◆ Material() [3/4]

Material ( DesignObjectBase * property_table)

◆ Material() [4/4]

Material ( const DesignObject & obj)
explicit

Member Function Documentation

◆ appearanceName()

TranslatedString appearanceName ( ) const

◆ cleanupMaterial()

void cleanupMaterial ( )

◆ colorBy()

void colorBy ( const DesignParameterAccumulator & accumulator)

◆ combineFrom()

void combineFrom ( const Material & mesh)

◆ constantColor()

RGBColor constantColor ( Model model,
RGBColor background_color = RGBColor(255, 255, 255),
UVType type = UVType::e_KD ) const
nodiscard

◆ convertValueToColor()

RGBColor convertValueToColor ( fltp08 value) const

◆ copyFrom()

void copyFrom ( const Material & mesh)

◆ defaultRenderProperty()

PrimitiveProperty defaultRenderProperty ( ) const

◆ displayName()

TranslatedString displayName ( ) const

◆ getMaterialProperty()

template<class t_type >
t_type getMaterialProperty ( MaterialProperties mat_index) const
inline

◆ getShadingModel()

Material::ShadingModel getShadingModel ( ) const

◆ getTextureCoordinateMode()

Material::TextureCoordMode getTextureCoordinateMode ( ) const

◆ getTileTextureMode()

Vector< 3, Material::TileTextureMode > getTileTextureMode ( ) const

◆ getUVColor()

RGBColor getUVColor ( UVType uv_index) const

◆ getUVImage()

String getUVImage ( UVType uv_index) const

◆ getUVIntensity()

fltp04 getUVIntensity ( UVType uv_index) const

◆ getUVLayer()

uint04 getUVLayer ( UVType uv_index) const

◆ getUVMode()

Material::UVMode getUVMode ( UVType uv_index) const

◆ hasActiveImage()

bool hasActiveImage ( ) const

◆ hasActiveUVImage()

bool hasActiveUVImage ( UVType index) const

◆ hasImageData()

bool hasImageData ( ) const

◆ hasModelDependentColor() [1/2]

bool hasModelDependentColor ( ) const

◆ hasModelDependentColor() [2/2]

bool hasModelDependentColor ( UVType type) const

◆ hasOpacity()

bool hasOpacity ( ) const

◆ hasPerVertexColoring()

bool hasPerVertexColoring ( UVType type = UVType::e_KD) const

◆ hasUVColor()

bool hasUVColor ( UVType index) const

◆ hasUVIntensity()

bool hasUVIntensity ( UVType index) const

◆ hasUVLayer()

bool hasUVLayer ( UVType index) const

◆ isSupportedByShadingModel()

bool isSupportedByShadingModel ( UVType type) const

◆ palette()

Buffer< RGBColor > palette ( ) const

◆ setMaterialProperty()

template<class t_type >
void setMaterialProperty ( MaterialProperties mat_index,
const t_type & type )
inline

◆ setPalette()

void setPalette ( const Buffer< RGBColor > & palette)

◆ setShadingModel()

void setShadingModel ( ShadingModel model)

◆ setTextureCoordinateMode()

void setTextureCoordinateMode ( const TextureCoordMode & mode)

◆ setTileTextureMode()

void setTileTextureMode ( const Vector< 3, TileTextureMode > & modes)

◆ setupAsDefault()

void setupAsDefault ( )

◆ setUVColor() [1/2]

template<class t_type >
void setUVColor ( const t_type & type)
inline

◆ setUVColor() [2/2]

template<class t_type >
void setUVColor ( UVType uv_index,
const t_type & type )
inline

◆ setUVImage()

template<class t_type >
void setUVImage ( UVType uv_index,
const t_type & type )
inline

◆ setUVIntensity()

template<class t_type >
void setUVIntensity ( UVType uv_index,
const t_type & type )
inline

◆ setUVLayer()

template<class t_type >
void setUVLayer ( UVType uv_index,
const t_type & type )
inline

◆ setUVMode()

void setUVMode ( UVType uv_index,
const UVMode & type )

◆ updateMaterialProperty()

template<class t_type >
void updateMaterialProperty ( MaterialProperties mat_index,
const t_type & type,
const void * lock_ptr = nullptr )
inline

◆ updateModifiedTime()

void updateModifiedTime ( const Time & time = Time::SystemTime())

◆ updateUVColor() [1/2]

template<class t_type >
void updateUVColor ( const t_type & type,
const void * lock_ptr = nullptr )
inline

◆ updateUVColor() [2/2]

template<class t_type >
void updateUVColor ( UVType uv_index,
const t_type & value,
const void * lock_ptr = nullptr )
inline

◆ validate()

bool validate ( ) const

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