Merged master info NewAtmosphere.

This commit is contained in:
Jonathas Costa
2017-07-27 17:13:42 -04:00
130 changed files with 3573 additions and 1495 deletions
@@ -45,16 +45,8 @@ public:
void setModules(const std::vector<OpenSpaceModule*>& modules);
bool busyWaitForDecode();
bool logSGCTOutOfOrderErrors();
bool useDoubleBuffering();
private:
properties::OptionProperty _scenes;
properties::BoolProperty _busyWaitForDecode;
properties::BoolProperty _logSGCTOutOfOrderErrors;
properties::BoolProperty _useDoubleBuffering;
properties::BoolProperty _spiceUseExceptions;
};
} // namespace openspace
@@ -65,9 +65,9 @@ private:
};
// Properties
properties::BoolProperty _rollFriction;
properties::BoolProperty _rotationalFriction;
properties::BoolProperty _horizontalFriction;
properties::BoolProperty _verticalFriction;
properties::BoolProperty _zoomFriction;
properties::FloatProperty _followFocusNodeRotationDistance;
properties::FloatProperty _minimumAllowedDistance;
properties::FloatProperty _sensitivity;
@@ -32,16 +32,11 @@ namespace openspace::properties {
template <typename T>
class NumericalProperty : public TemplateProperty<T> {
public:
NumericalProperty(std::string identifier, std::string guiName,
Property::Visibility visibility = Property::Visibility::User);
NumericalProperty(std::string identifier, std::string guiName, T value,
Property::Visibility visibility = Property::Visibility::User);
NumericalProperty(std::string identifier, std::string guiName, T value,
T minimumValue, T maximumValue,
Property::Visibility visibility = Property::Visibility::User);
NumericalProperty(std::string identifier, std::string guiName, T value,
T minimumValue, T maximumValue, T steppingValue,
Property::Visibility visibility = Property::Visibility::User);
NumericalProperty(Property::PropertyInfo info);
NumericalProperty(Property::PropertyInfo info, T value);
NumericalProperty(Property::PropertyInfo info, T value, T minimumValue, T maximumValue);
NumericalProperty(Property::PropertyInfo info, T value, T minimumValue, T maximumValue,
T steppingValue);
bool getLuaValue(lua_State* state) const override;
bool setLuaValue(lua_State* state) override;
@@ -232,50 +232,41 @@ const std::string NumericalProperty<T>::SteppingValueKey = "SteppingValue";
// a single constructor
template <typename T>
NumericalProperty<T>::NumericalProperty(std::string identifier, std::string guiName,
Property::Visibility visibility)
NumericalProperty<T>::NumericalProperty(Property::PropertyInfo info)
: NumericalProperty<T>(
std::move(identifier), std::move(guiName),
std::move(info),
PropertyDelegate<NumericalProperty<T>>::template defaultValue<T>(),
PropertyDelegate<NumericalProperty<T>>::template defaultMinimumValue<T>(),
PropertyDelegate<NumericalProperty<T>>::template defaultMaximumValue<T>(),
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>(),
visibility
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>()
)
{}
template <typename T>
NumericalProperty<T>::NumericalProperty(std::string identifier,
std::string guiName, T value,
Property::Visibility visibility)
NumericalProperty<T>::NumericalProperty(Property::PropertyInfo info, T value)
: NumericalProperty<T>(
std::move(identifier), std::move(guiName), std::move(value),
std::move(info),
std::move(value),
PropertyDelegate<NumericalProperty<T>>::template defaultMinimumValue<T>(),
PropertyDelegate<NumericalProperty<T>>::template defaultMaximumValue<T>(),
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>(),
visibility
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>()
)
{}
template <typename T>
NumericalProperty<T>::NumericalProperty(std::string identifier, std::string guiName,
T value, T minimumValue, T maximumValue,
Property::Visibility visibility)
NumericalProperty<T>::NumericalProperty(Property::PropertyInfo info, T value,
T minimumValue, T maximumValue)
: NumericalProperty<T>(
std::move(identifier) , std::move(guiName), std::move(value),
std::move(minimumValue), std::move(maximumValue),
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>(),
visibility
std::move(info),
std::move(value), std::move(minimumValue), std::move(maximumValue),
PropertyDelegate<NumericalProperty<T>>::template defaultSteppingValue<T>()
)
{}
template <typename T>
NumericalProperty<T>::NumericalProperty(std::string identifier,
std::string guiName, T value,
T minimumValue, T maximumValue, T steppingValue,
Property::Visibility visibility)
: TemplateProperty<T>(std::move(identifier), std::move(guiName), std::move(value),
visibility)
NumericalProperty<T>::NumericalProperty(Property::PropertyInfo info, T value,
T minimumValue, T maximumValue, T steppingValue)
: TemplateProperty<T>(std::move(info), std::move(value))
, _minimumValue(std::move(minimumValue))
, _maximumValue(std::move(maximumValue))
, _stepping(std::move(steppingValue))
+10 -8
View File
@@ -57,21 +57,23 @@ public:
/**
* The constructor delegating the <code>identifier</code> and the <code>guiName</code>
* to its super class.
* \param identifier A unique identifier for this property
* \param guiName The GUI name that should be used to represent this property
* \param info The PropertyInfo structure that contains all the required static
* information for initializing this Property.
* \pre \p info.identifier must not be empty
* \pre \p info.guiName must not be empty
*/
OptionProperty(std::string identifier, std::string guiName,
Property::Visibility visibility = Property::Visibility::User);
OptionProperty(Property::PropertyInfo info);
/**
* The constructor delegating the <code>identifier</code> and the <code>guiName</code>
* to its super class.
* \param identifier A unique identifier for this property
* \param guiName The GUI name that should be used to represent this property
* \param info The PropertyInfo structure that contains all the required static
* information for initializing this Property.
* \param displayType Optional DisplayType for GUI (default RADIO)
* \pre \p info.identifier must not be empty
* \pre \p info.guiName must not be empty
*/
OptionProperty(std::string identifier, std::string guiName, DisplayType displayType,
Property::Visibility visibility = Property::Visibility::User);
OptionProperty(PropertyInfo info, DisplayType displayType);
/**
* Returns the name of the class for reflection purposes.
+46 -26
View File
@@ -63,14 +63,29 @@ class PropertyOwner;
class Property {
public:
/**
* The visibility classes for Property%s. The classes are strictly ordered as
* All > Developer > User > Hidden
*/
* The visibility classes for Property%s. The classes are strictly ordered as
* All > Developer > User > Hidden
*/
enum class Visibility {
All = 3, ///< Visible for all types, no matter what
Hidden = 2, ///< Never visible
Developer = 1, ///< Visible in Developer mode
User = 0 ///< Visible in User mode
Hidden = 3, ///< Never visible
Developer = 2, ///< Visible in Developer mode
User = 1, ///< Visible in User mode
All = 0, ///< Visible for all types, no matter what
};
/**
* This structure is passed to the constructor of a Property and contains the unique
* identifier, a GUI name and descriptive text that are both user facing.
*/
struct PropertyInfo {
/// The unique identifier that is part of the fully qualified URI of this Property
std::string identifier;
/// The name that is displayed in the user interface
std::string guiName;
/// The user facing description of this Property
std::string description;
/// Determins the visibility of this Property in the user interface
Visibility visibility = Visibility::All;
};
/// An OnChangeHandle is returned by the onChange method to uniquely identify an
@@ -85,16 +100,14 @@ public:
* The constructor for the property. The <code>identifier</code> needs to be unique
* for each PropertyOwner. The <code>guiName</code> will be stored in the metaData
* to be accessed by the GUI elements using the <code>guiName</code> key. The default
* visibility settings is <code>true</code>, whereas the default read-only state is
* visibility settings is Visibility::All, whereas the default read-only state is
* <code>false</code>.
* \param identifier A unique identifier for this property. It has to be unique to the
* PropertyOwner and cannot contain any <code>.</code>s
* \param guiName The human-readable GUI name for this Property
* \pre \p identifier must not be empty
* \pre \p guiName must not be empty
* \param info The PropertyInfo structure that contains all the required static
* information for initializing this Property.
* \pre \p info.identifier must not be empty
* \pre \p info.guiName must not be empty
*/
Property(std::string identifier, std::string guiName,
Visibility visibility = Visibility::All);
Property(PropertyInfo info);
/**
* The destructor taking care of deallocating all unused memory. This method will not
@@ -258,18 +271,12 @@ public:
std::string guiName() const;
/**
* Returns the description for this Property that contains all necessary information
* required for creating a GUI representation. The format of the description is a
* valid Lua table, i.e., it is surrounded by a pair of <code>{</code> and
* <code>}</code> with key,value pairs between. Each value can either be a number, a
* string, a bool, or another table. The general values set by this base function
* are: <code>Identifier</code>, <code>Name</code>, <code>Type</code>. All other
* values are specific to the type and are added in a specific subclass, which require
* the subclass to call this method first.
* \return The descriptive text for the Property that can be used for constructing a
* GUI representation
* This function returns a user-facing description of the Property which can be
* displayed in the user interface to inform the user what this Property does and how
* it affects the rendering.
* \return The description of this Property
*/
virtual std::string description() const;
std::string description() const;
/**
* Sets the identifier of the group that this Property belongs to. Property groups can
@@ -407,6 +414,12 @@ protected:
/// The identifier for this Property
std::string _identifier;
/// The GUI user-facing name of this Property
std::string _guiName;
/// The user-facing description of this Property
std::string _description;
/// The Dictionary containing all meta data necessary for external applications
ghoul::Dictionary _metaData;
@@ -415,6 +428,13 @@ protected:
private:
OnChangeHandle _currentHandleValue;
#ifdef _DEBUG
// These identifiers can be used for debugging. Each Property is assigned one unique
// identifier.
static uint64_t Identifier;
uint64_t _id;
#endif
};
} // namespace openspace::properties
@@ -40,7 +40,7 @@
* @} @}
*/
#include <openspace/properties/numericalproperty.h>
#include <openspace/properties/templateproperty.h>
namespace openspace::properties {
@@ -38,8 +38,7 @@ public:
std::string description;
};
SelectionProperty(std::string identifier, std::string guiName,
Property::Visibility visibility = Property::Visibility::User);
SelectionProperty(Property::PropertyInfo info);
void addOption(Option option);
void removeOptions();
@@ -51,27 +51,19 @@ namespace openspace::properties {
template <typename T>
class TemplateProperty : public Property {
public:
typedef T ValueType;
/**
* The constructor initializing the TemplateProperty with the provided
* <code>identifier</code> and human-readable <code>guiName</code>. The default value
* for the stored type <code>T</code> is retrieved using the PropertyDelegate's
* PropertyDelegate::defaultValue method, which must be specialized for new types or
* a compile-error will occur.
* \param identifier The identifier that is used for this TemplateProperty
* \param guiName The human-readable GUI name for this TemplateProperty
*/
TemplateProperty(std::string identifier, std::string guiName,
Property::Visibility visibility = Visibility::User);
using ValueType = T;
/**
* The constructor initializing the TemplateProperty with the provided
* <code>identifier</code>, human-readable <code>guiName</code> and provided
* <code>value</code>.
* \param info The PropertyInfo structure that contains all the required static
* information for initializing this Property.
* \pre \p info.identifier must not be empty
* \pre \p info.guiName must not be empty
*/
TemplateProperty(std::string identifier, std::string guiName, T value,
Property::Visibility visibility = Visibility::User);
TemplateProperty(Property::PropertyInfo info,
T value = PropertyDelegate<TemplateProperty<T>>::template defaultValue<T>());
/**
* Returns the class name for this TemplateProperty. The default implementation makes
@@ -159,7 +151,7 @@ public:
/**
* The assignment operator allows the TemplateProperty's value to be set without using
* the TemplateProperty::set method. It will be done internally by thos method and it
* the TemplateProperty::set method. It will be done internally by this method and it
* allows assignments such as <code>prop = T(1)</code>.
* \param val The value that should be set.
*/
@@ -142,25 +142,9 @@ namespace openspace::properties {
} \
// 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
template <typename T>
TemplateProperty<T>::TemplateProperty(std::string identifier, std::string guiName,
Property::Visibility visibility)
: TemplateProperty<T>(
std::move(identifier), std::move(guiName),
PropertyDelegate<TemplateProperty<T>>::template defaultValue<T>(),
visibility)
{
}
template <typename T>
TemplateProperty<T>::TemplateProperty(std::string identifier, std::string guiName,
T value, Property::Visibility visibility)
: Property(std::move(identifier), std::move(guiName), visibility)
TemplateProperty<T>::TemplateProperty(Property::PropertyInfo info, T value)
: Property(std::move(info))
, _value(std::move(value))
{}
@@ -169,11 +153,6 @@ std::string TemplateProperty<T>::className() const {
return PropertyDelegate<TemplateProperty<T>>::className();
}
//template <typename T>
//std::string TemplateProperty<T>::description() {
// return
//}
template <typename T>
TemplateProperty<T>::operator T() {
return _value;
@@ -38,11 +38,12 @@ public:
/**
* Initializes the TriggerProperty by delegating the <code>identifier</code> and
* <code>guiName</code> to the Property constructor.
* \param identifier The unique identifier used for this Property
* \param guiName The human-readable name of this Property
* \param info The PropertyInfo structure that contains all the required static
* information for initializing this Property.
* \pre \p info.identifier must not be empty
* \pre \p info.guiName must not be empty
*/
TriggerProperty(std::string identifier, std::string guiName,
Property::Visibility visibility = Property::Visibility::User);
TriggerProperty(PropertyInfo info);
/**
* Returns the class name <code>TriggerProperty</code>.
-1
View File
@@ -61,7 +61,6 @@ public:
static std::unique_ptr<Renderable> createFromDictionary(const ghoul::Dictionary& dictionary);
// constructors & destructor
Renderable();
Renderable(const ghoul::Dictionary& dictionary);
virtual ~Renderable();