CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
region.h
1
2#pragma once
3
4#include "fwd.h"
5
6#include "drawing/rectangle_f.h"
7#include "drawing/drawing2d/combine_mode.h"
8#include "drawing/drawing2d/matrix.h"
9#include "drawing/drawing2d/graphics_path.h"
10#include "drawing/drawing2d/region_data.h"
11#include "system/exceptions.h"
12#include "system/shared_ptr.h"
13
14#include <memory>
15
16#ifdef ASPOSECPPLIB_BEING_BUILT
17#include <core/SkRegion.h>
18#endif
19
21ASPOSECPP_3RD_PARTY_CLASS(SkRegion);
23ASPOSECPP_3RD_PARTY_STRUCT(SkIRect);
25ASPOSECPP_3RD_PARTY_STRUCT(SkRect);
27ASPOSECPP_3RD_PARTY_CLASS(SkMatrix);
29ASPOSECPP_3RD_PARTY_CLASS(SkPath);
30
31namespace System { namespace Drawing { namespace Details { namespace Region { class BaseRegionDataNode; } } } }
32namespace System { namespace Drawing { namespace Details { namespace Skia { class SkiaData; } } } }
33
34namespace System { namespace Drawing {
35
36class Graphics;
41class ASPOSECPP_SHARED_CLASS Region : public Object
42{
43 RTTI_INFO(System::Drawing::Region, ::System::BaseTypesInfo<System::Object>)
44public:
46 using Object::Equals;
48
50 ASPOSECPP_SHARED_API Region();
54 ASPOSECPP_SHARED_API Region(const RectangleF& rect);
58 ASPOSECPP_SHARED_API Region(const Rectangle& rect);
62 ASPOSECPP_SHARED_API Region(const SharedPtr<Drawing2D::GraphicsPath>& path);
63 ASPOSECPP_SHARED_API Region(const SkPath& path);
67 ASPOSECPP_SHARED_API Region(const SharedPtr<Drawing2D::RegionData>& region_data);
68
70 virtual ASPOSECPP_SHARED_API ~Region();
71
75 ASPOSECPP_SHARED_API ArrayPtr<RectangleF> GetRegionScans(const SharedPtr<Drawing2D::Matrix>& matrix) const;
76
80 ASPOSECPP_SHARED_API RectangleF GetBounds(const SharedPtr<Graphics>& graphics) const;
81
85 ASPOSECPP_SHARED_API void Union(const RectangleF & rect);
86
90 ASPOSECPP_SHARED_API void Union(const Rectangle & rect);
91
95 ASPOSECPP_SHARED_API void Union(const SharedPtr<Drawing2D::GraphicsPath>& path);
96
100 ASPOSECPP_SHARED_API void Union(const SharedPtr<Region>& region);
101
103 ASPOSECPP_SHARED_API SharedPtr<Region> Clone() const;
104
108 ASPOSECPP_SHARED_API void Intersect(const RectangleF & rect);
109
113 ASPOSECPP_SHARED_API void Intersect(const Rectangle & rect);
114
118 ASPOSECPP_SHARED_API void Intersect(const SharedPtr<Drawing2D::GraphicsPath>& path);
119
123 ASPOSECPP_SHARED_API void Intersect(const SharedPtr<Region>& region);
124
128 ASPOSECPP_SHARED_API void Exclude(const RectangleF & rect);
129
133 ASPOSECPP_SHARED_API void Exclude(const Rectangle & rect);
134
138 ASPOSECPP_SHARED_API void Exclude(const SharedPtr<Drawing2D::GraphicsPath>& path);
139
143 ASPOSECPP_SHARED_API void Exclude(const SharedPtr<Region>& region);
144
148 ASPOSECPP_SHARED_API void Translate(int dx, int dy);
152 ASPOSECPP_SHARED_API void Translate(float dx, float dy);
155 ASPOSECPP_SHARED_API void Transform(const SharedPtr<Drawing2D::Matrix>& matrix);
156
159 ASPOSECPP_SHARED_API void Transform(const SkMatrix& matrix);
160
164 ASPOSECPP_SHARED_API void Complement(const RectangleF & rect);
165
169 ASPOSECPP_SHARED_API void Complement(const Rectangle & rect);
170
174 ASPOSECPP_SHARED_API void Complement(const SharedPtr<Drawing2D::GraphicsPath>& path);
175
179 ASPOSECPP_SHARED_API void Complement(const SharedPtr<Region>& region);
180
184 ASPOSECPP_SHARED_API void Xor(const RectangleF & rect);
188 ASPOSECPP_SHARED_API void Xor(const Rectangle & rect);
192 ASPOSECPP_SHARED_API void Xor(const SharedPtr<Drawing2D::GraphicsPath>& path);
196 ASPOSECPP_SHARED_API void Xor(const SharedPtr<Region>& region);
197
205 ASPOSECPP_SHARED_API bool Equals(const SharedPtr<Region>& r, const SharedPtr<Graphics>& g);
206
210 ASPOSECPP_SHARED_API bool IsEmpty(const SharedPtr<Graphics>& g) const;
211
215 ASPOSECPP_SHARED_API bool IsInfinite(const SharedPtr<Graphics>& g) const;
216
219 ASPOSECPP_SHARED_API bool IsVisible(const Point& point) const;
222 ASPOSECPP_SHARED_API bool IsVisible(const PointF& point) const;
225 ASPOSECPP_SHARED_API bool IsVisible(const Rectangle& rect);
228 ASPOSECPP_SHARED_API bool IsVisible(const RectangleF& rect);
233 ASPOSECPP_SHARED_API bool IsVisible(const Point& point, const SharedPtr<Graphics>& graphics) const;
238 ASPOSECPP_SHARED_API bool IsVisible(const PointF& point, const SharedPtr<Graphics>& graphics) const;
243 ASPOSECPP_SHARED_API bool IsVisible(const Rectangle& rect, const SharedPtr<Graphics>& graphics);
248 ASPOSECPP_SHARED_API bool IsVisible(const RectangleF& rect, const SharedPtr<Graphics>& graphics);
252 ASPOSECPP_SHARED_API bool IsVisible(float x, float y) const;
258 ASPOSECPP_SHARED_API bool IsVisible(float x, float y, const SharedPtr<Graphics>& graphics) const;
259
261 void Dispose() {}
263 ASPOSECPP_SHARED_API void MakeInfinite();
265 ASPOSECPP_SHARED_API void MakeEmpty();
269
270private:
271 friend class Graphics;
272 friend class Details::Skia::SkiaData;
273
275
276 void GetSkiaPath(SkPath& path);
277
279
280 bool IsInfinite() const;
281
282 void ApplyOperation(const SharedPtr<Details::Region::BaseRegionDataNode>& node, Drawing2D::CombineMode operationType);
283 void ApplyOperation(const SharedPtr<Region>& region, Drawing2D::CombineMode operationType);
284};
285
286}} // System::Drawing
Represents a drawing surface. Objects of this class should only be allocated using System::MakeObject...
Definition: graphics.h:68
Represents a pair of single-precision floating point X and Y coordinates of a point on a 2-dimensiona...
Definition: point_f.h:14
Represents a pair of integer X and Y coordinates of a point on a 2-dimensional plane....
Definition: point.h:15
Represents a rectangular area of an image defined as single-precision floating point X and Y coordina...
Definition: rectangle_f.h:15
Represents a rectangular area of an image defined as integer X and Y coordinates of its upper left co...
Definition: rectangle.h:19
Represents the interior of a graphic shape. Objects of this class should only be allocated using Syst...
Definition: region.h:42
Region(const RectangleF &rect)
Constructs a new instance of Region class that represents a region defined by the specified rectangle...
void Complement(const RectangleF &rect)
Replaces the region represented by the current object with the portion of the region defined by the s...
bool IsVisible(const Point &point, const SharedPtr< Graphics > &graphics) const
Determines if the specified point is contained within the region represented by the current object us...
void Dispose()
Releases all operating system resources acquired by the current object.
Definition: region.h:261
SharedPtr< Region > Clone() const
Returns a copy of the current object.
void Transform(const SkMatrix &matrix)
Transforms this region by the specified matrix.
void Exclude(const Rectangle &rect)
Replaces the region represented by the current object with the result of exclusion of the region defi...
bool IsVisible(const Point &point) const
Determines if the specified point is contained within the region represented by the current object.
Region()
Constructs a new instance of Region class.
void Union(const SharedPtr< Region > &region)
Replaces the region represented by the current object with the result of union of this region and and...
Region(const SkPath &path)
SharedPtr< Drawing2D::RegionData > GetRegionData() const
Returns a RegionData object containing data that defines the region represented by the current object...
void Complement(const Rectangle &rect)
Replaces the region represented by the current object with the portion of the region defined by the s...
void Intersect(const RectangleF &rect)
Replaces the region represented by the current object with the result of intersection of this region ...
ArrayPtr< RectangleF > GetRegionScans(const SharedPtr< Drawing2D::Matrix > &matrix) const
Returns an array of RectangleF structures that approximate this Region after the specified matrix tra...
bool IsInfinite(const SharedPtr< Graphics > &g) const
Determines wheter the region represented by the current object has infinite interior on the specified...
void Union(const SharedPtr< Drawing2D::GraphicsPath > &path)
Replaces the region represented by the current object with the result of union of this region and a r...
Region(const SharedPtr< Drawing2D::GraphicsPath > &path)
Constructs a new instance of Region class that represents a region defined by the specified path.
void Exclude(const RectangleF &rect)
Replaces the region represented by the current object with the result of exclusion of the region defi...
virtual ~Region()
Destructor.
void Intersect(const SharedPtr< Region > &region)
Replaces the region represented by the current object with the result of intersection of this region ...
void Complement(const SharedPtr< Drawing2D::GraphicsPath > &path)
Replaces the region represented by the current object with the portion of the region defined by the s...
void Translate(int dx, int dy)
Moves the coordinates of the region by the specified amount.
void Xor(const Rectangle &rect)
Replaces the region represented by the current object with the portions of this region and the region...
Region(const SharedPtr< Drawing2D::RegionData > &region_data)
Constructs a new instance of Region class that represents a region defined by the specified RegionDat...
bool IsEmpty(const SharedPtr< Graphics > &g) const
Determines wheter the region represented by the current object has empty interior on the specified dr...
void Xor(const RectangleF &rect)
Replaces the region represented by the current object with the portions of this region and the region...
void Intersect(const SharedPtr< Drawing2D::GraphicsPath > &path)
Replaces the region represented by the current object with the result of intersection of this region ...
RectangleF GetBounds(const SharedPtr< Graphics > &graphics) const
Gets a RectangleF structure that represents a rectangle that bounds this Region on the drawing surfac...
void MakeEmpty()
Initializes the current object to empty interior.
bool Equals(const SharedPtr< Region > &r, const SharedPtr< Graphics > &g)
Determines whether the specified region is identical to the region represented by the current object ...
bool IsVisible(const PointF &point) const
Determines if the specified point is contained within the region represented by the current object.
void Transform(const SharedPtr< Drawing2D::Matrix > &matrix)
Transforms this region by the specified matrix.
void Intersect(const Rectangle &rect)
Replaces the region represented by the current object with the result of intersection of this region ...
bool IsVisible(const RectangleF &rect)
Determines if any portion the specified rectangle is contained within the region represented by the c...
Region(const Rectangle &rect)
Constructs a new instance of Region class that represents a region defined by the specified rectangle...
bool IsVisible(const Rectangle &rect, const SharedPtr< Graphics > &graphics)
Determines if any portion the specified rectangle is contained within the region represented by the c...
void Exclude(const SharedPtr< Region > &region)
Replaces the region represented by the current object with the result of exclusion of the specified r...
void Exclude(const SharedPtr< Drawing2D::GraphicsPath > &path)
Replaces the region represented by the current object with the result of exclusion of the region defi...
bool IsVisible(const PointF &point, const SharedPtr< Graphics > &graphics) const
Determines if the specified point is contained within the region represented by the current object us...
void Complement(const SharedPtr< Region > &region)
Replaces the region represented by the current object with the portion of the specified region that d...
bool IsVisible(const RectangleF &rect, const SharedPtr< Graphics > &graphics)
Determines if any portion the specified rectangle is contained within the region represented by the c...
void MakeInfinite()
Initializes this region object to an infinite interior.
bool IsVisible(float x, float y) const
Determines if the specified point is contained within the region represented by the current object.
void Union(const RectangleF &rect)
Replaces the region represented by the current object with the result of union operation of this regi...
void Translate(float dx, float dy)
Moves the coordinates of the region by the specified amount.
bool IsVisible(float x, float y, const SharedPtr< Graphics > &graphics) const
Determines if the specified point is contained within the region represented by the current object us...
void Xor(const SharedPtr< Region > &region)
Replaces the region represented by the current object with the portions of this region and the specif...
void Union(const Rectangle &rect)
Replaces the region represented by the current object with the result of union of this region and a r...
void Xor(const SharedPtr< Drawing2D::GraphicsPath > &path)
Replaces the region represented by the current object with the portions of this region and the region...
bool IsVisible(const Rectangle &rect)
Determines if any portion the specified rectangle is contained within the region represented by the c...
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
virtual bool Equals(ptr obj)
Compares objects using C# Object.Equals semantics.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
CombineMode
Specifies how clipping regions are combined.
Definition: combine_mode.h:7
Definition: db_command.h:9