NDEVR
API Documentation

Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR API 3D environment. More...

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

Public Types

enum  GridLineMode : uint01 { e_no_linework = 0 , e_global_linework = 1 , e_modelspace_linework = 2 , e_invalid = 255 }
 Defines modes for gridline rendering on material surfaces. More...
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
}
 Enumerates the available shading models for material rendering. More...
enum  TextureCoordMode {
  e_tex_coord_undefined , e_use_mat_coordinates , e_project_sphere , e_project_cylinder ,
  e_project_box , e_project_plane
}
 Defines how texture coordinates are generated or interpreted for a material. More...
enum  TileTextureMode {
  e_tile_tex_undefined , e_tile_texture_wrap , e_tile_texture_clamp , e_tile_texture_decal ,
  e_tile_texture_mirror
}
 Defines how texture coordinates outside the [0,1] range are handled per axis. More...
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
}
 Defines UV mapping modes that control how texture colors are determined for surfaces. More...
Public Types inherited from DesignInfo
enum  DesignObjectType : uint01

Public Member Functions

 Material (const DesignObject &obj)
 Constructs a Material from a generic DesignObject reference.
 Material (DesignObjectBase *property_table)
 Constructs a new Material and allocates a row in the given property table.
 Material (uint04 index, DesignObjectBase *property_table)
 Constructs a Material referencing a specific row in the given property table.
TranslatedString appearanceName () const
 Returns the appearance-specific name for this material.
void cleanupMaterial ()
 Cleans up and resets material properties to a minimal valid state.
void colorBy (const DesignParameterAccumulator &accumulator)
 Applies color-by-property rendering using the given parameter accumulator.
void combineFrom (const Material &mesh)
 Combines material properties from another Material into this one.
RGBColor constantColor (Model model, RGBColor background_color=RGBColor(255, 255, 255), UVType type=UVType::e_KD) const
 Computes a constant representative color for this material given a model and background.
RGBColor convertValueToColor (fltp08 value) const
 Converts a scalar value to an RGBColor using this material's color palette and range.
void copyFrom (const Material &mesh)
 Copies all material properties from another Material, replacing current values.
PrimitiveProperty defaultRenderProperty () const
 Returns the default primitive render property for this material.
TranslatedString displayName () const
 Returns a user-facing display name for this material.
void ensureImageDataLoaded (ImageFactory &factory)
 Ensures that any referenced image data is loaded into memory using the provided factory.
ShadingModel getShadingModel () const
 Retrieves the current shading model for this material.
TextureCoordMode getTextureCoordinateMode () const
 Retrieves the current texture coordinate generation mode.
Vector< 3, TileTextureModegetTileTextureMode () const
 Retrieves the texture tiling mode for each of the three axes.
RGBColor getUVColor (UVType uv_index) const
 Retrieves the color assigned to the specified UV channel.
StringView getUVImage (UVType uv_index) const
 Retrieves the image file path or identifier for the specified UV channel.
fltp04 getUVIntensity (UVType uv_index) const
 Retrieves the intensity value for the specified UV channel.
uint04 getUVLayer (UVType uv_index) const
 Retrieves the layer index for the specified UV channel.
UVMode getUVMode (UVType uv_index) const
 Retrieves the UV mapping mode for the specified UV channel.
bool hasActiveImage () const
 Checks whether this material has an active (non-empty, in-use) image texture.
bool hasActiveUVImage (UVType index) const
 Checks whether the specified UV channel has an active image texture assigned.
bool hasImageData () const
 Checks whether this material has any image data loaded or referenced.
bool hasModelDependentColor () const
 Checks whether any UV type has model-dependent coloring.
bool hasModelDependentColor (UVType type) const
 Checks whether the color for the specified UV type depends on the owning model.
bool hasOpacity () const
 Checks whether this material has a non-default opacity value set.
bool hasPerVertexColoring (UVType type=UVType::e_KD) const
 Checks whether per-vertex coloring is active for the specified UV type.
bool hasUVColor (UVType index) const
 Checks whether the specified UV channel has a color assigned.
bool hasUVIntensity (UVType index) const
 Checks whether the specified UV channel has a non-default intensity value.
bool hasUVLayer (UVType index) const
 Checks whether the specified UV channel has a layer index assigned.
bool isSupportedByShadingModel (UVType type) const
 Checks whether the given UV type is supported by the current shading model.
