From ed1dd32fa20cba4dc288be1b8a0d0ff828aadbc2 Mon Sep 17 00:00:00 2001
From: Krisjanis Rijnieks <krisjanis.rijnieks@gmail.com>
Date: Mon, 26 Sep 2016 21:23:14 +0300
Subject: [PATCH] Clean up old code related to TextureEditingWidget old paths

---
 .../States/TextureMappingState.cpp            | 22 -------------------
 src/Surfaces/SurfaceManagerGui.cpp            | 12 ----------
 src/Surfaces/SurfaceManagerGui.h              |  3 ---
 3 files changed, 37 deletions(-)

diff --git a/src/Application/States/TextureMappingState.cpp b/src/Application/States/TextureMappingState.cpp
index 9ff6bb2..d67dd16 100644
--- a/src/Application/States/TextureMappingState.cpp
+++ b/src/Application/States/TextureMappingState.cpp
@@ -20,7 +20,6 @@ TextureMappingState::TextureMappingState(){
 }
 
 void TextureMappingState::update(Application * app){
-	//app->getGui()->getTextureEditor()->update();
 	Gui::instance()->getTextureEditorWidget().update();
 }
 
@@ -69,9 +68,6 @@ void TextureMappingState::draw(Application * app){
 	
 	Gui::instance()->getTextureHighlightWidget().setSurfaceManager(app->getSurfaceManager());
 	Gui::instance()->getTextureHighlightWidget().draw();
-	
-	// TODO: Replace with a transform widget.
-	//app->getGui()->getTextureEditor()->draw();
 	Gui::instance()->getTextureEditorWidget().draw();
 	
 	ofPopMatrix();
@@ -90,34 +86,28 @@ void TextureMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args)
 	switch(args.key){
 
 	 case OF_KEY_LEFT:
-		 //app->getGui()->getTextureEditor()->moveSelection(ofVec2f(-moveStep, 0.0f));
 		 Gui::instance()->getTextureEditorWidget().moveSelection(ofVec2f(-moveStep, 0.0f));
 		 break;
 
 	 case OF_KEY_RIGHT:
-		 //app->getGui()->getTextureEditor()->moveSelection(ofVec2f(moveStep, 0.0f));
 		 Gui::instance()->getTextureEditorWidget().moveSelection(ofVec2f(moveStep, 0.0f));
 		 break;
 
 	 case OF_KEY_UP:
-		 //app->getGui()->getTextureEditor()->moveSelection(ofVec2f(0.0f, -moveStep));
 		 Gui::instance()->getTextureEditorWidget().moveSelection(ofVec2f(0.0f, -moveStep));
 		 break;
 
 	 case OF_KEY_DOWN:
-		 //app->getGui()->getTextureEditor()->moveSelection(ofVec2f(0.0f, moveStep));
 		 Gui::instance()->getTextureEditorWidget().moveSelection(ofVec2f(0.0f, moveStep));
 		 break;
 
 	 case '>':
 		 app->getCmdManager()->exec(
-			 //new SelNextTexCoordCmd(app->getGui()->getTextureEditor()));
 			 new SelNextTexCoordCmd(&Gui::instance()->getTextureEditorWidget()));
 		 break;
 		 
 	 case '<':
 		 app->getCmdManager()->exec(
-			 //new SelPrevTexCoordCmd(app->getGui()->getTextureEditor()));
 			 new SelPrevTexCoordCmd(&Gui::instance()->getTextureEditorWidget()));
 		 break;
 	 
@@ -159,9 +149,7 @@ void TextureMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args)
 void TextureMappingState::onBackgroundPressed(Application * app, GuiBackgroundEvent & e){
 	// Exec the command only if a joint is selected.
 	bool selected = false;
-	//for(unsigned int i = 0; i < app->getGui()->getTextureEditor()->getJoints().size(); ++i){
 	for(unsigned int i = 0; i < Gui::instance()->getTextureEditorWidget().getJoints().size(); ++i){
-		//if(app->getGui()->getTextureEditor()->getJoints()[i]->selected){
 		if(Gui::instance()->getTextureEditorWidget().getJoints()[i]->selected){
 			selected = true;
 			break;
@@ -170,7 +158,6 @@ void TextureMappingState::onBackgroundPressed(Application * app, GuiBackgroundEv
 	
 	if(selected){
 		app->getCmdManager()->exec(
-			//new DeselectTexCoordCmd(app->getGui()->getTextureEditor()));
 			new DeselectTexCoordCmd(&Gui::instance()->getTextureEditorWidget()));
 	}
 	
@@ -190,7 +177,6 @@ void TextureMappingState::onMousePressed(Application * app, ofMouseEventArgs & a
 	}
 	
 	// Old code from SurfaceManagerGui
-	//CircleJoint * hitJoint = app->getGui()->getTextureEditor()->hitTestJoints(ofVec2f(args.x, args.y));
 	CircleJoint * hitJoint =
 		Gui::instance()->getTextureEditorWidget().hitTestJoints(ofVec2f(args.x, args.y));
 	
@@ -198,15 +184,12 @@ void TextureMappingState::onMousePressed(Application * app, ofMouseEventArgs & a
 	
 		hitJoint->mousePressed(args);
 		
-		//app->getGui()->getTextureEditor()->unselectAllJoints();
 		Gui::instance()->getTextureEditorWidget().unselectAllJoints();
 		hitJoint->select();
 		hitJoint->startDrag();
 		int jointIndex;
 		
-		//for(int i = 0; i < app->getGui()->getTextureEditor()->getJoints().size(); i++){
 		for(int i = 0; i < Gui::instance()->getTextureEditorWidget().getJoints().size(); i++){
-			//if(app->getGui()->getTextureEditor()->getJoints()[i] == hitJoint){
 			if(Gui::instance()->getTextureEditorWidget().getJoints()[i] == hitJoint){
 				jointIndex = i;
 				break;
@@ -214,7 +197,6 @@ void TextureMappingState::onMousePressed(Application * app, ofMouseEventArgs & a
 		}
 
 		app->getCmdManager()->exec(
-			//new MvTexCoordCmd(jointIndex, app->getGui()->getTextureEditor()));
 			new MvTexCoordCmd(jointIndex, &Gui::instance()->getTextureEditorWidget()));
 		
 	}else if(app->getSurfaceManager()->getSelectedSurface()->getTextureHitArea().inside(args.x, args.y)){
@@ -225,7 +207,6 @@ void TextureMappingState::onMousePressed(Application * app, ofMouseEventArgs & a
 		// TODO: emit event through the gui singleton
 		app->getCmdManager()->exec(new MvAllTexCoordsCmd(
 			app->getSurfaceManager()->getSelectedSurface(),
-			//app->getGui()->getTextureEditor()));
 			&Gui::instance()->getTextureEditorWidget()));
 
 	}else{
@@ -251,7 +232,6 @@ void TextureMappingState::onMouseReleased(Application * app, ofMouseEventArgs &
 	args.y -= _canvasTranslate.y;
 
 	app->getGui()->stopDrag();
-	//app->getGui()->getTextureEditor()->stopDragJoints();
 	Gui::instance()->getTextureEditorWidget().stopDragJoints();
 }
 
@@ -260,13 +240,11 @@ void TextureMappingState::onMouseDragged(Application * app, ofMouseEventArgs & a
 	if(!_bTranslateCanvas){
 		args.x -= _canvasTranslate.x;
 		args.y -= _canvasTranslate.y;
-		//app->getGui()->getTextureEditor()->onMouseDragged(args);
 		Gui::instance()->getTextureEditorWidget().onMouseDragged(args);
 		
 		if(app->getGui()->bDrag){
 			ofVec2f mousePosition = ofVec2f(args.x, args.y);
 			ofVec2f distance = mousePosition - app->getGui()->clickPosition;
-			//app->getGui()->getTextureEditor()->moveTexCoords(distance);
 			Gui::instance()->getTextureEditorWidget().moveTexCoords(distance);
 			app->getGui()->clickPosition = mousePosition;
 		}
diff --git a/src/Surfaces/SurfaceManagerGui.cpp b/src/Surfaces/SurfaceManagerGui.cpp
index 4ebf4cf..a0ba49f 100644
--- a/src/Surfaces/SurfaceManagerGui.cpp
+++ b/src/Surfaces/SurfaceManagerGui.cpp
@@ -63,12 +63,6 @@ void SurfaceManagerGui::setMode(int newGuiMode){
 		sourcesEditor.disable();
 	}
 
-	/*
-	if(guiMode == GuiMode::TEXTURE_MAPPING){
-		textureEditor.setSurface(surfaceManager->getSelectedSurface());
-	}
-	*/
-
 	if(guiMode == GuiMode::PROJECTION_MAPPING){
 		projectionEditor.enable();
 	}else{
@@ -92,12 +86,6 @@ ProjectionEditor * SurfaceManagerGui::getProjectionEditor(){
 	return &projectionEditor;
 }
 
-/*
-TextureEditorWidget * SurfaceManagerGui::getTextureEditor(){
-	return &textureEditor;
-}
-*/
-
 SourcesEditor * SurfaceManagerGui::getSourcesEditor(){
 	return &sourcesEditor;
 }
diff --git a/src/Surfaces/SurfaceManagerGui.h b/src/Surfaces/SurfaceManagerGui.h
index 7f56914..0226ef1 100644
--- a/src/Surfaces/SurfaceManagerGui.h
+++ b/src/Surfaces/SurfaceManagerGui.h
@@ -6,7 +6,6 @@
 #include "ofGraphics.h"
 
 #include "SurfaceManager.h"
-//#include "TextureEditorWidget.h"
 #include "ProjectionEditor.h"
 #include "SourcesEditor.h"
 #include "GuiMode.h"
@@ -37,7 +36,6 @@ class SurfaceManagerGui {
 		void stopDrag();
 	
 		ProjectionEditor * getProjectionEditor();
-		//TextureEditorWidget * getTextureEditor();
 		SourcesEditor * getSourcesEditor();
 	
 		void onVertexChanged(int & i);
@@ -52,7 +50,6 @@ class SurfaceManagerGui {
 	private:
 		SurfaceManager * surfaceManager;
 		MediaServer * mediaServer;
-		//TextureEditorWidget textureEditor;
 		ProjectionEditor projectionEditor;
 		SourcesEditor sourcesEditor;