86 bool operator== (
const Path&)
const noexcept;
87 bool operator!= (
const Path&)
const noexcept;
89 static const float defaultToleranceForTesting;
90 static const float defaultToleranceForMeasurement;
94 bool isEmpty()
const noexcept;
117 bool contains (
float x,
float y,
118 float tolerance = defaultToleranceForTesting)
const;
134 float tolerance = defaultToleranceForTesting)
const;
147 float tolerance = defaultToleranceForTesting)
const;
167 float tolerance = defaultToleranceForMeasurement)
const;
174 Point<float> getPointAlongPath (
float distanceFromStart,
176 float tolerance = defaultToleranceForMeasurement)
const;
185 float tolerance = defaultToleranceForMeasurement)
const;
189 void clear()
noexcept;
202 void startNewSubPath (
float startX,
float startY);
240 void lineTo (
float endX,
float endY);
262 void quadraticTo (
float controlPointX,
288 void cubicTo (
float controlPoint1X,
289 float controlPoint1Y,
290 float controlPoint2X,
291 float controlPoint2Y,
317 void addRectangle (
float x,
float y,
float width,
float height);
323 template <
typename ValueType>
326 addRectangle (
static_cast<float> (rectangle.
getX()),
static_cast<float> (rectangle.
getY()),
327 static_cast<float> (rectangle.
getWidth()),
static_cast<float> (rectangle.
getHeight()));
334 void addRoundedRectangle (
float x,
float y,
float width,
float height,
341 void addRoundedRectangle (
float x,
float y,
float width,
float height,
349 void addRoundedRectangle (
float x,
float y,
float width,
float height,
350 float cornerSizeX,
float cornerSizeY,
351 bool curveTopLeft,
bool curveTopRight,
352 bool curveBottomLeft,
bool curveBottomRight);
358 template <
typename ValueType>
361 addRoundedRectangle (
static_cast<float> (rectangle.
getX()),
static_cast<float> (rectangle.
getY()),
362 static_cast<float> (rectangle.
getWidth()),
static_cast<float> (rectangle.
getHeight()),
363 cornerSizeX, cornerSizeY);
370 template <
typename ValueType>
373 addRoundedRectangle (rectangle, cornerSize, cornerSize);
384 void addTriangle (
float x1,
float y1,
408 void addQuadrilateral (
float x1,
float y1,
417 void addEllipse (
float x,
float y,
float width,
float height);
446 void addArc (
float x,
float y,
float width,
float height,
449 bool startAsNewSubPath =
false);
473 void addCentredArc (
float centreX,
float centreY,
474 float radiusX,
float radiusY,
475 float rotationOfEllipse,
478 bool startAsNewSubPath =
false);
502 void addPieSegment (
float x,
float y,
503 float width,
float height,
506 float innerCircleProportionalSize);
529 float innerCircleProportionalSize);
538 void addLineSegment (
Line<float> line,
float lineThickness);
546 float arrowheadWidth,
547 float arrowheadLength);
555 float startAngle = 0.0f);
564 float startAngle = 0.0f);
580 float arrowBaseWidth);
589 void addPath (
const Path& pathToAppend);
599 void addPath (
const Path& pathToAppend,
607 void swapWithPath (
Path&)
noexcept;
619 void preallocateSpace (
int numExtraCoordsToMakeSpaceFor);
643 void scaleToFit (
float x,
float y,
float width,
float height,
644 bool preserveProportions)
noexcept;
663 AffineTransform getTransformToScaleToFit (
float x,
float y,
float width,
float height,
664 bool preserveProportions,
665 Justification justificationType = Justification::centred)
const;
682 bool preserveProportions,
683 Justification justificationType = Justification::centred)
const;
690 Path createPathWithRoundedCorners (
float cornerRadius)
const;
708 void setUsingNonZeroWinding (
bool isNonZeroWinding)
noexcept;
738 bool next()
noexcept;
750 PathElementType elementType;
752 float x1 = 0,
y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0;
782 void loadPathFromData (
const void* data,
size_t numberOfBytes);
788 void writePathToStream (
OutputStream& destination)
const;
799 void restoreFromString (
StringRef stringVersion);
811 PathBounds() noexcept;
812 Rectangle<
float> getRectangle() const noexcept;
813 void reset() noexcept;
814 void reset (
float,
float) noexcept;
815 void extend (
float,
float) noexcept;
817 template <typename... Coords>
818 void extend (
float x,
float y, Coords... coords) noexcept
824 float pathXMin = 0, pathXMax = 0, pathYMin = 0, pathYMax = 0;
828 bool useNonZeroWinding =
true;
830 static constexpr float lineMarker = 100001.0f;
831 static constexpr float moveMarker = 100002.0f;
832 static constexpr float quadMarker = 100003.0f;
833 static constexpr float cubicMarker = 100004.0f;
834 static constexpr float closeSubPathMarker = 100005.0f;
Holds a resizable array of primitive or copy-by-value objects.
A table of horizontal scan-line segments - used for rasterising Paths.
Represents a type of justification to be used when positioning graphical items.
The base class for streams that write data to some kind of destination.
Flattens a Path object into a series of straight-line sections.
Iterates the lines and curves that a path contains.
@ quadraticTo
For this type, x1, y1, x2, y2 indicate the control point and endpoint of a quadratic curve.
@ lineTo
For this type, x1 and y1 indicate the end point of the line.
@ cubicTo
For this type, x1, y1, x2, y2, x3, y3 indicate the two control points and the endpoint of a cubic cur...
@ startNewSubPath
For this type, x1 and y1 will be set to indicate the first point in the subpath.
A path is a sequence of lines and curves that may either form a closed shape or be open-ended.
void addRoundedRectangle(Rectangle< ValueType > rectangle, float cornerSize)
Adds a rectangle with rounded corners to the path.
void addRoundedRectangle(Rectangle< ValueType > rectangle, float cornerSizeX, float cornerSizeY)
Adds a rectangle with rounded corners to the path.
bool isUsingNonZeroWinding() const
Returns the flag that indicates whether the path should use a non-zero winding rule.
void addRectangle(Rectangle< ValueType > rectangle)
Adds a rectangle to the path.
A pair of (x, y) coordinates.
Manages a rectangle and allows geometric operations to be performed on it.
ValueType getX() const noexcept
Returns the x coordinate of the rectangle's left-hand-side.
ValueType getWidth() const noexcept
Returns the width of the rectangle.
ValueType getY() const noexcept
Returns the y coordinate of the rectangle's top edge.
ValueType getHeight() const noexcept
Returns the height of the rectangle.
A simple class for holding temporary references to a string literal or String.
#define JUCE_LEAK_DETECTOR(OwnerClass)
This macro lets you embed a leak-detecting object inside a class.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...