xtd 0.2.0
xtd::drawing::point_f Struct Reference
Inheritance diagram for xtd::drawing::point_f:
xtd::object xtd::iequatable< point_f > xtd::interface xtd::extensions::equality_operators< type_t, equatable_t >

Definition

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

Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:43
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.hpp:35
Inheritance
xtd::objectxtd::drawing::point_f
Namespace
xtd::drawing
Library
xtd.drawing
Examples
animation.cpp.

Public 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.
 

Public Properties

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

Public Constructors

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

Public Methods

bool equals (const xtd::object &obj) const noexcept override
 Determines whether the specified object is equal to the current object.
 
bool equals (const point_f &other) const noexcept override
 Determines whether the specified object is equal to the current object.
 
xtd::size get_hash_code () const noexcept override
 Serves as a hash function for a particular type.
 
void offset (float dx, float dy) noexcept
 Translates this xtd::drawing::point_f by the specified amount.
 
void offset (const point_f &pt) noexcept
 Translates this xtd::drawing::point_f by the specified xtd::drawing::point_f.
 
xtd::string to_string () const noexcept override
 Converts this point to a human-readable string.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 

Operators

point_f operator+ (const size &sz) const noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::size.
 
point_f operator+ (const size_f &sz) const noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::size_f.
 
point_f operator+ (const point &pt) const noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::point.
 
point_f operator+ (const point_f &pt) const noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::point_f.
 
point_foperator+= (const size &sz) noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::size.
 
point_foperator+= (const size_f &sz) noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::size_f.
 
point_foperator+= (const point &pt) noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::point.
 
point_foperator+= (const point_f &pt) noexcept
 Translates a xtd::drawing::point_f by a given xtd::drawing::point_f.
 
point_f operator- (const size &sz) const noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size.
 
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.
 
point_f operator- (const point &pt) const noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::point.
 
point_f operator- (const point_f &pt) const noexcept
 Translates a xtd::drawing::point by the negative of a given xtd::drawing::point.
 
point_foperator-= (const size &sz) noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size.
 
point_foperator-= (const size_f &sz) noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::size_f.
 
point_foperator-= (const point &pt) noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::point.
 
point_foperator-= (const point_f &pt) noexcept
 Translates a xtd::drawing::point_f by the negative of a given xtd::drawing::point_f.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<class object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
- Public Member Functions inherited from xtd::iequatable< point_f >
virtual bool equals (const point_f &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 
- Static Public Member Functions inherited from xtd::object
template<class object_a_t , class object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<class object_a_t , class object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

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

◆ 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.

◆ equals() [1/2]

bool xtd::drawing::point_f::equals ( const xtd::object obj) const
overridevirtualnoexcept

Determines whether the specified object is equal to the current object.

Parameters
objThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.

Reimplemented from xtd::object.

◆ equals() [2/2]

bool xtd::drawing::point_f::equals ( const point_f other) const
overridenoexcept

Determines whether the specified object is equal to the current object.

Parameters
otherThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.

◆ get_hash_code()

xtd::size xtd::drawing::point_f::get_hash_code ( ) const
overridevirtualnoexcept

Serves as a hash function for a particular type.

Returns
A hash code for the current object.

Reimplemented from xtd::object.

◆ 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.

◆ to_string()

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

Converts this point to a human-readable string.

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

Reimplemented from xtd::object.

◆ 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.

◆ 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.

◆ 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.

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.

◆ x

float xtd::drawing::point_f::x

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

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

◆ y

float xtd::drawing::point_f::y

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

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

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