Geogram Version 1.10.2
A programming library of geometric algorithms
Loading...
Searching...
No Matches
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 nb_vertices_non_periodic () const
 Gets the number of non-periodic vertices.
index_t periodic_vertex_instance (index_t pv) const
 Gets the instance from a periodic vertex.
index_t periodic_vertex_real (index_t pv) const
 Gets the real vertex 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.
void periodic_vertex_get_T (index_t pv, int &Tx, int &Ty, int &Tz) const
 Gets the translation 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.
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.

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}.
static int reorder_instances [27]
 Used to back-map an integer translation to an instance.
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

◆ binary_to_string()

std::string GEO::Periodic::binary_to_string ( Numeric::uint32 m) const
inline

Definition at line 149 of file periodic.h.

◆ 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.

◆ nb_vertices_non_periodic()

index_t GEO::Periodic::nb_vertices_non_periodic ( ) const
inline

Gets the number of non-periodic vertices.

in periodic mode, nb_vertices() returns the total number of vertices, real ones and periodic instances. This function gets the number of real vertices.

Returns
the number of non-periodic vertices

Definition at line 68 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 76 of file periodic.h.

◆ periodic_vertex_real()

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 85 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.

◆ periodic_vertex_to_string()

std::string GEO::Periodic::periodic_vertex_to_string ( index_t v) const
inline

Definition at line 143 of file periodic.h.

◆ T_to_instance()

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

◆ instance_is_positive

bool GEO::Periodic::instance_is_positive[27]
static

Tests whether all the coordinates of the translation vector associated with an instance are 0 or 1.

Definition at line 177 of file periodic.h.

◆ nb_vertices_non_periodic_

index_t GEO::Periodic::nb_vertices_non_periodic_

Number of real vertices.

Definition at line 182 of file periodic.h.

◆ 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: