34#include <NDEVR/DesignObject.h>
35#include <NDEVR/Table.h>
37#include <NDEVR/Pointer.h>
38#include <NDEVR/BaseValues.h>
39#include <NDEVR/VectorFunctions.h>
42 class DesignParameterAccumulator;
62 , e_background_gradiant
64 , e_number_of_shading_models
76 , e_background_contrast_plus_solid
86 , e_modelspace_linework
93 , e_tile_texture_clamp
94 , e_tile_texture_decal
95 , e_tile_texture_mirror
100 , e_use_mat_coordinates
118 , e_grid_line_spacing
119 , e_gridline_spacing_mode
120 , e_is_dynamic_texture
121 , e_model_space_material
122 , e_color_value_palette
123 , e_draw_by_property_channel
125 , e_extra_property_color_min
126 , e_extra_property_color_mid
127 , e_extra_property_color_max
129 , e_extra_property_value_min
130 , e_extra_property_value_mid
131 , e_extra_property_value_max
133 , e_override_parent_material
134 , e_override_camera_material
136 , e_tile_texture_mode
137 , e_texture_coord_mode
138 , e_use_normal_for_tex_coord
142 , e_fade_render_distance
143 , e_max_render_distance
144 , e_ignore_color_channel_lighting
151 bool hasActiveImage()
const;
152 bool hasImageData()
const;
155 bool hasOpacity()
const;
156 void setupAsDefault();
158 bool isSupportedByShadingModel(
UVType type)
const;
165 bool validate()
const;
167 template<
class t_type>
170 return m_base->material_table.get()[m_base->material_property_index[cast<uint04>(mat_index)]].get<t_type>(m_design_index);
172 template<
class t_type>
175 m_base->material_table.get()[m_base->material_property_index[cast<uint04>(mat_index)]].set(m_design_index, type);
177 template<
class t_type>
180 if (getMaterialProperty<t_type>(mat_index) != type)
182 WLock wLock(lock_ptr);
183 setMaterialProperty(mat_index, type);
184 updateModifiedTime();
189 void copyFrom(
const Material& mesh);
190 void combineFrom(
const Material& mesh);
195 template<
class t_type>
198 uint04 column = m_base->uv_image_file[cast<uint04>(uv_index)];
199 m_base->material_table.get()[column].set(m_design_index, type);
201 template<
class t_type>
204 for (
uint04 i = 0; i < cast<uint04>(UVType::e_uv_size); i++)
205 setUVColor(cast<UVType>(i), type);
207 template<
class t_type>
210 uint04 column = m_base->uv_color[cast<uint04>(uv_index)];
211 m_base->material_table.get()[column].set(m_design_index, type);
213 template<
class t_type>
216 for (
uint04 i = 0; i < cast<uint04>(UVType::e_uv_size); i++)
217 updateUVColor(cast<UVType>(i), type, lock_ptr);
219 template<
class t_type>
222 if (getUVColor(uv_index) != value)
224 WLock lock(lock_ptr);
225 uint04 column = m_base->uv_color[cast<uint04>(uv_index)];
226 m_base->material_table.get()[column].set(m_design_index, value);
227 updateModifiedTime();
230 template<
class t_type>
233 uint04 column = m_base->uv_intensity[cast<uint04>(uv_index)];
234 m_base->material_table.get()[column].set(m_design_index, type);
236 template<
class t_type>
239 uint04 column = m_base->uv_layer[cast<uint04>(uv_index)];
240 m_base->material_table.get()[column].set(m_design_index, type);
242 void setUVMode(
UVType uv_index,
const UVMode& type);
247 UVMode getUVMode(
UVType uv_index)
const;
248 bool hasActiveUVImage(
UVType index)
const;
249 bool hasUVIntensity(
UVType index)
const;
250 void cleanupMaterial();
251 bool hasUVLayer(
UVType index)
const;
252 bool hasUVColor(
UVType index)
const;
253 bool hasPerVertexColoring(
UVType type = UVType::e_KD)
const;
254 bool hasModelDependentColor(
UVType type)
const;
255 bool hasModelDependentColor()
const;
259 void updateModifiedTime(
const Time& time = Time::SystemTime());
269 static const bool Unsigned =
false;
270 static const bool Float =
false;
271 static const bool Integer =
false;
272 static const bool Number =
false;
273 static const bool Enum =
false;
276 static const bool Boolean =
false;
289 struct hash<NDEVR::Material>
294 std::size_t value = 0;
296 value = value * 256 + (s[i + 0U] ^ s[i + 8U]);
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition DesignObjectBase.h:140
Definition DesignObject.h:66
Definition DesignParameterAccumulator.h:57
ShadingModel
Definition Material.h:48
TileTextureMode
Definition Material.h:90
t_type getMaterialProperty(MaterialProperties mat_index) const
Definition Material.h:168
void setMaterialProperty(MaterialProperties mat_index, const t_type &type)
Definition Material.h:173
GridLineMode
Definition Material.h:83
void setUVLayer(UVType uv_index, const t_type &type)
Definition Material.h:237
MaterialProperties
Definition Material.h:108
void updateMaterialProperty(MaterialProperties mat_index, const t_type &type, const void *lock_ptr=nullptr)
Definition Material.h:178
void setUVColor(const t_type &type)
Definition Material.h:202
void updateUVColor(const t_type &type, const void *lock_ptr=nullptr)
Definition Material.h:214
TextureCoordMode
Definition Material.h:98
UVMode
Definition Material.h:68
void setUVColor(UVType uv_index, const t_type &type)
Definition Material.h:208
void setUVImage(UVType uv_index, const t_type &type)
Definition Material.h:196
void updateUVColor(UVType uv_index, const t_type &value, const void *lock_ptr=nullptr)
Definition Material.h:220
void setUVIntensity(UVType uv_index, const t_type &type)
Definition Material.h:231
Definition Pointer.hpp:62
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:53
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Definition TranslatedString.h:9
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
@ e_background_contrast
Definition CADEntities.h:46
constexpr bool DESIGN_PRIM
Definition DesignObject.h:47
PrimitiveProperty
Definition DesignObjectBase.h:44
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:157
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
UVType
Definition DesignObjectBase.h:127
static constexpr ObjectInfo< Material, false, false > VectorSub()
Definition Material.h:277
Information about the object.
Definition ObjectInfo.h:56
std::size_t operator()(const NDEVR::Material &d) const noexcept
Definition Material.h:291