Loading...
Searching...
No Matches
juce::Parallelogram< ValueType > Class Template Reference

## Detailed Description

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

Represents a parallelogram that is defined by 3 points.

See also
  Rectangle, Point, Line

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

- juce_graphics/geometry/juce_Parallelogram.h

## 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 & | operator= (const Parallelogram &)=default
| ~Parallelogram ()=default
| Destructor.
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.
ValueType | getWidth () const noexcept
| Returns the width of the parallelogram (i.e.
ValueType | getHeight () const noexcept
| Returns the height of the parallelogram (i.e.
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.
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.
bool | operator== (const Parallelogram &other) const noexcept
| Returns true if the two parallelograms are identical.
bool | operator!= (const Parallelogram &other) const noexcept
| Returns true if the two parallelograms are not identical.
Parallelogram | operator+ (Point< ValueType > deltaPosition) const noexcept
| Returns a parallelogram which is the same as this one moved by a given amount.
Parallelogram & | operator+= (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.
Parallelogram & | operator-= (Point< ValueType > deltaPosition) noexcept
| Moves this parallelogram by a given amount.
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.
Point< ValueType > | getRelativePoint (Point< ValueType > relativePosition) const noexcept
| Returns a point within this parallelogram, specified as proportional coordinates.
Parallelogram | transformedBy (const AffineTransform &transform) const noexcept
| Returns a transformed version of the parallelogram.
Rectangle< ValueType > | getBoundingBox () const noexcept
| Returns the smallest rectangle that encloses this parallelogram.

## Public Attributes

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

## Constructors and Destructors

## Parallelogram() [1/4]

template<typename ValueType>

juce::Parallelogram< ValueType >::Parallelogram | ( |  | ) |

default

Creates a parallelogram with zero size at the origin.

Referenced by operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), Parallelogram(), and transformedBy().

## Parallelogram() [2/4]

template<typename ValueType>

juce::Parallelogram< ValueType >::Parallelogram | ( | const Parallelogram< ValueType > & |  | ) |

default

Creates a copy of another parallelogram.

References Parallelogram().

## Parallelogram() [3/4]

template<typename ValueType>

juce::Parallelogram< ValueType >::Parallelogram | ( | Point< ValueType > | topLeftPosition,
|  | Point< ValueType > | topRightPosition,
|  | Point< ValueType > | bottomLeftPosition )

inline noexcept

Creates a parallelogram based on 3 points.

## Parallelogram() [4/4]

template<typename ValueType>

juce::Parallelogram< ValueType >::Parallelogram | ( | Rectangle< ValueType > | rectangle | ) |

inline noexcept

Creates a parallelogram from a rectangle.

## ~Parallelogram()

template<typename ValueType>

juce::Parallelogram< ValueType >::~Parallelogram | ( |  | ) |

default

Destructor.

## Member Functions

## operator=()

template<typename ValueType>

Parallelogram & juce::Parallelogram< ValueType >::operator= | ( | const Parallelogram< ValueType > & |  | ) |

default

References Parallelogram().

## isEmpty()

template<typename ValueType>

bool juce::Parallelogram< ValueType >::isEmpty | ( |  | ) | const

inline noexcept

Returns true if the parallelogram has an area of zero.

References bottomLeft, topLeft, and topRight.

## isFinite()

template<typename ValueType>

bool juce::Parallelogram< ValueType >::isFinite | ( |  | ) | const

inline noexcept

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

not NaN or infinity.

References bottomLeft, topLeft, and topRight.

## getWidth()

template<typename ValueType>

ValueType juce::Parallelogram< ValueType >::getWidth | ( |  | ) | const

inline noexcept

Returns the width of the parallelogram (i.e.

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

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

## getHeight()

template<typename ValueType>

ValueType juce::Parallelogram< ValueType >::getHeight | ( |  | ) | const

inline noexcept

Returns the height of the parallelogram (i.e.

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

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

## getTopLeft()

template<typename ValueType>

Point< ValueType > juce::Parallelogram< ValueType >::getTopLeft | ( |  | ) | const

inline noexcept

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

References topLeft.

## getTopRight()

template<typename ValueType>

Point< ValueType > juce::Parallelogram< ValueType >::getTopRight | ( |  | ) | const

inline noexcept

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

References topRight.

## getBottomLeft()

template<typename ValueType>

Point< ValueType > juce::Parallelogram< ValueType >::getBottomLeft | ( |  | ) | const

inline noexcept

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

References bottomLeft.

## getBottomRight()

template<typename ValueType>

Point< ValueType > juce::Parallelogram< ValueType >::getBottomRight | ( |  | ) | const

inline noexcept

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

References bottomLeft, topLeft, and topRight.

Referenced by getBoundingBox().

## operator==()

template<typename ValueType>

bool juce::Parallelogram< ValueType >::operator== | ( | const Parallelogram< ValueType > & | other | ) | const

inline noexcept

Returns true if the two parallelograms are identical.

References bottomLeft, Parallelogram(), topLeft, and topRight.

Referenced by operator!=().

## operator!=()

template<typename ValueType>

bool juce::Parallelogram< ValueType >::operator!= | ( | const Parallelogram< ValueType > & | other | ) | const

inline noexcept

Returns true if the two parallelograms are not identical.

References operator==(), and Parallelogram().

## operator+()

template<typename ValueType>

Parallelogram juce::Parallelogram< ValueType >::operator+ | ( | Point< ValueType > | deltaPosition | ) | const

inline noexcept

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

References Parallelogram().

Referenced by operator-().

## operator+=()

template<typename ValueType>

Parallelogram & juce::Parallelogram< ValueType >::operator+= | ( | Point< ValueType > | deltaPosition | ) |

inline noexcept

Moves this parallelogram by a given amount.

References bottomLeft, Parallelogram(), topLeft, and topRight.

Referenced by operator-=().

## operator-()

template<typename ValueType>

Parallelogram juce::Parallelogram< ValueType >::operator- | ( | Point< ValueType > | deltaPosition | ) | const

inline noexcept

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

References operator+(), and Parallelogram().

## operator-=()

template<typename ValueType>

Parallelogram & juce::Parallelogram< ValueType >::operator-= | ( | Point< ValueType > | deltaPosition | ) |

inline noexcept

Moves this parallelogram by a given amount.

References operator+=(), and Parallelogram().

## operator*()

template<typename ValueType>
template<typename PointOrScalarType>

Parallelogram juce::Parallelogram< ValueType >::operator* | ( | PointOrScalarType | scaleFactor | ) | const

inline noexcept

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

References Parallelogram().

## operator*=()

template<typename ValueType>
template<typename PointOrScalarType>

Parallelogram juce::Parallelogram< ValueType >::operator*= | ( | PointOrScalarType | scaleFactor | ) |

inline noexcept

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

References bottomLeft, Parallelogram(), topLeft, and topRight.

## getRelativePoint()

template<typename ValueType>

Point< ValueType > juce::Parallelogram< ValueType >::getRelativePoint | ( | Point< ValueType > | relativePosition | ) | const

inline noexcept

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 bottomLeft, topLeft, and topRight.

## transformedBy()

template<typename ValueType>

Parallelogram juce::Parallelogram< ValueType >::transformedBy | ( | const AffineTransform & | transform | ) | const

inline noexcept

Returns a transformed version of the parallelogram.

References Parallelogram().

## getBoundingBox()

template<typename ValueType>

Rectangle< ValueType > juce::Parallelogram< ValueType >::getBoundingBox | ( |  | ) | const

inline noexcept

Returns the smallest rectangle that encloses this parallelogram.

References bottomLeft, juce::Rectangle< ValueType >::findAreaContainingPoints(), getBottomRight(), topLeft, and topRight.

## Member Data Documentation

## topLeft

template<typename ValueType>

Point<ValueType> juce::Parallelogram< ValueType >::topLeft

Referenced by getBottomRight(), getBoundingBox(), getHeight(), getRelativePoint(), getTopLeft(), getWidth(), isEmpty(), isFinite(), operator*=(), operator+=(), and operator==().

## topRight

template<typename ValueType>

Point<ValueType> juce::Parallelogram< ValueType >::topRight

Referenced by getBottomRight(), getBoundingBox(), getRelativePoint(), getTopRight(), getWidth(), isEmpty(), isFinite(), operator*=(), operator+=(), and operator==().

## bottomLeft

template<typename ValueType>

Point<ValueType> juce::Parallelogram< ValueType >::bottomLeft

Referenced by getBottomLeft(), getBottomRight(), getBoundingBox(), getHeight(), getRelativePoint(), isEmpty(), isFinite(), operator*=(), operator+=(), and operator==().

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited