From 2e3be3095381d457ea5231841b322152b3fb1631 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sat, 17 Sep 2016 11:34:10 +0300 Subject: [PATCH] Clean up SurfaceManagerGui With the intention to remove it completely in a step-by-step manner. --- src/Surfaces/SurfaceManagerGui.cpp | 41 +----------------------------- src/Surfaces/SurfaceManagerGui.h | 3 --- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/src/Surfaces/SurfaceManagerGui.cpp b/src/Surfaces/SurfaceManagerGui.cpp index 7da8215..b726f74 100644 --- a/src/Surfaces/SurfaceManagerGui.cpp +++ b/src/Surfaces/SurfaceManagerGui.cpp @@ -7,59 +7,22 @@ SurfaceManagerGui::SurfaceManagerGui(){ surfaceManager = 0; guiMode = GuiMode::NONE; bDrag = false; - registerMouseEvents(); ofHideCursor(); _cmdManager = 0; } SurfaceManagerGui::~SurfaceManagerGui(){ - unregisterMouseEvents(); surfaceManager = 0; _cmdManager = 0; } -void SurfaceManagerGui::registerMouseEvents(){ - //ofAddListener(ofEvents().mousePressed, this, - // &SurfaceManagerGui::mousePressed); - //ofAddListener(ofEvents().mouseReleased, this, - // &SurfaceManagerGui::mouseReleased); - //ofAddListener(ofEvents().mouseDragged, this, - // &SurfaceManagerGui::mouseDragged); -} - -void SurfaceManagerGui::unregisterMouseEvents(){ - //ofRemoveListener(ofEvents().mousePressed, this, - // &SurfaceManagerGui::mousePressed); - //ofRemoveListener(ofEvents().mouseReleased, this, - // &SurfaceManagerGui::mouseReleased); - //ofRemoveListener(ofEvents().mouseDragged, this, - // &SurfaceManagerGui::mouseDragged); -} - void SurfaceManagerGui::draw(){ if(surfaceManager == 0){ return; } if(guiMode == GuiMode::TEXTURE_MAPPING){ - // draw the texture of the selected surface - /* - if(surfaceManager->getSelectedSurface() != 0){ - bool normalizedTexCoords = ofGetUsingNormalizedTexCoords(); - ofEnableNormalizedTexCoords(); - - // Reset default color to white first - ofSetColor(255, 255, 255, 255); - surfaceManager->getSelectedSurface()->drawTexture(ofVec2f(0, 0)); - - if(!normalizedTexCoords){ - ofDisableNormalizedTexCoords(); - } - } - */ - - // draw texture editing GUI on top - //textureEditor.draw(); + // TODO: Remove this if else together with the SurfaceManagerGui }else if(guiMode == GuiMode::PROJECTION_MAPPING){ projectionEditor.draw(); }else if(guiMode == GuiMode::SOURCE_SELECTION){ @@ -285,7 +248,6 @@ SourcesEditor * SurfaceManagerGui::getSourcesEditor(){ } void SurfaceManagerGui::onVertexChanged(int & i){ - //cout << "VERTEX CHANGED: " << vertex.x << ", " << vertex.y << endl; bool isDragged = projectionEditor.getJoints()->at(i)->isDragged(); projectionEditor.createJoints(); projectionEditor.getJoints()->at(i)->select(); @@ -297,7 +259,6 @@ void SurfaceManagerGui::onVertexChanged(int & i){ } void SurfaceManagerGui::onVerticesChanged(vector & vertices){ - //cout << "VERTICES CHANGED: " << vertices.size() << endl; projectionEditor.createJoints(); } diff --git a/src/Surfaces/SurfaceManagerGui.h b/src/Surfaces/SurfaceManagerGui.h index 68d4d70..b996471 100644 --- a/src/Surfaces/SurfaceManagerGui.h +++ b/src/Surfaces/SurfaceManagerGui.h @@ -28,9 +28,6 @@ class SurfaceManagerGui { SurfaceManagerGui(); ~SurfaceManagerGui(); - void registerMouseEvents(); - void unregisterMouseEvents(); - void draw(); void mousePressed(ofMouseEventArgs & args); void mouseReleased(ofMouseEventArgs & args);