mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-24 22:09:10 -06:00
Add description for numerical properties
This commit is contained in:
@@ -50,6 +50,11 @@ public:
|
||||
using TemplateProperty<T>::operator=;
|
||||
|
||||
protected:
|
||||
static const std::string MinimumValueKey;
|
||||
static const std::string MaximumValueKey;
|
||||
|
||||
std::string generateAdditionalDescription() const;
|
||||
|
||||
T _minimumValue;
|
||||
T _maximumValue;
|
||||
};
|
||||
|
||||
@@ -142,6 +142,13 @@ namespace properties {
|
||||
return PropertyDelegate<TemplateProperty<TYPE>>::typeLua(); \
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
const std::string NumericalProperty<T>::MinimumValueKey = "MinimumValue";
|
||||
|
||||
template <typename T>
|
||||
const std::string NumericalProperty<T>::MaximumValueKey = "MaximumValueKey";
|
||||
|
||||
// Delegating constructors are necessary; automatic template deduction cannot
|
||||
// deduce template argument for 'U' if 'default' methods are used as default values in
|
||||
// a single constructor
|
||||
@@ -199,7 +206,6 @@ int NumericalProperty<T>::typeLua() const {
|
||||
return PropertyDelegate<NumericalProperty<T>>::typeLua();
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
T NumericalProperty<T>::minValue() const {
|
||||
return _minimumValue;
|
||||
@@ -210,5 +216,13 @@ T NumericalProperty<T>::maxValue() const {
|
||||
return _maximumValue;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::string NumericalProperty<T>::generateAdditionalDescription() const {
|
||||
std::string result;
|
||||
result += MinimumValueKey + " = " + std::to_string(_minimumValue) + ",";
|
||||
result += MaximumValueKey + " = " + std::to_string(_maximumValue);
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace properties
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user