JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_RelativePointPath.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
40class JUCE_API RelativePointPath
41{
42public:
43 //==============================================================================
46 explicit RelativePointPath (const Path& path);
48
49 bool operator== (const RelativePointPath&) const noexcept;
50 bool operator!= (const RelativePointPath&) const noexcept;
51
52 //==============================================================================
54 void createPath (Path& path, Expression::Scope* scope) const;
55
57 bool containsAnyDynamicPoints() const;
58
60 void swapWith (RelativePointPath&) noexcept;
61
62 //==============================================================================
67 {
68 nullElement,
69 startSubPathElement,
70 closeSubPathElement,
71 lineToElement,
72 quadraticToElement,
73 cubicToElement
74 };
75
76 //==============================================================================
79 class JUCE_API ElementBase
80 {
81 public:
83 virtual ~ElementBase() = default;
84 virtual void addToPath (Path& path, Expression::Scope*) const = 0;
85 virtual RelativePoint* getControlPoints (int& numPoints) = 0;
86 virtual ElementBase* clone() const = 0;
87 bool isDynamic();
88
89 const ElementType type;
90
91 private:
93 };
94
95 //==============================================================================
97 class JUCE_API StartSubPath : public ElementBase
98 {
99 public:
100 StartSubPath (const RelativePoint& pos);
101 void addToPath (Path& path, Expression::Scope*) const override;
102 RelativePoint* getControlPoints (int& numPoints) override;
103 ElementBase* clone() const override;
104
105 RelativePoint startPos;
106
107 private:
109 };
110
111 //==============================================================================
113 class JUCE_API CloseSubPath : public ElementBase
114 {
115 public:
116 CloseSubPath();
117 void addToPath (Path& path, Expression::Scope*) const override;
118 RelativePoint* getControlPoints (int& numPoints) override;
119 ElementBase* clone() const override;
120
121 private:
123 };
124
125 //==============================================================================
127 class JUCE_API LineTo : public ElementBase
128 {
129 public:
130 LineTo (const RelativePoint& endPoint);
131 void addToPath (Path& path, Expression::Scope*) const override;
132 RelativePoint* getControlPoints (int& numPoints) override;
133 ElementBase* clone() const override;
134
135 RelativePoint endPoint;
136
137 private:
139 };
140
141 //==============================================================================
143 class JUCE_API QuadraticTo : public ElementBase
144 {
145 public:
146 QuadraticTo (const RelativePoint& controlPoint, const RelativePoint& endPoint);
147 ValueTree createTree() const;
148 void addToPath (Path& path, Expression::Scope*) const override;
149 RelativePoint* getControlPoints (int& numPoints) override;
150 ElementBase* clone() const override;
151
152 RelativePoint controlPoints[2];
153
154 private:
156 };
157
158 //==============================================================================
160 class JUCE_API CubicTo : public ElementBase
161 {
162 public:
163 CubicTo (const RelativePoint& controlPoint1, const RelativePoint& controlPoint2, const RelativePoint& endPoint);
164 ValueTree createTree() const;
165 void addToPath (Path& path, Expression::Scope*) const override;
166 RelativePoint* getControlPoints (int& numPoints) override;
167 ElementBase* clone() const override;
168
169 RelativePoint controlPoints[3];
170
171 private:
173 };
174
175 //==============================================================================
176 void addElement (ElementBase* newElement);
177
178 //==============================================================================
180 bool usesNonZeroWinding;
181
182private:
183 class Positioner;
184 friend class Positioner;
185 bool containsDynamicPoints;
186
187 void applyTo (DrawablePath& path) const;
188
189 RelativePointPath& operator= (const RelativePointPath&);
191};
192
193} // namespace juce
A drawable object which renders a filled or outlined shape.
When evaluating an Expression object, this class is used to resolve symbols and perform functions tha...
An array designed for holding objects.
A path is a sequence of lines and curves that may either form a closed shape or be open-ended.
Definition juce_Path.h:65
Class for the close sub path element.
Class for the cubic to element.
Base class for the elements that make up a RelativePointPath.
Class for the line to element.
Class for the quadratic to element.
Class for the start sub path element.
A path object that consists of RelativePoint coordinates rather than the normal fixed ones.
ElementType
The types of element that may be contained in this path.
An X-Y position stored as a pair of RelativeCoordinate values.
A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...
#define JUCE_LEAK_DETECTOR(OwnerClass)
This macro lets you embed a leak-detecting object inside a class.
#define JUCE_DECLARE_NON_COPYABLE(className)
This is a shorthand macro for deleting a class's copy constructor and copy assignment operator.
JUCE Namespace.