xtd 0.2.0
Loading...
Searching...
No Matches
point_f.h
Go to the documentation of this file.
1
4#pragma once
5#include "../drawing_export.h"
6#include <xtd/iequatable>
7#include <xtd/object>
8#include <xtd/ustring>
9#include <cstdint>
10#include <ostream>
11#include <string>
12
14namespace xtd {
16 namespace drawing {
18 class point;
19 class point_f;
20 class size;
21 class size_f;
23
35 class drawing_export_ point_f : public xtd::object, public xtd::iequatable<point_f> {
36 public:
38
41 static const point_f empty;
43
45
49 point_f() noexcept = default;
53 point_f(float x, float y) noexcept;
56 explicit point_f(const size_f& sz) noexcept;
58
60 point_f(const point_f&) noexcept = default;
61 point_f& operator =(const point_f&) noexcept = default;
63
65
69 bool is_empty() const noexcept;
70
73 float x() const noexcept;
74
77 void x(float x) noexcept;
78
81 float y() const noexcept;
82
85 void y(float y) noexcept;
87
89
91 bool equals(const point_f& value) const noexcept override;
92
96 void offset(float dx, float dy) noexcept;
97
101 void offset(const point_f& pt) noexcept;
102
105 xtd::ustring to_string() const noexcept override;
107
109
116 static point_f add(const point_f& pt, const size& sz) noexcept;
122 static point_f add(const point_f& pt, const size_f& sz) noexcept;
127 static point_f add(const point_f& pt1, const point& pt2) noexcept;
132 static point_f add(const point_f& pt1, const point_f& pt2) noexcept;
133
139 static point_f subtract(const point_f& pt, const size& sz) noexcept;
145 static point_f subtract(const point_f& pt, const size_f& sz) noexcept;
150 static point_f subtract(const point_f& pt1, const point& pt2) noexcept;
155 static point_f subtract(const point_f& pt1, const point_f& pt2) noexcept;
157
159
164 point_f operator +(const size& sz) const noexcept;
168 point_f operator +(const size_f& sz) const noexcept;
172 point_f operator +(const point& pt) const noexcept;
176 point_f operator +(const point_f& pt) const noexcept;
177
181 point_f& operator +=(const size& sz) noexcept;
185 point_f& operator +=(const size_f& sz) noexcept;
189 point_f& operator +=(const point& pt) noexcept;
193 point_f& operator +=(const point_f& pt) noexcept;
194
198 point_f operator -(const size& sz) const noexcept;
202 point_f operator -(const size_f& sz) const noexcept;
206 point_f operator -(const point& pt) const noexcept;
210 point_f operator -(const point_f& pt) const noexcept;
211
215 point_f& operator -=(const size& sz) noexcept;
219 point_f& operator -=(const size_f& sz) noexcept;
223 point_f& operator -=(const point& pt) noexcept;
227 point_f& operator -=(const point_f& pt) noexcept;
229
230 private:
231 float x_ = 0;
232 float y_ = 0;
233 };
234 }
235}
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition point_f.h: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.h:41
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.h:54
Stores an ordered pair of floating-point, which specify a height and width.
Definition size_f.h:31
Stores an ordered pair of integers, which specify a height and width.
Definition size.h:31
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:18
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
size_t size
Represents a size of any object in bytes.
Definition types.h:197
@ 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.h:10