Jameo Core Library
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
jm::Point Class Reference

Defines a point. This point is used for 2D-Coordinates. More...

Public Member Functions

 Point ()
 Constructor. Creates point <0,0>.
 
 Point (double x, double y)
 Constructor. Creates point <x,y>.
 
 Point (const Vertex2 &v)
 
double x () const
 Returns the x-component of the point.
 
double y () const
 Returns the y-component of the point.
 
double & rX ()
 Returns reference to the x-component.
 
double & rY ()
 Returns reference to the y-component.
 
void setX (double x)
 
void setY (double y)
 
Point cWiseMin (const Point &other) const
 Returns the component-wise minimum of this point and the other point.
 
Point cWiseMax (const Point &other) const
 Returns the component-wise maximum of this point and the other point.
 
jm::Vertex2 toVertex2 () const
 
Pointoperator+= (const Point &another)
 
Pointoperator-= (const Point &another)
 

Friends

DllExport friend Point operator+ (const Point &v1, const Point &v2)
 
DllExport friend Point operator- (const Point &v1, const Point &v2)
 
DllExport friend Point operator* (const double &d, const Point &p)
 
DllExport friend Point operator* (const Point &p, const double &d)
 

Detailed Description

Defines a point. This point is used for 2D-Coordinates.

In opposite to Vertex2 this class has no vector operations. It is only used for 2D-Coordinates. Typically used in combination with Rect.

Constructor & Destructor Documentation

◆ Point() [1/3]

jm::Point::Point ( )

Constructor. Creates point <0,0>.

◆ Point() [2/3]

jm::Point::Point ( double  x,
double  y 
)

Constructor. Creates point <x,y>.

Parameters
xX-Component of the point.
yY-Component of the point.

◆ Point() [3/3]

jm::Point::Point ( const Vertex2 v)
explicit

Member Function Documentation

◆ cWiseMax()

Point jm::Point::cWiseMax ( const Point other) const

Returns the component-wise maximum of this point and the other point.

Parameters
otherThe other point.

◆ cWiseMin()

Point jm::Point::cWiseMin ( const Point other) const

Returns the component-wise minimum of this point and the other point.

Parameters
otherThe other point.

◆ operator+=()

Point & jm::Point::operator+= ( const Point another)

◆ operator-=()

Point & jm::Point::operator-= ( const Point another)

◆ rX()

double & jm::Point::rX ( )

Returns reference to the x-component.

◆ rY()

double & jm::Point::rY ( )

Returns reference to the y-component.

◆ setX()

void jm::Point::setX ( double  x)

◆ setY()

void jm::Point::setY ( double  y)

◆ toVertex2()

jm::Vertex2 jm::Point::toVertex2 ( ) const

◆ x()

double jm::Point::x ( ) const

Returns the x-component of the point.

◆ y()

double jm::Point::y ( ) const

Returns the y-component of the point.

Friends And Related Symbol Documentation

◆ operator* [1/2]

DllExport friend Point operator* ( const double &  d,
const Point p 
)
friend

◆ operator* [2/2]

DllExport friend Point operator* ( const Point p,
const double &  d 
)
friend

◆ operator+

DllExport friend Point operator+ ( const Point v1,
const Point v2 
)
friend

◆ operator-

DllExport friend Point operator- ( const Point v1,
const Point v2 
)
friend