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/string>
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 using object::equals;
92 bool equals(const point_f& value) const noexcept override;
93
97 void offset(float dx, float dy) noexcept;
98
102 void offset(const point_f& pt) noexcept;
103
106 xtd::string to_string() const noexcept override;
108
110
117 static point_f add(const point_f& pt, const size& sz) noexcept;
123 static point_f add(const point_f& pt, const size_f& sz) noexcept;
128 static point_f add(const point_f& pt1, const point& pt2) noexcept;
133 static point_f add(const point_f& pt1, const point_f& pt2) noexcept;
134
140 static point_f subtract(const point_f& pt, const size& sz) noexcept;
146 static point_f subtract(const point_f& pt, const size_f& sz) noexcept;
151 static point_f subtract(const point_f& pt1, const point& pt2) noexcept;
156 static point_f subtract(const point_f& pt1, const point_f& pt2) noexcept;
158
160
165 point_f operator +(const size& sz) const noexcept;
169 point_f operator +(const size_f& sz) const noexcept;
173 point_f operator +(const point& pt) const noexcept;
177 point_f operator +(const point_f& pt) const noexcept;
178
182 point_f& operator +=(const size& sz) noexcept;
186 point_f& operator +=(const size_f& sz) noexcept;
190 point_f& operator +=(const point& pt) noexcept;
194 point_f& operator +=(const point_f& pt) noexcept;
195
199 point_f operator -(const size& sz) const noexcept;
203 point_f operator -(const size_f& sz) const noexcept;
207 point_f operator -(const point& pt) const noexcept;
211 point_f operator -(const point_f& pt) const noexcept;
212
216 point_f& operator -=(const size& sz) noexcept;
220 point_f& operator -=(const size_f& sz) noexcept;
224 point_f& operator -=(const point& pt) noexcept;
228 point_f& operator -=(const point_f& pt) noexcept;
230
231 private:
232 float x_ = 0;
233 float y_ = 0;
234 };
235 }
236}
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:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
size_t size
Represents a size of any object in bytes.
Definition size.h: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.h:10