JUCE
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Public Member Functions
RelativeCoordinate Class Reference

Expresses a coordinate as a dynamically evaluated expression. More...

List of all members.

Classes

struct  StandardStrings
struct  Strings
 A set of static strings that are commonly used by the RelativeCoordinate class. More...

Public Member Functions

 RelativeCoordinate ()
 Creates a zero coordinate.
 RelativeCoordinate (const Expression &expression)
 RelativeCoordinate (const RelativeCoordinate &other)
RelativeCoordinateoperator= (const RelativeCoordinate &other)
 RelativeCoordinate (double absoluteDistanceFromOrigin)
 Creates an absolute position from the parent origin on either the X or Y axis.
 RelativeCoordinate (const String &stringVersion)
 Recreates a coordinate from a string description.
 ~RelativeCoordinate ()
 Destructor.
bool operator== (const RelativeCoordinate &other) const noexcept
bool operator!= (const RelativeCoordinate &other) const noexcept
double resolve (const Expression::Scope *evaluationScope) const
 Calculates the absolute position of this coordinate.
bool references (const String &coordName, const Expression::Scope *evaluationScope) const
 Returns true if this coordinate uses the specified coord name at any level in its evaluation.
bool isRecursive (const Expression::Scope *evaluationScope) const
 Returns true if there's a recursive loop when trying to resolve this coordinate's position.
bool isDynamic () const
 Returns true if this coordinate depends on any other coordinates for its position.
void moveToAbsolute (double absoluteTargetPosition, const Expression::Scope *evaluationScope)
 Changes the value of this coord to make it resolve to the specified position.
const ExpressiongetExpression () const
 Returns the expression that defines this coordinate.
String toString () const
 Returns a string which represents this coordinate.

Detailed Description

Expresses a coordinate as a dynamically evaluated expression.

See also:
RelativePoint, RelativeRectangle

Constructor & Destructor Documentation

Creates a zero coordinate.

RelativeCoordinate::RelativeCoordinate ( double  absoluteDistanceFromOrigin)

Creates an absolute position from the parent origin on either the X or Y axis.

Parameters:
absoluteDistanceFromOriginthe distance from the origin
RelativeCoordinate::RelativeCoordinate ( const String stringVersion)

Recreates a coordinate from a string description.

The string will be parsed by ExpressionParser::parse().

Parameters:
stringVersionthe expression to use
See also:
toString

Destructor.


Member Function Documentation

RelativeCoordinate& RelativeCoordinate::operator= ( const RelativeCoordinate other)
bool RelativeCoordinate::operator== ( const RelativeCoordinate other) const
bool RelativeCoordinate::operator!= ( const RelativeCoordinate other) const
double RelativeCoordinate::resolve ( const Expression::Scope evaluationScope) const

Calculates the absolute position of this coordinate.

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

bool RelativeCoordinate::references ( const String coordName,
const Expression::Scope evaluationScope 
) const

Returns true if this coordinate uses the specified coord name at any level in its evaluation.

This will recursively check any coordinates upon which this one depends.

bool RelativeCoordinate::isRecursive ( const Expression::Scope evaluationScope) const

Returns true if there's a recursive loop when trying to resolve this coordinate's position.

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

void RelativeCoordinate::moveToAbsolute ( double  absoluteTargetPosition,
const Expression::Scope evaluationScope 
)

Changes the value of this coord to make it resolve to the specified position.

Calling this will leave the anchor points unchanged, but will set this coordinate's absolute or relative position to whatever value is necessary to make its resultant position match the position that is provided.

Returns the expression that defines this coordinate.

Returns a string which represents this coordinate.

For details of the string syntax, see the constructor notes.


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