xtd 1.0.0
Loading...
Searching...
No Matches
point_f.hpp
Go to the documentation of this file.
1
4#pragma once
6#include <xtd/iequatable>
7#include <xtd/object>
8#include <xtd/string>
9#include <cstdint>
10#include <ostream>
11#include <string>
12
14namespace xtd {
16 namespace drawing {
18 struct point;
19 struct point_f;
20 struct size;
21 struct size_f;
23
37
40 static const point_f empty;
42
44
48 point_f() noexcept = default;
52 point_f(float x, float y) noexcept;
55 explicit point_f(const size_f& sz) noexcept;
57
59
63 [[nodiscard]] auto is_empty() const noexcept -> bool;
64
67 float x = .0f;
68
71 float y = .0f;
73
75
80 [[nodiscard]] auto equals(const xtd::object& obj) const noexcept -> bool override;
84 [[nodiscard]] auto equals(const point_f& other) const noexcept -> bool override;
85
88 auto get_hash_code() const noexcept -> xtd::usize override;
89
93 auto offset(float dx, float dy) noexcept -> void;
94
98 auto offset(const point_f& pt) noexcept -> void;
99
102 [[nodiscard]] auto to_string() const noexcept -> xtd::string override;
104
106
113 [[nodiscard]] static auto add(const point_f& pt, const xtd::drawing::size& sz) noexcept -> point_f;
119 [[nodiscard]] static auto add(const point_f& pt, const xtd::drawing::size_f& sz) noexcept -> point_f;
124 [[nodiscard]] static auto add(const point_f& pt1, const xtd::drawing::point& pt2) noexcept -> point_f;
129 [[nodiscard]] static auto add(const point_f& pt1, const point_f& pt2) noexcept -> point_f;
130
136 [[nodiscard]] static auto subtract(const point_f& pt, const xtd::drawing::size& sz) noexcept -> point_f;
142 [[nodiscard]] static auto subtract(const point_f& pt, const xtd::drawing::size_f& sz) noexcept -> point_f;
147 [[nodiscard]] static auto subtract(const point_f& pt1, const xtd::drawing::point& pt2) noexcept -> point_f;
152 [[nodiscard]] static auto subtract(const point_f& pt1, const point_f& pt2) noexcept -> point_f;
154
156
161 auto operator +(const xtd::drawing::size& sz) const noexcept -> point_f;
165 auto operator +(const xtd::drawing::size_f& sz) const noexcept -> point_f;
169 auto operator +(const xtd::drawing::point& pt) const noexcept -> point_f;
173 auto operator +(const point_f& pt) const noexcept -> point_f;
174
178 auto operator +=(const xtd::drawing::size& sz) noexcept -> point_f&;
182 auto operator +=(const xtd::drawing::size_f& sz) noexcept -> point_f&;
186 auto operator +=(const xtd::drawing::point& pt) noexcept -> point_f&;
190 auto operator +=(const point_f& pt) noexcept -> point_f&;
191
195 auto operator -(const xtd::drawing::size& sz) const noexcept -> point_f;
199 auto operator -(const xtd::drawing::size_f& sz) const noexcept -> point_f;
203 auto operator -(const xtd::drawing::point& pt) const noexcept -> point_f;
207 auto operator -(const point_f& pt) const noexcept -> point_f;
208
212 auto operator -=(const xtd::drawing::size& sz) noexcept -> point_f&;
216 auto operator -=(const xtd::drawing::size_f& sz) noexcept -> point_f&;
220 auto operator -=(const xtd::drawing::point& pt) noexcept -> point_f&;
224 auto operator -=(const point_f& pt) noexcept -> point_f&;
226 };
227 }
228}
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
Contains drawing_export_ keyword.
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.hpp:35
auto equals(const xtd::object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
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...
auto is_empty() const noexcept -> bool
Gets a value indicating whether this xtd::drawing::point_f is empty.
static const point_f empty
Represents a xtd::drawing::point_f that has xtd::drawing::point_f::x and xtd::drawing::point_f::y val...
Definition point_f.hpp:40
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.
float x
Gets or sets the x-coordinate of this xtd::drawing::point_f.
Definition point_f.hpp:67
auto get_hash_code() const noexcept -> xtd::usize override
Serves as a hash function for a particular type.
auto to_string() const noexcept -> xtd::string override
Converts this point to a human-readable string.
float y
Gets or sets the y-coordinate of this xtd::drawing::point_f.
Definition point_f.hpp:71
auto offset(float dx, float dy) noexcept -> void
Translates this xtd::drawing::point_f by the specified amount.
point_f() noexcept=default
Initializes a new instance of the xtd::drawing::point_f class.
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.hpp:54
Stores an ordered pair of floating-point, which specify a height and width.
Definition size_f.hpp:32
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:32