xtd - Reference Guide 0.2.0
xtd::drawing::point_f Class Reference

#include <point_f.h>

Definition

Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimensional plane.

class drawing_export_ point_f : public xtd::object
Inheritance
xtd::objectxtd::drawing::point_f
Namespace
xtd::drawing
Library
xtd.drawing

Fields

static const point_f empty
 Represents a xtd::drawing::point_f that has xtd::drawing::point_f::x and xtd::drawing::point_f::y values set to zero. More...
 

Constructors

 point_f () noexcept=default
 Initializes a new instance of the xtd::drawing::point_f class. More...
 
 point_f (float x, float y) noexcept
 Initializes a new instance of the xtd::drawing::point_f class with the specified coordinates. More...
 
 point_f (const size_f &sz) noexcept
 Initializes a new instance of the xtd::drawing::point_t class from a xtd::drawing::size_f. More...
 

Properties

bool is_empty () const noexcept
 Gets a value indicating whether this xtd::drawing::point_f is empty. More...
 
float x () const noexcept
 Gets the x-coordinate of this xtd::drawing::point_f. More...
 
void x (float x) noexcept
 Sets the x-coordinate of this xtd::drawing::point_f. More...
 
float y () const noexcept
 Gets the y-coordinate of this xtd::drawing::point_f. More...
 
void y (float y) noexcept
 Sets the y-coordinate of this xtd::drawing::point_f. More...
 

Methods

void offset (float dx, float dy) noexcept
 Translates this xtd::drawing::point_f by the specified amount. More...
 
void offset (const point_f &pt) noexcept
 Translates this xtd::drawing::point_f by the specified xtd::drawing::point_f. More...
 
xtd::ustring to_string () const noexcept override
 Converts this point to a human-readable string. More...
 
static point_f add (const point_f &pt, const size &sz) noexcept
 Adds the specified xtd::drawing::size to the specified xtd::drawing::point_f. More...
 
static point_f add (const point_f &pt, const size_f &sz) noexcept
 Adds the specified xtd::drawing::size_f to the specified xtd::drawing::point_f. More...
 
static point_f add (const point_f &pt1, const point &pt2) noexcept
 Adds the specified xtd::drawing::point to the specified xtd::drawing::point_f. More...
 
static point_f add (const point_f &pt1, const point_f &pt2) noexcept
 Adds the specified xtd::drawing::point_f to the specified xtd::drawing::point_f. More...
 
static point_f subtract (const point_f &pt, const size &sz) noexcept
 Returns the result of subtracting specified xtd::drawing::size from the specified xtd::drawing::point_f. More...
 
static point_f subtract (const point_f &pt, const size_f &sz) noexcept
 Returns the result of subtracting specified xtd::drawing::size_f from the specified xtd::drawing::point_f. More...
 
static point_f subtract (const point_f &pt1, const point &pt2) noexcept
 Returns the result of subtracting specified xtd::drawing::point from the specified xtd::drawing::point. More...
 
static point_f subtract (const point_f &pt1, const point_f &pt2) noexcept
 Returns the result of subtracting specified xtd::drawing::point from the specified xtd::drawing::point. More...
 

Operators

point_f operator+ (const size &sz) const noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::size. More...
 
point_f operator+ (const size_f &sz) const noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::size_f. More...
 
point_f operator+ (const point &pt) const noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::point. More...
 
point_f operator+ (const point_f &pt) const noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::point_f. More...
 
point_foperator+= (const size &sz) noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::size. More...
 
point_foperator+= (const size_f &sz) noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::size_f. More...
 
point_foperator+= (const point &pt) noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::point. More...
 
point_foperator+= (const point_f &pt) noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::point_f. More...
 
point_f operator- (const size &sz) const noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size. More...
 
point_f operator- (const size_f &sz) const noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size_f. More...
 
point_f operator- (const point &pt) const noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::point. More...
 
point_f operator- (const point_f &pt) const noexcept
 Translates a xtd::drawing::point by the negative of a given xtd::drawing::point. More...
 
point_foperator-= (const size &sz) noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size. More...
 
point_foperator-= (const size_f &sz) noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size_f. More...
 
point_foperator-= (const point &pt) noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::point. More...
 
point_foperator-= (const point_f &pt) noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::point_f. More...
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance. More...
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Constructor & Destructor Documentation

◆ point_f() [1/3]

xtd::drawing::point_f::point_f ( )
defaultnoexcept

Initializes a new instance of the xtd::drawing::point_f class.

Remarks
xtd::drawing::point::x and xtd::drawing::point::y values are set to zero.

◆ point_f() [2/3]

xtd::drawing::point_f::point_f ( float  x,
float  y 
)
noexcept

Initializes a new instance of the xtd::drawing::point_f class with the specified coordinates.

Parameters
xThe horizontal position of the point.
yThe vertical position of the point.

◆ point_f() [3/3]

xtd::drawing::point_f::point_f ( const size_f sz)
explicitnoexcept

Initializes a new instance of the xtd::drawing::point_t class from a xtd::drawing::size_f.

Parameters
szA size that specifies the coordinates for the new point.

Member Function Documentation

◆ add() [1/4]

static point_f xtd::drawing::point_f::add ( const point_f pt,
const size sz 
)
staticnoexcept

Adds the specified xtd::drawing::size to the specified xtd::drawing::point_f.

Parameters
ptThe xtd::drawing::point_f to add.
szThe xtd::drawing::size to add.
Returns
The xtd::drawing::point_f that is the result of the addition operation.
Remarks
The xtd::drawing::point::add adds the xtd::drawing::size::width and xtd::drawing::size::height of the specified size to the xtd::drawing::point_f::x and xtd::drawing::point_f::y values of the specified xtd::drawing::point_f.

◆ add() [2/4]

static point_f xtd::drawing::point_f::add ( const point_f pt,
const size_f sz 
)
staticnoexcept

Adds the specified xtd::drawing::size_f to the specified xtd::drawing::point_f.

Parameters
ptThe xtd::drawing::point_f to add.
szThe xtd::drawing::size_f to add.
Returns
The xtd::drawing::point_f that is the result of the addition operation.
Remarks
The xtd::drawing::point::add adds the xtd::drawing::size_f::width and xtd::drawing::size_f::height of the specified size to the xtd::drawing::point_f::x and xtd::drawing::point_f::y values of the specified xtd::drawing::point_f.

◆ add() [3/4]

static point_f xtd::drawing::point_f::add ( const point_f pt1,
const point pt2 
)
staticnoexcept

Adds the specified xtd::drawing::point to the specified xtd::drawing::point_f.

Parameters
pt1The xtd::drawing::point_f to add.
pt2The xtd::drawing::point to add.
Returns
The xtd::drawing::point_f that is the result of the addition operation.

◆ add() [4/4]

static point_f xtd::drawing::point_f::add ( const point_f pt1,
const point_f pt2 
)
staticnoexcept

Adds the specified xtd::drawing::point_f to the specified xtd::drawing::point_f.

Parameters
pt1The xtd::drawing::point_f to add.
pt2The xtd::drawing::point_f to add.
Returns
The xtd::drawing::point_f that is the result of the addition operation.

◆ is_empty()

bool xtd::drawing::point_f::is_empty ( ) const
noexcept

Gets a value indicating whether this xtd::drawing::point_f is empty.

Returns
true if both xtd::drawing::point_f::x and xtd::drawing::point_f::y are 0; otherwise, false.

◆ offset() [1/2]

void xtd::drawing::point_f::offset ( float  dx,
float  dy 
)
noexcept

Translates this xtd::drawing::point_f by the specified amount.

Parameters
dxThe amount to offset the x-coordinate.
dyThe amount to offset the y-coordinate.

◆ offset() [2/2]

void xtd::drawing::point_f::offset ( const point_f pt)
noexcept

Translates this xtd::drawing::point_f by the specified xtd::drawing::point_f.

Parameters
pThe xtd::drawing::point used offset this xtd::drawing::point_f.
Remarks
This method adjusts the xtd::drawing::point_f::x and xtd::drawing::point_f::y values of this xtd::drawing::point_f to the sum of the xtd::drawing::point_f::x and xtd::drawing::point_f::y values of this xtd::drawing::point_f and p.

◆ operator+() [1/4]

point_f xtd::drawing::point_f::operator+ ( const size sz) const
noexcept

Translates a xtd::drawing::point_f by a given xtd::drawing::size.

Parameters
szA xtd::drawing::size that specifies the pair of numbers to add to the coordinates of this xtd::drawing::point_f.
Returns
The translated xtd::drawing::point_f.

◆ operator+() [2/4]

point_f xtd::drawing::point_f::operator+ ( const size_f sz) const
noexcept

Translates a xtd::drawing::point_f by a given xtd::drawing::size_f.

Parameters
szA xtd::drawing::size_f that specifies the pair of numbers to add to the coordinates of this xtd::drawing::point_f.
Returns
The translated xtd::drawing::point_f.

