openshot-audio  0.1.6
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) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_RELATIVEPOINTPATH_H_INCLUDED
26 #define JUCE_RELATIVEPOINTPATH_H_INCLUDED
27 
28 
29 //==============================================================================
39 {
40 public:
41  //==============================================================================
44  explicit RelativePointPath (const Path& path);
46 
47  bool operator== (const RelativePointPath&) const noexcept;
48  bool operator!= (const RelativePointPath&) const noexcept;
49 
50  //==============================================================================
52  void createPath (Path& path, Expression::Scope* scope) const;
53 
55  bool containsAnyDynamicPoints() const;
56 
58  void swapWith (RelativePointPath&) noexcept;
59 
60  //==============================================================================
65  {
71  cubicToElement
72  };
73 
74  //==============================================================================
78  {
79  public:
80  ElementBase (ElementType type);
81  virtual ~ElementBase() {}
82  virtual ValueTree createTree() const = 0;
83  virtual void addToPath (Path& path, Expression::Scope*) const = 0;
84  virtual RelativePoint* getControlPoints (int& numPoints) = 0;
85  virtual ElementBase* clone() const = 0;
86  bool isDynamic();
87 
89 
90  private:
92  };
93 
94  //==============================================================================
96  {
97  public:
98  StartSubPath (const RelativePoint& pos);
99  ValueTree createTree() const;
100  void addToPath (Path& path, Expression::Scope*) const;
101  RelativePoint* getControlPoints (int& numPoints);
102  ElementBase* clone() const;
103 
105 
106  private:
108  };
109 
110  //==============================================================================
112  {
113  public:
114  CloseSubPath();
115  ValueTree createTree() const;
116  void addToPath (Path& path, Expression::Scope*) const;
117  RelativePoint* getControlPoints (int& numPoints);
118  ElementBase* clone() const;
119 
120  private:
122  };
123 
124  //==============================================================================
125  class JUCE_API LineTo : public ElementBase
126  {
127  public:
128  LineTo (const RelativePoint& endPoint);
129  ValueTree createTree() const;
130  void addToPath (Path& path, Expression::Scope*) const;
131  RelativePoint* getControlPoints (int& numPoints);
132  ElementBase* clone() const;
133 
135 
136  private:
138  };
139 
140  //==============================================================================
142  {
143  public:
144  QuadraticTo (const RelativePoint& controlPoint, const RelativePoint& endPoint);
145  ValueTree createTree() const;
146  void addToPath (Path& path, Expression::Scope*) const;
147  RelativePoint* getControlPoints (int& numPoints);
148  ElementBase* clone() const;
149 
150  RelativePoint controlPoints[2];
151 
152  private:
154  };
155 
156  //==============================================================================
157  class JUCE_API CubicTo : public ElementBase
158  {
159  public:
160  CubicTo (const RelativePoint& controlPoint1, const RelativePoint& controlPoint2, const RelativePoint& endPoint);
161  ValueTree createTree() const;
162  void addToPath (Path& path, Expression::Scope*) const;
163  RelativePoint* getControlPoints (int& numPoints);
164  ElementBase* clone() const;
165 
166  RelativePoint controlPoints[3];
167 
168  private:
170  };
171 
172  //==============================================================================
173  void addElement (ElementBase* newElement);
174 
175  //==============================================================================
178 
179 private:
180  class Positioner;
181  friend class Positioner;
182  bool containsDynamicPoints;
183 
184  void applyTo (DrawablePath& path) const;
185 
186  RelativePointPath& operator= (const RelativePointPath&);
188 };
189 
190 
191 #endif // JUCE_RELATIVEPOINTPATH_H_INCLUDED
const ElementType type
Definition: juce_RelativePointPath.h:88
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_RelativePointPath.h:141
virtual RelativePoint * getControlPoints(int &numPoints)=0
Definition: juce_RelativePointPath.h:69
Definition: juce_Expression.h:113
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_RelativePointPath.h:70
Definition: juce_RelativePoint.h:35
Definition: juce_RelativePointPath.h:67
Definition: juce_RelativePointPath.h:68
Definition: juce_Path.h:62
bool usesNonZeroWinding
Definition: juce_RelativePointPath.h:177
virtual ElementBase * clone() const =0
ElementType
Definition: juce_RelativePointPath.h:64
Definition: juce_RelativePointPath.h:66
void addElement(ElementBase *newElement)
Definition: juce_RelativePointPath.cpp:113
RelativePoint endPoint
Definition: juce_RelativePointPath.h:134
Definition: juce_RelativePointPath.h:125
bool operator==(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:565
Definition: juce_DrawablePath.h:37
Definition: juce_OwnedArray.h:55
#define JUCE_DECLARE_NON_COPYABLE(className)
Definition: juce_PlatformDefs.h:191
Definition: juce_RelativePointPath.h:38
Definition: juce_RelativePointPath.h:95
Definition: juce_RelativePointPath.h:111
virtual ~ElementBase()
Definition: juce_RelativePointPath.h:81
Definition: juce_ValueTree.h:64
Definition: juce_RelativePointPath.h:157
#define JUCE_LEAK_DETECTOR(OwnerClass)
Definition: juce_LeakedObjectDetector.h:141
RelativePoint startPos
Definition: juce_RelativePointPath.h:104
bool operator!=(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:566
virtual void addToPath(Path &path, Expression::Scope *) const =0
Definition: juce_RelativePointPath.h:77
OwnedArray< ElementBase > elements
Definition: juce_RelativePointPath.h:176
virtual ValueTree createTree() const =0