xtd - Reference Guide 0.2.0
region.h
Go to the documentation of this file.
1 #pragma once
5 #include "../drawing_export.h"
6 #include <xtd/object.h>
8 
10 namespace xtd {
12  namespace drawing {
14  class graphics;
16 
31  class drawing_export_ region final : public xtd::object {
32  public:
34 
38  region();
46  region(const xtd::drawing::rectangle& rect);
50  region(const xtd::drawing::rectangle_f& rect);
52 
54  region(const region& value) = default;
55  region& operator =(const region& value) = default;
56  ~region();
57  bool operator ==(const region& value) const;
58  bool operator !=(const region& value) const;
60 
62 
66  intptr_t handle() const;
68 
70 
74  void complement(const xtd::drawing::drawing2d::graphics_path& path);
77  void complement(const xtd::drawing::rectangle& rect);
80  void complement(const xtd::drawing::rectangle_f& rect);
83  void complement(const xtd::drawing::region& region);
84 
87  void exclude(const xtd::drawing::drawing2d::graphics_path& path);
90  void exclude(const xtd::drawing::rectangle& rect);
92  void exclude(const xtd::drawing::rectangle_f& rect);
95  void exclude(const xtd::drawing::region& region);
96 
101  static xtd::drawing::region from_hrgn(intptr_t hrgn);
102 
107  xtd::drawing::rectangle_f get_bounds() const;
112  xtd::drawing::rectangle_f get_bounds(const xtd::drawing::graphics& g) const;
113 
118  intptr_t get_hrgn(const xtd::drawing::graphics& g) const;
119 
122  void intersect(const xtd::drawing::drawing2d::graphics_path& path);
125  void intersect(const xtd::drawing::rectangle& rect);
128  void intersect(const xtd::drawing::rectangle_f& rect);
131  void intersect(const xtd::drawing::region& region);
132 
136  bool is_empty() const noexcept;
141  bool is_empty(const xtd::drawing::graphics& g) const noexcept;
142 
146  bool is_infinite() const noexcept;
151  bool is_infinite(const xtd::drawing::graphics& g) const noexcept;
152 
158  bool is_visible(const xtd::drawing::rectangle_f& rect, const xtd::drawing::graphics& g) const noexcept;
167  bool is_visible(float x, float y, float width, float height, const xtd::drawing::graphics& g) const noexcept;
173  bool is_visible(const xtd::drawing::rectangle& rect, const xtd::drawing::graphics& g) const noexcept;
182  bool is_visible(int32_t x, int32_t y, int32_t width, int32_t height, const xtd::drawing::graphics& g) const noexcept;
186  bool is_visible(const xtd::drawing::rectangle_f& rect) const noexcept;
193  bool is_visible(float x, float y, float width, float height) const noexcept;
197  bool is_visible(const xtd::drawing::rectangle& rect) const noexcept;
204  bool is_visible(int32_t x, int32_t y, int32_t width, int32_t height) const noexcept;
210  bool is_visible(xtd::drawing::point_f pt, const xtd::drawing::graphics& g) const noexcept;
217  bool is_visible(float x, float y, const xtd::drawing::graphics& g) const noexcept;
223  bool is_visible(xtd::drawing::point pt, const xtd::drawing::graphics& g) const noexcept;
230  bool is_visible(int32_t x, int32_t y, const xtd::drawing::graphics& g) const noexcept;
234  bool is_visible(xtd::drawing::point_f pt) const noexcept;
239  bool is_visible(float x, float y) const noexcept;
243  bool is_visible(xtd::drawing::point pt) const noexcept;
248  bool is_visible(int32_t x, int32_t y) const noexcept;
249 
251  void make_empty();
252 
254  void make_infinite();
255 
258  void make_union(const xtd::drawing::drawing2d::graphics_path& path);
261  void make_union(const xtd::drawing::rectangle& rect);
264  void make_union(const xtd::drawing::rectangle_f& rect);
267  void make_union(const xtd::drawing::region& region);
268 
271  void make_xor(const xtd::drawing::drawing2d::graphics_path& path);
274  void make_xor(const xtd::drawing::rectangle& rect);
277  void make_xor(const xtd::drawing::rectangle_f& rect);
280  void make_xor(const xtd::drawing::region& region);
281 
284  void release_hrgn(intptr_t region_handle);
285 
289  void translate(int32_t dx, int32_t dy);
293  void translate(float dx, float dy);
295 
296  private:
297  struct data {
298  intptr_t handle = 0;
299  };
300  std::shared_ptr<data> data_ = std::make_shared<data>();
301  };
302  }
303 }
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics_path.h:35
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition: point.h:53
Contains xtd::drawing::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:31
Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimen...
Definition: point_f.h:34
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
Contains xtd::object class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:30
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics.h:70