diff --git a/.gitignore b/.gitignore index b8fb45e994..bf9732efea 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ html/ latex/ shaders/ABuffer/constants.hglsl *.OpenSpaceGenerated.glsl +LuaScripting.txt diff --git a/ext/ghoul b/ext/ghoul index d06a196c28..7345997f82 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit d06a196c2895ab8f548c3e520690eb921f3437d4 +Subproject commit 7345997f82b96d007934ceed5cad25f8a94c2e90 diff --git a/include/openspace/interaction/keys.h b/include/openspace/interaction/keys.h index b380a7b789..e92f41c620 100644 --- a/include/openspace/interaction/keys.h +++ b/include/openspace/interaction/keys.h @@ -37,7 +37,7 @@ enum class KeyAction { }; enum class KeyModifier { - None = 0, + NoModifier = 0, Shift = GLFW_MOD_SHIFT, Control = GLFW_MOD_CONTROL, Alt = GLFW_MOD_ALT, diff --git a/include/openspace/interaction/mouse.h b/include/openspace/interaction/mouse.h index 2a4cca19d6..605a5be699 100644 --- a/include/openspace/interaction/mouse.h +++ b/include/openspace/interaction/mouse.h @@ -40,14 +40,14 @@ enum class MouseButton { Left = SGCT_MOUSE_BUTTON_LEFT, Right = SGCT_MOUSE_BUTTON_RIGHT, Middle = SGCT_MOUSE_BUTTON_MIDDLE, - Button1 = SGCT_MOUSE_BUTTON_1, - Button2 = SGCT_MOUSE_BUTTON_2, - Button3 = SGCT_MOUSE_BUTTON_3, - Button4 = SGCT_MOUSE_BUTTON_4, - Button5 = SGCT_MOUSE_BUTTON_5, - Button6 = SGCT_MOUSE_BUTTON_6, - Button7 = SGCT_MOUSE_BUTTON_7, - Button8 = SGCT_MOUSE_BUTTON_8, + //Button1 = SGCT_MOUSE_BUTTON_1, + //Button2 = SGCT_MOUSE_BUTTON_2, + //Button3 = SGCT_MOUSE_BUTTON_3, + //Button4 = SGCT_MOUSE_BUTTON_4, + //Button5 = SGCT_MOUSE_BUTTON_5, + //Button6 = SGCT_MOUSE_BUTTON_6, + //Button7 = SGCT_MOUSE_BUTTON_7, + //Button8 = SGCT_MOUSE_BUTTON_8, ButtonLast = SGCT_MOUSE_BUTTON_LAST, }; diff --git a/include/openspace/properties/optionproperty.h b/include/openspace/properties/optionproperty.h new file mode 100644 index 0000000000..ae7f36125e --- /dev/null +++ b/include/openspace/properties/optionproperty.h @@ -0,0 +1,97 @@ +/***************************************************************************************** +* * +* OpenSpace * +* * +* Copyright (c) 2014 * +* * +* Permission is hereby granted, free of charge, to any person obtaining a copy of this * +* software and associated documentation files (the "Software"), to deal in the Software * +* without restriction, including without limitation the rights to use, copy, modify, * +* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * +* permit persons to whom the Software is furnished to do so, subject to the following * +* conditions: * +* * +* The above copyright notice and this permission notice shall be included in all copies * +* or substantial portions of the Software. * +* * +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * +* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * +* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * +* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * +* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +****************************************************************************************/ + +#ifndef __OPTIONPROPERTY_H__ +#define __OPTIONPROPERTY_H__ + +#include + +#include + +namespace openspace { +namespace properties { + +/** + * The OptionProperty is a property that provides a number of predefined (using the + * addOption method) options consisting of a description and a + * value. The available options can be queried using the options method. + * Only values representing valid options can be used to set this property, or an error + * will be logged + */ +class OptionProperty : public IntProperty { +public: + /** + * The struct storing a single option consisting of an integer value and + * a string description. + */ + struct Option { + int value; + std::string description; + }; + + /** + * The constructor delegating the identifier and the guiName + * 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 + */ + OptionProperty(std::string identifier, std::string guiName); + + /** + * Returns the name of the class for reflection purposes. + * \return The name of this class for reflection purposes + */ + std::string className() const override; + using IntProperty::operator=; + + /** + * Adds the passed option to the list of available options. The value of + * the option must not have been registered previously, or a warning will + * be logged. + * \param option The option that will be added to the list of available options + */ + void addOption(Option option); + + /** + * Returns the list of available options. + * /return The list of available options + */ + const std::vector