40 #ifndef GEOGRAM_DELAUNAY_PERIODIC
41 #define GEOGRAM_DELAUNAY_PERIODIC
69 return nb_vertices_non_periodic_;
78 return pv / nb_vertices_non_periodic_;
87 return pv % nb_vertices_non_periodic_;
110 return real + nb_vertices_non_periodic_*instance;
122 int i = (Tz+1) + 3*(Ty+1) + 9*(Tx+1);
124 return index_t(reorder_instances[i]);
134 index_t instance = periodic_vertex_instance(pv);
135 Tx = translation[instance][0];
136 Ty = translation[instance][1];
137 Tz = translation[instance][2];
150 pv = make_periodic_vertex(
151 periodic_vertex_real(pv), T_to_instance(Tx, Ty, Tz)
155 std::string periodic_vertex_to_string(
index_t v)
const {
157 String::to_string(periodic_vertex_real(v)) +
":" +
158 String::to_string(periodic_vertex_instance(v)) ;
162 std::string s(32,
' ');
164 s[i] = ((m & (1u << (31u-i))) != 0) ?
'1' :
'0';
174 static int translation[27][3];
183 static int reorder_instances[27];
189 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 nb_vertices_non_periodic() const
Gets the number of non-periodic vertices.
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.