2#ifndef _aspose_drawing_drawing2d_graphics_path_h_
3#define _aspose_drawing_drawing2d_graphics_path_h_
5#include "system/object.h"
6#include "system/enum_helpers.h"
7#include "drawing/pen.h"
8#include "drawing/point.h"
9#include "drawing/point_f.h"
10#include "drawing/rectangle.h"
11#include "drawing/rectangle_f.h"
12#include "drawing/font_family.h"
13#include "drawing/string_format.h"
14#include "drawing/drawing2d/matrix.h"
15#include "drawing/drawing2d/fill_mode.h"
16#include "drawing/drawing2d/path_data.h"
17#include "drawing/drawing2d/path_point_type.h"
21#ifdef ASPOSECPPLIB_BEING_BUILT
22#include <core/SkPath.h>
26ASPOSECPP_3RD_PARTY_CLASS(SkPath);
28ASPOSECPP_3RD_PARTY_CLASS(SkMatrix);
30ASPOSECPP_3RD_PARTY_STRUCT(SkRect);
32ASPOSECPP_3RD_PARTY_TYPEDEF(SkScalar,
float);
35namespace System {
namespace Drawing {
class Graphics; } }
36namespace System {
namespace Drawing {
class Region; } }
37namespace System {
namespace Drawing {
namespace Details {
namespace Skia {
class SkiaData; } } } }
39namespace System {
namespace Drawing {
namespace Drawing2D {
43 enum class FigureType {
53 Ellipse = (0x01 << 3),
59 Polygon = (0x01 << 6),
68 DECLARE_ENUM_OPERATORS(System::Drawing::Drawing2D::Detail::FigureType);
70 DECLARE_USING_GLOBAL_OPERATORS
74class PathGradientBrush;
144 ASPOSECPP_SHARED_API
void AddBezier(
int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
int x4,
int y4);
154 ASPOSECPP_SHARED_API
void AddBezier(
float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
float x4,
float y4);
175 ASPOSECPP_SHARED_API
void AddLine(
int x1,
int y1,
int x2,
int y2);
181 ASPOSECPP_SHARED_API
void AddLine(
float x1,
float y1,
float x2,
float y2);
234 ASPOSECPP_SHARED_API
void AddArc(
float x,
float y,
float width,
float height,
float startAngle,
float sweepAngle);
242 ASPOSECPP_SHARED_API
void AddArc(
int x,
int y,
int width,
int height,
float startAngle,
float sweepAngle);
247 ASPOSECPP_SHARED_API
void AddArc(
const RectangleF& rect,
float startAngle,
float sweepAngle);
252 ASPOSECPP_SHARED_API
void AddArc(
const Rectangle& rect,
float startAngle,
float sweepAngle);
259 ASPOSECPP_SHARED_API
void AddEllipse(
float x,
float y,
float width,
float height);
265 ASPOSECPP_SHARED_API
void AddEllipse(
int x,
int y,
int width,
int height);
280 ASPOSECPP_SHARED_API
void AddPie(
float x,
float y,
float width,
float height,
float startAngle,
float sweepAngle);
288 ASPOSECPP_SHARED_API
void AddPie(
int x,
int y,
int width,
int height,
float startAngle,
float sweepAngle);
293 ASPOSECPP_SHARED_API
void AddPie(
const Rectangle& rect,
float startAngle,
float sweepAngle);
376 ASPOSECPP_SHARED_API
void Transform(
const SkMatrix& matrix);
424 friend class Details::Skia::SkiaData;
429 bool m_figure_started =
true;
432 Detail::FigureType m_figure_flags = Detail::FigureType::Unknown;
443 ASPOSECPP_SHARED_API
void AddBezierImpl(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3, SkScalar x4, SkScalar y4);
449 ASPOSECPP_SHARED_API
void AddLineImpl(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2);
457 ASPOSECPP_SHARED_API
void AddArcImpl(SkScalar left, SkScalar top, SkScalar width, SkScalar height, SkScalar startAngle, SkScalar sweepAngle);
463 ASPOSECPP_SHARED_API
void AddEllipseImpl(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom);
471 ASPOSECPP_SHARED_API
void AddPieImpl(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom, SkScalar startAngle, SkScalar sweepAngle);
507 bool IsClosedPath()
const;
509 std::shared_ptr<SkPath> GetFlattenPath()
const;
514DECLARE_USING_ENUM_OPERATORS(System::Drawing::Drawing2D::Detail);
Represents a user-defined line cap. Objects of this class should only be allocated using System::Make...
Definition: custom_line_cap.h:40
Represents a set of connected lines and curves. Objects of this class should only be allocated using ...
Definition: graphics_path.h:80
ArrayPtr< uint8_t > get_PathTypes() const
Returns an array that contains values that indicate the types of the points that make up a path repre...
void CloseAllFigures()
Closes all open figures and starts a new one.
void AddLineImpl(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
Adds the specified line to the path represented by the current object.
void AddBezierImpl(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3, SkScalar x4, SkScalar y4)
Adds the specified cubic Bezier curve to the path represented by the current object.
void AddBeziers(const ArrayPtr< PointF > &points)
Adds a sequence of connected cubic Bezier curves to the current figure.
void AddArc(int x, int y, int width, int height, float startAngle, float sweepAngle)
Adds the specified elliptical arc to the path represented by the current object.
void Dispose()
Releases all operating system resources acquired by the current object.
Definition: graphics_path.h:410
void AddCurve(const ArrayPtr< Point > &points, int offset, int number_of_segments, float tension)
Adds the specified curve to the path represented by the current object.
void AddLine(float x1, float y1, float x2, float y2)
Adds the specified line to the path represented by the current object.
std::shared_ptr< SkPath > m_sk_path
The underlying SkPath object that contains the information about the path.
Definition: graphics_path.h:427
void Flatten(const MatrixPtr &matrix, float flatness)
Flattens each curve in the path by converting them into a series of connected lines.
FillMode get_FillMode()
Returns the fill mode of the current object.
void AddPolygon(const ArrayPtr< PointF > &points)
Adds the specified polygon to the path represented by the current object.
void AddPieImpl(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom, SkScalar startAngle, SkScalar sweepAngle)
Adds the specified outline of the pie shape to the path represented by the current object.
void AddCurve(const ArrayPtr< PointF > &points, int offset, int number_of_segments, float tension)
Adds the specified curve to the path represented by the current object.
void SetMarkers()
NOT IMPLEMENTED.
void AddLine(const PointF &pt1, const PointF &pt2)
Adds the specified line to the path represented by the current object.
static SkPath ConvertCurves(const SkPath &source)
Converts path curves into the ones available in .NET engine so translated code can work with them.
void AddArc(float x, float y, float width, float height, float startAngle, float sweepAngle)
Adds the specified elliptical arc to the path represented by the current object.
static bool NeedConvertCurves(const SkPath &source)
Check if ConvertCurves should be applied to source.
void AddArcImpl(SkScalar left, SkScalar top, SkScalar width, SkScalar height, SkScalar startAngle, SkScalar sweepAngle)
Adds the specified elliptical arc to the path represented by the current object.
void Flatten(const MatrixPtr &matrix)
Flattens each curve in the path by converting them into a series of connected lines....
GraphicsPath(const ArrayPtr< Point > &pts, const ArrayPtr< uint8_t > &types, FillMode fillMode=FillMode::Alternate)
Constructs a new instance of GraphicsPath object that represents the specified path.
void AddEllipse(int x, int y, int width, int height)
Adds the specified ellipse to the path represented by the current object.
void AddPolygon(const ArrayPtr< Point > &points)
Adds the specified polygon to the path represented by the current object.
void set_FillMode(FillMode mode)
Sets the fill mode of the current object.
void AddBezier(const Point &pt1, const Point &pt2, const Point &pt3, const Point &pt4)
Adds the specified cubic Bezier curve to the path represented by the current object.
GraphicsPath(const SkPath &path)
void AddBezier(const PointF &pt1, const PointF &pt2, const PointF &pt3, const PointF &pt4)
Adds the specified cubic Bezier curve to the path represented by the current object.
virtual SharedPtr< GraphicsPath > Clone()
Creates a copy of the current object.
void AddLine(const Point &pt1, const Point &pt2)
Adds the specified line to the path represented by the current object.
RectangleF GetBounds(const MatrixPtr &matrix=nullptr, const SharedPtr< Pen > &pen=nullptr) const
Returns a RectangleF object that represents a rectangle that bounds the path represented by the curre...
void AddStringImpl(const String &text, const SharedPtr< FontFamily > &family, int style, float emSize, SkRect layoutRect, const SharedPtr< StringFormat > &stringFormat)
Adds a string of text to the path represented by the current object.
void AddPath(const SharedPtr< GraphicsPath > &path, bool connect)
Adds the specified path to the path represented by the current object.
std::shared_ptr< SkPath > GetSkPath(const SharedPtr< Pen > &pen, const SkMatrix &matrix)
Returns a processed SkPath.
void AddLines(const ArrayPtr< Point > &points)
Adds the specified series of connected line segments to the path represented by the current object.
void AddBeziers(const ArrayPtr< Point > &points)
Adds a sequence of connected cubic Bezier curves to the current figure.
void AddString(const String &text, const SharedPtr< FontFamily > &family, int style, float emSize, Rectangle layoutRect, const SharedPtr< StringFormat > &stringFormat)
Adds a string of text to the path represented by the current object.
void AddPie(const Rectangle &rect, float startAngle, float sweepAngle)
Adds the specified outline of the pie shape to the path represented by the current object.
ArrayPtr< uint8_t > get_PathTypesImpl(bool forceClose) const
Returns an array that contains values that indicate the types of the points that make up a path repre...
~GraphicsPath()
Destructor.
void AddString(const String &text, const SharedPtr< FontFamily > &family, int style, float emSize, RectangleF layoutRect, const SharedPtr< StringFormat > &stringFormat)
Adds a string of text to the path represented by the current object.
bool IsOutlineVisible(const PointF &point, const SharedPtr< Pen > &pen)
Indicates whether the specified point is contained within (under) the outline of this GraphicsPath wh...
void AddCurve(const ArrayPtr< PointF > &points, float tension=0.5)
Adds the specified curve to the path represented by the current object.
void AddArc(const Rectangle &rect, float startAngle, float sweepAngle)
Adds the specified elliptical arc to the path represented by the current object.
bool IsVisible(const PointF &point)
Determines if the specified point is contained within the path represented by the current object.
void AddArc(const RectangleF &rect, float startAngle, float sweepAngle)
Adds the specified elliptical arc to the path represented by the current object.
ArrayPtr< uint8_t > get_PathTypesImpl() const
Returns an array that contains values that indicate the types of the points that make up a path repre...
void AddBezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
Adds the specified cubic Bezier curve to the path represented by the current object.
void AddString(const String &text, const SharedPtr< FontFamily > &family, int style, float emSize, Point origin, const SharedPtr< StringFormat > &stringFormat)
Adds a string of text to the path represented by the current object.
void AddLines(const ArrayPtr< PointF > &points)
Adds the specified series of connected line segments to the path represented by the current object.
void Transform(const SkMatrix &matrix)
void AddRectangles(const ArrayPtr< Rectangle > &rects)
Adds the specified series of rectangles to the path represented by the current object.
void AddBezier(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
Adds the specified cubic Bezier curve to the path represented by the current object.
void Widen(const SharedPtr< Pen > &pen)
Replaces this path with an outline around the original path.
void AddCurve(const ArrayPtr< Point > &points, float tension=0.5)
Adds the specified curve to the path represented by the current object.
void AddString(const String &text, const SharedPtr< FontFamily > &family, int style, float emSize, PointF origin, const SharedPtr< StringFormat > &stringFormat)
Adds a string of text to the path represented by the current object.
void AddPie(float x, float y, float width, float height, float startAngle, float sweepAngle)
Adds the specified outline of the pie shape to the path represented by the current object.
GraphicsPath(const ArrayPtr< PointF > &pts, const ArrayPtr< uint8_t > &types, FillMode fillMode=FillMode::Alternate)
Constructs a new instance of GraphicsPath object that represents the specified path.
void AddPie(int x, int y, int width, int height, float startAngle, float sweepAngle)
Adds the specified outline of the pie shape to the path represented by the current object.
Detail::FigureType GetFigureFlags()
Returns a value which is a bitwise combination of Detail::FigureType values that indicates what types...
Definition: graphics_path.h:415
void AddRectangle(const Rectangle &rect)
Adds the specified rectangle to the path represented by the current object.
void AddClosedCurve(const ArrayPtr< PointF > &points, float tension=0.5)
Adds the specified closed curve to the path represented by the current object.
PointF GetLastPoint() const
Returns a PointF object representing the last point in the path.
void Transform(const MatrixPtr &matrix)
Transforms the path represented by the current object by applying the specified transform matrix to i...
void AddEllipse(const Rectangle &rect)
Adds the specified ellipse to the path represented by the current object.
void Reverse()
Reverses the order of points in the PathPoints array of this GraphicsPath.
void AddEllipse(float x, float y, float width, float height)
Adds the specified ellipse to the path represented by the current object.
void AddLine(int x1, int y1, int x2, int y2)
Adds the specified line to the path represented by the current object.
void AddEllipseImpl(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)
Adds the specified ellipse to the path represented by the current object.
void Flatten()
Flattens each curve in the path by converting them into a series of connected lines....
int get_PointCount() const
Returns the number of points in the path represented by the current object.
void StartFigure()
Starts a new figure.
bool IsVisible(float x, float y)
Determines if the specified point is contained within the path represented by the current object.
GraphicsPath(FillMode fillMode=FillMode::Alternate)
Constructs a new instance of GraphicsPath class with the specified fill mode.
void Reset()
Empties the path by removing all points from it.
void AddRectangles(const ArrayPtr< RectangleF > &rects)
Adds the specified series of rectangles to the path represented by the current object.
void CloseFigure()
Closes the current figure and starts a new one.
void AddEllipse(const RectangleF &rect)
Adds the specified ellipse to the path represented by the current object.
ArrayPtr< PointF > get_PathPoints() const
Returns an array that contains points that make up a path represented by the current object.
void AddClosedCurve(const ArrayPtr< Point > &points, float tension=0.5)
Adds the specified closed curve to the path represented by the current object.
SharedPtr< PathData > get_PathData()
Returns a PathData object containing the points that make up a path represented by the current object...
void AddRectangle(const RectangleF &rect)
Adds the specified rectangle to the path represented by the current object.
Represents a brush that fills the interior of a GraphicsPath object with a gradient....
Definition: path_gradient_brush.h:39
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
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
FillMode
Specifies how to fill the interior of a closed path.
Definition: fill_mode.h:9
@ Alternate
Alternate fill mode.
Definition: db_command.h:9