39RelativeCoordinate::StandardStrings::Type RelativeCoordinate::StandardStrings::getTypeOf (
const String& s)
noexcept
41 if (s == Strings::left)
return left;
42 if (s == Strings::right)
return right;
43 if (s == Strings::top)
return top;
44 if (s == Strings::bottom)
return bottom;
45 if (s == Strings::x)
return x;
46 if (s == Strings::y)
return y;
47 if (s == Strings::width)
return width;
48 if (s == Strings::height)
return height;
49 if (s == Strings::parent)
return parent;
68RelativeCoordinate& RelativeCoordinate::operator= (
const RelativeCoordinate&
other)
75 : term (std::move (
other.term))
79RelativeCoordinate& RelativeCoordinate::operator= (RelativeCoordinate&&
other)
noexcept
81 term = std::move (
other.term);
102 return term.toString() ==
other.term.toString();
105bool RelativeCoordinate::operator!= (
const RelativeCoordinate&
other)
const noexcept
107 return ! operator== (
other);
112 if (scope !=
nullptr)
122 if (scope !=
nullptr)
132 if (scope !=
nullptr)
When evaluating an Expression object, this class is used to resolve symbols and perform functions tha...
A class for dynamically evaluating simple numeric expressions.
Expression adjustedToGiveNewResult(double targetValue, const Scope &scope) const
Attempts to return an expression which is a copy of this one, but with a constant adjusted to make th...
bool usesAnySymbols() const
Returns true if this expression contains any symbols.
double evaluate() const
Evaluates this expression, without using a Scope.
String toString() const
Returns a string version of the expression.
Expresses a coordinate as a dynamically evaluated expression.
void moveToAbsolute(double absoluteTargetPosition, const Expression::Scope *evaluationScope)
Changes the value of this coord to make it resolve to the specified position.
bool isDynamic() const
Returns true if this coordinate depends on any other coordinates for its position.
bool isRecursive(const Expression::Scope *evaluationScope) const
Returns true if there's a recursive loop when trying to resolve this coordinate's position.
String toString() const
Returns a string which represents this coordinate.
RelativeCoordinate()
Creates a zero coordinate.
double resolve(const Expression::Scope *evaluationScope) const
Calculates the absolute position of this coordinate.
~RelativeCoordinate()
Destructor.
bool isNotEmpty() const noexcept
Returns true if the string contains at least one character.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
static const String top
"top"
static const String bottom
"bottom"
static const String height
"height"
static const String width
"width"
static const String right
"right"
static const String left
"left"
static const String parent
"parent"