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:
Alexander Bock
2016-07-31 19:26:55 +02:00
parent 393f39de2e
commit 6bd0ef7102
5 changed files with 22 additions and 19 deletions

View File

@@ -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();

View File

@@ -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