◆ operator+() [3/4]

point_f xtd::drawing::point_f::operator+ ( const point pt) const
noexcept

Translates a xtd::drawing::point_f by a given xtd::drawing::point.

Parameters
ptA xtd::drawing::point that specifies the pair of numbers to add to the coordinates of this xtd::drawing::point_f.
Returns
The translated xtd::drawing::point_f.

◆ operator+() [4/4]

point_f xtd::drawing::point_f::operator+ ( const point_f pt) const
noexcept

Translates a xtd::drawing::point_f by a given xtd::drawing::point_f.

Parameters
ptA xtd::drawing::size that specifies the pair of numbers to add to the coordinates of this xtd::drawing::point_f.
Returns
The translated xtd::drawing::point_f.

◆ operator+=() [1/4]

point_f& xtd::drawing::point_f::operator+= ( const size sz)
noexcept

Translates a xtd::drawing::point_f by a given xtd::drawing::size.

Parameters
szA xtd::drawing::size that specifies the pair of numbers to add to the coordinates of this xtd::drawing::point_f.
Returns
The translated xtd::drawing::point_f.

◆ operator+=() [2/4]

point_f& xtd::drawing::point_f::operator+= ( const size_f sz)
noexcept

Translates a xtd::drawing::point_f by a given xtd::drawing::size_f.

Parameters
szA xtd::drawing::size_f that specifies the pair of numbers to add to the coordinates of this xtd::drawing::point_f.
Returns
The translated xtd::drawing::point_f.

◆ operator+=() [3/4]

point_f& xtd::drawing::point_f::operator+= ( const point pt)
noexcept

Translates a xtd::drawing::point_f by a given xtd::drawing::point.

Parameters
ptA xtd::drawing::point that specifies the pair of numbers to add to the coordinates of this xtd::drawing::point_f.
Returns
The translated xtd::drawing::point_f.

◆ operator+=() [4/4]

point_f& xtd::drawing::point_f::operator+= ( const point_f pt)
noexcept

Translates a xtd::drawing::point_f by a given xtd::drawing::point_f.

Parameters
ptA xtd::drawing::point_f that specifies the pair of numbers to add to the coordinates of this xtd::drawing::point_f.
Returns
The translated xtd::drawing::point_f.

◆ operator-() [1/4]

point_f xtd::drawing::point_f::operator- ( const size sz) const
noexcept

Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size.

Parameters
szA xtd::drawing::size that specifies the pair of numbers to subtract from the coordinates of this xtd::drawing::point_f.
Returns
A xtd::drawing::point_f structure that is translated by the negative of a given xtd::drawing::size structure.

◆ operator-() [2/4]

point_f xtd::drawing::point_f::operator- ( const size_f sz) const
noexcept

Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size_f.

Parameters
szA xtd::drawing::size_f that specifies the pair of numbers to subtract from the coordinates of this xtd::drawing::point_f.
Returns
A xtd::drawing::point_f structure that is translated by the negative of a given xtd::drawing::size_f structure.

◆ operator-() [3/4]

point_f xtd::drawing::point_f::operator- ( const point pt) const
noexcept

Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::point.

Parameters
ptA xtd::drawing::point that specifies the pair of numbers to subtract from the coordinates of this xtd::drawing::point.
Returns
A xtd::drawing::point_f structure that is translated by the negative of a given xtd::drawing::point structure.

◆ operator-() [4/4]

point_f xtd::drawing::point_f::operator- ( const point_f pt) const
noexcept

Translates a xtd::drawing::point by the negative of a given xtd::drawing::point.

Parameters
ptA xtd::drawing::point that specifies the pair of numbers to subtract from the coordinates of this xtd::drawing::point.
Returns
A xtd::drawing::point structure that is translated by the negative of a given xtd::drawing::point structure.

◆ operator-=() [1/4]

point_f& xtd::drawing::point_f::operator-= ( const size sz)
noexcept

Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size.

Parameters
szA xtd::drawing::size that specifies the pair of numbers to subtract from the coordinates of this xtd::drawing::point_f.
Returns
A xtd::drawing::point_f structure that is translated by the negative of a given xtd::drawing::size structure.

◆ operator-=() [2/4]

point_f& xtd::drawing::point_f::operator-= ( const size_f sz)
noexcept

Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size_f.

Parameters
szA xtd::drawing::size_f that specifies the pair of numbers to subtract from the coordinates of this xtd::drawing::point_f.
Returns
A xtd::drawing::point_f structure that is translated by the negative of a given xtd::drawing::size_f structure.