Buffer< RGBColorpalette () const
 Retrieves the color palette used for value-based coloring.
void setPalette (const Buffer< RGBColor > &palette)
 Sets the color palette used for value-based coloring.
void setTileTextureMode (const Vector< 3, TileTextureMode > &modes)
 Sets the texture tiling mode for each of the three axes.
void setupAsDefault ()
 Initializes this material with default property values.
template<class t_type>
void setUVColor (const t_type &type)
 Sets the color for all UV channels to the same value.
template<class t_type>
void setUVColor (UVType uv_index, const t_type &type)
 Sets the color for a specific UV channel.
void setUVImage (UVType uv_index, const StringView &type)
 Sets the image file path or identifier for the specified UV channel.
template<class t_type>
void setUVIntensity (UVType uv_index, const t_type &type)
 Sets the intensity value for the specified UV channel.
template<class t_type>
void setUVLayer (UVType uv_index, const t_type &type)
 Sets the layer index for the specified UV channel.
void setUVMode (UVType uv_index, const UVMode &type)
 Sets the UV mapping mode for the specified UV channel.
void updateModifiedTime (const Time &time=Time::SystemTime())
 Updates the material's modification timestamp.
template<class t_type>
void updateUVColor (const t_type &type, const void *lock_ptr=nullptr)
 Updates the color for all UV channels, only writing if the value has changed.
template<class t_type>
void updateUVColor (UVType uv_index, const t_type &value, const void *lock_ptr=nullptr)
 Updates the color for a specific UV channel, only writing if the value has changed.
bool validate () const
 Validates that this material's properties are in a consistent and usable state.
Public Member Functions inherited from DesignObject
 DesignObject ()=default
 Creates an "invalid" design object.
 DesignObject (const DesignInfo &info)
 Constructs a DesignObject from an existing DesignInfo, sharing the same base and indices.
 DesignObject (DesignObjectBase *base)
 Creates an new design object within the given DesignObjectBase.
 DesignObject (uint04 index, DesignObjectBase *base)
 Sets a DesignObject up to be a pointer to an existing object in the database.
JSONNode activeFilters () const
 Retrieves the active filters applied to this design object as a JSON structure.
void appendData (const StringView &data, bool compressed)
 Appends data to this design object's data storage.
DesignObjectBasebase () const
 Returns a reference to the underlying DesignObjectBase database.
void clearAllMetaData ()
 Removes all metadata entries from this design object.
void clearMetaData (const StringView &index)
 Removes a specific metadata entry by key.
void copyFrom (const DesignObject &object)
 Copies all properties from the given design object into this one.
uint04 designIndex () const
 Returns the design-specific index used to access type-specific properties (e.g., model, geometry, material properties).
bool doesPropertyBeginWith (NDPO property, const StringView &value, bool ignore_case) const
 Checks whether a string property's value begins with the given substring.
bool doesPropertyContain (NDPO property, const StringView &value, bool ignore_case) const
 Checks whether a string property's value contains the given substring.
File file () const
 Returns the file path associated with this design object as a File object.
template<auto t_property>
constexpr decltype(auto) get () const
 Retrieves a property value using a compile-time property constant, with the type deduced from PropertySpec.
template<auto t_property, class t_type>
constexpr decltype(auto) get () const
 Retrieves a property value using a compile-time property constant, cast to the requested type.
template<class t_type, class t_property_type>
constexpr decltype(auto) get (t_property_type property) const
 Retrieves a property value from the database, cast to the requested type.
DesignObject getDesignParent () const
 Retrieves the parent design object of this object in the model hierarchy.
StringView getIcon () const
 Retrieves the icon identifier string associated with this design object.
template<class t_type>
decltype(auto) getInheritedProperty (NDPO property) const
 Retrieves a property value, walking up the parent hierarchy if the property is not set on this object.
Scene getScene () const
 Retrieves the Scene that this design object belongs to.
bool hasMetaData (const StringView &index) const
 Checks whether a metadata entry exists for the given key.
template<class t_type, class t_design_type>
bool hasProperty (t_design_type property) const
 Checks whether a property has a valid (non-default) value.
uint04 index () const
 Returns the primary row index of this object within the DesignObjectBase property table.
template<auto t_property>
bool is (const char *value) const
 Checks whether a compile-time property matches the given C-string value.
