mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-27 15:29:26 -06:00
Merge branch 'feature/osirisrex' of github.com:OpenSpace/OpenSpace into feature/osirisrex
This commit is contained in:
@@ -27,18 +27,30 @@
|
||||
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
#include <openspace/properties/scalarproperty.h>
|
||||
#include <openspace/properties/optionproperty.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class OpenSpaceModule;
|
||||
|
||||
class SettingsEngine : public properties::PropertyOwner {
|
||||
public:
|
||||
SettingsEngine();
|
||||
SettingsEngine();
|
||||
|
||||
void initialize();
|
||||
|
||||
void setModules(std::vector<OpenSpaceModule*> modules);
|
||||
|
||||
private:
|
||||
properties::FloatProperty _eyeSeparation;
|
||||
void initEyeSeparation();
|
||||
void initSceneFiles();
|
||||
|
||||
properties::FloatProperty _eyeSeparation;
|
||||
properties::OptionProperty _scenes;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
|
||||
#endif //#ifndef __SETTINGSENGINE_H__
|
||||
|
||||
@@ -50,13 +50,20 @@ public:
|
||||
std::string description;
|
||||
};
|
||||
|
||||
enum class DisplayType {
|
||||
RADIO,
|
||||
DROPDOWN
|
||||
};
|
||||
|
||||
/**
|
||||
* 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 displayType Optional DisplayType for GUI (default RADIO)
|
||||
*/
|
||||
OptionProperty(std::string identifier, std::string guiName);
|
||||
OptionProperty(std::string identifier, std::string guiName, DisplayType displayType);
|
||||
|
||||
/**
|
||||
* Returns the name of the class for reflection purposes.
|
||||
@@ -65,6 +72,12 @@ public:
|
||||
std::string className() const override;
|
||||
using IntProperty::operator=;
|
||||
|
||||
/**
|
||||
* Returns the type for GUI display.
|
||||
* \return OptionType for display purposes
|
||||
*/
|
||||
DisplayType displayType() const;
|
||||
|
||||
/**
|
||||
* Adds the passed option to the list of available options. The <code>value</code> of
|
||||
* the <code>option</code> must not have been registered previously, or a warning will
|
||||
@@ -74,9 +87,16 @@ public:
|
||||
*/
|
||||
void addOption(int value, std::string desc);
|
||||
|
||||
/**
|
||||
* Appends options with vectors of values and descriptions
|
||||
* \param values A std::vector<int> of values for the options
|
||||
* \param descs A std::vector<string> of descriptions for each value
|
||||
*/
|
||||
void addOptions(std::vector<int> values, std::vector<std::string> descs);
|
||||
|
||||
/**
|
||||
* Returns the list of available options.
|
||||
* /return The list of available options
|
||||
* \return The list of available options
|
||||
*/
|
||||
const std::vector<Option>& options() const;
|
||||
|
||||
@@ -87,12 +107,19 @@ public:
|
||||
*/
|
||||
void setValue(int value) override;
|
||||
|
||||
/**
|
||||
* Get the description of the option that matches <code>value</code>
|
||||
* \param value The value of the option
|
||||
*/
|
||||
std::string getDescriptionByValue(int value);
|
||||
|
||||
private:
|
||||
static const std::string OptionsKey;
|
||||
std::string generateAdditionalDescription() const;
|
||||
|
||||
/// The list of options which have been registered with this OptionProperty
|
||||
std::vector<Option> _options;
|
||||
DisplayType _displayType;
|
||||
};
|
||||
|
||||
} // namespace properties
|
||||
|
||||
@@ -37,8 +37,9 @@ namespace properties {
|
||||
* NumericalProperty classes to outsource the definitions of class names, default values,
|
||||
* etc. Using the PropertyDelegate, it is possible to create new TemplateProperty types
|
||||
* without subclassing the TemplateProperty, but rather creating a specialized instance
|
||||
* of PropertyDelegate. See (http://openspace.itn.liu.se/trac/wiki/guides/properties) for
|
||||
* more detailed information.
|
||||
* of PropertyDelegate. See
|
||||
* (https://github.com/OpenSpace/OpenSpace/wiki/Concepts-Properties) for more detailed
|
||||
* information.
|
||||
* \see TemplateProperty
|
||||
* \see NumericalProperty
|
||||
* \tparam T The full class for which this specialized instance of PropertyDelegate is
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace properties {
|
||||
* to the PropertyDelegate::defaultValue method, providing the template parameter
|
||||
* <code>T</code> as argument. When a new TemplateProperty is required, that method needs
|
||||
* to be specialized for the new type or a compile-time error will occur
|
||||
* (See http://openspace.itn.liu.se/trac/wiki/guides/properties).
|
||||
* (See https://github.com/OpenSpace/OpenSpace/wiki/Concepts-Properties).
|
||||
* \tparam T The type of value that is stored in this TemplateProperty
|
||||
* \see Property
|
||||
* \see NumericalProperty
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
#ifndef __SCRIPT_HELPER_H__
|
||||
#define __SCRIPT_HELPER_H__
|
||||
|
||||
#define SCRIPT_CHECK_ARGUMENTS(__stack__, __reqArg__, __realArg__) \
|
||||
#define SCRIPT_CHECK_ARGUMENTS(__category__, __stack__, __reqArg__, __realArg__) \
|
||||
if (__realArg__ != __reqArg__) { \
|
||||
LERROR(ghoul::lua::errorLocation(__stack__) << "Expected " << __reqArg__ << \
|
||||
" arguments, got " << __realArg__); \
|
||||
LERRORC(__category__, ghoul::lua::errorLocation(__stack__) << "Expected " << \
|
||||
__reqArg__ << " arguments, got " << __realArg__); \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,10 @@
|
||||
#ifndef __OPENSPACEMODULE_H__
|
||||
#define __OPENSPACEMODULE_H__
|
||||
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
@@ -34,7 +37,7 @@ namespace openspace {
|
||||
* into a useful granularity to be mostly used self-sufficiently. Each OpenSpaceModule
|
||||
* needs a unique, nonempty <code>name</code>.
|
||||
*/
|
||||
class OpenSpaceModule {
|
||||
class OpenSpaceModule : public properties::PropertyOwner {
|
||||
public:
|
||||
/**
|
||||
* Constructs the OpenSpaceModule with a specific \p name. The uniqueness of the
|
||||
@@ -61,12 +64,6 @@ public:
|
||||
*/
|
||||
void deinitialize();
|
||||
|
||||
/**
|
||||
* Returns the name for this OpenSpaceModule.
|
||||
* \return THe name for this OpenSpaceModule
|
||||
*/
|
||||
std::string name() const;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Customization point for each derived class. The internalInitialize method is called
|
||||
@@ -85,9 +82,6 @@ protected:
|
||||
* path tokens.
|
||||
*/
|
||||
std::string modulePath() const;
|
||||
|
||||
/// The name of this OpenSpaceModule
|
||||
const std::string _name;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -682,7 +682,7 @@ public:
|
||||
* \param destinationFrame The name of the destination reference frame
|
||||
* \param ephemerisTimeFrom The time for the source reference frame
|
||||
* \param ephemerisTimeTo The time for the destination reference frame
|
||||
* \return Thetransformation matrix that maps between the \p sourceFrame at time
|
||||
* \return The transformation matrix that maps between the \p sourceFrame at time
|
||||
* \p ephemerisTimeFrom to the \p destinationFrame at the time \p ephemerisTimeTo.
|
||||
* \throws SpiceException If there is no coverage available for the specified
|
||||
* \p sourceFrame and \p destinationFrame
|
||||
|
||||
Reference in New Issue
Block a user