xtd 0.2.0
point_f.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../drawing_export.hpp"
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 point_f(const point_f&) noexcept = default;
60 point_f& operator =(const point_f&) noexcept = default;
62
64
68 bool is_empty() const noexcept;
69
72 float x = .0f;
73
76 float y = .0f;
78
80
85 bool equals(const xtd::object& obj) const noexcept override;
89 bool equals(const point_f& other) const noexcept override;
90
93 xtd::size get_hash_code() const noexcept override;
94
98 void offset(float dx, float dy) noexcept;
99
103 void offset(const point_f& pt) noexcept;
104
107 xtd::string to_string() const noexcept override;
109
111
118 static point_f add(const point_f& pt, const size& sz) noexcept;
124 static point_f add(const point_f& pt, const size_f& sz) noexcept;
129 static point_f add(const point_f& pt1, const point& pt2) noexcept;
134 static point_f add(const point_f& pt1, const point_f& pt2) noexcept;
135
141 static point_f subtract(const point_f& pt, const size& sz) noexcept;
147 static point_f subtract(const point_f& pt, const size_f& sz) noexcept;
152 static point_f subtract(const point_f& pt1, const point& pt2) noexcept;
157 static point_f subtract(const point_f& pt1, const point_f& pt2) noexcept;
159
161
166 point_f operator +(const size& sz) const noexcept;
170 point_f operator +(const size_f& sz) const noexcept;
174 point_f operator +(const point& pt) const noexcept;
178 point_f operator +(const point_f& pt) const noexcept;
179
183 point_f& operator +=(const size& sz) noexcept;
187 point_f& operator +=(const size_f& sz) noexcept;
191 point_f& operator +=(const point& pt) noexcept;
195 point_f& operator +=(const point_f& pt) noexcept;
196
200 point_f operator -(const size& sz) const noexcept;
204 point_f operator -(const size_f& sz) const noexcept;
208 point_f operator -(const point& pt) const noexcept;
212 point_f operator -(const point_f& pt) const noexcept;
213
217 point_f& operator -=(const size& sz) noexcept;
221 point_f& operator -=(const size_f& sz) noexcept;
225 point_f& operator -=(const point& pt) noexcept;
229 point_f& operator -=(const point_f& pt) noexcept;
231 };
232 }
233}
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
@ point
Specifies a printer's point (1/72 inch) as the unit of measure.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.hpp:35
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
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:31
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31