template<auto t_property>
bool is (const String &value) const
 Checks whether a compile-time property matches the given String value.
template<auto t_property>
bool is (const StringView &value) const
 Checks whether a compile-time property matches the given StringView value.
template<auto t_property, class t_type>
std::enable_if<!ObjectInfo< t_type >::String, bool >::type is (const t_type &value) const
 Checks whether a compile-time property matches a non-string value using equality comparison.
template<class t_property_type>
bool is (t_property_type property, const char *value) const
 Checks whether a string property matches the given C-string value.
template<class t_property_type>
bool is (t_property_type property, const String &value) const
 Checks whether a string property matches the given String value.
template<class t_property_type>
bool is (t_property_type property, const StringView &value) const
 Checks whether a string property matches the given StringView value.
template<class t_property_type, class t_type>
std::enable_if<!ObjectInfo< t_type >::String, bool >::type is (t_property_type property, const t_type &value) const
 Checks whether a non-string property matches the given value using equality comparison.
bool isDesignType (DesignObjectType mode) const
 Checks whether this object has the specified design type flag set.
bool isDesignType (uint04 mode) const
 Checks whether this object has the specified design type flag set, using a raw integer value.
bool isValid () const
 Checks whether this design object has a valid index into the database.
const JSONNodemetaData () const
 Retrieves the entire metadata tree for this design object.
const JSONNodemetaData (const StringView &index) const
 Retrieves a specific metadata entry by key.
void offsetDesign (const Vector< 3, fltp08 > &offset)
 Translates this design object by the given offset vector.
 operator bool () const
 Bool conversion operator.
bool operator!= (const DesignObject &object) const
 Checks inequality with another DesignObject.
bool operator< (const DesignObject &object) const
 Less-than comparison for ordering DesignObjects (e.g., for sorted containers).
bool operator== (const DesignObject &object) const
 Checks equality with another DesignObject by comparing base pointers and indices.
bool operator> (const DesignObject &object) const
 Greater-than comparison for ordering DesignObjects (e.g., for sorted containers).
Table & propertyTable ()
 Returns a mutable reference to the property table that stores this object's properties.
const Table & propertyTable () const
 Returns a const reference to the property table that stores this object's properties.
void removeMetaData (const StringView &index, const void *lock_ptr=nullptr)
 Removes a metadata entry by key, with optional write lock support.
void scale (Vector< 3, fltp08 > scale, Vertex< 3, fltp08 > center_of_scale, const Matrix< fltp08 > &transform)
 Scales this design object's geometry by the given scale factors around a center point, applying an additional transform.
void scale (Vector< 3, fltp08 > scale, Vertex< 3, fltp08 > center_of_scale=Constant< Vertex< 3, fltp08 > >::Invalid)
 Scales this design object's geometry and transform by the given scale factors around a center point.
template<auto t_property, class t_type>
void set (const t_type &value)
 Sets a property value in the database using a compile-time property constant.
template<class t_type, class t_property_type>
void set (t_property_type property, const t_type &value)
 Sets a property value in the database.
void setActiveFilters (const JSONNode &node)
 Sets the active filters on this design object from a JSON structure.
void setDesignType (DesignObjectType mode, bool is_type)
 Sets or clears a design type flag on this object.
void setMetaData (const JSONNode &node)
 Replaces the entire metadata tree with the given JSON node.
void setMetaData (const StringView &index, const bool &data)
 Sets a metadata entry at the given key to a boolean value.
void setMetaData (const StringView &index, const fltp08 &data)
 Sets a metadata entry at the given key to a 64-bit floating point value.
void setMetaData (const StringView &index, const JSONNode &node)
 Sets a metadata entry at the given key to the specified JSON node value.
void setMetaData (const StringView &index, const String &data)
 Sets a metadata entry at the given key to a String value.
void setMetaData (const StringView &index, const StringView &data)
 Sets a metadata entry at the given key to a StringView value.
void setMetaData (const StringView &index, const uint01 &data)
 Sets a metadata entry at the given key to a uint01 value.
void setMetaData (const StringView &index, const uint04 &data)
 Sets a metadata entry at the given key to a uint04 value.
template<auto t_property, class t_type>
bool update (const t_type &value, const void *lock=nullptr)
 Updates a property using a compile-time property constant, only if the new value differs.
