Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
GEO::Periodic Class Reference

Utilities for managing 3D periodic space. More...

#include <geogram/delaunay/periodic.h>

Inheritance diagram for GEO::Periodic:
GEO::PeriodicDelaunay3d

Public Member Functions

index_t periodic_vertex_instance (index_t pv) const
 Gets the instance from a periodic vertex. More...
 
index_t periodic_vertex_real (index_t pv) const
 Gets the real vertex from a periodic vertex. More...
 
signed_index_t periodic_vertex_real (signed_index_t pv) const
 Gets the real vertex from a periodic vertex. More...
 
index_t make_periodic_vertex (index_t real, index_t instance) const
 Makes a periodic vertex from a real vertex and instance. More...
 
void periodic_vertex_get_T (index_t pv, int &Tx, int &Ty, int &Tz) const
 Gets the translation from a periodic vertex. More...
 
void periodic_vertex_set_T (index_t &pv, int Tx, int Ty, int Tz) const
 Sets the translation in a periodic vertex. More...
 
std::string periodic_vertex_to_string (index_t v) const
 
std::string binary_to_string (Numeric::uint32 m) const
 

Static Public Member Functions

static index_t T_to_instance (int Tx, int Ty, int Tz)
 Gets the instance from a translation. More...
 

Public Attributes

index_t nb_vertices_non_periodic_
 Number of real vertices.
 

Static Public Attributes

static int translation [27][3]
 Gives for each instance the integer translation coordinates in {-1,0,1}. More...
 
static int reorder_instances [27]
 Used to back-map an integer translation to an instance. More...
 
static bool instance_is_positive [27]
 Tests whether all the coordinates of the translation vector associated with an instance are 0 or 1.
 

Detailed Description

Utilities for managing 3D periodic space.

Definition at line 57 of file periodic.h.

Member Function Documentation

◆ make_periodic_vertex()

index_t GEO::Periodic::make_periodic_vertex ( index_t  real,
index_t  instance 
) const
inline

Makes a periodic vertex from a real vertex and instance.

Parameters
[in]realthe real vertex, in 0..nb_vertices_non_periodic_-1
[in]instancethe instance, in 0..26

Definition at line 95 of file periodic.h.

◆ periodic_vertex_get_T()

void GEO::Periodic::periodic_vertex_get_T ( index_t  pv,
int &  Tx,
int &  Ty,
int &  Tz 
) const
inline

Gets the translation from a periodic vertex.

Parameters
[in]pvthe periodic vertex
[out]Tx,Ty,Tzthe translation coordinates, in {-1, 0, 1}

Definition at line 120 of file periodic.h.

◆ periodic_vertex_instance()

index_t GEO::Periodic::periodic_vertex_instance ( index_t  pv) const
inline

Gets the instance from a periodic vertex.

Returns
the instance in 0..26

Definition at line 64 of file periodic.h.

◆ periodic_vertex_real() [1/2]

index_t GEO::Periodic::periodic_vertex_real ( index_t  pv) const
inline

Gets the real vertex from a periodic vertex.

Returns
the real vertex, in 0..nb_vertices_non_periodic_-1

Definition at line 73 of file periodic.h.

◆ periodic_vertex_real() [2/2]

signed_index_t GEO::Periodic::periodic_vertex_real ( signed_index_t  pv) const
inline

Gets the real vertex from a periodic vertex.

Returns
the real vertex, in 0..nb_vertices_non_periodic_-1

Definition at line 82 of file periodic.h.

◆ periodic_vertex_set_T()

void GEO::Periodic::periodic_vertex_set_T ( index_t pv,
int  Tx,
int  Ty,
int  Tz 
) const
inline

Sets the translation in a periodic vertex.

Parameters
[in,out]pvthe periodic vertex
[in]Tx,Ty,Tzthe translation coordinates, in {-1, 0, 1}

Definition at line 133 of file periodic.h.

◆ T_to_instance()

static index_t GEO::Periodic::T_to_instance ( int  Tx,
int  Ty,
int  Tz 
)
inlinestatic

Gets the instance from a translation.

Parameters
[in]Tx,Ty,Tzthe translation coordinates, in {-1, 0, 1}
Returns
the instance, in 0..26

Definition at line 106 of file periodic.h.

Member Data Documentation

◆ reorder_instances

int GEO::Periodic::reorder_instances[27]
static

Used to back-map an integer translation to an instance.

This maps (Tx+1) + 3*(Ty+1) + 9*(Tz+1) to the associated instance id. This indirection is required because we wanted instance 0 to correspond to the 0 translation (rather than (-1,-1,-1) that would require no indirection).

Definition at line 171 of file periodic.h.

◆ translation

int GEO::Periodic::translation[27][3]
static

Gives for each instance the integer translation coordinates in {-1,0,1}.

The zero translation is the first one (instance 0).

Definition at line 162 of file periodic.h.


The documentation for this class was generated from the following file: