xtd 0.2.0
region.h
Go to the documentation of this file.
1 #pragma once
5 #include "../drawing_export.h"
7 #include <xtd/iequatable>
8 #include <xtd/object>
9 
11 namespace xtd {
13  namespace drawing {
15  class graphics;
17 
32  class drawing_export_ region final : public xtd::object, public xtd::iequatable<region> {
33  struct data;
34 
35  public:
37 
41  region();
49  explicit region(const xtd::drawing::rectangle& rect);
53  explicit region(const xtd::drawing::rectangle_f& rect);
55 
57  region(const region& value) = default;
58  region& operator =(const region& value) = default;
59  ~region();
61 
63 
67  intptr handle() const noexcept;
69 
71 
75  void complement(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
78  void complement(const xtd::drawing::rectangle& rect) noexcept;
81  void complement(const xtd::drawing::rectangle_f& rect) noexcept;
84  void complement(const xtd::drawing::region& region) noexcept;
85 
86  bool equals(const region& value) const noexcept override;
87 
90  void exclude(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
93  void exclude(const xtd::drawing::rectangle& rect) noexcept;
95  void exclude(const xtd::drawing::rectangle_f& rect) noexcept;
98  void exclude(const xtd::drawing::region& region) noexcept;
99 
104  static xtd::drawing::region from_hrgn(intptr hrgn);
105 
110  xtd::drawing::rectangle_f get_bounds() const noexcept;
115  xtd::drawing::rectangle_f get_bounds(const xtd::drawing::graphics& g) const noexcept;
116 
121  intptr get_hrgn(const xtd::drawing::graphics& g) const noexcept;
122 
125  void intersect(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
128  void intersect(const xtd::drawing::rectangle& rect) noexcept;
131  void intersect(const xtd::drawing::rectangle_f& rect) noexcept;
134  void intersect(const xtd::drawing::region& region) noexcept;
135 
139  bool is_empty() const noexcept;
144  bool is_empty(const xtd::drawing::graphics& g) const noexcept;
145 
149  bool is_infinite() const noexcept;
154  bool is_infinite(const xtd::drawing::graphics& g) const noexcept;
155 
161  bool is_visible(const xtd::drawing::rectangle_f& rect, const xtd::drawing::graphics& g) const noexcept;
170  bool is_visible(float x, float y, float width, float height, const xtd::drawing::graphics& g) const noexcept;
176  bool is_visible(const xtd::drawing::rectangle& rect, const xtd::drawing::graphics& g) const noexcept;
185  bool is_visible(int32 x, int32 y, int32 width, int32 height, const xtd::drawing::graphics& g) const noexcept;
189  bool is_visible(const xtd::drawing::rectangle_f& rect) const noexcept;
196  bool is_visible(float x, float y, float width, float height) const noexcept;
200  bool is_visible(const xtd::drawing::rectangle& rect) const noexcept;
207  bool is_visible(int32 x, int32 y, int32 width, int32 height) const noexcept;
213  bool is_visible(xtd::drawing::point_f pt, const xtd::drawing::graphics& g) const noexcept;
220  bool is_visible(float x, float y, const xtd::drawing::graphics& g) const noexcept;
226  bool is_visible(xtd::drawing::point pt, const xtd::drawing::graphics& g) const noexcept;
233  bool is_visible(int32 x, int32 y, const xtd::drawing::graphics& g) const noexcept;
237  bool is_visible(xtd::drawing::point_f pt) const noexcept;
242  bool is_visible(float x, float y) const noexcept;
246  bool is_visible(xtd::drawing::point pt) const noexcept;
251  bool is_visible(int32 x, int32 y) const noexcept;
252 
254  void make_empty();
255 
257  void make_infinite() noexcept;
258 
261  void make_union(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
264  void make_union(const xtd::drawing::rectangle& rect) noexcept;
267  void make_union(const xtd::drawing::rectangle_f& rect) noexcept;
270  void make_union(const xtd::drawing::region& region) noexcept;
271 
274  void make_xor(const xtd::drawing::drawing_2d::graphics_path& path) noexcept;
277  void make_xor(const xtd::drawing::rectangle& rect) noexcept;
280  void make_xor(const xtd::drawing::rectangle_f& rect) noexcept;
283  void make_xor(const xtd::drawing::region& region) noexcept;
284 
287  void release_hrgn(intptr region_handle);
288 
292  void translate(int32 dx, int32 dy) noexcept;
296  void translate(float dx, float dy) noexcept;
298 
299  private:
300  std::shared_ptr<data> data_;
301  };
302  }
303 }
intmax_t intptr
Represent a pointer or a handle.
Definition: types.h:151
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:54
Contains xtd::drawing::drawing_2d/::graphics_path class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Stores a set of four floating-point numbers that represent the location and size of a rectangle...
Definition: rectangle_f.h:34
Describes the interior of a graphics shape composed of rectangles and paths. This class cannot be inh...
Definition: region.h:32
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition: point_f.h:35
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:18
The xtd::uri::local_path data.
Stores a set of four integers that represent the location and size of a rectangle.
Definition: rectangle.h:44
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics.h:70
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics_path.h:36