template<class t_type, class t_property_type>
bool update (t_property_type property, const t_type &value, const void *lock=nullptr)
 Updates a property only if the new value differs from the current value.
void updateCreatedTime ()
 Sets the creation time stamp for this design object to the current system time.
void updateDesignModifiedTime (Time time=Time::SystemTime())
 Updates the modified time stamp for this design object.
void updateDesignTransform (const Matrix< fltp08 > &transform, const void *lock=nullptr)
 Updates the transform of this design object if it differs from the current value.
bool updateDesignVisible (bool is_visible, const void *lock=nullptr)
 Updates the spatial visibility of this design object if it differs from the current value.
void updateMetaData (const StringView &index, const bool &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
void updateMetaData (const StringView &index, const fltp08 &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
void updateMetaData (const StringView &index, const String &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
void updateMetaData (const StringView &index, const StringView &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
bool validateDesignObject () const
 Validates the internal state of this design object, ensuring indices and base pointer are consistent.

Additional Inherited Members

Static Public Member Functions inherited from DesignObject
static constexpr StringView FilePathDesignNameVariable ()
 Returns the placeholder variable string used in file paths to represent the design name.
Protected Member Functions inherited from DesignObject
template<class t_type>
void _setProperty (NDPO property, const t_type &value)
 Low-level property setter that directly writes to the design properties table without triggering side effects such as transform or visibility updates.
void initDesignObject ()
 Initializes default property values for this design object after construction.
Protected Member Functions inherited from DesignInfo
 DesignInfo (DesignObjectBase *base)
 Creates an new design object within the given DesignObjectBase.
 DesignInfo (uint04 index, DesignObjectBase *base)
 Sets a DesignObject up to be a pointer to an existing object in the database.
void _setDesignVisible (bool is_visible)
 Sets the spatial visibility of this design object and propagates the change through the design hierarchy.
void _setTransform (const Matrix< fltp08 > &transform)
 Sets the 4x4 transform matrix for this design object and propagates the change through the design hierarchy.
Protected Attributes inherited from DesignInfo
DesignObjectBasem_base = nullptr
 Pointer to the owning DesignObjectBase property database.
uint04 m_design_index = Constant<uint04>::Invalid
 Index of the parent design that owns this object.
uint04 m_index = Constant<uint04>::Invalid
 Row index of this object within the property database.

Detailed Description

Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR API 3D environment.


Models may have 3 materials but Materials can be shared across any number of Models within a Scene.

Warning
Access to these members and data should be made in a thread-safe manner using DesignObjectLookup read and write locks.
See also
Model, Effect, MaterialRaster, RGBColor

Definition at line 152 of file Material.h.

Member Enumeration Documentation

◆ GridLineMode

Defines modes for gridline rendering on material surfaces.


Enumerator
e_no_linework 

No gridlines rendered.

e_global_linework 

Gridlines rendered in global/world coordinate space.

e_modelspace_linework 

Gridlines rendered in model-local coordinate space.

e_invalid 

Invalid/unset gridline mode.

Definition at line 202 of file Material.h.

◆ ShadingModel

Enumerates the available shading models for material rendering.


Each value represents a distinct lighting/shading algorithm that determines how light interacts with the material surface during rendering.

Enumerator
e_flat 

Flat shading. Shading is done on per-face base, diffuse only. Also known as 'faceted shading'.

e_gouraud 

Simple Gouraud shading with per-vertex color interpolation.

e_phong 

Phong shading with per-pixel lighting.

e_phong_blinn 

Phong-Blinn shading model.

e_toon 

Toon shading per pixel. Also known as 'comic' shader.

e_oren_nayar 

Oren-Nayar shading per pixel. Extension to Lambertian shading accounting for surface roughness.

e_minnaert 

Minnaert shading per pixel. Extension to Lambertian shading accounting for material "darkness".

e_cook_torrance 

Cook-Torrance shading model. Special shader for metallic surfaces.

e_no_shading 

No shading applied. Constant light influence of 1.0.

e_fresnel 

Fresnel-based shading model.

e_pbr 

Physically-based rendering model.

e_ibl 

Image-based lighting model.

e_water 

Specialized water surface shading.

e_background_gradiant 

Background gradient shading.

e_skybox 

Skybox cubemap shading.

e_number_of_shading_models 

Sentinel value indicating the total number of shading models.

Definition at line 161 of file Material.h.

◆ TextureCoordMode

Defines how texture coordinates are generated or interpreted for a material.


Enumerator
e_tex_coord_undefined 

Texture coordinate mode is undefined/unset.

e_use_mat_coordinates 

Use the material's own texture coordinate definitions.

e_project_sphere 

Generate texture coordinates via spherical projection.

e_project_cylinder 

Generate texture coordinates via cylindrical projection.

e_project_box 

Generate texture coordinates via box/cube projection.

e_project_plane 

Generate texture coordinates via planar projection.

Definition at line 225 of file Material.h.

◆ TileTextureMode

Defines how texture coordinates outside the [0,1] range are handled per axis.


Enumerator
e_tile_tex_undefined 

Tiling mode is undefined/unset.

e_tile_texture_wrap 

Texture coordinate wraps: u|v is translated to u%1|v%1.

e_tile_texture_clamp 

Texture coordinates outside [0,1] are clamped to the nearest valid value.

e_tile_texture_decal 

Texture is not applied to pixels with coordinates outside [0,1].

e_tile_texture_mirror 

Texture coordinate mirrors: u%1|v%1 if (u-(u%1))%2 is zero, otherwise 1-(u%1)|1-(v%1).

Definition at line 213 of file Material.h.

◆ UVMode

Defines UV mapping modes that control how texture colors are determined for surfaces.


Enumerator
e_none 

No UV mapping applied.

e_solid_color 

A single solid color is used.

e_color_channel 

Color is taken from the per-vertex color channel.

e_scaled_channel 

Color channel values are scaled by a property range.

e_color_by_model 

Color is determined by the owning model.

e_background 

Uses the background color.

e_background_contrast 

Uses a color that contrasts with the background.

e_background_contrast_plus_solid 

Combines background contrast with a solid color.

e_image 

Color is sampled from a texture image.

e_color_by_layer 

Color is determined by the layer assignment.

e_highlight 

Uses the highlight/selection color.

Definition at line 184 of file Material.h.

Constructor & Destructor Documentation

◆ Material() [1/3]

Material::Material ( uint04 index,
DesignObjectBase * property_table )

Constructs a Material referencing a specific row in the given property table.


Parameters
[in]indexThe row index within the material property table.
[in]property_tableThe design object base containing the material data.

References DesignObject::index().

◆ Material() [2/3]

Material::Material ( DesignObjectBase * property_table)

Constructs a new Material and allocates a row in the given property table.


Parameters
[in]property_tableThe design object base to allocate the material in.

◆ Material() [3/3]

Material::Material ( const DesignObject & obj)
explicit

Constructs a Material from a generic DesignObject reference.


Parameters
[in]objThe DesignObject to interpret as a Material.

References DesignObject::DesignObject().

Member Function Documentation

◆ appearanceName()

TranslatedString Material::appearanceName ( ) const

Returns the appearance-specific name for this material.


Returns
A translated string describing the material's appearance.

◆ cleanupMaterial()

void Material::cleanupMaterial ( )

Cleans up and resets material properties to a minimal valid state.


◆ colorBy()

void Material::colorBy ( const DesignParameterAccumulator & accumulator)

Applies color-by-property rendering using the given parameter accumulator.


Parameters
[in]accumulatorThe design parameter accumulator providing property data for color mapping.

◆ combineFrom()

void Material::combineFrom ( const Material & mesh)

Combines material properties from another Material into this one.


Properties from the source are merged with existing values rather than fully replacing them.

Parameters
[in]meshThe source Material to combine from.

◆ constantColor()

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

Computes a constant representative color for this material given a model and background.


Parameters
[in]modelThe Model context for resolving model-dependent colors.
[in]background_colorThe background color used for contrast calculations (defaults to white).
[in]typeThe UV type to evaluate (defaults to e_KD, the diffuse channel).
Returns
The resolved RGBColor for the material.

References e_KD.

◆ convertValueToColor()

RGBColor Material::convertValueToColor ( fltp08 value) const

Converts a scalar value to an RGBColor using this material's color palette and range.


Parameters
[in]valueThe scalar value to convert.
Returns
The interpolated RGBColor corresponding to the value.

◆ copyFrom()

void Material::copyFrom ( const Material & mesh)

Copies all material properties from another Material, replacing current values.


Parameters
[in]meshThe source Material to copy from.

◆ defaultRenderProperty()

PrimitiveProperty Material::defaultRenderProperty ( ) const

Returns the default primitive render property for this material.


Returns
The PrimitiveProperty that determines default rendering behavior.

◆ displayName()

TranslatedString Material::displayName ( ) const

Returns a user-facing display name for this material.


Returns
A translated string suitable for display in the UI.

◆ ensureImageDataLoaded()

void Material::ensureImageDataLoaded ( ImageFactory & factory)

Ensures that any referenced image data is loaded into memory using the provided factory.


Parameters
[in]factoryThe ImageFactory used to load image data on demand.

◆ getShadingModel()

ShadingModel Material::getShadingModel ( ) const

Retrieves the current shading model for this material.


Returns
The ShadingModel enum value.

◆ getTextureCoordinateMode()

TextureCoordMode Material::getTextureCoordinateMode ( ) const

Retrieves the current texture coordinate generation mode.


Returns
The TextureCoordMode value for this material.

◆ getTileTextureMode()

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

Retrieves the texture tiling mode for each of the three axes.


Returns
A 3-component vector of TileTextureMode values.

◆ getUVColor()

RGBColor Material::getUVColor ( UVType uv_index) const

Retrieves the color assigned to the specified UV channel.


Parameters
[in]uv_indexThe UV channel to query.
Returns
The RGBColor for the specified channel.

Referenced by updateUVColor().

◆ getUVImage()

StringView Material::getUVImage ( UVType uv_index) const

Retrieves the image file path or identifier for the specified UV channel.


Parameters
[in]uv_indexThe UV channel to query.
Returns
A StringView containing the image path or identifier.

◆ getUVIntensity()

fltp04 Material::getUVIntensity ( UVType uv_index) const

Retrieves the intensity value for the specified UV channel.


Parameters
[in]uv_indexThe UV channel to query.
Returns
The intensity value as a float.

◆ getUVLayer()

uint04 Material::getUVLayer ( UVType uv_index) const

Retrieves the layer index for the specified UV channel.


Parameters
[in]uv_indexThe UV channel to query.
Returns
The layer index.

◆ getUVMode()

UVMode Material::getUVMode ( UVType uv_index) const

Retrieves the UV mapping mode for the specified UV channel.


Parameters
[in]uv_indexThe UV channel to query.
Returns
The UVMode for the specified channel.

◆ hasActiveImage()

bool Material::hasActiveImage ( ) const

Checks whether this material has an active (non-empty, in-use) image texture.


Returns
True if an active image is assigned to this material.

◆ hasActiveUVImage()

bool Material::hasActiveUVImage ( UVType index) const

Checks whether the specified UV channel has an active image texture assigned.


Parameters
[in]indexThe UV channel to check.
Returns
True if an active image is assigned to the channel.

References DesignObject::index().

◆ hasImageData()

bool Material::hasImageData ( ) const

Checks whether this material has any image data loaded or referenced.


Returns
True if image data exists for this material.

◆ hasModelDependentColor() [1/2]

bool Material::hasModelDependentColor ( ) const

Checks whether any UV type has model-dependent coloring.


Returns
True if any UV channel has model-dependent color.

◆ hasModelDependentColor() [2/2]

bool Material::hasModelDependentColor ( UVType type) const

Checks whether the color for the specified UV type depends on the owning model.


Parameters
[in]typeThe UV type to check.
Returns
True if color depends on the model.

◆ hasOpacity()

bool Material::hasOpacity ( ) const

Checks whether this material has a non-default opacity value set.


Returns
True if opacity has been explicitly set.

◆ hasPerVertexColoring()

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

Checks whether per-vertex coloring is active for the specified UV type.


Parameters
[in]typeThe UV type to check (defaults to e_KD, the diffuse channel).
Returns
True if per-vertex coloring is enabled.

References e_KD.

◆ hasUVColor()

bool Material::hasUVColor ( UVType index) const

Checks whether the specified UV channel has a color assigned.


Parameters
[in]indexThe UV channel to check.
Returns
True if a color has been set for the channel.

References DesignObject::index().

◆ hasUVIntensity()

bool Material::hasUVIntensity ( UVType index) const

Checks whether the specified UV channel has a non-default intensity value.


Parameters
[in]indexThe UV channel to check.
Returns
True if a UV intensity value has been set.

References DesignObject::index().

◆ hasUVLayer()

bool Material::hasUVLayer ( UVType index) const

Checks whether the specified UV channel has a layer index assigned.


Parameters
[in]indexThe UV channel to check.
Returns
True if a layer index has been set.

References DesignObject::index().

◆ isSupportedByShadingModel()

bool Material::isSupportedByShadingModel ( UVType type) const

Checks whether the given UV type is supported by the current shading model.


Parameters
[in]typeThe UV type to check for support.
Returns
True if the shading model supports the specified UV type.

◆ palette()

Buffer< RGBColor > Material::palette ( ) const

Retrieves the color palette used for value-based coloring.


Returns
A Buffer of RGBColor values representing the palette.

Referenced by setPalette().

◆ setPalette()

void Material::setPalette ( const Buffer< RGBColor > & palette)

Sets the color palette used for value-based coloring.


Parameters
[in]paletteThe Buffer of RGBColor values to use as the palette.

References palette().

◆ setTileTextureMode()

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

Sets the texture tiling mode for each of the three axes.


Parameters
[in]modesA 3-component vector of TileTextureMode values (one per axis).

◆ setupAsDefault()

void Material::setupAsDefault ( )

Initializes this material with default property values.


◆ setUVColor() [1/2]

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

Sets the color for all UV channels to the same value.


Parameters
[in]typeThe color value to set across all UV channels.

Definition at line 382 of file Material.h.

References cast(), e_uv_size, setUVColor(), and type.

Referenced by setUVColor().

◆ setUVColor() [2/2]

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

Sets the color for a specific UV channel.


Parameters
[in]uv_indexThe UV channel to set the color for.
[in]typeThe color value to set.

Definition at line 394 of file Material.h.

References cast(), DesignInfo::m_base, DesignInfo::m_design_index, and type.

◆ setUVImage()

void Material::setUVImage ( UVType uv_index,
const StringView & type )
inline

Sets the image file path or identifier for the specified UV channel.


Parameters
[in]uv_indexThe UV channel to assign the image to.
[in]typeThe image file path or resource identifier.

Definition at line 372 of file Material.h.

References cast(), DesignInfo::m_base, DesignInfo::m_design_index, and type.

◆ setUVIntensity()

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

Sets the intensity value for the specified UV channel.


Parameters
[in]uv_indexThe UV channel to set the intensity for.
[in]typeThe intensity value to set.

Definition at line 438 of file Material.h.

References cast(), DesignInfo::m_base, DesignInfo::m_design_index, and type.

◆ setUVLayer()

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

Sets the layer index for the specified UV channel.


Parameters
[in]uv_indexThe UV channel to set the layer for.
[in]typeThe layer index to set.

Definition at line 449 of file Material.h.

References cast(), DesignInfo::m_base, DesignInfo::m_design_index, and type.

◆ setUVMode()

void Material::setUVMode ( UVType uv_index,
const UVMode & type )

Sets the UV mapping mode for the specified UV channel.


Parameters
[in]uv_indexThe UV channel to configure.
[in]typeThe UVMode to apply.

◆ updateModifiedTime()

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

Updates the material's modification timestamp.


Parameters
[in]timeThe time to record as the modification time (defaults to current system time).

References Time::SystemTime().

Referenced by updateUVColor().

◆ updateUVColor() [1/2]

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

Updates the color for all UV channels, only writing if the value has changed.


Acquires a write lock and updates the modified time if any value changed.

Parameters
[in]typeThe color value to set across all UV channels.
[in]lock_ptrOptional pointer used for write lock acquisition.

Definition at line 407 of file Material.h.

References cast(), e_uv_size, type, and updateUVColor().

Referenced by updateUVColor().

◆ updateUVColor() [2/2]

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

Updates the color for a specific UV channel, only writing if the value has changed.


Acquires a write lock and updates the modified time if the value differs from the current one.

Parameters
[in]uv_indexThe UV channel to update.
[in]valueThe new color value.
[in]lock_ptrOptional pointer used for write lock acquisition.

Definition at line 422 of file Material.h.

References cast(), getUVColor(), DesignInfo::m_base, DesignInfo::m_design_index, and updateModifiedTime().

◆ validate()

bool Material::validate ( ) const

Validates that this material's properties are in a consistent and usable state.


Returns
True if the material passes validation checks.

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