◆ operator-=() [3/4]

point_f& xtd::drawing::point_f::operator-= ( const point pt)
noexcept

Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::point.

Parameters
ptA xtd::drawing::point that specifies the pair of numbers to subtract from the coordinates of this xtd::drawing::point_f.
Returns
The translated xtd::drawing::point_f.

◆ operator-=() [4/4]

point_f& xtd::drawing::point_f::operator-= ( const point_f pt)
noexcept

Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::point_f.

Parameters
ptA xtd::drawing::point_f that specifies the pair of numbers to subtract from the coordinates of this xtd::drawing::point_f.
Returns
The translated xtd::drawing::point_f.

◆ subtract() [1/4]

static point_f xtd::drawing::point_f::subtract ( const point_f pt,
const size sz 
)
staticnoexcept

Returns the result of subtracting specified xtd::drawing::size from the specified xtd::drawing::point_f.

Parameters
ptThe xtd::drawing::point_f to be subtracted from.
szThe xtd::drawing::size to subtract from the xtd::drawing::point.
Returns
The xtd::drawing::point_f that is the result of the subtraction operation.
Remarks
The xtd::drawing::point_f::subtract subtracts the xtd::drawing::size::width and xtd::drawing::size::height of the specified xtd::drawing::size from the xtd::drawing::point_f::x and xtd::drawing::point_f::y values of the specified xtd::drawing::point_f.

◆ subtract() [2/4]

static point_f xtd::drawing::point_f::subtract ( const point_f pt,
const size_f sz 
)
staticnoexcept

Returns the result of subtracting specified xtd::drawing::size_f from the specified xtd::drawing::point_f.

Parameters
ptThe xtd::drawing::point_f to be subtracted from.
szThe xtd::drawing::size_f to subtract from the xtd::drawing::point.
Returns
The xtd::drawing::point_f that is the result of the subtraction operation.
Remarks
The xtd::drawing::point_f::subtract subtracts the xtd::drawing::size_f::width and xtd::drawing::size_F::height of the specified xtd::drawing::size_f from the xtd::drawing::point_f::x and xtd::drawing::point_f::y values of the specified xtd::drawing::poin_ft.

◆ subtract() [3/4]

static point_f xtd::drawing::point_f::subtract ( const point_f pt1,
const point pt2 
)
staticnoexcept

Returns the result of subtracting specified xtd::drawing::point from the specified xtd::drawing::point.

Parameters
pt1The xtd::drawing::point_f to be subtracted from.
pt2The xtd::drawing::point to subtract from the xtd::drawing::point_f.
Returns
The xtd::drawing::point_f that is the result of the subtraction operation.

◆ subtract() [4/4]

static point_f xtd::drawing::point_f::subtract ( const point_f pt1,
const point_f pt2 
)
staticnoexcept

Returns the result of subtracting specified xtd::drawing::point from the specified xtd::drawing::point.

Parameters
pt1The xtd::drawing::point_f to be subtracted from.
pt2The xtd::drawing::point_f to subtract from the xtd::drawing::point_f.
Returns
The xtd::drawing::point_f that is the result of the subtraction operation.

◆ to_string()

xtd::ustring xtd::drawing::point_f::to_string ( ) const
overridevirtualnoexcept

Converts this point to a human-readable string.

Returns
An xtd::ustring that represents this xtd::drawing::point.

Reimplemented from xtd::object.

◆ x() [1/2]

float xtd::drawing::point_f::x ( ) const
noexcept

Gets the x-coordinate of this xtd::drawing::point_f.

Returns
The x-coordinate of this xtd::drawing::point_f.

◆ x() [2/2]

void xtd::drawing::point_f::x ( float  x)
noexcept

Sets the x-coordinate of this xtd::drawing::point_f.

Parameters
xThe x-coordinate of this xtd::drawing::point_f.

◆ y() [1/2]

float xtd::drawing::point_f::y ( ) const
noexcept

Gets the y-coordinate of this xtd::drawing::point_f.

Returns
The y-coordinate of this xtd::drawing::point_f.

◆ y() [2/2]

void xtd::drawing::point_f::y ( float  y)
noexcept

Sets the y-coordinate of this xtd::drawing::point_f.

Parameters
yThe x-coordinate of this xtd::drawing::point_f.

Member Data Documentation

◆ empty

const point_f xtd::drawing::point_f::empty
static

Represents a xtd::drawing::point_f that has xtd::drawing::point_f::x and xtd::drawing::point_f::y values set to zero.


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