Public Member Functions | Friends | List of all members
tuw::Point2D Class Reference

#include <point2d.h>

Inheritance diagram for tuw::Point2D:
Inheritance graph
[legend]

Public Member Functions

double angle () const
 
const cv::Point_< double > & cv () const
 
cv::Point_< double > & cv ()
 
double distanceTo (const Point2D &p) const
 
bool equal (const Point2D &o, double tolerance=0.0001) const
 
double get_h () const
 
double get_x () const
 
double get_y () const
 
const double & h () const
 
double & h ()
 
bool inside (double x0, double y0, double x1, double y1) const
 
 Point2D ()
 
 Point2D (const Point2D &p)
 
 Point2D (const cv::Point &p)
 
 Point2D (double x, double y)
 
 Point2D (double x, double y, double h)
 
 Point2D (const Polar2D &p)
 
template<typename T >
 Point2D (const cv::Vec< T, 3 > &p)
 
template<typename T >
 Point2D (const cv::Vec< T, 2 > &p)
 
template<typename T >
 Point2D (const cv::Point_< T > &p)
 
double radius () const
 
Point2Dset (double x, double y)
 
Point2Dset (double x, double y, double h)
 
void set_h (double v)
 
void set_x (double v)
 
void set_y (double v)
 
std::string str (const char *format="[%6.4lf, %6.4lf, %6.5lf]") const
 
cv::Vec< double, 2 > vector () const
 
const double & x () const
 
double & x ()
 
const double & y () const
 
double & y ()
 

Friends

std::ostream & operator<< (std::ostream &os, const Point2D &o)
 

Detailed Description

class to represent a point using homogeneous coordinates [x, y, 1]

Definition at line 19 of file point2d.h.

Constructor & Destructor Documentation

Point2D::Point2D ( )

constructor

Definition at line 5 of file point2d.cpp.

Point2D::Point2D ( const Point2D p)

copy constructor

Parameters
psource

Definition at line 6 of file point2d.cpp.

Point2D::Point2D ( const cv::Point &  p)

constructor

Parameters
psource

Definition at line 7 of file point2d.cpp.

Point2D::Point2D ( double  x,
double  y 
)

constructor

Parameters
x
y

Definition at line 8 of file point2d.cpp.

Point2D::Point2D ( double  x,
double  y,
double  h 
)

constructor

Parameters
x
y
h

Definition at line 9 of file point2d.cpp.

Point2D::Point2D ( const Polar2D p)

constructor

Parameters
p

Definition at line 10 of file point2d.cpp.

template<typename T >
tuw::Point2D::Point2D ( const cv::Vec< T, 3 > &  p)
inline

Definition at line 53 of file point2d.h.

template<typename T >
tuw::Point2D::Point2D ( const cv::Vec< T, 2 > &  p)
inline

Definition at line 54 of file point2d.h.

template<typename T >
tuw::Point2D::Point2D ( const cv::Point_< T > &  p)
inline

Definition at line 55 of file point2d.h.

Member Function Documentation

double Point2D::angle ( ) const

angle form origin to point (alpha in polar space)

See also
radius
Polar2D
Returns
angle between -PI and +PI

Definition at line 151 of file point2d.cpp.

const cv::Point_< double > & Point2D::cv ( ) const

returns a cv::Point_<double> reference

Returns
cv

Definition at line 135 of file point2d.cpp.

cv::Point_< double > & Point2D::cv ( )

returns a cv::Point_<double> reference

Returns
cv

Definition at line 142 of file point2d.cpp.

double Point2D::distanceTo ( const Point2D p) const

returns the distance to an other point

Returns
disance

Definition at line 127 of file point2d.cpp.

bool Point2D::equal ( const Point2D o,
double  tolerance = 0.0001 
) const

compares with within tolerance

Parameters
o
tolerance

Definition at line 192 of file point2d.cpp.

double Point2D::get_h ( ) const

get function for h

Returns
h component

Definition at line 113 of file point2d.cpp.

double Point2D::get_x ( ) const

get function for x

Returns
x component

Definition at line 85 of file point2d.cpp.

double Point2D::get_y ( ) const

get function for y

Returns
y component

Definition at line 99 of file point2d.cpp.

const double & Point2D::h ( ) const

homogeneous component

Returns
rotation

Definition at line 63 of file point2d.cpp.

double & Point2D::h ( )

homogeneous component

Returns
rotation

Definition at line 70 of file point2d.cpp.

bool Point2D::inside ( double  x0,
double  y0,
double  x1,
double  y1 
) const

checks if a point is within a rectangle

Parameters
x0top left x
y0top left y
x1bottom right x
y1bottom right y
Returns
true if inside

Definition at line 171 of file point2d.cpp.

double Point2D::radius ( ) const

distance to origin (rho in polar space)

See also
angle
Polar2D
Returns
distance

Definition at line 160 of file point2d.cpp.

Point2D & Point2D::set ( double  x,
double  y 
)

sets values

Parameters
x
y
Returns
this reference

Definition at line 17 of file point2d.cpp.

Point2D & Point2D::set ( double  x,
double  y,
double  h 
)

sets values

Parameters
x
y
Returns
this reference

Definition at line 27 of file point2d.cpp.

void Point2D::set_h ( double  v)

set funktion for h

Parameters
hcomponent

Definition at line 106 of file point2d.cpp.

void Point2D::set_x ( double  v)

set funktion for x

Parameters
xcomponent

Definition at line 78 of file point2d.cpp.

void Point2D::set_y ( double  v)

set funktion for y

Parameters
ycomponent

Definition at line 92 of file point2d.cpp.

std::string Point2D::str ( const char *  format = "[%6.4lf, %6.4lf, %6.5lf]") const

returns x and y as formated string

Parameters
formatusing printf format
Returns
string

Definition at line 180 of file point2d.cpp.

cv::Vec< double, 2 > Point2D::vector ( ) const

vector without homogeneous component

Returns
state vector

Definition at line 120 of file point2d.cpp.

const double & Point2D::x ( ) const

translational x component

Returns
x component

translational x component

Returns
rotation

Definition at line 35 of file point2d.cpp.

double & Point2D::x ( )

translational x component

Returns
x component

translational x component

Returns
rotation

Definition at line 42 of file point2d.cpp.

const double & Point2D::y ( ) const

translational y component

Returns
y component

Definition at line 49 of file point2d.cpp.

double & Point2D::y ( )

translational y component

Returns
y component

Definition at line 56 of file point2d.cpp.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Point2D o 
)
friend

Stream extraction

Parameters
osoutputstream
oobject
Returns
stream

Definition at line 180 of file point2d.h.


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


tuw_geometry
Author(s): Markus Bader
autogenerated on Mon Jun 10 2019 15:33:09