Merge branch 'master' of github.com:OpenSpace/OpenSpace into feature/data-management

Conflicts:
	data/scene/default.scene
	modules/sync/syncmodule.h
	openspace.cfg
	src/engine/openspaceengine.cpp
	src/scene/scene.cpp
	src/scene/scene_doc.inl
	src/scene/scenegraphnode.cpp
	src/scene/scenegraphnode_doc.inl
	src/scene/sceneloader.cpp
	src/scripting/scriptengine.cpp
This commit is contained in:
Emil Axelsson
2017-08-14 11:17:25 +02:00
928 changed files with 10516 additions and 10536 deletions
+12 -30
View File
@@ -34,11 +34,9 @@
namespace ghoul { class Dictionary; }
namespace openspace {
namespace documentation {
namespace openspace::documentation {
using Optional = ghoul::Boolean;
using Exhaustive = ghoul::Boolean;
/**
* The TestResult structure returns the information from the #testSpecification method. It
@@ -163,7 +161,7 @@ struct DocumentationEntry {
* \pre \p verifier must not be nullptr
*/
DocumentationEntry(std::string key, std::shared_ptr<Verifier> verifier,
std::string doc = "", Optional optional = Optional::No);
Optional optional, std::string doc = "");
/**
* The constructor for a DocumentationEntry describing a \p key in a Documentation.
@@ -186,8 +184,8 @@ struct DocumentationEntry {
* \pre \p key must not be empty
* \pre \p verifier must not be nullptr
*/
DocumentationEntry(std::string key, Verifier* verifier, std::string doc = "",
Optional optional = Optional::No);
DocumentationEntry(std::string key, Verifier* verifier, Optional optional,
std::string doc = "");
/// The key that is described by this DocumentationEntry
std::string key;
@@ -205,11 +203,8 @@ struct DocumentationEntry {
* used to impose restrictions on keys and values and determine whether a given
* ghoul::Dictionary adheres to these specifications (see #testSpecification and
* #testSpecificationAndThrow methods). Each Documentation consists of a human-readable
* \c name, a list of DocumentationEntry%s that each describe a single key value, and a
* flag whether these entries are Exhaustive or not. If a Documentation is Exhaustive, a
* ghoul::Dictionary that contains additional keys will fail the specification, whereas a
* non-exhaustive Documentation allow for other (potentially non used) keys. The most
* convenient way of creating a Documentation is by using nested initializer lists:
* \c name, and a list of DocumentationEntry%s that each describe a single key value. The
* most convenient way of creating a Documentation is by using nested initializer lists:
*\verbatim
Documentation doc = {
"Documentation for an arbitrary dictionary",
@@ -217,9 +212,8 @@ Documentation doc = {
{ "key1", new IntVerifier, "Documentation key1", Optional::Yes },
{ "key2", new FloatVerifier, "Documentation key2" },
{ "key3", new StringVerifier }
},
Exhaustive::Yes
+;
}
};
\endverbatim
*
* If multiple DocumentationEntries cover the same key, they are all evaluated for that
@@ -237,31 +231,23 @@ struct Documentation {
* Documentation%s to reference this entry
* \param entries A list of DocumentationEntry%s that describe the individual keys for
* this entrie Documentation
* \param exhaustive Determines whether the \p entries are an exhaustive specification
* of the object or whether additional, potentially unused, keys are allowed
*/
Documentation(std::string name, std::string id, DocumentationEntries entries = {},
Exhaustive exhaustive = Exhaustive::No);
Documentation(std::string name, std::string id, DocumentationEntries entries = {});
/**
* Creates a Documentation with a human-readable \p name.
* \param name The human-readable name of this Documentation
* \param entries A list of DocumentationEntry%s that describe the individual keys for
* this entrie Documentation
* \param exhaustive Determines whether the \p entries are an exhaustive specification
* of the object or whether additional, potentially unused, keys are allowed
*/
Documentation(std::string name, DocumentationEntries entries = {},
Exhaustive exhaustive = Exhaustive::No);
Documentation(std::string name, DocumentationEntries entries = {});
/**
* Creates a Documentation.
* \param entries A list of DocumentationEntry%s that describe the individual keys for
* this entrie Documentation
* \param exhaustive Determines whether the \p entries are an exhaustive specification
* of the object or whether additional, potentially unused, keys are allowed
*/
Documentation(DocumentationEntries entries = {}, Exhaustive exhaustive = Exhaustive::No);
Documentation(DocumentationEntries entries = {});
/// The human-readable name of the Documentation
std::string name;
@@ -269,8 +255,6 @@ struct Documentation {
std::string id;
/// A list of specifications that are describing this Documentation
DocumentationEntries entries;
/// A flag to say wheter the DocumentationEntries are an exhaustive description
Exhaustive exhaustive;
};
/**
@@ -303,9 +287,7 @@ TestResult testSpecification(const Documentation& documentation,
void testSpecificationAndThrow(const Documentation& documentation,
const ghoul::Dictionary& dictionary, std::string component);
} // namespace documentation
} // namespace openspace
} // namespace openspace::documentation
// Make the overload for std::to_string available for the Offense::Reason for easier
// error logging
@@ -31,8 +31,7 @@
#include <ghoul/misc/exception.h>
namespace openspace {
namespace documentation {
namespace openspace::documentation {
/**
* The DocumentationEngine has the ability to collect all Documentation%s that are
@@ -92,8 +91,7 @@ private:
static DocumentationEngine* _instance;
};
} // namespace documentation
} // namespace openspace
} // namespace openspace::documentation
#define DocEng (openspace::documentation::DocumentationEngine::ref())
@@ -100,6 +100,15 @@ private:
const std::string _javascriptFile;
};
/**
* This function takes a \p text and escapes all necessary characters () that JSON
* does not want in its strings.
* \param text The text that is to be escaped
* \return The same text will all required characteres escaped
*/
std::string escapedJson(const std::string& text);
} // namespace openspace
#endif // __OPENSPACE_CORE___DOCUMENTATIONGENERATOR___H__
+3 -12
View File
@@ -32,8 +32,7 @@
#include <functional>
#include <type_traits>
namespace openspace {
namespace documentation {
namespace openspace::documentation {
/**
* The base class of all Verifier%s. Each object must have an Verifier::operator()
@@ -171,12 +170,8 @@ struct TableVerifier : public TemplateVerifier<ghoul::Dictionary> {
* \param documentationEntries The DocumentationEntry%s that are used to recursively
* test the ghoul::Dictionary that is contained inside. If this list is empty, only a
* type check is performed
* \param exhaustive Whether the DocumentationEntry%s contained in
* \p documentationEntries completely describe the contained table or whether
* additional keys are allowed
*/
TableVerifier(std::vector<DocumentationEntry> documentationEntries = {},
Exhaustive exhaustive = Exhaustive::No);
TableVerifier(std::vector<DocumentationEntry> documentationEntries = {});
/**
* Checks whether the \p key%'s value is a table (= ghoul::Dictionary) and (if
@@ -198,9 +193,6 @@ struct TableVerifier : public TemplateVerifier<ghoul::Dictionary> {
/// The documentations passed in the constructor
std::vector<DocumentationEntry> documentations;
/// Flag that specifies whether the TableVerifier::documentation exhaustively
/// describes the table or whether additional keys are allowed
Exhaustive exhaustive;
};
/**
@@ -1153,8 +1145,7 @@ extern template struct DeprecatedVerifier<BoolVector4Verifier>;
extern template struct DeprecatedVerifier<IntVector4Verifier>;
extern template struct DeprecatedVerifier<DoubleVector4Verifier>;
} // namespace documentation
} // namespace openspace
} // namespace openspace::documentation
#include "verifier.inl"
+3 -5
View File
@@ -29,10 +29,9 @@
namespace std {
std::string to_string(std::string value);
}
} // namespace std
namespace openspace {
namespace documentation {
namespace openspace::documentation {
template <typename T>
TestResult TemplateVerifier<T>::operator()(const ghoul::Dictionary& dict,
@@ -355,5 +354,4 @@ std::string DeprecatedVerifier<T>::documentation() const {
return T::documentation() + " (deprecated)";
}
} // namespace documentation
} // namespace openspace
} // namespace openspace::documentation
@@ -1,4 +1,4 @@
/*****************************************************************************************
/*****************************************************************************************
* *
* OpenSpace *
* *
@@ -28,6 +28,7 @@
#include <ghoul/misc/dictionary.h>
namespace openspace {
namespace documentation { struct Documentation; }
/**
+2 -6
View File
@@ -27,12 +27,8 @@
#include <memory>
namespace ghoul {
class Dictionary;
namespace logging { class Log; }
} // namespace ghoul
namespace ghoul { class Dictionary; }
namespace ghoul::logging { class Log; }
namespace openspace {
+1 -7
View File
@@ -33,13 +33,7 @@
#include <ghoul/misc/assert.h>
#include <algorithm>
namespace ghoul {
namespace systemcapabilities {
struct Version;
} // namespace systemcapabilities
} // namespace ghoul
namespace ghoul::systemcapabilities { struct Version; }
namespace openspace {
+3 -8
View File
@@ -35,14 +35,9 @@
#include <string>
#include <vector>
namespace ghoul {
class Dictionary;
namespace cmdparser { class CommandlineParser; }
namespace fontrendering { class FontManager; }
} // namespace ghoul
namespace ghoul { class Dictionary; }
namespace ghoul::cmdparser { class CommandlineParser; }
namespace ghoul::fontrendering { class FontManager; }
namespace openspace {
@@ -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
+2 -4
View File
@@ -30,8 +30,7 @@
#include <ghoul/glm.h>
#include <glm/gtx/vector_angle.hpp>
namespace openspace {
namespace interaction {
namespace openspace::interaction {
class NavigationHandler;
@@ -47,7 +46,6 @@ protected:
NavigationHandler* _handler;
};
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
#endif // __OPENSPACE_CORE___CONTROLLER___H__
@@ -25,8 +25,7 @@
#ifndef __OPENSPACE_CORE___DELAYEDVARIABLE___H__
#define __OPENSPACE_CORE___DELAYEDVARIABLE___H__
namespace openspace {
namespace interaction {
namespace openspace::interaction {
/**
* Class that acts as a smoothing filter to a variable. The filter has a step
@@ -51,8 +50,7 @@ private:
T _currentValue;
};
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
#include "delayedvariable.inl"
@@ -25,8 +25,7 @@
#include <ghoul/misc/assert.h>
#include <ghoul/glm.h>
namespace openspace {
namespace interaction {
namespace openspace::interaction {
template <typename T, typename ScaleType>
DelayedVariable<T, ScaleType>::DelayedVariable(ScaleType scaleFactor, ScaleType friction)
@@ -72,5 +71,4 @@ T DelayedVariable<T, ScaleType>::get() const {
return _currentValue;
}
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
+3 -5
View File
@@ -28,12 +28,11 @@
#include <openspace/util/keys.h>
#include <openspace/util/mouse.h>
#include <glm/glm.hpp>
#include <ghoul/glm.h>
#include <list>
namespace openspace {
namespace interaction {
namespace openspace::interaction {
class InputState {
public:
@@ -64,7 +63,6 @@ private:
double _mouseScrollDelta;
};
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
#endif // __OPENSPACE_CORE___INPUTSTATE___H__
+3 -5
View File
@@ -27,8 +27,7 @@
#include <functional>
namespace openspace {
namespace interaction {
namespace openspace::interaction {
/*
* Interpolates a typename T using a transfer function.
@@ -44,7 +43,7 @@ public:
void setDeltaTime(float deltaTime);
void setTransferFunction(std::function<T(float)> transferFunction);
void setInterpolationTime(float interpolationTime);
void step();
void step();
float deltaTimeScaled() const;
T value() const;
@@ -57,8 +56,7 @@ private:
float _scaledDeltaTime;
};
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
#include "interpolator.inl"
@@ -26,8 +26,7 @@
#include <functional>
namespace openspace {
namespace interaction {
namespace openspace::interaction {
template <typename T>
Interpolator<T>::Interpolator()
@@ -81,5 +80,4 @@ bool Interpolator<T>::isInterpolating() const {
return _t < 1.0 && _t >= 0.0;
}
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
@@ -32,14 +32,13 @@
#include <ghoul/misc/boolean.h>
namespace openspace {
class Camera;
class SceneGraphNode;
} // namespace
class Camera;
class SceneGraphNode;
namespace openspace::interaction {
namespace interaction {
class KeyBindingManager : public DocumentationGenerator
{
class KeyBindingManager : public DocumentationGenerator {
public:
KeyBindingManager();
~KeyBindingManager() = default;
@@ -81,7 +80,6 @@ private:
std::multimap<KeyWithModifier, KeyInformation> _keyLua;
};
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
#endif // __OPENSPACE_CORE___KEYBINDINGMANAGER___H__
@@ -28,17 +28,14 @@
#include <openspace/util/timeline.h>
#include <openspace/network/parallelconnection.h>
#include <glm/glm.hpp>
#include <ghoul/glm.h>
#include <glm/gtx/quaternion.hpp>
namespace openspace {
namespace openspace { class Camera; }
class Camera;
namespace openspace::interaction {
namespace interaction {
class KeyframeNavigator
{
class KeyframeNavigator {
public:
struct CameraPose {
glm::dvec3 position;
@@ -63,7 +60,6 @@ private:
Timeline<CameraPose> _cameraPoseTimeline;
};
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
#endif // __OPENSPACE_CORE___KEYFRAMENAVIGATOR___H__
+1 -5
View File
@@ -35,11 +35,7 @@
#include <string>
#include <vector>
namespace ghoul {
namespace opengl {
class ProgramObject;
} // namespace opengl
} // namespace ghoul
namespace ghoul::opengl { class ProgramObject; }
namespace openspace {
+8 -11
View File
@@ -28,10 +28,9 @@
#include <openspace/interaction/delayedvariable.h>
#include <openspace/interaction/inputstate.h>
#include <glm/glm.hpp>
#include <ghoul/glm.h>
namespace openspace {
namespace interaction {
namespace openspace::interaction {
struct MouseState {
MouseState(double scaleFactor);
@@ -42,14 +41,13 @@ struct MouseState {
DelayedVariable<glm::dvec2, double> velocity;
};
class MouseStates
{
class MouseStates {
public:
/**
\param sensitivity
\param velocityScaleFactor can be set to 60 to remove the inertia of the
interaction. Lower value will make it harder to move the camera.
*/
* \param sensitivity
* \param velocityScaleFactor can be set to 60 to remove the inertia of the
* interaction. Lower value will make it harder to move the camera.
*/
MouseStates(double sensitivity, double velocityScaleFactor);
void updateMouseStatesFromInput(const InputState& inputState, double deltaTime);
void setRotationalFriction(double friction);
@@ -74,7 +72,6 @@ private:
MouseState _globalRollMouseState;
};
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
#endif // __OPENSPACE_CORE___MOUSESTATE___H__
@@ -38,11 +38,11 @@
#include <ghoul/misc/boolean.h>
namespace openspace {
class Camera;
class SceneGraphNode;
} // namespace openspace
class Camera;
class SceneGraphNode;
namespace interaction {
namespace openspace::interaction {
class NavigationHandler : public properties::PropertyOwner {
public:
@@ -85,6 +85,7 @@ public:
* interaction
*/
static scripting::LuaLibrary luaLibrary();
private:
bool _cameraUpdatedFromScript = false;
@@ -99,7 +100,6 @@ private:
properties::BoolProperty _useKeyFrameInteraction;
};
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
#endif // __OPENSPACE_CORE___NAVIGATIONHANDLER___H__
@@ -34,16 +34,16 @@
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
#include <glm/glm.hpp>
#include <ghoul/glm.h>
#include <glm/gtx/quaternion.hpp>
namespace openspace {
class SceneGraphNode;
class Camera;
struct SurfacePositionHandle;
} // namespace
class SceneGraphNode;
class Camera;
class SurfacePositionHandle;
namespace interaction {
namespace openspace::interaction {
class OrbitalNavigator : public properties::PropertyOwner {
public:
@@ -64,10 +64,16 @@ private:
glm::dquat globalRotation;
};
// Properties
properties::BoolProperty _rotationalFriction;
properties::BoolProperty _horizontalFriction;
properties::BoolProperty _verticalFriction;
struct Friction : public properties::PropertyOwner {
Friction();
properties::BoolProperty roll;
properties::BoolProperty rotational;
properties::BoolProperty zoom;
};
Friction _friction;
properties::FloatProperty _followFocusNodeRotationDistance;
properties::FloatProperty _minimumAllowedDistance;
properties::FloatProperty _sensitivity;
@@ -191,7 +197,6 @@ private:
const glm::dvec3 cameraPositionWorldSpace);
};
} // namespace interaction
} // namespace openspace
} // namespace openspace::interaction
#endif // __OPENSPACE_CORE___ORBITALNAVIGATOR___H__
+1
View File
@@ -34,6 +34,7 @@
namespace ghoul { class Dictionary; }
namespace openspace {
namespace documentation { struct Documentation; }
/**
@@ -25,18 +25,14 @@
#ifndef __OPENSPACE_CORE___MESSAGESTRUCTURES___H__
#define __OPENSPACE_CORE___MESSAGESTRUCTURES___H__
//std includes
#include <string>
#include <vector>
//glm includes
#include <glm/gtx/quaternion.hpp>
//openspace includes
#include <openspace/util/camera.h>
namespace openspace{
namespace datamessagestructures {
namespace openspace::datamessagestructures {
enum class Type : uint32_t {
CameraData = 0,
TimeData,
@@ -187,7 +183,6 @@ struct ScriptMessage {
};
};
} //namespace messagestructures
} // namespace openspace
} // namespace openspace::messagestructures
#endif // __OPENSPACE_CORE___MESSAGESTRUCTURES___H__
@@ -25,20 +25,16 @@
#ifndef __OPENSPACE_CORE___PARALLELCONNECTION___H__
#define __OPENSPACE_CORE___PARALLELCONNECTION___H__
//openspace includes
#include <openspace/network/messagestructures.h>
#include <openspace/properties/propertyowner.h>
#include <openspace/properties/stringproperty.h>
#include <openspace/properties/numericalproperty.h>
#include <openspace/properties/scalar/floatproperty.h>
//glm includes
#include <glm/gtx/quaternion.hpp>
//ghoul includes
#include <ghoul/designpattern/event.h>
//std includes
#include <string>
#include <vector>
#include <deque>
@@ -48,8 +44,6 @@
#include <map>
#include <condition_variable>
#if defined(WIN32) || defined(__MING32__) || defined(__MING64__)
typedef size_t _SOCKET;
#else
@@ -27,8 +27,7 @@
#include <cstdint>
namespace openspace {
namespace performance {
namespace openspace::performance {
struct PerformanceLayout {
static const int8_t Version = 0;
@@ -57,7 +56,6 @@ struct PerformanceLayout {
int16_t nFunctionEntries;
};
} // namespace performance
} // namespace openspace
} // namespace openspace::performance
#endif // __OPENSPACE_CORE___PERFORMANCELAYOUT___H__
@@ -33,15 +33,11 @@
#include <memory>
#include <vector>
namespace ghoul {
class SharedMemory;
}
namespace ghoul { class SharedMemory; }
namespace openspace {
namespace openspace { class SceneGraphNode; }
class SceneGraphNode;
namespace performance {
namespace openspace::performance {
class PerformanceManager {
public:
@@ -95,7 +91,6 @@ private:
bool createLogDir();
};
} // namespace performance
} // namespace openspace
} // namespace openspace::performance
#endif // __OPENSPACE_CORE___PERFORMANCEMANAGER___H__
@@ -31,8 +31,7 @@
#include <chrono>
#include <string>
namespace openspace {
namespace performance {
namespace openspace::performance {
class PerformanceManager;
@@ -59,7 +58,6 @@ private:
OsEng.renderEngine().performanceManager() \
)
} // namespace performance
} // namespace openspace
} // namespace openspace::performance
#endif // __OPENSPACE_CORE___PERFORMANCEMEASUREMENT___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat2Property, glm::dmat2x2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DMAT2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat2x3Property, glm::dmat2x3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DMAT2X3PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat2x4Property, glm::dmat2x4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DMAT2X4PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat3Property, glm::dmat3x3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DMAT3PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat3x2Property, glm::dmat3x2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DMAT3X2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat3x4Property, glm::dmat3x4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DMAT3X4PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat4Property, glm::dmat4x4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DMAT4PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat4x2Property, glm::dmat4x2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DMAT4X2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DMat4x3Property, glm::dmat4x3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DMAT4X3PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat2Property, glm::mat2x2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___MAT2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat2x3Property, glm::mat2x3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___MAT2X3PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat2x4Property, glm::mat2x4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___MAT2X4PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat3Property, glm::mat3x3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___MAT3PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat3x2Property, glm::mat3x2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___MAT3X2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat3x4Property, glm::mat3x4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___MAT3X4PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat4Property, glm::mat4x4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___MAT4PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat4x2Property, glm::mat4x2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___MAT4X2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Mat4x3Property, glm::mat4x3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___MAT4X3PROPERTY___H__
@@ -27,22 +27,16 @@
#include <openspace/properties/templateproperty.h>
namespace openspace {
namespace properties {
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;
@@ -73,8 +67,7 @@ protected:
T _stepping;
};
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#include "openspace/properties/numericalproperty.inl"
@@ -24,11 +24,10 @@
#include <ghoul/lua/ghoul_lua.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
#define REGISTER_NUMERICALPROPERTY_HEADER(CLASS_NAME, TYPE) \
typedef NumericalProperty<TYPE> CLASS_NAME; \
using CLASS_NAME = NumericalProperty<TYPE>; \
\
template <> \
std::string PropertyDelegate<NumericalProperty<TYPE>>::className(); \
@@ -233,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))
@@ -361,5 +351,4 @@ std::string NumericalProperty<T>::generateAdditionalDescription() const {
return result;
}
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
+12 -12
View File
@@ -29,8 +29,7 @@
#include <vector>
namespace openspace {
namespace properties {
namespace openspace::properties {
/**
* The OptionProperty is a property that provides a number of predefined (using the
@@ -58,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.
@@ -131,7 +132,6 @@ private:
DisplayType _displayType;
};
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___OPTIONPROPERTY___H__
+49 -30
View File
@@ -28,13 +28,13 @@
#include <openspace/properties/propertydelegate.h>
#include <ghoul/misc/dictionary.h>
#include <functional>
#include <string>
struct lua_State;
namespace openspace {
namespace properties {
namespace openspace::properties {
class PropertyOwner;
@@ -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,9 +428,15 @@ 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 properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___PROPERTY___H__
@@ -29,8 +29,7 @@
struct lua_State;
namespace openspace {
namespace properties {
namespace openspace::properties {
/**
* The PropertyDelegate class is used by (among others) the TemplateProperty and the
@@ -158,8 +157,7 @@ public:
static bool toString(std::string& outValue, U inValue);
};
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#include <openspace/properties/propertydelegate.inl>
@@ -24,8 +24,7 @@
#include <typeinfo>
namespace openspace {
namespace properties {
namespace openspace::properties {
template <typename T>
std::string PropertyDelegate<T>::className() {
@@ -95,5 +94,4 @@ U PropertyDelegate<T>::fromString(std::string value, bool& success) {
"Unimplemented PropertyDelegate::fromString specialization");
}
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
+16 -6
View File
@@ -29,8 +29,7 @@
#include <string>
#include <vector>
namespace openspace {
namespace properties {
namespace openspace::properties {
class Property;
@@ -52,9 +51,14 @@ class PropertyOwner {
public:
/// The separator that is used while accessing the properties and/or sub-owners
static const char URISeparator = '.';
struct PropertyOwnerInfo {
std::string name;
std::string description;
};
/// The constructor initializing the PropertyOwner's name to <code>""</code>
PropertyOwner(std::string name = "");
PropertyOwner(PropertyOwnerInfo info);
/**
* The destructor will remove all Propertys and PropertyOwners it owns along with
@@ -76,7 +80,12 @@ public:
* Returns the name of this PropertyOwner.
* \return The name of this PropertyOwner
*/
const std::string& name() const;
std::string name() const;
void setDescription(std::string description);
std::string description() const;
/**
* Returns a list of all Propertys directly owned by this PropertyOwner. This list not
@@ -224,6 +233,8 @@ public:
private:
/// The name of this PropertyOwner
std::string _name;
/// The description for this PropertyOwner
std::string _description;
/// The owner of this PropertyOwner
PropertyOwner* _owner;
/// A list of all registered Property's
@@ -236,7 +247,6 @@ private:
std::vector<std::string> _tags;
};
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___PROPERTYOWNER___H__
@@ -40,14 +40,12 @@
* @} @}
*/
#include <openspace/properties/numericalproperty.h>
#include <openspace/properties/templateproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(BoolProperty, bool);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___BOOLPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(CharProperty, char);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___CHARPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DoubleProperty, double);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DOUBLEPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(FloatProperty, float);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___FLOATPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(IntProperty, int);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___INTPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(LongDoubleProperty, long double);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___LONGDOUBLEPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(LongLongProperty, long long);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___LONGLONGPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(LongProperty, long);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___LONGPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(ShortProperty, short);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___SHORTPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(SignedCharProperty, signed char);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___SIGNEDCHARPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UCharProperty, unsigned char);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___UCHARPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UIntProperty, unsigned int);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___UINTPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(ULongLongProperty, unsigned long long);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___ULONGLONGPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(ULongProperty, unsigned long);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___ULONGPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UShortProperty, unsigned short);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___USHORTPROPERTY___H__
@@ -42,12 +42,10 @@
#include <openspace/properties/numericalproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
//REGISTER_NUMERICALPROPERTY_HEADER(WCharProperty, wchar_t);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___WCHARPROPERTY___H__
@@ -29,8 +29,7 @@
#include <vector>
namespace openspace {
namespace properties {
namespace openspace::properties {
class SelectionProperty : public TemplateProperty<std::vector<int>> {
public:
@@ -39,13 +38,17 @@ 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();
const std::vector<Option>& options() const;
using TemplateProperty<std::vector<int>>::operator std::vector<int>;
using TemplateProperty<std::vector<int>>::operator=;
private:
static const std::string OptionsKey;
std::string generateAdditionalDescription() const;
@@ -77,7 +80,6 @@ template <>
template <>
bool PropertyDelegate<TemplateProperty<std::vector<int>>>::toString(std::string& outValue, std::vector<int> inValue);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___SELECTIONPROPERTY___H__
@@ -27,12 +27,10 @@
#include <openspace/properties/templateproperty.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(StringProperty, std::string);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___STRINGPROPERTY___H__
+11 -21
View File
@@ -27,8 +27,7 @@
#include <openspace/properties/property.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
/**
* This concrete subclass of Property handles a single parameter value that is of type
@@ -52,27 +51,19 @@ namespace 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
@@ -91,7 +82,7 @@ public:
virtual ghoul::any get() const override;
/**
* Sets the value fro the provided ghoul::any object. If the types between
* Sets the value from the provided ghoul::any object. If the types between
* <code>T</code> and <code>value</code> disagree, an error is logged and the stored
* value remains unchanged.
*/
@@ -160,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.
*/
@@ -186,8 +177,7 @@ protected:
T _value;
};
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#include "openspace/properties/templateproperty.inl"
@@ -24,8 +24,7 @@
#include <ghoul/logging/logmanager.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
// The following macros can be used to quickly generate the necessary PropertyDelegate
// specializations required by the TemplateProperty class. Use the
@@ -143,25 +142,9 @@ namespace 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))
{}
@@ -170,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;
@@ -240,16 +218,23 @@ const std::type_info& TemplateProperty<T>::type() const {
template <typename T>
bool TemplateProperty<T>::getLuaValue(lua_State* state) const {
bool success = PropertyDelegate<TemplateProperty<T>>::template toLuaValue<T>(state, _value);
bool success = PropertyDelegate<TemplateProperty<T>>::template toLuaValue<T>(
state,
_value
);
return success;
}
template <typename T>
bool TemplateProperty<T>::setLuaValue(lua_State* state) {
bool success = false;
T thisValue = PropertyDelegate<TemplateProperty<T>>::template fromLuaValue<T>(state, success);
if (success)
T thisValue = PropertyDelegate<TemplateProperty<T>>::template fromLuaValue<T>(
state,
success
);
if (success) {
set(ghoul::any(thisValue));
}
return success;
}
@@ -260,18 +245,24 @@ int TemplateProperty<T>::typeLua() const {
template <typename T>
bool TemplateProperty<T>::getStringValue(std::string& value) const {
bool success = PropertyDelegate<TemplateProperty<T>>::template toString<T>(value, _value);
bool success = PropertyDelegate<TemplateProperty<T>>::template toString<T>(
value,
_value
);
return success;
}
template <typename T>
bool TemplateProperty<T>::setStringValue(std::string value) {
bool success = false;
T thisValue = PropertyDelegate<TemplateProperty<T>>::template fromString<T>(value, success);
if (success)
T thisValue = PropertyDelegate<TemplateProperty<T>>::template fromString<T>(
value,
success
);
if (success) {
set(ghoul::any(thisValue));
}
return success;
}
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
@@ -27,8 +27,7 @@
#include <openspace/properties/property.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
/**
* TriggerProperty that can be used to fire events into your code using the callback
@@ -39,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>.
@@ -67,7 +67,6 @@ public:
void set(ghoul::any value);
};
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___TRIGGERPROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(BVec2Property, glm::bvec2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___BVEC2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(BVec3Property, glm::bvec3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___BVEC3PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_TEMPLATEPROPERTY_HEADER(BVec4Property, glm::bvec4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___BVEC4PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DVec2Property, glm::dvec2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DVEC2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DVec3Property, glm::dvec3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DVEC3PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(DVec4Property, glm::dvec4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___DVEC4PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(IVec2Property, glm::ivec2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___IVEC2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(IVec3Property, glm::ivec3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___IVEC3PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(IVec4Property, glm::ivec4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___IVEC4PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UVec2Property, glm::uvec2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___UVEC2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UVec3Property, glm::uvec3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___UVEC3PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(UVec4Property, glm::uvec4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___UVEC4PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Vec2Property, glm::vec2);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___VEC2PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Vec3Property, glm::vec3);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___VEC3PROPERTY___H__
@@ -29,12 +29,10 @@
#include <ghoul/glm.h>
namespace openspace {
namespace properties {
namespace openspace::properties {
REGISTER_NUMERICALPROPERTY_HEADER(Vec4Property, glm::vec4);
} // namespace properties
} // namespace openspace
} // namespace openspace::properties
#endif // __OPENSPACE_CORE___VEC4PROPERTY___H__
+1 -3
View File
@@ -30,9 +30,7 @@
namespace openspace {
namespace properties {
class Property;
}
namespace properties { class Property; }
class Renderable;
class Scene;
@@ -77,13 +77,13 @@ public:
void update();
void render(float blackoutFactor, bool doPerformanceMeasurements) override;
/**
* Update render data
* Responsible for calling renderEngine::setRenderData
*/
virtual void updateRendererData() override;
virtual void raycastersChanged(VolumeRaycaster& raycaster, bool attached) override;
private:
void clear();
@@ -36,16 +36,12 @@
#include <openspace/rendering/renderer.h>
#include <openspace/util/updatestructures.h>
namespace ghoul {
class Dictionary;
namespace filesystem {
class File;
}
namespace opengl {
class ProgramObject;
class Texture;
}
namespace ghoul { class Dictionary; }
namespace ghoul::filesystem { class File; }
namespace ghoul::opengl {
class ProgramObject;
class Texture;
}
namespace openspace {
@@ -32,8 +32,8 @@ class VolumeRaycaster;
class RaycasterListener {
public:
virtual void raycastersChanged(VolumeRaycaster& raycaster, bool attached) = 0;
}; // RaycasterListener
};
} // openspace
} // namespace openspace
#endif // __OPENSPACE_CORE___RAYCASTERLISTENER___H__
+7 -11
View File
@@ -29,13 +29,11 @@
#include <openspace/properties/scalar/boolproperty.h>
namespace ghoul {
namespace opengl {
class ProgramObject;
class Texture;
}
class Dictionary;
} // namespace ghoul
namespace ghoul { class Dictionary; }
namespace ghoul::opengl {
class ProgramObject;
class Texture;
}
namespace openspace {
@@ -63,12 +61,11 @@ public:
static std::unique_ptr<Renderable> createFromDictionary(const ghoul::Dictionary& dictionary);
// constructors & destructor
Renderable();
Renderable(const ghoul::Dictionary& dictionary);
virtual ~Renderable();
virtual bool initialize() = 0;
virtual bool deinitialize() = 0;
virtual void initialize();
virtual void deinitialize();
virtual bool isReady() const = 0;
bool isEnabled() const;
@@ -76,7 +73,6 @@ public:
void setBoundingSphere(float boundingSphere);
float boundingSphere() const;
virtual void render(const RenderData& data);
virtual void render(const RenderData& data, RendererTasks& rendererTask);
virtual void update(const UpdateData& data);
virtual SurfacePositionHandle calculateSurfacePositionHandle(
+5 -9
View File
@@ -32,22 +32,18 @@
#include <openspace/properties/scalar/intproperty.h>
#include <openspace/properties/triggerproperty.h>
namespace ghoul {
namespace fontrendering {
class Font;
class Dictionary;
class SharedMemory;
}
namespace opengl {
class ProgramObject;
}
class Dictionary;
class SharedMemory;
} // namespace ghoul
namespace ghoul::fontrendering { class Font; }
namespace ghoul::opengl { class ProgramObject; }
namespace openspace {
namespace performance { class PerformanceManager; }
namespace scripting { struct LuaLibrary; }
class Camera;
class RaycasterManager;
class Renderer;
+7 -12
View File
@@ -32,16 +32,11 @@
#include <vector>
#include <map>
namespace ghoul {
class Dictionary;
namespace filesystem {
class File;
}
namespace opengl {
class ProgramObject;
class Texture;
}
namespace ghoul { class Dictionary; }
namespace ghoul::filesystem { class File; }
namespace ghoul::opengl {
class ProgramObject;
class Texture;
}
namespace openspace {
@@ -63,12 +58,12 @@ public:
/**
* Set raycasting uniforms on the program object, and setup raycasting.
*/
virtual void preRaycast(ghoul::opengl::ProgramObject& programObject) {};
virtual void preRaycast(ghoul::opengl::ProgramObject& /*programObject*/) {};
/**
* Tear down raycasting for the specified program object.
*/
virtual void postRaycast(ghoul::opengl::ProgramObject& programObject) {};
virtual void postRaycast(ghoul::opengl::ProgramObject& /*programObject*/) {};
virtual void update() = 0;
+3 -6
View File
@@ -28,18 +28,15 @@
#include <string>
#include <vector>
namespace ghoul {
namespace opengl {
class Texture;
class ProgramObject;
}
namespace ghoul::opengl {
class Texture;
class ProgramObject;
}
namespace openspace {
class Volume {
public:
/**
* Constructor
*/
+8 -10
View File
@@ -29,11 +29,9 @@
#include <vector>
#include <openspace/util/updatestructures.h>
namespace ghoul {
namespace opengl {
class Texture;
class ProgramObject;
}
namespace ghoul::opengl {
class Texture;
class ProgramObject;
}
namespace openspace {
@@ -51,30 +49,30 @@ public:
/**
* Render the volume's entry points (front face of the bounding geometry)
*/
virtual void renderEntryPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) = 0;
virtual void renderEntryPoints(const RenderData& /*data*/, ghoul::opengl::ProgramObject& /*program*/) = 0;
/**
* Render the volume's exit points (back face of the bounding geometry)
*/
virtual void renderExitPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) = 0;
virtual void renderExitPoints(const RenderData& /*data*/, ghoul::opengl::ProgramObject& /*program*/) = 0;
/**
* Prepare the volume for the ABuffer's resolve step.
* Make sure textures are up to date, bind them to texture units, set program uniforms etc.
*/
virtual void preRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) {};
virtual void preRaycast(const RaycastData& /*data*/, ghoul::opengl::ProgramObject& /*program*/) {};
/**
* Clean up for the volume after the ABuffer's resolve step.
* Make sure texture units are deinitialized, etc.
*/
virtual void postRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) {};
virtual void postRaycast(const RaycastData& /*data*/, ghoul::opengl::ProgramObject& /*program*/) {};
/**
* Return true if the camera is inside the volume.
* Also set localPosition to the camera position in the volume's local coordainte system.
*/
virtual bool cameraIsInside(const RenderData& data, glm::vec3& localPosition) { return false; };
virtual bool cameraIsInside(const RenderData& /*data*/, glm::vec3& /*localPosition*/) { return false; };
/**
* Return a path the file to use as vertex shader
*
+2 -2
View File
@@ -75,8 +75,8 @@ public:
static std::unique_ptr<SceneGraphNode> createFromDictionary(const ghoul::Dictionary& dictionary);
bool initialize();
bool deinitialize();
void initialize();
void deinitialize();
void traversePreOrder(std::function<void(SceneGraphNode*)> fn);
void traversePostOrder(std::function<void(SceneGraphNode*)> fn);
+2 -4
View File
@@ -30,8 +30,7 @@
#include <string>
#include <vector>
namespace openspace {
namespace scripting {
namespace openspace::scripting {
/**
* This structure represents a Lua library, itself consisting of a unique #name and
@@ -80,7 +79,6 @@ struct LuaLibrary {
bool operator<(const LuaLibrary& rhs) const;
};
} // namespace scripting
} // namespace openspace
} // namespace openspace::scripting
#endif // __OPENSPACE_CORE___LUALIBRARY___H__

Some files were not shown because too many files have changed in this diff Show More