CGAL 5.1 - 2D Periodic Triangulations
Periodic_2Offset_2 Class Reference

#include <Concepts/Periodic_2Offset_2.h>

Definition

The concept Periodic_2Offset_2 describes a two-/dimensional integer vector with some specialized access functions and operations.

Has Models:
CGAL::Periodic_2_offset_2
See also
Periodic_2TriangulationTraits_2
Periodic_2DelaunayTriangulationTraits_2

Related Functions

(Note that these are not member functions.)

istream & operator>> (istream &is, Periodic_2Offset_2 &off)
 Inputs an offset from is. More...
 
ostream & operator<< (ostream &os, Periodic_2Offset_2 &off) const
 Outputs an offset from os. More...
 

Creation

 Periodic_2Offset_2 ()
 Default constructor. More...
 
 Periodic_2Offset_2 (int x, int y)
 Constructs the offset (x,y). More...
 

Operations

Periodic_2Offset_2 operator+ (const Periodic_2Offset_2 &o) const
 Return the vector sum of this and o. More...
 
Periodic_2Offset_2 operator- (const Periodic_2Offset_2 &o) const
 Return the vector difference of this and o. More...
 
Periodic_2Offset_2 operator- () const
 Return the negative vector of this. More...
 
void operator+= (const Periodic_2Offset_2 &o) const
 Add o to this using vector addition. More...
 
void operator-= (const Periodic_2Offset_2 &o) const
 Subtract o from this using vector subtraction. More...
 
bool operator== (const Periodic_2Offset_2 &o) const
 Return true if o and this represent the same vector. More...
 
bool operator!= (const Periodic_2Offset_2 &o) const
 Return true if o and this do not represent the same vector. More...
 
bool operator< (const Periodic_2Offset_2 &o) const
 Compare this and o lexicographically. More...
 

Access Functions

int operator[] (int i)
 Return the \( i\)-th entry of this. More...
 
int x () const
 Return the \( x\)-entry of this. More...
 
int y () const
 Return the \( y\)-entry of this. More...
 
bool is_null () const
 Returns true if this is equal to (0,0). More...
 
bool is_zero () const
 Returns true if this is equal to (0,0). More...
 

Constructor & Destructor Documentation

◆ Periodic_2Offset_2() [1/2]

Periodic_2Offset_2::Periodic_2Offset_2 ( )

Default constructor.

◆ Periodic_2Offset_2() [2/2]

Periodic_2Offset_2::Periodic_2Offset_2 ( int  x,
int  y 
)

Constructs the offset (x,y).

Member Function Documentation

◆ is_null()

bool Periodic_2Offset_2::is_null ( ) const

Returns true if this is equal to (0,0).

◆ is_zero()

bool Periodic_2Offset_2::is_zero ( ) const

Returns true if this is equal to (0,0).

◆ operator!=()

bool Periodic_2Offset_2::operator!= ( const Periodic_2Offset_2 o) const

Return true if o and this do not represent the same vector.

◆ operator+()

Periodic_2Offset_2 Periodic_2Offset_2::operator+ ( const Periodic_2Offset_2 o) const

Return the vector sum of this and o.

◆ operator+=()

void Periodic_2Offset_2::operator+= ( const Periodic_2Offset_2 o) const

Add o to this using vector addition.

◆ operator-() [1/2]

Periodic_2Offset_2 Periodic_2Offset_2::operator- ( ) const

Return the negative vector of this.

◆ operator-() [2/2]

Periodic_2Offset_2 Periodic_2Offset_2::operator- ( const Periodic_2Offset_2 o) const

Return the vector difference of this and o.

◆ operator-=()

void Periodic_2Offset_2::operator-= ( const Periodic_2Offset_2 o) const

Subtract o from this using vector subtraction.

◆ operator<()

bool Periodic_2Offset_2::operator< ( const Periodic_2Offset_2 o) const

Compare this and o lexicographically.

◆ operator==()

bool Periodic_2Offset_2::operator== ( const Periodic_2Offset_2 o) const

Return true if o and this represent the same vector.

◆ operator[]()

int Periodic_2Offset_2::operator[] ( int  i)

Return the \( i\)-th entry of this.

Precondition
\( i\in\{0,1\}\)

◆ x()

int Periodic_2Offset_2::x ( ) const

Return the \( x\)-entry of this.

◆ y()

int Periodic_2Offset_2::y ( ) const

Return the \( y\)-entry of this.

Friends And Related Function Documentation

◆ operator<<()

ostream & operator<< ( ostream &  os,
Periodic_2Offset_2 off 
) const
related

Outputs an offset from os.

◆ operator>>()

istream & operator>> ( istream &  is,
Periodic_2Offset_2 off 
)
related

Inputs an offset from is.