PGROUTING  3.2
pgrouting::XY_vertex Class Reference

#include "xy_vertex.h"

Public Member Functions

 XY_vertex ()=default
 
 XY_vertex (const int64_t _id, double _x, double _y)
 
 XY_vertex (const Pgr_edge_xy_t &other, bool is_source)
 
 XY_vertex (const XY_vertex &)=default
 
void cp_members (const XY_vertex &other)
 
bool operator== (const XY_vertex &rhs) const
 
double x () const
 
double y () const
 

Public Attributes

int64_t id
 
Bpoint point
 

Friends

std::ostream & operator<< (std::ostream &log, const XY_vertex &v)
 

Detailed Description

Definition at line 40 of file xy_vertex.h.

Constructor & Destructor Documentation

◆ XY_vertex() [1/4]

pgrouting::XY_vertex::XY_vertex ( )
default

◆ XY_vertex() [2/4]

pgrouting::XY_vertex::XY_vertex ( const XY_vertex )
default

◆ XY_vertex() [3/4]

pgrouting::XY_vertex::XY_vertex ( const int64_t  _id,
double  _x,
double  _y 
)
inline

Definition at line 44 of file xy_vertex.h.

44  :
45  id(_id), point(_x, _y) {
46  }

◆ XY_vertex() [4/4]

pgrouting::XY_vertex::XY_vertex ( const Pgr_edge_xy_t other,
bool  is_source 
)
inline

Definition at line 48 of file xy_vertex.h.

48  :
49  id(is_source? other.source : other.target),
50  point(is_source? Bpoint(other.x1, other.y1) : Bpoint(other.x2, other.y2))
51  {}

Member Function Documentation

◆ cp_members()

void pgrouting::XY_vertex::cp_members ( const XY_vertex other)
inline

Definition at line 57 of file xy_vertex.h.

57  {
58  this->id = other.id;
59  this->point = other.point;
60  }

References id, and point.

◆ operator==()

bool pgrouting::XY_vertex::operator== ( const XY_vertex rhs) const

Definition at line 57 of file xy_vertex.cpp.

57  {
58  if (&rhs == this) return true;
59  return this->id == rhs.id &&
60  almost_equal(point.x(), rhs.point.x(), 2) && almost_equal(point.y(), rhs.point.y(), 2);
61 }

References anonymous_namespace{xy_vertex.cpp}::almost_equal(), id, and point.

◆ x()

double pgrouting::XY_vertex::x ( ) const
inline

Definition at line 54 of file xy_vertex.h.

54 {return point.x();}

References point.

◆ y()

double pgrouting::XY_vertex::y ( ) const
inline

Definition at line 55 of file xy_vertex.h.

55 {return point.y();}

References point.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  log,
const XY_vertex v 
)
friend

Definition at line 51 of file xy_vertex.cpp.

51  {
52  log << v.id << "-" << bg::wkt(v.point);
53  return log;
54 }

Member Data Documentation

◆ id

int64_t pgrouting::XY_vertex::id

Definition at line 66 of file xy_vertex.h.

Referenced by cp_members(), pgrouting::operator<<(), and operator==().

◆ point

Bpoint pgrouting::XY_vertex::point

Definition at line 67 of file xy_vertex.h.

Referenced by cp_members(), pgrouting::operator<<(), operator==(), x(), and y().


The documentation for this class was generated from the following files:
Pgr_edge_xy_t::target
int64_t target
Definition: pgr_edge_xy_t.h:41
pgrouting::XY_vertex::id
int64_t id
Definition: xy_vertex.h:66
pgrouting::Bpoint
bg::model::d2::point_xy< double > Bpoint
Definition: bline.hpp:40
anonymous_namespace{xy_vertex.cpp}::almost_equal
std::enable_if<!std::numeric_limits< T >::is_integer, bool >::type almost_equal(T x, T y, int ulp)
Definition: xy_vertex.cpp:38
Pgr_edge_xy_t::source
int64_t source
Definition: pgr_edge_xy_t.h:40
pgrouting::XY_vertex::point
Bpoint point
Definition: xy_vertex.h:67
Pgr_edge_xy_t::y1
double y1
Definition: pgr_edge_xy_t.h:45
Pgr_edge_xy_t::y2
double y2
Definition: pgr_edge_xy_t.h:47
Pgr_edge_xy_t::x2
double x2
Definition: pgr_edge_xy_t.h:46
Pgr_edge_xy_t::x1
double x1
Definition: pgr_edge_xy_t.h:44