Updated Ghoul version

Started cleaning up OpenSpace
This commit is contained in:
Alexander Bock
2015-12-13 22:01:42 -08:00
parent 8260f5701d
commit e26f1d41a4
34 changed files with 304 additions and 351 deletions
+6 -6
View File
@@ -384,11 +384,11 @@ void GUI::renderMainWindow() {
bool toJupiter = ImGui::Button("Coordinate System to Jupiter");
if (toSun)
OsEng.scriptEngine()->queueScript("openspace.setPropertyValue('Interaction.coordinateSystem', 'Sun');");
OsEng.scriptEngine().queueScript("openspace.setPropertyValue('Interaction.coordinateSystem', 'Sun');");
if (toPluto)
OsEng.scriptEngine()->queueScript("openspace.setPropertyValue('Interaction.coordinateSystem', 'Pluto');");
OsEng.scriptEngine().queueScript("openspace.setPropertyValue('Interaction.coordinateSystem', 'Pluto');");
if (toJupiter)
OsEng.scriptEngine()->queueScript("openspace.setPropertyValue('Interaction.coordinateSystem', 'Jupiter');");
OsEng.scriptEngine().queueScript("openspace.setPropertyValue('Interaction.coordinateSystem', 'Jupiter');");
ImGui::Checkbox("Help", &_help._isEnabled);
@@ -536,7 +536,7 @@ int show(lua_State* L) {
if (nArguments != 0)
return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments);
OsEng.gui()->setEnabled(true);
OsEng.gui().setEnabled(true);
return 0;
}
@@ -550,7 +550,7 @@ int hide(lua_State* L) {
if (nArguments != 0)
return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments);
OsEng.gui()->setEnabled(false);
OsEng.gui().setEnabled(false);
return 0;
}
@@ -564,7 +564,7 @@ int toggle(lua_State* L) {
if (nArguments != 0)
return luaL_error(L, "Expected %i arguments, got %i", 0, nArguments);
OsEng.gui()->setEnabled(!OsEng.gui()->isEnabled());
OsEng.gui().setEnabled(!OsEng.gui().isEnabled());
return 0;
}
@@ -39,9 +39,9 @@ namespace openspace {
namespace gui {
void GuiOriginComponent::render() {
const SceneGraphNode* currentFocus = OsEng.interactionHandler()->focusNode();
const SceneGraphNode* currentFocus = OsEng.interactionHandler().focusNode();
std::vector<SceneGraphNode*> nodes = OsEng.renderEngine()->scene()->allSceneGraphNodes();
std::vector<SceneGraphNode*> nodes = OsEng.renderEngine().scene()->allSceneGraphNodes();
std::sort(nodes.begin(), nodes.end(), [](SceneGraphNode* lhs, SceneGraphNode* rhs) { return lhs->name() < rhs->name(); });
auto it = std::find(nodes.begin(), nodes.end(), currentFocus);
ghoul_assert(it != nodes.end(), "Focus node not found");
@@ -57,7 +57,7 @@ void GuiOriginComponent::render() {
if (result) {
LINFO("openspace.setPropertyValue('Interaction.origin', '" + nodes[position]->name() + "');");
OsEng.scriptEngine()->queueScript("openspace.setPropertyValue('Interaction.origin', '" + nodes[position]->name() + "');");
OsEng.scriptEngine().queueScript("openspace.setPropertyValue('Interaction.origin', '" + nodes[position]->name() + "');");
}
}
@@ -76,7 +76,7 @@ void GuiPerformanceComponent::render() {
};
ImGui::Begin("Performance", &_isEnabled);
if (OsEng.renderEngine()->doesPerformanceMeasurements() &&
if (OsEng.renderEngine().doesPerformanceMeasurements() &&
ghoul::SharedMemory::exists(RenderEngine::PerformanceMeasurementSharedData))
{
ImGui::SliderFloat2("Min values, max Value", _minMaxValues, 0.f, 10000.f);
@@ -48,7 +48,7 @@ namespace {
void executeScript(const std::string& id, const std::string& value) {
std::string script =
"openspace.setPropertyValue('" + id + "', " + value + ");";
OsEng.scriptEngine()->queueScript(script);
OsEng.scriptEngine().queueScript(script);
}
void renderBoolProperty(Property* prop, const std::string& ownerName) {
@@ -432,17 +432,17 @@ void GuiPropertyComponent::render() {
ImGui::Begin("Properties", &_isEnabled, size, 0.5f);
if (ImGui::CollapsingHeader("OnScreen GUI")) {
glm::vec2& pos = OsEng.renderEngine()->_onScreenInformation._position;
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;
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& node = OsEng.renderEngine()._onScreenInformation._node;
int iValue = node;
ImGui::SliderInt("Node#", &iValue, 0, 30);
node = iValue;
+1 -1
View File
@@ -42,7 +42,7 @@ void GuiTimeComponent::render() {
bool changed = ImGui::SliderFloat("Delta Time", &deltaTime, -100.f, 100.f);
if (changed)
OsEng.scriptEngine()->queueScript("openspace.time.setDeltaTime(" + std::to_string(deltaTime) + ")");
OsEng.scriptEngine().queueScript("openspace.time.setDeltaTime(" + std::to_string(deltaTime) + ")");
//char dateBuffer[512] = {};