JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::Parallelogram< ValueType > Class Template Reference

Represents a parallelogram that is defined by 3 points. More...

#include <juce_Parallelogram.h>

Inheritance diagram for juce::Parallelogram< ValueType >:
Collaboration diagram for juce::Parallelogram< ValueType >:

Public Member Functions

 Parallelogram ()=default
 Creates a parallelogram with zero size at the origin.
 
 Parallelogram (const Parallelogram &)=default
 Creates a copy of another parallelogram.
 
 Parallelogram (Point< ValueType > topLeftPosition, Point< ValueType > topRightPosition, Point< ValueType > bottomLeftPosition) noexcept
 Creates a parallelogram based on 3 points.
 
 Parallelogram (Rectangle< ValueType > rectangle) noexcept
 Creates a parallelogram from a rectangle.
 
 ~Parallelogram ()=default
 Destructor.
 
Point< ValueType > getBottomLeft () const noexcept
 Returns the parallelogram's bottom-left position as a Point.
 
Point< ValueType > getBottomRight () const noexcept
 Returns the parallelogram's bottom-right position as a Point.
 
Rectangle< ValueType > getBoundingBox () const noexcept
 Returns the smallest rectangle that encloses this parallelogram.
 
ValueType getHeight () const noexcept
 Returns the height of the parallelogram (i.e.
 
Point< ValueType > getRelativePoint (Point< ValueType > relativePosition) const noexcept
 Returns a point within this parallelogram, specified as proportional coordinates.
 
Point< ValueType > getTopLeft () const noexcept
 Returns the parallelogram's top-left position as a Point.
 
Point< ValueType > getTopRight () const noexcept
 Returns the parallelogram's top-right position as a Point.
 
ValueType getWidth () const noexcept
 Returns the width of the parallelogram (i.e.
 
bool isEmpty () const noexcept
 Returns true if the parallelogram has an area of zero.
 
bool isFinite () const noexcept
 Returns true if the parallelogram's coordinates are all finite numbers, i.e.
 
bool operator!= (const Parallelogram &other) const noexcept
 Returns true if the two parallelograms are not identical.
 
template<typename PointOrScalarType >
Parallelogram operator* (PointOrScalarType scaleFactor) const noexcept
 Returns a parallelogram that has been scaled by the given amount, centred around the origin.
 
template<typename PointOrScalarType >
Parallelogram operator*= (PointOrScalarType scaleFactor) noexcept
 Scales this parallelogram by the given amount, centred around the origin.
 
Parallelogram operator+ (Point< ValueType > deltaPosition) const noexcept
 Returns a parallelogram which is the same as this one moved by a given amount.
 
Parallelogramoperator+= (Point< ValueType > deltaPosition) noexcept
 Moves this parallelogram by a given amount.
 
Parallelogram operator- (Point< ValueType > deltaPosition) const noexcept
 Returns a parallelogram which is the same as this one moved by a given amount.
 
Parallelogramoperator-= (Point< ValueType > deltaPosition) noexcept
 Moves this parallelogram by a given amount.
 
Parallelogramoperator= (const Parallelogram &)=default
 
bool operator== (const Parallelogram &other) const noexcept
 Returns true if the two parallelograms are identical.
 
Parallelogram transformedBy (const AffineTransform &transform) const noexcept
 Returns a transformed version of the parallelogram.
 

Public Attributes

Point< ValueType > bottomLeft
 
Point< ValueType > topLeft
 
Point< ValueType > topRight
 

Detailed Description

template<typename ValueType>
class juce::Parallelogram< ValueType >

Represents a parallelogram that is defined by 3 points.

See also
Rectangle, Point, Line

@tags{Graphics}

Constructor & Destructor Documentation

◆ Parallelogram() [1/4]

template<typename ValueType >
juce::Parallelogram< ValueType >::Parallelogram ( )
default

Creates a parallelogram with zero size at the origin.

◆ Parallelogram() [2/4]

template<typename ValueType >
juce::Parallelogram< ValueType >::Parallelogram ( const Parallelogram< ValueType > &  )
default

Creates a copy of another parallelogram.

◆ Parallelogram() [3/4]

template<typename ValueType >
juce::Parallelogram< ValueType >::Parallelogram ( Point< ValueType >  topLeftPosition,
Point< ValueType >  topRightPosition,
Point< ValueType >  bottomLeftPosition 
)
inlinenoexcept

Creates a parallelogram based on 3 points.

◆ Parallelogram() [4/4]

template<typename ValueType >
juce::Parallelogram< ValueType >::Parallelogram ( Rectangle< ValueType >  rectangle)
inlinenoexcept

Creates a parallelogram from a rectangle.

◆ ~Parallelogram()

template<typename ValueType >
juce::Parallelogram< ValueType >::~Parallelogram ( )
default

Destructor.

Member Function Documentation

◆ getBottomLeft()

template<typename ValueType >
Point< ValueType > juce::Parallelogram< ValueType >::getBottomLeft ( ) const
inlinenoexcept

Returns the parallelogram's bottom-left position as a Point.

References juce::Parallelogram< ValueType >::bottomLeft.

◆ getBottomRight()

template<typename ValueType >
Point< ValueType > juce::Parallelogram< ValueType >::getBottomRight ( ) const
inlinenoexcept

◆ getBoundingBox()

template<typename ValueType >
Rectangle< ValueType > juce::Parallelogram< ValueType >::getBoundingBox ( ) const
inlinenoexcept

◆ getHeight()

template<typename ValueType >
ValueType juce::Parallelogram< ValueType >::getHeight ( ) const
inlinenoexcept

Returns the height of the parallelogram (i.e.

the straight-line distance between the top-left and bottom-left.

References juce::Parallelogram< ValueType >::bottomLeft, juce::Line< ValueType >::getLength(), and juce::Parallelogram< ValueType >::topLeft.

◆ getRelativePoint()

template<typename ValueType >
Point< ValueType > juce::Parallelogram< ValueType >::getRelativePoint ( Point< ValueType >  relativePosition) const
inlinenoexcept

Returns a point within this parallelogram, specified as proportional coordinates.

The relative X and Y values should be between 0 and 1, where 0 is the left or top of this parallelogram, and 1 is the right or bottom. (Out-of-bounds values will return a point outside the parallelogram).

References juce::Parallelogram< ValueType >::bottomLeft, juce::Parallelogram< ValueType >::topLeft, and juce::Parallelogram< ValueType >::topRight.

◆ getTopLeft()

template<typename ValueType >
Point< ValueType > juce::Parallelogram< ValueType >::getTopLeft ( ) const
inlinenoexcept

Returns the parallelogram's top-left position as a Point.

References juce::Parallelogram< ValueType >::topLeft.

◆ getTopRight()

template<typename ValueType >
Point< ValueType > juce::Parallelogram< ValueType >::getTopRight ( ) const
inlinenoexcept

Returns the parallelogram's top-right position as a Point.

References juce::Parallelogram< ValueType >::topRight.

◆ getWidth()

template<typename ValueType >
ValueType juce::Parallelogram< ValueType >::getWidth ( ) const
inlinenoexcept

Returns the width of the parallelogram (i.e.

the straight-line distance between the top-left and top-right.

References juce::Line< ValueType >::getLength(), juce::Parallelogram< ValueType >::topLeft, and juce::Parallelogram< ValueType >::topRight.

◆ isEmpty()

template<typename ValueType >
bool juce::Parallelogram< ValueType >::isEmpty ( ) const
inlinenoexcept

◆ isFinite()

template<typename ValueType >
bool juce::Parallelogram< ValueType >::isFinite ( ) const
inlinenoexcept

Returns true if the parallelogram's coordinates are all finite numbers, i.e.

not NaN or infinity.

References juce::Parallelogram< ValueType >::bottomLeft, juce::Parallelogram< ValueType >::topLeft, and juce::Parallelogram< ValueType >::topRight.

◆ operator!=()

template<typename ValueType >
bool juce::Parallelogram< ValueType >::operator!= ( const Parallelogram< ValueType > &  other) const
inlinenoexcept

Returns true if the two parallelograms are not identical.

References juce::Parallelogram< ValueType >::operator==().

◆ operator*()

template<typename ValueType >
template<typename PointOrScalarType >
Parallelogram juce::Parallelogram< ValueType >::operator* ( PointOrScalarType  scaleFactor) const
inlinenoexcept

Returns a parallelogram that has been scaled by the given amount, centred around the origin.

◆ operator*=()

template<typename ValueType >
template<typename PointOrScalarType >
Parallelogram juce::Parallelogram< ValueType >::operator*= ( PointOrScalarType  scaleFactor)
inlinenoexcept

Scales this parallelogram by the given amount, centred around the origin.

References juce::Parallelogram< ValueType >::bottomLeft, juce::Parallelogram< ValueType >::topLeft, and juce::Parallelogram< ValueType >::topRight.

◆ operator+()

template<typename ValueType >
Parallelogram juce::Parallelogram< ValueType >::operator+ ( Point< ValueType >  deltaPosition) const
inlinenoexcept

Returns a parallelogram which is the same as this one moved by a given amount.

Referenced by juce::Parallelogram< ValueType >::operator-().

◆ operator+=()

template<typename ValueType >
Parallelogram & juce::Parallelogram< ValueType >::operator+= ( Point< ValueType >  deltaPosition)
inlinenoexcept

◆ operator-()

template<typename ValueType >
Parallelogram juce::Parallelogram< ValueType >::operator- ( Point< ValueType >  deltaPosition) const
inlinenoexcept

Returns a parallelogram which is the same as this one moved by a given amount.

References juce::Parallelogram< ValueType >::operator+().

◆ operator-=()

template<typename ValueType >
Parallelogram & juce::Parallelogram< ValueType >::operator-= ( Point< ValueType >  deltaPosition)
inlinenoexcept

Moves this parallelogram by a given amount.

References juce::Parallelogram< ValueType >::operator+=().

◆ operator=()

template<typename ValueType >
Parallelogram & juce::Parallelogram< ValueType >::operator= ( const Parallelogram< ValueType > &  )
default

◆ operator==()

template<typename ValueType >
bool juce::Parallelogram< ValueType >::operator== ( const Parallelogram< ValueType > &  other) const
inlinenoexcept

◆ transformedBy()

template<typename ValueType >
Parallelogram juce::Parallelogram< ValueType >::transformedBy ( const AffineTransform transform) const
inlinenoexcept

Returns a transformed version of the parallelogram.

Member Data Documentation

◆ bottomLeft

◆ topLeft

◆ topRight


The documentation for this class was generated from the following file: