From 64f7fa5d29e735c320ed1811075e3fc3dacd5757 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Fri, 21 Oct 2016 19:17:36 +0200 Subject: [PATCH] Integrate TextureConsumersWidget into Application Now in TextureMappingMode one can see the texture coordinates of other surfaces consuming the source. --- src/Application/Modes/TextureMappingMode.cpp | 2 ++ src/Commands/SetApplicationModeCmd.cpp | 1 + src/Gui/Gui.cpp | 4 ++++ src/Gui/Gui.h | 3 +++ 4 files changed, 10 insertions(+) diff --git a/src/Application/Modes/TextureMappingMode.cpp b/src/Application/Modes/TextureMappingMode.cpp index 76cb98b..2836dfd 100644 --- a/src/Application/Modes/TextureMappingMode.cpp +++ b/src/Application/Modes/TextureMappingMode.cpp @@ -21,6 +21,7 @@ TextureMappingMode::TextureMappingMode(){ void TextureMappingMode::setup(Application * app){ Gui::instance()->getTextureHighlightWidget().setSurfaceManager(app->getSurfaceManager()); + Gui::instance()->getTextureConsumersWidget().setSurfaceManager(app->getSurfaceManager()); } void TextureMappingMode::update(Application * app){ @@ -67,6 +68,7 @@ void TextureMappingMode::draw(Application * app){ ofPushMatrix(); ofTranslate(_canvasTranslate.x, _canvasTranslate.y); + Gui::instance()->getTextureConsumersWidget().draw(); Gui::instance()->getTextureHighlightWidget().draw(); Gui::instance()->getTextureEditorWidget().draw(); ofPopMatrix(); diff --git a/src/Commands/SetApplicationModeCmd.cpp b/src/Commands/SetApplicationModeCmd.cpp index 2aa095e..d6bb149 100644 --- a/src/Commands/SetApplicationModeCmd.cpp +++ b/src/Commands/SetApplicationModeCmd.cpp @@ -20,6 +20,7 @@ void SetApplicationModeCmd::exec(){ Gui::instance()->getTextureEditorWidget().setSurface( _application->getSurfaceManager()->getSelectedSurface()); + Gui::instance()->getTextureConsumersWidget().findConsumerSurfaces(); if(_applicationState != PresentationMode::instance()){ ofShowCursor(); diff --git a/src/Gui/Gui.cpp b/src/Gui/Gui.cpp index da147f1..c547b53 100644 --- a/src/Gui/Gui.cpp +++ b/src/Gui/Gui.cpp @@ -108,6 +108,10 @@ SourcesEditorWidget & Gui::getSourcesEditorWidget(){ return _sourcesEditorWidget; } +TextureConsumersWidget & Gui::getTextureConsumersWidget(){ + return _textureConsumersWidget; +} + void Gui::onScaleWidgetEvent(GuiWidgetEvent & event){ GuiEvent e; e.args = event.args; diff --git a/src/Gui/Gui.h b/src/Gui/Gui.h index 2b04367..c24e836 100644 --- a/src/Gui/Gui.h +++ b/src/Gui/Gui.h @@ -11,6 +11,7 @@ #include "TextureEditorWidget.h" #include "ProjectionEditorWidget.h" #include "SourcesEditorWidget.h" +#include "TextureConsumersWidget.h" namespace ofx { namespace piMapper { @@ -73,6 +74,7 @@ class Gui { TextureEditorWidget & getTextureEditorWidget(); ProjectionEditorWidget & getProjectionEditorWidget(); SourcesEditorWidget & getSourcesEditorWidget(); + TextureConsumersWidget & getTextureConsumersWidget(); // Consider these as a part of the application states/modes. void onMousePressed(ofMouseEventArgs & args); @@ -96,6 +98,7 @@ class Gui { TextureEditorWidget _textureEditorWidget; ProjectionEditorWidget _projectionEditorWidget; SourcesEditorWidget _sourcesEditorWidget; + TextureConsumersWidget _textureConsumersWidget; }; } // piMapper