xtd 1.0.0
Loading...
Searching...
No Matches
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< point_f, iequatable< point_f > >

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:45
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
point_f() noexcept=default
Initializes a new instance of the xtd::drawing::point_f class.
Inheritance
xtd::objectxtd::drawing::point_f
Namespace
xtd::drawing
Library
xtd.drawing

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.
auto is_empty () const noexcept -> bool
 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

auto equals (const xtd::object &obj) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
auto equals (const point_f &other) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
auto get_hash_code () const noexcept -> xtd::usize override
 Serves as a hash function for a particular type.
auto offset (float dx, float dy) noexcept -> void
 Translates this xtd::drawing::point_f by the specified amount.
auto offset (const point_f &pt) noexcept -> void
 Translates this xtd::drawing::point_f by the specified xtd::drawing::point_f.
auto to_string () const noexcept -> xtd::string override
 Converts this point to a human-readable string.
static auto add (const point_f &pt, const xtd::drawing::size &sz) noexcept -> point_f
 Adds the specified xtd::drawing::size to the specified xtd::drawing::point_f.
static auto add (const point_f &pt, const xtd::drawing::size_f &sz) noexcept -> point_f
 Adds the specified xtd::drawing::size_f to the specified xtd::drawing::point_f.
static auto add (const point_f &pt1, const xtd::drawing::point &pt2) noexcept -> point_f
 Adds the specified xtd::drawing::point to the specified xtd::drawing::point_f.
static auto add (const point_f &pt1, const point_f &pt2) noexcept -> point_f
 Adds the specified xtd::drawing::point_f to the specified xtd::drawing::point_f.
static auto subtract (const point_f &pt, const xtd::drawing::size &sz) noexcept -> point_f
 Returns the result of subtracting specified xtd::drawing::size from the specified xtd::drawing::point_f.
static auto subtract (const point_f &pt, const xtd::drawing::size_f &sz) noexcept -> point_f
 Returns the result of subtracting specified xtd::drawing::size_f from the specified xtd::drawing::point_f.
static auto subtract (const point_f &pt1, const xtd::drawing::point &pt2) noexcept -> point_f
 Returns the result of subtracting specified xtd::drawing::point from the specified xtd::drawing::point.
static auto subtract (const point_f &pt1, const point_f &pt2) noexcept -> point_f
 Returns the result of subtracting specified xtd::drawing::point from the specified xtd::drawing::point.

Operators

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

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto equals (const point_f &) const noexcept -> bool=0
 Indicates whether the current object is equal to another object of the same type.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 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()

auto xtd::drawing::point_f::is_empty ( ) const -> bool
nodiscardnoexcept

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]

auto xtd::drawing::point_f::equals ( const xtd::object & obj) const -> bool
nodiscardoverridevirtualnoexcept

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]

auto xtd::drawing::point_f::equals ( const point_f & other) const -> bool
nodiscardoverridenoexcept

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()

auto xtd::drawing::point_f::get_hash_code ( ) const -> xtd::usize
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]

auto xtd::drawing::point_f::offset ( float dx,
float dy ) -> void
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]

auto xtd::drawing::point_f::offset ( const point_f & pt) -> void
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()

auto xtd::drawing::point_f::to_string ( ) const -> xtd::string
nodiscardoverridevirtualnoexcept

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]

auto xtd::drawing::point_f::add ( const point_f & pt,
const xtd::drawing::size & sz ) -> point_f
staticnodiscardnoexcept

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]

auto xtd::drawing::point_f::add ( const point_f & pt,
const xtd::drawing::size_f & sz ) -> point_f
staticnodiscardnoexcept

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]

auto xtd::drawing::point_f::add ( const point_f & pt1,
const xtd::drawing::point & pt2 ) -> point_f
staticnodiscardnoexcept

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]

auto xtd::drawing::point_f::add ( const point_f & pt1,
const point_f & pt2 ) -> point_f
staticnodiscardnoexcept

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]

auto xtd::drawing::point_f::subtract ( const point_f & pt,
const xtd::drawing::size & sz ) -> point_f
staticnodiscardnoexcept

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]

auto xtd::drawing::point_f::subtract ( const point_f & pt,
const xtd::drawing::size_f & sz ) -> point_f
staticnodiscardnoexcept

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]

auto xtd::drawing::point_f::subtract ( const point_f & pt1,
const xtd::drawing::point & pt2 ) -> point_f
staticnodiscardnoexcept

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]

auto xtd::drawing::point_f::subtract ( const point_f & pt1,
const point_f & pt2 ) -> point_f
staticnodiscardnoexcept

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]

auto xtd::drawing::point_f::operator+ ( const xtd::drawing::size & sz) const -> point_f
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]

auto xtd::drawing::point_f::operator+ ( const xtd::drawing::size_f & sz) const -> point_f
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]

auto xtd::drawing::point_f::operator+ ( const xtd::drawing::point & pt) const -> point_f
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]

auto xtd::drawing::point_f::operator+ ( const point_f & pt) const -> point_f
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]

auto xtd::drawing::point_f::operator+= ( const xtd::drawing::size & sz) -> point_f &
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]

auto xtd::drawing::point_f::operator+= ( const xtd::drawing::size_f & sz) -> point_f &
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]

auto xtd::drawing::point_f::operator+= ( const xtd::drawing::point & pt) -> point_f &
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]

auto xtd::drawing::point_f::operator+= ( const point_f & pt) -> point_f &
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]

auto xtd::drawing::point_f::operator- ( const xtd::drawing::size & sz) const -> point_f
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]

auto xtd::drawing::point_f::operator- ( const xtd::drawing::size_f & sz) const -> point_f
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]

auto xtd::drawing::point_f::operator- ( const xtd::drawing::point & pt) const -> point_f
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]

auto xtd::drawing::point_f::operator- ( const point_f & pt) const -> point_f
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]

auto xtd::drawing::point_f::operator-= ( const xtd::drawing::size & sz) -> point_f &
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]

auto xtd::drawing::point_f::operator-= ( const xtd::drawing::size_f & sz) -> point_f &
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]

auto xtd::drawing::point_f::operator-= ( const xtd::drawing::point & pt) -> point_f &
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]

auto xtd::drawing::point_f::operator-= ( const point_f & pt) -> point_f &
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: