33#include <NDEVR/Model.h>
34#include <NDEVR/Geometry.h>
40 template<u
int01 t_dims>
49 case 1:
return location[
X];
50 case 2:
return m_size[
X] * location[
Y] + location[
X];
61 vec_location[
X] = location;
64 vec_location[
Y] = location /
m_size[
X];
65 vec_location[
X] = location %
m_size[
X];
70 vec_location[
X] = location %
m_size[
X];
97 template<u
int01 t_dims>
129 for (
uint04 i = 0; i < count; i++)
143 template<
class t_type>
149 template<
class t_type>
155 template<
class t_type>
161 template<
class t_type>
167 template<
class t_type>
171 for (
uint01 dim = 0; dim < t_dims; dim++)
173 if (index[dim] < 0 || index[dim] > size[dim])
183 for (
uint01 i = 0; i < GridIndexing<t_dims>::getNumberOfCorners(); i++)
186 if constexpr (t_dims >= 3)
187 location_sum[
Z] = (i / 4) % 2;
188 if constexpr (t_dims >= 2)
189 location_sum[
Y] = (i / 2) % 2;
190 if constexpr (t_dims >= 1)
191 location_sum[
X] = (i / 1) % 2;
192 if (discrete[
X] == size[
X] - 1)
194 if (discrete[
Y] == size[
Y] - 1)
206 for (
uint01 i = 0; i < GridIndexing<t_dims>::getNumberOfCorners(); i++)
209 if constexpr (t_dims >= 3)
210 location_sum[
Z] = (i / 4) % 2;
211 if constexpr (t_dims >= 2)
212 location_sum[
Y] = (i / 2) % 2;
213 if constexpr (t_dims >= 1)
214 location_sum[
X] = (i / 1) % 2;
217 value += center[i] * difference.
product();
#define lib_assert(expression, message)
Definition LibAssert.h:61
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:55
bool isValid() const
Definition DesignObject.h:355
t_type getProperty(DesignProperty property) const
Definition DesignObject.h:256
void setProperty(DesignProperty property, const t_type &value)
Definition DesignObject.h:177
A core class within the model heirarchy containing vertex-based data (Usually 3D data) within a set c...
Definition Geometry.h:64
void updateVertexColumns(bool invalidate_bounds=true, bool erase_kd_tree=true)
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)
void setGeometryType(GeometryType geometry_type)
void setVertex(VertexProperty property, uint04 index, const t_type &vector)
Definition Geometry.h:871
Converts 1 dimensional index into N dimensional index based on size of each dimension.
Definition GriddedMesh.h:42
Vector< t_dims, uint04 > convertFromIndex(const uint04 &location) const
Definition GriddedMesh.h:55
static constexpr uint01 getNumberOfCorners()
Definition GriddedMesh.h:76
uint04 convertToIndex(const Vector< t_dims, uint04 > &location) const
Definition GriddedMesh.h:44
void setSize(Vector< t_dims, uint04 > index_size)
Definition GriddedMesh.h:86
Vector< t_dims, uint04 > m_size
Definition GriddedMesh.h:91
Stores a uniform grid of data in N dimensions into a Geometry object.
Definition GriddedMesh.h:99
void setVertexProperty(uint04 property_index, Vector< t_dims, uint04 > index, const t_type &value)
Definition GriddedMesh.h:156
void setVertex(VertexProperty property, Vector< t_dims, uint04 > index, const t_type &vector)
Definition GriddedMesh.h:144
const Vector< t_dims, uint04 > & getIndexSize() const
Definition GriddedMesh.h:137
GridMesh(const Geometry &model)
Definition GriddedMesh.h:103
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:110
bool isValid() const
Definition GriddedMesh.h:106
t_type interpolateVertex(VertexProperty property, const Vector< t_dims, fltp08 > &index, InterpolationValues interpolation=InterpolationValues::e_linear) const
Definition GriddedMesh.h:168
t_type getVertexProperty(uint04 property_index, Vector< t_dims, uint04 > index) const
Definition GriddedMesh.h:162
Geometry geometry() const
Definition GriddedMesh.h:251
GridMesh()
Definition GriddedMesh.h:101
Geometry m_geo
Definition GriddedMesh.h:253
t_type vertex(VertexProperty property, Vector< t_dims, uint04 > index) const
Definition GriddedMesh.h:150
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
constexpr t_type product() const
Definition Vector.hpp:488
A class to easily iterate each vertex of a Geometry.
Definition Geometry.h:1455
void setVertex(uint04 index, const t_type &value)
Definition Geometry.h:1487
void setFlag(uint04 index, const BitFlag &value)
Definition Geometry.h:1491
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170
VertexProperty
Definition DesignObjectBase.h:52
InterpolationValues
Values that represent interpolation functions. Useful in large or complicated geological or time base...
Definition BaseValues.hpp:221
@ nearest_neighbor
Definition BaseValues.hpp:222
@ e_linear
Definition BaseValues.hpp:223
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
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
constexpr Angle< t_angle_type > abs(const Angle< t_angle_type > &value)
Changes an input with a negative sign, to a positive sign.
Definition AngleFunctions.h:645
@ Y
Definition BaseValues.hpp:169
@ X
Definition BaseValues.hpp:167
@ Z
Definition BaseValues.hpp:171
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233