mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
Add GuiISWAComponent
This commit is contained in:
@@ -36,8 +36,7 @@
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <openspace/rendering/screenspacerenderable.h>
|
||||
#include <modules/base/rendering/screenspaceimage.h>
|
||||
#include <modules/iswa/util/iswamanager.h>
|
||||
|
||||
// #include <modules/iswa/util/iswamanager.h>
|
||||
|
||||
#include <ghoul/opengl/ghoul_gl.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
@@ -297,10 +296,10 @@ void GUI::endFrame() {
|
||||
|
||||
if (_property.isEnabled())
|
||||
_property.render();
|
||||
if (_iSWAproperty.isEnabled())
|
||||
_iSWAproperty.render();
|
||||
if (_screenSpaceProperty.isEnabled())
|
||||
_screenSpaceProperty.render();
|
||||
if (_iSWAproperty.isEnabled())
|
||||
_iSWAproperty.render();
|
||||
if (_performance.isEnabled())
|
||||
_performance.render();
|
||||
if (_help.isEnabled())
|
||||
@@ -434,15 +433,13 @@ void GUI::renderMainWindow() {
|
||||
}
|
||||
|
||||
#ifdef OPENSPACE_MODULE_ISWA_ENABLED
|
||||
if(ISWAManager::isInitialized()){
|
||||
static const int addCygnetBufferSize = 256;
|
||||
static char addCygnetBuffer[addCygnetBufferSize];
|
||||
ImGui::InputText("addCynget", addCygnetBuffer, addCygnetBufferSize);
|
||||
|
||||
if(ImGui::SmallButton("Add Cygnet")){
|
||||
if(ImGui::SmallButton("Add Cygnet"))
|
||||
OsEng.scriptEngine().queueScript("openspace.iswa.addCygnet('"+std::string(addCygnetBuffer)+"');");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
ImGui::End();
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* *
|
||||
* 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. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <modules/onscreengui/include/guiiswacomponent.h>
|
||||
|
||||
#include "imgui.h"
|
||||
|
||||
namespace {
|
||||
const ImVec2 size = ImVec2(350, 500);
|
||||
}
|
||||
|
||||
namespace openspace {
|
||||
namespace gui {
|
||||
|
||||
void GuiHelpComponent::render() {
|
||||
ImGui::Begin("ISWA", &_isEnabled, size, 0.5f);
|
||||
ImGui::ShowUserGuide();
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
} // gui
|
||||
} // openspace
|
||||
@@ -514,22 +514,22 @@ void GuiPropertyComponent::handleProperty(const ghoul::Dictionary& dictionary) {
|
||||
void GuiPropertyComponent::render() {
|
||||
ImGui::Begin("Properties", &_isEnabled, size, 0.5f);
|
||||
|
||||
if (ImGui::CollapsingHeader("OnScreen GUI")) {
|
||||
glm::vec2& pos = OsEng.renderEngine()._onScreenInformation._position;
|
||||
Vec2Property::ValueType value = pos;
|
||||
ImGui::SliderFloat2("Position", &value.x, -1.f, 1.f);
|
||||
pos = value;
|
||||
// if (ImGui::CollapsingHeader("OnScreen GUI")) {
|
||||
// glm::vec2& pos = OsEng.renderEngine()._onScreenInformation._position;
|
||||
// Vec2Property::ValueType value = pos;
|
||||
// ImGui::SliderFloat2("Position", &value.x, -1.f, 1.f);
|
||||
// pos = value;
|
||||
|
||||
unsigned int& size = OsEng.renderEngine()._onScreenInformation._size;
|
||||
int sizeValue = static_cast<int>(size);
|
||||
ImGui::SliderInt("Size", &sizeValue, 0, 36);
|
||||
size = static_cast<unsigned int>(sizeValue);
|
||||
// unsigned int& size = OsEng.renderEngine()._onScreenInformation._size;
|
||||
// int sizeValue = static_cast<int>(size);
|
||||
// ImGui::SliderInt("Size", &sizeValue, 0, 36);
|
||||
// size = static_cast<unsigned int>(sizeValue);
|
||||
|
||||
int& node = OsEng.renderEngine()._onScreenInformation._node;
|
||||
int iValue = node;
|
||||
ImGui::SliderInt("Node#", &iValue, 0, 30);
|
||||
node = iValue;
|
||||
}
|
||||
// int& node = OsEng.renderEngine()._onScreenInformation._node;
|
||||
// int iValue = node;
|
||||
// ImGui::SliderInt("Node#", &iValue, 0, 30);
|
||||
// node = iValue;
|
||||
// }
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user