21 const std::string &
value)
51 std::shared_ptr<VisibleWhenProperty> &&conditionTwo,
66 const auto &objectOne = comparison->conditionOne;
67 const auto &objectTwo = comparison->conditionTwo;
69 switch (comparison->logicOperator) {
71 return objectOne->isVisible(algo) && objectTwo->isVisible(algo);
74 return objectOne->isVisible(algo) || objectTwo->isVisible(algo);
77 return objectOne->isVisible(algo) ^ objectTwo->isVisible(algo);
80 throw std::runtime_error(
"Unknown logic operator in EnabledWhenProperty");
110 throw std::runtime_error(
"Both PropertyDetails and ComparisonDetails were "
111 "null in VisibleWhenProperty");
double value
The value of the point.
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
virtual bool checkCriterion(const IPropertyManager *algo) const
Checks that the specified property matches the criteria given.
std::shared_ptr< PropertyDetails > m_propertyDetails
Holds the various details used within the comparison.
Interface to PropertyManager.
Interface for modifiers to Property's that specify if they should be enabled or visible in a GUI.
Same as EnabledWhenProperty, but returns the value for the isVisible() property instead of the isEnab...
IPropertySettings * clone() const override
Make a copy of the present type of validator.
bool isVisible(const IPropertyManager *algo) const override
Return true/false based on whether the other property satisfies the criterion.
bool isEnabled(const IPropertyManager *algo) const override
Return true always as we only consider visible.
std::shared_ptr< ComparisonDetails< VisibleWhenProperty > > m_comparisonDetails
Hold a copy of any existing VisibleWhenPropertyObjects.
VisibleWhenProperty(const std::string &otherPropName, ePropertyCriterion when, const std::string &value="")
Constructs a VisibleWhenProperty object which checks the property with name given and if it matches t...
virtual bool checkComparison(const IPropertyManager *algo) const override
Checks two VisisbleWhenProperty objects to determine the result of both of them.
ePropertyCriterion
Enum for use in EnabledWhenProperty.
eLogicOperator
Enum for use when combining two EnabledWhenPropertyItems.
Struct which holds details for comparison between two EnabledWhenPropertyObjects.