33#include <NDEVR/Model.h>
34#include <NDEVR/Geometry.h>
38 template<u
int01 t_dims>
47 case 1:
return location[
X];
48 case 2:
return m_size[
X] * location[
Y] + location[
X];
59 vec_location[
X] = location;
62 vec_location[
Y] = location /
m_size[
X];
63 vec_location[
X] = location %
m_size[
X];
68 vec_location[
X] = location %
m_size[
X];
91 template<u
int01 t_dims>
123 for (
uint04 i = 0; i < count; i++)
137 template<
class t_type>
143 template<
class t_type>
149 template<
class t_type>
155 template<
class t_type>
161 template<
class t_type>
165 for (
uint01 dim = 0; dim < t_dims; dim++)
167 if (index[dim] < 0 || index[dim] > size[dim])
177 for (
uint01 i = 0; i < GridIndexing<t_dims>::getNumberOfCorners(); i++)
180 if constexpr (t_dims >= 3)
181 location_sum[
Z] = (i / 4) % 2;
182 if constexpr (t_dims >= 2)
183 location_sum[
Y] = (i / 2) % 2;
184 if constexpr (t_dims >= 1)
185 location_sum[
X] = (i / 1) % 2;
186 if (discrete[
X] == size[
X] - 1)
188 if (discrete[
Y] == size[
Y] - 1)
200 for (
uint01 i = 0; i < GridIndexing<t_dims>::getNumberOfCorners(); i++)
203 if constexpr (t_dims >= 3)
204 location_sum[
Z] = (i / 4) % 2;
205 if constexpr (t_dims >= 2)
206 location_sum[
Y] = (i / 2) % 2;
207 if constexpr (t_dims >= 1)
208 location_sum[
X] = (i / 1) % 2;
211 value += center[i] * difference.
product();
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:68
bool isValid() const
Definition DesignObject.h:362
t_type getProperty(DesignProperty property) const
Definition DesignObject.h:263
void setProperty(DesignProperty property, const t_type &value)
Definition DesignObject.h:184
void updateVertexColumns(bool invalidate_bounds=true, bool erase_kd_tree=true)
Definition Geometry.cpp:2206
t_type vertex(VertexProperty property, uint04 index) const
Definition Geometry.h:919
VertexMode
Definition Geometry.h:68
@ e_no_vertex
Definition Geometry.h:69
void setupVertexTable(uint04 vertex_size, VertexMode position, VertexMode normal=VertexMode::e_no_vertex, VertexMode color=VertexMode::e_no_vertex, VertexMode texture=VertexMode::e_no_vertex, VertexMode tangent=VertexMode::e_no_vertex, VertexMode bitangent=VertexMode::e_no_vertex, VertexMode bones=VertexMode::e_no_vertex)
Definition Geometry.cpp:1203
void setGeometryType(GeometryType geometry_type)
Definition Geometry.cpp:1016
void setVertex(VertexProperty property, uint04 index, const t_type &vector)
Definition Geometry.h:871
Definition GriddedMesh.h:40
Vector< t_dims, uint04 > convertFromIndex(const uint04 &location) const
Definition GriddedMesh.h:53
static constexpr uint01 getNumberOfCorners()
Definition GriddedMesh.h:74
uint04 convertToIndex(const Vector< t_dims, uint04 > &location) const
Definition GriddedMesh.h:42
void setSize(Vector< t_dims, uint04 > index_size)
Definition GriddedMesh.h:84
Vector< t_dims, uint04 > m_size
Definition GriddedMesh.h:89
Definition GriddedMesh.h:93
void setVertexProperty(uint04 property_index, Vector< t_dims, uint04 > index, const t_type &value)
Definition GriddedMesh.h:150
void setVertex(VertexProperty property, Vector< t_dims, uint04 > index, const t_type &vector)
Definition GriddedMesh.h:138
const Vector< t_dims, uint04 > & getIndexSize() const
Definition GriddedMesh.h:131
GridMesh(const Geometry &model)
Definition GriddedMesh.h:97
void setupVertexTable(Vector< t_dims, uint04 > index_size, Geometry::VertexMode position, Geometry::VertexMode normal=Geometry::VertexMode::e_no_vertex, Geometry::VertexMode color=Geometry::VertexMode::e_no_vertex, Geometry::VertexMode texture=Geometry::VertexMode::e_no_vertex, Geometry::VertexMode tangent=Geometry::VertexMode::e_no_vertex, Geometry::VertexMode bitangent=Geometry::VertexMode::e_no_vertex, Geometry::VertexMode bones=Geometry::VertexMode::e_no_vertex)
Definition GriddedMesh.h:104
bool isValid() const
Definition GriddedMesh.h:100
t_type interpolateVertex(VertexProperty property, const Vector< t_dims, fltp08 > &index, InterpolationValues interpolation=InterpolationValues::e_linear) const
Definition GriddedMesh.h:162
t_type getVertexProperty(uint04 property_index, Vector< t_dims, uint04 > index) const
Definition GriddedMesh.h:156
Geometry geometry() const
Definition GriddedMesh.h:245
GridMesh()
Definition GriddedMesh.h:95
Geometry m_geo
Definition GriddedMesh.h:247
t_type vertex(VertexProperty property, Vector< t_dims, uint04 > index) const
Definition GriddedMesh.h:144
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
constexpr t_type product() const
Definition Vector.hpp:526
Definition Geometry.h:1452
void setVertex(uint04 index, const t_type &value)
Definition Geometry.h:1484
void setFlag(uint04 index, const BitFlag &value)
Definition Geometry.h:1488
VertexProperty
Definition DesignObjectBase.h:52
InterpolationValues
Values that represent interpolation functions. Useful in large or complicated geological or time.
Definition BaseValues.hpp:255
@ nearest_neighbor
Definition BaseValues.hpp:256
@ e_linear
Definition BaseValues.hpp:257
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
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514
constexpr Angle< t_angle_type > abs(const Angle< t_angle_type > &value)
Definition AngleFunctions.h:750
constexpr bool isNaN(const t_type &value)
Query if 'value' is valid or invalid.
Definition BaseFunctions.hpp:200
@ Y
Definition BaseValues.hpp:202
@ X
Definition BaseValues.hpp:200
@ Z
Definition BaseValues.hpp:204
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
Definition BaseValues.hpp:272