|
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 |
Flattens a Path object into a series of straight-line sections. More...
#include "juce_PathIterator.h"
Public Member Functions | |
| PathFlatteningIterator (const Path &path, const AffineTransform &transform=AffineTransform(), float tolerance=Path::defaultToleranceForMeasurement) | |
| Creates a PathFlatteningIterator. | |
| ~PathFlatteningIterator () | |
| Destructor. | |
| bool | next () |
| Fetches the next line segment from the path. | |
| bool | isLastInSubpath () const noexcept |
| Returns true if the current segment is the last in the current sub-path. | |
Public Attributes | |
| float | x1 |
| The x position of the start of the current line segment. | |
| float | y1 |
| The y position of the start of the current line segment. | |
| float | x2 |
| The x position of the end of the current line segment. | |
| float | y2 |
| The y position of the end of the current line segment. | |
| bool | closesSubPath |
| Indicates whether the current line segment is closing a sub-path. | |
| int | subPathIndex |
| The index of the current line within the current sub-path. | |
Flattens a Path object into a series of straight-line sections.
Use one of these to iterate through a Path object, and it will convert all the curves into line sections so it's easy to render or perform geometric operations on.
@tags{Graphics}
Definition at line 41 of file juce_PathIterator.h.
| juce::PathFlatteningIterator::PathFlatteningIterator | ( | const Path & | path, |
| const AffineTransform & | transform = AffineTransform(), |
||
| float | tolerance = Path::defaultToleranceForMeasurement |
||
| ) |
Creates a PathFlatteningIterator.
After creation, use the next() method to initialise the fields in the object with the first line's position.
| path | the path to iterate along |
| transform | a transform to apply to each point in the path being iterated |
| tolerance | the amount by which the curves are allowed to deviate from the lines into which they are being broken down - a higher tolerance contains less lines, so can be generated faster, but will be less smooth. |
Definition at line 34 of file juce_PathIterator.cpp.
| juce::PathFlatteningIterator::~PathFlatteningIterator | ( | ) |
Destructor.
Definition at line 50 of file juce_PathIterator.cpp.
|
noexcept |
Returns true if the current segment is the last in the current sub-path.
Definition at line 54 of file juce_PathIterator.cpp.
| bool juce::PathFlatteningIterator::next | ( | ) |
Fetches the next line segment from the path.
This will update the member variables x1, y1, x2, y2, subPathIndex and closesSubPath so that they describe the new line segment.
Definition at line 60 of file juce_PathIterator.cpp.
| bool juce::PathFlatteningIterator::closesSubPath |
Indicates whether the current line segment is closing a sub-path.
If the current line is the one that connects the end of a sub-path back to the start again, this will be true.
Definition at line 83 of file juce_PathIterator.h.
| int juce::PathFlatteningIterator::subPathIndex |
The index of the current line within the current sub-path.
E.g. you can use this to see whether the line is the first one in the subpath by seeing if it's 0.
Definition at line 90 of file juce_PathIterator.h.
| float juce::PathFlatteningIterator::x1 |
The x position of the start of the current line segment.
Definition at line 73 of file juce_PathIterator.h.
| float juce::PathFlatteningIterator::x2 |
The x position of the end of the current line segment.
Definition at line 75 of file juce_PathIterator.h.
| float juce::PathFlatteningIterator::y1 |
The y position of the start of the current line segment.
Definition at line 74 of file juce_PathIterator.h.
| float juce::PathFlatteningIterator::y2 |
The y position of the end of the current line segment.
Definition at line 76 of file juce_PathIterator.h.