34#include "Design/Headers/Model.h"
35#include "Design/Headers/Material.h"
36#include "Design/Headers/GriddedMesh.h"
42 class BLOCK_MODEL_API BlockGeometry :
public GridMesh<3>
47 explicit BlockGeometry(
const Geometry& model)
51 inline uint04 convertToIndex(uint04 x, uint04 y, uint04 z)
const
53 return GridMesh<3>::convertToIndex(Vector<3, uint04>(x, y, z));
55 inline uint04 convertToIndex(Vector<3, uint04> vec)
const
57 return GridMesh<3>::convertToIndex(vec);
59 bool isBlockVisible(uint04 x, uint04 y, uint04 z);
61 bool processSelection(SelectionInfo& info)
const;
63 template<
class t_type>
64 void setBlockVertex(VertexProperty property, uint04 x, uint04 y, uint04 z,
const t_type& vector)
66 m_geo.setVertex(property, convertToIndex(x, y, z), vector);
68 template<
class t_type>
69 t_type blockVertex(VertexProperty property, uint04 x, uint04 y, uint04 z)
const
71 return m_geo.vertex<t_type>(property, convertToIndex(x, y, z));
74 template<
class t_type>
75 void setVertexProperty(uint04 extra_property_index, uint04 x, uint04 y, uint04 z,
const t_type& vector)
77 m_geo.setVertexProperty(extra_property_index, convertToIndex(x, y, z), vector);
79 template<
class t_type>
80 t_type vertexProperty(uint04 extra_property_index, uint04 x, uint04 y, uint04 z)
const
82 return m_geo.vertexProperty<t_type>(extra_property_index, convertToIndex(x, y, z));
84 void pointKriging(
const Matrix<fltp08>& mat, Geometry sample_data, LogPtr log = LogPtr());
85 void lineKriging(
const Matrix<fltp08>& mat, Geometry sample_data, LogPtr log = LogPtr());
86 void triangulate(
const Matrix<fltp08>& matrix, LogPtr log = LogPtr());
87 void calculateTangentSpace(
bool calc_tan,
bool calc_bitan);
88 void calculatePrimitiveIndices();
89 static constexpr StringView TypeName() {
return "block_model"; }
90 static void KrigeModel(Geometry& block_model,
const Geometry& model, Vector<3, fltp08> block_size, LogPtr log = LogPtr());
98 class NDEVR_DESIGN_API BlockModel :
public Model
101 explicit BlockModel(
const Model& model)
105 if (!m_geometry.isValid())
122 static const char* TypeName() {
return "block_model"; }
123 const BlockGeometry& blockGeometry()
const {
return m_geometry; }
124 BlockGeometry& blockGeometry() {
return m_geometry; }
126 BlockGeometry m_geometry;
void set(t_property_type property, const t_type &value)
Sets a property value in the database.
bool is(t_property_type property, const StringView &value) const
Checks whether a string property matches the given StringView value.
Stores a uniform grid of data in N dimensions into a Geometry object.
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
void setUVColor(const t_type &type)
Sets the color for all UV channels to the same value.
@ e_no_shading
No shading applied. Constant light influence of 1.0.
@ e_modelspace_linework
Gridlines rendered in model-local coordinate space.
@ e_solid_color
A single solid color is used.
void setUVMode(UVType uv_index, const UVMode &type)
Sets the UV mapping mode for the specified UV channel.
Geometry getGeometry() const
Returns the geometry attached to this model.
Geometry createChildGeometry()
Creates a new child geometry for this model.
Model()
Default constructor. Creates an uninitialized Model.
Material createChildMaterial(bool copy_child=false)
Creates a new child material for this model.
Represents a color in the RGB space with optional alpha transparency.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
The primary namespace for the NDEVR SDK.
@ pixel_thickness
Thickness in pixels for line and point rendering.
@ shading_model
The shading model index used for rendering (see Material::ShadingModel).
@ gridline_spacing_mode
Mode controlling how gridline spacing is interpreted.
@ grid_line_spacing
Spacing values for gridline rendering (4-component vector).
@ two_sided
Whether the material is rendered on both sides of a face.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
@ e_KD
Diffuse texture/color channel.
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.