Feature/cmake cleanup (#381)

* Rename OnScreenGui module to ImGui
* Support multiple external module folders (closes #31)
* Cleaning up CMake files
  * Restructure application specification
  * Add parameter for library mode to all modules
  * Add functions to handle global variable state
* Misc/remove warnings (#383)
* Increase build timeout and do a clean rebuild every commit
This commit is contained in:
Alexander Bock
2017-08-14 09:38:32 -04:00
committed by GitHub
parent 0b063827b8
commit c275b2f833
321 changed files with 2201 additions and 1892 deletions
+90
View File
@@ -0,0 +1,90 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___GUI___H__
#define __OPENSPACE_MODULE_IMGUI___GUI___H__
#include <modules/imgui/include/guicomponent.h>
#include <modules/imgui/include/guifilepathcomponent.h>
#include <modules/imgui/include/guihelpcomponent.h>
#include <modules/imgui/include/guiperformancecomponent.h>
#include <modules/imgui/include/guipropertycomponent.h>
#include <modules/imgui/include/guiorigincomponent.h>
#include <modules/imgui/include/guitimecomponent.h>
#include <modules/imgui/include/guiiswacomponent.h>
#include <modules/imgui/include/guiparallelcomponent.h>
#include <openspace/scripting/scriptengine.h>
#include <openspace/properties/property.h>
#include <openspace/util/keys.h>
#include <openspace/util/mouse.h>
namespace openspace::gui {
class GUI : public GuiComponent {
public:
GUI();
void initialize() override;
void deinitialize() override;
void initializeGL() override;
void deinitializeGL() override;
bool mouseButtonCallback(MouseButton button, MouseAction action);
bool mouseWheelCallback(double position);
bool keyCallback(Key key, KeyModifier modifier, KeyAction action);
bool charCallback(unsigned int character, KeyModifier modifier);
void startFrame(float deltaTime, const glm::vec2& windowSize,
const glm::vec2& dpiScaling, const glm::vec2& mousePos, uint32_t mouseButtons);
void endFrame();
void render() override;
//protected:
GuiHelpComponent _help;
GuiFilePathComponent _filePath;
GuiOriginComponent _origin;
GuiPerformanceComponent _performance;
GuiPropertyComponent _globalProperty;
GuiPropertyComponent _property;
GuiPropertyComponent _screenSpaceProperty;
GuiPropertyComponent _virtualProperty;
GuiTimeComponent _time;
#ifdef OPENSPACE_MODULE_ISWA_ENABLED
GuiIswaComponent _iswa;
#endif // OPENSPACE_MODULE_ISWA_ENABLED
GuiParallelComponent _parallel;
private:
void renderAndUpdatePropertyVisibility();
properties::Property::Visibility _currentVisibility;
};
} // namespace openspace::gui
#endif // __OPENSPACE_MODULE_IMGUI___GUI___H__
+79
View File
@@ -0,0 +1,79 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___GUICOMPONENT___H__
#define __OPENSPACE_MODULE_IMGUI___GUICOMPONENT___H__
#include <openspace/properties/propertyowner.h>
#include <openspace/properties/scalar/boolproperty.h>
namespace openspace::gui {
class GUI;
/**
* The base class for a GUI component that can be rendered to the screen.
*/
class GuiComponent : public properties::PropertyOwner {
public:
/// Constructor that initializes this components member variables
GuiComponent(std::string name);
/**
* Returns if this component is enabled, that is, if it is currently active and
* visible on the screen.
* \return <code>true</code> if this component is enabled, <code>false</code>
* otherwise
*/
bool isEnabled() const;
/**
* Sets if this component is enabled, that is, if it is currently active and visible
* on the screen.
* \param enabled The new enabled status of this component
*/
void setEnabled(bool enabled);
/// Initializes the component with everything that does not require an OpenGL context
virtual void initialize();
/// Initializes the component with everything that requires an OpenGL context
virtual void initializeGL();
/// Deinitializes the component with things that do not require an OpenGL context
virtual void deinitialize();
/// Deinitializes the component with things that require an OpenGL context
virtual void deinitializeGL();
/// Renders the individual subcomponents to the screen
virtual void render() = 0;
protected:
/// <code>true</code> if this component is enabled and visible on the screen
properties::BoolProperty _isEnabled;
};
} // namespace openspace::gui
#endif // __OPENSPACE_MODULE_IMGUI___GUICOMPONENT___H__
@@ -0,0 +1,41 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___GUIFILEPATHCOMPONENT___H__
#define __OPENSPACE_MODULE_IMGUI___GUIFILEPATHCOMPONENT___H__
#include <modules/imgui/include/guicomponent.h>
namespace openspace::gui {
class GuiFilePathComponent : public GuiComponent {
public:
GuiFilePathComponent();
void render() override;
};
} // namespace openspace::gui
#endif // __OPENSPACE_MODULE_IMGUI___GUIFILEPATHCOMPONENT___H__
+41
View File
@@ -0,0 +1,41 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___GUIHELPCOMPONENT___H__
#define __OPENSPACE_MODULE_IMGUI___GUIHELPCOMPONENT___H__
#include <modules/imgui/include/guicomponent.h>
namespace openspace::gui {
class GuiHelpComponent : public GuiComponent {
public:
GuiHelpComponent();
void render() override;
};
} // namespace openspace::gui
#endif // __OPENSPACE_MODULE_IMGUI___GUIHELPCOMPONENT___H__
+54
View File
@@ -0,0 +1,54 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___GUIISWACOMPONENT___H__
#define __OPENSPACE_MODULE_IMGUI___GUIISWACOMPONENT___H__
#ifdef OPENSPACE_MODULE_ISWA_ENABLED
#include <modules/imgui/include/guipropertycomponent.h>
#include <map>
namespace openspace::gui {
class GuiIswaComponent : public GuiPropertyComponent {
public:
GuiIswaComponent();
void render() override;
private:
bool _gmData;
bool _gmImage;
bool _ionData;
std::vector<int> _cdfOptions;
std::map<std::string, int> _cdfOptionsMap;
};
} // namespace openspace::gui
#endif // OPENSPACE_MODULE_ISWA_ENABLED
#endif // __OPENSPACE_MODULE_IMGUI___GUIISWACOMPONENT___H__
@@ -0,0 +1,41 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___GUIORIGINCOMPONENT___H__
#define __OPENSPACE_MODULE_IMGUI___GUIORIGINCOMPONENT___H__
#include <modules/imgui/include/guicomponent.h>
namespace openspace::gui {
class GuiOriginComponent : public GuiComponent {
public:
GuiOriginComponent();
void render() override;
};
} // namespace openspace::gui
#endif // __OPENSPACE_MODULE_IMGUI___GUIORIGINCOMPONENT___H__
@@ -0,0 +1,49 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___GUIPARALLELCOMPONENT___H__
#define __OPENSPACE_MODULE_IMGUI___GUIPARALLELCOMPONENT___H__
#include <modules/imgui/include/guicomponent.h>
#include <modules/imgui/include/guipropertycomponent.h>
#include <string>
namespace openspace::gui {
class GuiParallelComponent : public GuiPropertyComponent {
public:
GuiParallelComponent();
void render() override;
private:
void renderDisconnected();
void renderClientWithHost();
void renderClientWithoutHost();
void renderClientCommon();
void renderHost();
};
} // namespace openspace::gui
#endif // __OPENSPACE_MODULE_IMGUI___GUIPARALLELCOMPONENT___H__
@@ -0,0 +1,59 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___GUIPERFORMANCECOMPONENT___H__
#define __OPENSPACE_MODULE_IMGUI___GUIPERFORMANCECOMPONENT___H__
#include <modules/imgui/include/guicomponent.h>
#include <openspace/properties/scalar/boolproperty.h>
#include <openspace/properties/scalar/intproperty.h>
#include <ghoul/misc/sharedmemory.h>
#include <memory>
namespace ghoul { class SharedMemory; }
namespace openspace::gui {
class GuiPerformanceComponent : public GuiComponent {
public:
GuiPerformanceComponent();
void render() override;
protected:
std::unique_ptr<ghoul::SharedMemory> _performanceMemory;
properties::IntProperty _sortingSelection;
properties::BoolProperty _sceneGraphIsEnabled;
properties::BoolProperty _functionsIsEnabled;
properties::BoolProperty _outputLogs;
};
} // namespace openspace::gui
#endif // __OPENSPACE_MODULE_IMGUI___GUIPERFORMANCECOMPONENT___H__
@@ -0,0 +1,73 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_ONSCREENGUI___GUIPROPERTYCOMPONENT___H__
#define __OPENSPACE_MODULE_ONSCREENGUI___GUIPROPERTYCOMPONENT___H__
#include <modules/imgui/include/guicomponent.h>
#include <openspace/properties/property.h>
#include <functional>
#include <string>
#include <vector>
namespace openspace::properties {
class Property;
class PropertyOwner;
} // namespace openspace::properties
namespace openspace::gui {
class GuiPropertyComponent : public GuiComponent {
public:
using SourceFunction = std::function<std::vector<properties::PropertyOwner*>()>;
GuiPropertyComponent(std::string name);
// This is the function that evaluates to the list of Propertyowners that this
// component should render
void setSource(SourceFunction func);
void setVisibility(properties::Property::Visibility visibility);
void setHasRegularProperties(bool hasOnlyRegularProperties);
void render() override;
protected:
void renderPropertyOwner(properties::PropertyOwner* owner);
void renderProperty(properties::Property* prop, properties::PropertyOwner* owner);
properties::Property::Visibility _visibility;
SourceFunction _function;
/// This is set to \c true if all properties contained in this GUIPropertyComponent
/// are regular, i.e., not containing wildcards, regex, or groups
/// This variable only has an impact on which \c setPropertyValue function is called
bool _hasOnlyRegularProperties = false;
};
} // namespace openspace::gui
#endif // __OPENSPACE_MODULE_ONSCREENGUI___GUIPROPERTYCOMPONENT___H__
+41
View File
@@ -0,0 +1,41 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___GUITIMECOMPONENT___H__
#define __OPENSPACE_MODULE_IMGUI___GUITIMECOMPONENT___H__
#include <modules/imgui/include/guicomponent.h>
namespace openspace::gui {
class GuiTimeComponent : public GuiComponent {
public:
GuiTimeComponent();
void render() override;
};
} // namespace openspace::gui
#endif // __OPENSPACE_MODULE_IMGUI___GUITIMECOMPONENT___H__
+46
View File
@@ -0,0 +1,46 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___IMGUI_INCLUDE___H__
#define __OPENSPACE_MODULE_IMGUI___IMGUI_INCLUDE___H__
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"
#elif (defined __GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif // __clang__
#include <imgui.h>
#ifdef __clang__
#pragma clang diagnostic pop
#elif (defined __GNUC__)
#pragma GCC diagnostic pop
#endif // __clang__
#endif // __OPENSPACE_MODULE_IMGUI___IMGUI_INCLUDE___H__
+96
View File
@@ -0,0 +1,96 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2017 *
* *
* 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 __OPENSPACE_MODULE_IMGUI___RENDERPROPERTIES___H__
#define __OPENSPACE_MODULE_IMGUI___RENDERPROPERTIES___H__
#include <ghoul/misc/boolean.h>
#include <string>
namespace openspace::properties {
class Property;
} // namespace openspace::properties
namespace openspace {
using IsRegularProperty = ghoul::Boolean;
void executeScript(const std::string& id, const std::string& value,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderBoolProperty(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderOptionProperty(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderSelectionProperty(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderStringProperty(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderDoubleProperty(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderIntProperty(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderIVec2Property(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderIVec3Property(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderIVec4Property(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderFloatProperty(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderVec2Property(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderVec3Property(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderVec4Property(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderDVec2Property(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderDVec3Property(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderDVec4Property(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
void renderTriggerProperty(properties::Property* prop, const std::string& ownerName,
IsRegularProperty isRegular = IsRegularProperty::Yes);
} // namespace openspace
#endif // __OPENSPACE_MODULE_IMGUI___RENDERPROPERTIES___H__