mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-26 23:08:55 -06:00
Make OpenSpaceModule a properties::PropertyOwner so that it can own properties
Add properties owned by OpenSpaceModule to the global settings engine (closing #104)
This commit is contained in:
@@ -29,13 +29,19 @@
|
||||
#include <openspace/properties/scalarproperty.h>
|
||||
#include <openspace/properties/optionproperty.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class OpenSpaceModule;
|
||||
|
||||
class SettingsEngine : public properties::PropertyOwner {
|
||||
public:
|
||||
SettingsEngine();
|
||||
|
||||
void initialize();
|
||||
|
||||
void setModules(std::vector<OpenSpaceModule*> modules);
|
||||
|
||||
private:
|
||||
void initEyeSeparation();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user