Loading...
Searching...
No Matches
juce::RelativePoint Class Reference

## Detailed Description

An X-Y position stored as a pair of RelativeCoordinate values.

See also
  RelativeCoordinate, RelativeRectangle

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

- juce_gui_basics/positioning/juce_RelativePoint.h

## Public Member Functions

| RelativePoint ()
| Creates a point at the origin.
| RelativePoint (Point< float > absolutePoint)
| Creates an absolute point, relative to the origin.
| RelativePoint (float absoluteX, float absoluteY)
| Creates an absolute point, relative to the origin.
| RelativePoint (const RelativeCoordinate &x, const RelativeCoordinate &y)
| Creates an absolute point from two coordinates.
| RelativePoint (const String &stringVersion)
| Creates a point from a stringified representation.
bool | operator== (const RelativePoint &) const noexcept
bool | operator!= (const RelativePoint &) const noexcept
Point< float > | resolve (const Expression::Scope *evaluationContext) const
| Calculates the absolute position of this point.
void | moveToAbsolute (Point< float > newPos, const Expression::Scope *evaluationContext)
| Changes the values of this point's coordinates to make it resolve to the specified position.
String | toString () const
| Returns a string which represents this point.
bool | isDynamic () const
| Returns true if this point depends on any other coordinates for its position.

## Public Attributes

RelativeCoordinate | x
RelativeCoordinate | y

## Constructors and Destructors

## RelativePoint() [1/5]

juce::RelativePoint::RelativePoint | ( |  | ) |

Creates a point at the origin.

Referenced by operator!=(), and operator==().

## RelativePoint() [2/5]

juce::RelativePoint::RelativePoint | ( | Point< float > | absolutePoint | ) |

Creates an absolute point, relative to the origin.

## RelativePoint() [3/5]

juce::RelativePoint::RelativePoint | ( | float | absoluteX,
|  | float | absoluteY )

Creates an absolute point, relative to the origin.

## RelativePoint() [4/5]

juce::RelativePoint::RelativePoint | ( | const RelativeCoordinate & | x,
|  | const RelativeCoordinate & | y )

Creates an absolute point from two coordinates.

References x, and y.

## RelativePoint() [5/5]

juce::RelativePoint::RelativePoint | ( | const String & | stringVersion | ) |

Creates a point from a stringified representation.

The string must contain a pair of coordinates, separated by space or a comma. The syntax for the coordinate strings is explained in the RelativeCoordinate class.

See also
  toString

## Member Functions

## operator==()

bool juce::RelativePoint::operator== | ( | const RelativePoint & |  | ) | const

noexcept

References RelativePoint().

## operator!=()

bool juce::RelativePoint::operator!= | ( | const RelativePoint & |  | ) | const

noexcept

References RelativePoint().

## resolve()

Point< float > juce::RelativePoint::resolve | ( | const Expression::Scope * | evaluationContext | ) | const

Calculates the absolute position of this point.

You'll need to provide a suitable Expression::Scope for looking up any coordinates that may be needed to calculate the result.

## moveToAbsolute()

void juce::RelativePoint::moveToAbsolute | ( | Point< float > | newPos,
|  | const Expression::Scope * | evaluationContext )

Changes the values of this point's coordinates to make it resolve to the specified position.

Calling this will leave any anchor points unchanged, but will set any absolute or relative positions to whatever values are necessary to make the resultant position match the position that is provided.

## toString()

String juce::RelativePoint::toString | ( |  | ) | const

Returns a string which represents this point.

This returns a comma-separated pair of coordinates. For details of the string syntax used by the coordinates, see the RelativeCoordinate constructor notes. The string that is returned can be passed to the RelativePoint constructor to recreate the point.

## isDynamic()

bool juce::RelativePoint::isDynamic | ( |  | ) | const

Returns true if this point depends on any other coordinates for its position.

## Member Data Documentation

## x

RelativeCoordinate juce::RelativePoint::x

Referenced by RelativePoint().

## y

RelativeCoordinate juce::RelativePoint::y

Referenced by RelativePoint().

### 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