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
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
juce::RelativePoint Class Reference

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

#include "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< floatresolve (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
 

Detailed Description

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

See also
RelativeCoordinate, RelativeRectangle

@tags{GUI}

Definition at line 37 of file juce_RelativePoint.h.

Constructor & Destructor Documentation

◆ RelativePoint() [1/5]

juce::RelativePoint::RelativePoint ( )

Creates a point at the origin.

Definition at line 41 of file juce_RelativePoint.cpp.

◆ RelativePoint() [2/5]

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

Creates an absolute point, relative to the origin.

Definition at line 45 of file juce_RelativePoint.cpp.

◆ RelativePoint() [3/5]

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

Creates an absolute point, relative to the origin.

Definition at line 50 of file juce_RelativePoint.cpp.

◆ RelativePoint() [4/5]

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

Creates an absolute point from two coordinates.

Definition at line 55 of file juce_RelativePoint.cpp.

◆ 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

Definition at line 60 of file juce_RelativePoint.cpp.

Member Function Documentation

◆ isDynamic()

bool juce::RelativePoint::isDynamic ( ) const

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

Definition at line 96 of file juce_RelativePoint.cpp.

◆ 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.

Definition at line 85 of file juce_RelativePoint.cpp.

◆ operator!=()

bool juce::RelativePoint::operator!= ( const RelativePoint other) const
noexcept

Definition at line 74 of file juce_RelativePoint.cpp.

◆ operator==()

bool juce::RelativePoint::operator== ( const RelativePoint other) const
noexcept

Definition at line 69 of file juce_RelativePoint.cpp.

◆ 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.

Definition at line 79 of file juce_RelativePoint.cpp.

◆ 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.

Definition at line 91 of file juce_RelativePoint.cpp.

Member Data Documentation

◆ x

RelativeCoordinate juce::RelativePoint::x

Definition at line 88 of file juce_RelativePoint.h.

◆ y

RelativeCoordinate juce::RelativePoint::y

Definition at line 88 of file juce_RelativePoint.h.


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