CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
custom_line_cap.h
1
2#ifndef _aspose_drawing_drawing2d_custom_line_cap_h_
3#define _aspose_drawing_drawing2d_custom_line_cap_h_
4
5#include "fwd.h"
6#include "drawing/drawing2d/line_cap.h"
7#include "drawing/drawing2d/line_join.h"
8#include "system/exceptions.h"
9
10#ifdef ASPOSECPPLIB_BEING_BUILT
11#include <core/SkScalar.h>
12#include <core/SkPath.h>
13#include <core/SkPathEffect.h>
14#endif
15
17ASPOSECPP_3RD_PARTY_CLASS(SkPaint);
19ASPOSECPP_3RD_PARTY_CLASS(SkPath);
21ASPOSECPP_3RD_PARTY_TYPEDEF(SkScalar, float);
23ASPOSECPP_3RD_PARTY_CLASS(SkPathEffect);
24
25template <typename T> class sk_sp;
26
27namespace System { namespace Drawing {
28
29class Pen;
30
31namespace Drawing2D {
32
33class GraphicsPath;
34
39class ASPOSECPP_SHARED_CLASS CustomLineCap : public Object
40{
41 RTTI_INFO(System::Drawing::Drawing2D::CustomLineCap, ::System::BaseTypesInfo<System::Object>)
42
43 friend class System::Drawing::Pen;
44
45public:
52 ASPOSECPP_SHARED_API CustomLineCap(const SharedPtr<GraphicsPath>& fillPath,
53 const SharedPtr<GraphicsPath>& strokePath,
54 LineCap baseCap = LineCap::Flat, float baseInset = 0);
55
59 ASPOSECPP_SHARED_API void SetStrokeCaps(LineCap startCap, LineCap endCap);
63 ASPOSECPP_SHARED_API void GetStrokeCaps(LineCap& startCap, LineCap& endCap);
65 virtual ASPOSECPP_SHARED_API SharedPtr<CustomLineCap> Clone();
66
68 ASPOSECPP_SHARED_API LineCap get_BaseCap() const;
71 ASPOSECPP_SHARED_API void set_BaseCap(LineCap value);
73 ASPOSECPP_SHARED_API float get_BaseInset() const;
76 ASPOSECPP_SHARED_API void set_BaseInset(float value);
78 ASPOSECPP_SHARED_API LineJoin get_StrokeJoin() const;
81 ASPOSECPP_SHARED_API void set_StrokeJoin(LineJoin value);
83 ASPOSECPP_SHARED_API float get_WidthScale() const;
86 ASPOSECPP_SHARED_API void set_WidthScale(float value);
88 void Dispose() {};
89
90protected:
93
96
97 void Init(const SharedPtr<GraphicsPath>& fillPath, const SharedPtr<GraphicsPath>& strokePath,
98 bool fit_to_line_width, LineCap baseCap, float baseInset);
99
100private:
101 MEMBER_FUNCTION_MAKE_OBJECT(CustomLineCap, CODEPORTING_ARGS(), CODEPORTING_ARGS());
102
104 static SharedPtr<CustomLineCap> MakeForLineCap(LineCap value);
106 SkPath ScaleCapPath(SkScalar& scale_x, SkScalar& scale_y, SkScalar& width, bool fix_scale = true) const;
108 SkPaint BuildCapPaint(const SkPaint& base_paint, sk_sp<SkPathEffect> path_effect) const;
110 void Apply(const SkPaint& base_paint, std::vector<SkPaint>& result, SkScalar width,
111 SkScalar scale_x, SkScalar scale_y, bool is_start_cap) const;
113 void AppendPath(const SkPath* src_path, SkPath* dest_path, SkScalar width, bool is_start_cap,
114 bool fix_scale = true) const;
115
116 bool m_fit_to_line_width;
117
118 LineCap m_base_cap;
120 float m_inset;
121 LineJoin m_stroke_join;
122 float m_width_scale;
126 LineCap m_start_cap;
128 LineCap m_end_cap;
130 SharedPtr<CustomLineCap> m_start_cap_child;
132 SharedPtr<CustomLineCap> m_end_cap_child;
133};
134}}}
135
136#endif
Represents a user-defined line cap. Objects of this class should only be allocated using System::Make...
Definition: custom_line_cap.h:40
CustomLineCap()
Default constructor for subclass creation.
void Init(const SharedPtr< GraphicsPath > &fillPath, const SharedPtr< GraphicsPath > &strokePath, bool fit_to_line_width, LineCap baseCap, float baseInset)
bool m_is_filled
Indicates in this cap is filled.
Definition: custom_line_cap.h:95
Represents a set of connected lines and curves. Objects of this class should only be allocated using ...
Definition: graphics_path.h:80
Represents properties such as color, width etc. of the lines and curves being drawn....
Definition: pen.h:48
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
LineCap
Indicates the available cap styles with which a Pen object can end a line.
Definition: line_cap.h:9
LineJoin
Specifies how consequent lines or curves are joined.
Definition: line_join.h:9
@ Pen
Defines color adjustment information for Pen objects.
Definition: db_command.h:9