40 #ifndef GEOGRAM_DELAUNAY_PERIODIC
41 #define GEOGRAM_DELAUNAY_PERIODIC
66 return pv / nb_vertices_non_periodic_;
75 return pv % nb_vertices_non_periodic_;
98 return real + nb_vertices_non_periodic_*instance;
110 int i = (Tz+1) + 3*(Ty+1) + 9*(Tx+1);
112 return index_t(reorder_instances[i]);
122 index_t instance = periodic_vertex_instance(pv);
123 Tx = translation[instance][0];
124 Ty = translation[instance][1];
125 Tz = translation[instance][2];
138 pv = make_periodic_vertex(
139 periodic_vertex_real(pv), T_to_instance(Tx, Ty, Tz)
143 std::string periodic_vertex_to_string(
index_t v)
const {
145 String::to_string(periodic_vertex_real(v)) +
":" +
146 String::to_string(periodic_vertex_instance(v)) ;
150 std::string s(32,
' ');
152 s[i] = ((m & (1u << (31u-i))) != 0) ?
'1' :
'0';
162 static int translation[27][3];
171 static int reorder_instances[27];
177 static bool instance_is_positive[27];
Assertion checking mechanism.
#define geo_debug_assert(x)
Verifies that a condition is met.
Utilities for managing 3D periodic space.
void periodic_vertex_get_T(index_t pv, int &Tx, int &Ty, int &Tz) const
Gets the translation from a periodic vertex.
index_t periodic_vertex_instance(index_t pv) const
Gets the instance from a periodic vertex.
index_t make_periodic_vertex(index_t real, index_t instance) const
Makes a periodic vertex from a real vertex and instance.
static index_t T_to_instance(int Tx, int Ty, int Tz)
Gets the instance from a translation.
index_t periodic_vertex_real(index_t pv) const
Gets the real vertex from a periodic vertex.
index_t nb_vertices_non_periodic_
Number of real vertices.
signed_index_t periodic_vertex_real(signed_index_t pv) const
Gets the real vertex from a periodic vertex.
void periodic_vertex_set_T(index_t &pv, int Tx, int Ty, int Tz) const
Sets the translation in a periodic vertex.
Common include file, providing basic definitions. Should be included before anything else by all head...
Global Vorpaline namespace.
geo_signed_index_t signed_index_t
The type for storing and manipulating indices differences.
geo_index_t index_t
The type for storing and manipulating indices.
Functions for string manipulation.