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_DrawableShape.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//==============================================================================
38class JUCE_API DrawableShape : public Drawable
39{
40protected:
41 //==============================================================================
44
45public:
47 ~DrawableShape() override;
48
49 //==============================================================================
57 void setFill (const FillType& newFill);
58
62 const FillType& getFill() const noexcept { return mainFill; }
63
67 void setStrokeFill (const FillType& newStrokeFill);
68
72 const FillType& getStrokeFill() const noexcept { return strokeFill; }
73
78 void setStrokeType (const PathStrokeType& newStrokeType);
79
83 void setStrokeThickness (float newThickness);
84
86 const PathStrokeType& getStrokeType() const noexcept { return strokeType; }
87
89 void setDashLengths (const Array<float>& newDashLengths);
90
92 const Array<float>& getDashLengths() const noexcept { return dashLengths; }
93
94 //==============================================================================
96 Rectangle<float> getDrawableBounds() const override;
98 void paint (Graphics&) override;
100 bool hitTest (int x, int y) override;
102 bool replaceColour (Colour originalColour, Colour replacementColour) override;
104 Path getOutlineAsPath() const override;
105
106protected:
107 //==============================================================================
109 void pathChanged();
111 void strokeChanged();
113 bool isStrokeVisible() const noexcept;
114
115 //==============================================================================
116 PathStrokeType strokeType;
117 Array<float> dashLengths;
118 Path path, strokePath;
119
120private:
121 FillType mainFill, strokeFill;
122
123 DrawableShape& operator= (const DrawableShape&);
124};
125
126} // namespace juce
Holds a resizable array of primitive or copy-by-value objects.
Definition juce_Array.h:56
Represents a colour, also including a transparency value.
Definition juce_Colour.h:38
A base class implementing common functionality for Drawable classes which consist of some kind of fil...
const FillType & getFill() const noexcept
Returns the current fill type.
const FillType & getStrokeFill() const noexcept
Returns the current stroke fill.
const Array< float > & getDashLengths() const noexcept
Returns the set of dash lengths that the path is using.
const PathStrokeType & getStrokeType() const noexcept
Returns the current outline style.
The base class for objects which can draw themselves, e.g.
Represents a colour or fill pattern to use for rendering paths.
A graphics context, used for drawing a component or image.
Describes a type of stroke used to render a solid outline along a path.
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
Manages a rectangle and allows geometric operations to be performed on it.
JUCE Namespace.