34#include <NDEVR/DesignObject.h>
35#include <NDEVR/Table.h>
36#include <NDEVR/Pointer.h>
37#include <NDEVR/BaseValues.h>
38#include <NDEVR/VectorFunctions.h>
41 class DesignParameterAccumulator;
68 , e_background_gradiant
70 , e_number_of_shading_models
82 , e_background_contrast_plus_solid
92 , e_modelspace_linework
99 , e_tile_texture_clamp
100 , e_tile_texture_decal
101 , e_tile_texture_mirror
105 e_tex_coord_undefined
106 , e_use_mat_coordinates
124 , e_grid_line_spacing
125 , e_gridline_spacing_mode
126 , e_is_dynamic_texture
127 , e_model_space_material
128 , e_color_value_palette
129 , e_draw_by_property_channel
131 , e_extra_property_color_min
132 , e_extra_property_color_mid
133 , e_extra_property_color_max
135 , e_extra_property_value_min
136 , e_extra_property_value_mid
137 , e_extra_property_value_max
139 , e_override_parent_material
140 , e_override_camera_material
142 , e_tile_texture_mode
143 , e_texture_coord_mode
144 , e_use_normal_for_tex_coord
148 , e_fade_render_distance
149 , e_max_render_distance
150 , e_ignore_color_channel_lighting
173 template<
class t_type>
176 return m_base->material_table.get()[m_base->material_property_index[cast<uint04>(mat_index)]].get<t_type>(m_design_index);
178 template<
class t_type>
181 m_base->material_table.get()[m_base->material_property_index[cast<uint04>(mat_index)]].set(m_design_index, type);
183 template<
class t_type>
186 if (getMaterialProperty<t_type>(mat_index) != type)
188 WLock wLock(lock_ptr);
189 setMaterialProperty(mat_index, type);
190 updateModifiedTime();
201 template<
class t_type>
204 uint04 column = m_base->uv_image_file[cast<uint04>(uv_index)];
205 m_base->material_table.get()[column].set(m_design_index, type);
207 template<
class t_type>
210 for (
uint04 i = 0; i < cast<uint04>(UVType::e_uv_size); i++)
211 setUVColor(cast<UVType>(i), type);
213 template<
class t_type>
216 uint04 column = m_base->uv_color[cast<uint04>(uv_index)];
217 m_base->material_table.get()[column].set(m_design_index, type);
219 template<
class t_type>
222 for (
uint04 i = 0; i < cast<uint04>(UVType::e_uv_size); i++)
223 updateUVColor(cast<UVType>(i), type, lock_ptr);
225 template<
class t_type>
228 if (getUVColor(uv_index) != value)
230 WLock lock(lock_ptr);
231 uint04 column = m_base->uv_color[cast<uint04>(uv_index)];
232 m_base->material_table.get()[column].set(m_design_index, value);
233 updateModifiedTime();
236 template<
class t_type>
239 uint04 column = m_base->uv_intensity[cast<uint04>(uv_index)];
240 m_base->material_table.get()[column].set(m_design_index, type);
242 template<
class t_type>
245 uint04 column = m_base->uv_layer[cast<uint04>(uv_index)];
246 m_base->material_table.get()[column].set(m_design_index, type);
270 static const uint01 Dimensions = 0;
271 static const bool Vector =
false;
272 static const bool Buffer =
false;
274 static const bool Pointer =
false;
275 static const bool Unsigned =
false;
276 static const bool Float =
false;
277 static const bool Integer =
false;
278 static const bool Number =
false;
279 static const bool Enum =
false;
280 static const bool String =
false;
281 static const bool Color =
false;
282 static const bool Boolean =
false;
295 struct hash<NDEVR::Material>
300 std::size_t value = 0;
302 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:56
The core Color class in the NDEVR API. Colors can be defined in several ways. The ACIColor is compact...
Definition Color.h:41
Provides the underlying data storage for the NDEVR Scene Model heirarchy.
Definition DesignObjectBase.h:150
A low-level database object that can be used to access general stored properties within the NDEVR Mod...
Definition DesignObject.h:67
Searches a model heirarchy and pulls all parameter data based on the AccumationMode settings.
Definition DesignParameterAccumulator.h:67
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Definition Material.h:51
ShadingModel
Definition Material.h:54
void setPalette(const Buffer< RGBColor > &palette)
bool hasUVLayer(UVType index) const
PrimitiveProperty defaultRenderProperty() const
RGBColor convertValueToColor(fltp08 value) const
bool hasUVColor(UVType index) const
bool hasImageData() const
TileTextureMode
Definition Material.h:96
t_type getMaterialProperty(MaterialProperties mat_index) const
Definition Material.h:174
Material(uint04 index, DesignObjectBase *property_table)
void setTileTextureMode(const Vector< 3, TileTextureMode > &modes)
void setMaterialProperty(MaterialProperties mat_index, const t_type &type)
Definition Material.h:179
void updateModifiedTime(const Time &time=Time::SystemTime())
bool hasUVIntensity(UVType index) const
UVMode getUVMode(UVType uv_index) const
GridLineMode
Definition Material.h:89
bool hasActiveImage() const
void setUVLayer(UVType uv_index, const t_type &type)
Definition Material.h:243
TextureCoordMode getTextureCoordinateMode() const
Vector< 3, TileTextureMode > getTileTextureMode() const
bool hasModelDependentColor(UVType type) const
MaterialProperties
Definition Material.h:114
void updateMaterialProperty(MaterialProperties mat_index, const t_type &type, const void *lock_ptr=nullptr)
Definition Material.h:184
void setUVColor(const t_type &type)
Definition Material.h:208
uint04 getUVLayer(UVType uv_index) const
RGBColor constantColor(Model model, RGBColor background_color=RGBColor(255, 255, 255), UVType type=UVType::e_KD) const
String getUVImage(UVType uv_index) const
fltp04 getUVIntensity(UVType uv_index) const
Material(DesignObjectBase *property_table)
void setShadingModel(ShadingModel model)
ShadingModel getShadingModel() const
void updateUVColor(const t_type &type, const void *lock_ptr=nullptr)
Definition Material.h:220
Buffer< RGBColor > palette() const
bool hasPerVertexColoring(UVType type=UVType::e_KD) const
TextureCoordMode
Definition Material.h:104
UVMode
Definition Material.h:74
void setUVMode(UVType uv_index, const UVMode &type)
Material(const DesignObject &obj)
bool hasModelDependentColor() const
bool isSupportedByShadingModel(UVType type) const
void setUVColor(UVType uv_index, const t_type &type)
Definition Material.h:214
TranslatedString appearanceName() const
void colorBy(const DesignParameterAccumulator &accumulator)
void setUVImage(UVType uv_index, const t_type &type)
Definition Material.h:202
void updateUVColor(UVType uv_index, const t_type &value, const void *lock_ptr=nullptr)
Definition Material.h:226
void setUVIntensity(UVType uv_index, const t_type &type)
Definition Material.h:237
RGBColor getUVColor(UVType uv_index) const
void setTextureCoordinateMode(const TextureCoordMode &mode)
bool hasActiveUVImage(UVType index) const
void combineFrom(const Material &mesh)
TranslatedString displayName() const
void copyFrom(const Material &mesh)
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
Provides shared ownership of a dynamically allocated object.
Definition Pointer.hpp:71
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:54
The core String class for the NDEVR API.
Definition String.h:69
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Used to lock a particular variable for writing. Only one write lock can be created when no read locks...
Definition RWLock.h:115
@ e_background_contrast
Definition CADEntities.h:49
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 Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
UVType
Channels that describe how an object should interact with light.
Definition DesignObjectBase.h:133
Information about the object.
Definition ObjectInfo.h:54