From 025eed2d95bca6407565280e00f9e285296666fd Mon Sep 17 00:00:00 2001
From: Krisjanis Rijnieks <krisjanis.rijnieks@gmail.com>
Date: Tue, 2 Feb 2016 19:23:06 +0100
Subject: [PATCH] Adjust `GridWarpSurface` related commands not to require
 projection editor

---
 src/Commands/AddGridColCmd.cpp | 5 +----
 src/Commands/AddGridColCmd.h   | 3 +--
 src/Commands/AddGridRowCmd.cpp | 5 +----
 src/Commands/AddGridRowCmd.h   | 3 +--
 src/Commands/RmGridColCmd.cpp  | 5 +----
 src/Commands/RmGridColCmd.h    | 3 +--
 src/Commands/RmGridRowCmd.cpp  | 5 +----
 src/Commands/RmGridRowCmd.h    | 3 +--
 8 files changed, 8 insertions(+), 24 deletions(-)

diff --git a/src/Commands/AddGridColCmd.cpp b/src/Commands/AddGridColCmd.cpp
index 08e1372..7011b18 100644
--- a/src/Commands/AddGridColCmd.cpp
+++ b/src/Commands/AddGridColCmd.cpp
@@ -3,9 +3,8 @@
 namespace ofx {
 namespace piMapper {
 
-AddGridColCmd::AddGridColCmd(GridWarpSurface * s, ProjectionEditor * e){
+AddGridColCmd::AddGridColCmd(GridWarpSurface * s){
 	_surface = s;
-	_editor = e;
 }
 
 void AddGridColCmd::exec(){
@@ -14,7 +13,6 @@ void AddGridColCmd::exec(){
 	_vertices = _surface->getVertices();
 	_texCoords = _surface->getTexCoords();
 	_surface->setGridCols(_surface->getGridCols() + 1);
-	_editor->createJoints();
 }
 
 void AddGridColCmd::undo(){
@@ -26,7 +24,6 @@ void AddGridColCmd::undo(){
 	}
 	_surface->setVertices(v);
 	_surface->setTexCoords(_texCoords);
-	_editor->createJoints();
 }
 
 } // namespace piMapper
diff --git a/src/Commands/AddGridColCmd.h b/src/Commands/AddGridColCmd.h
index c2d84ea..1e3c36f 100644
--- a/src/Commands/AddGridColCmd.h
+++ b/src/Commands/AddGridColCmd.h
@@ -13,7 +13,7 @@ namespace piMapper {
 class AddGridColCmd : public BaseUndoCmd {
 
 	public:
-		AddGridColCmd(GridWarpSurface * s, ProjectionEditor * e);
+		AddGridColCmd(GridWarpSurface * s);
 		void exec();
 		void undo();
 
@@ -21,7 +21,6 @@ class AddGridColCmd : public BaseUndoCmd {
 		vector <ofVec3f> _vertices;
 		vector <ofVec2f> _texCoords;
 		GridWarpSurface * _surface;
-		ProjectionEditor * _editor;
 
 };
 
diff --git a/src/Commands/AddGridRowCmd.cpp b/src/Commands/AddGridRowCmd.cpp
index 32b7925..ba35c8d 100644
--- a/src/Commands/AddGridRowCmd.cpp
+++ b/src/Commands/AddGridRowCmd.cpp
@@ -3,9 +3,8 @@
 namespace ofx {
 namespace piMapper {
 
-AddGridRowCmd::AddGridRowCmd(GridWarpSurface * s, ProjectionEditor * e){
+AddGridRowCmd::AddGridRowCmd(GridWarpSurface * s){
 	_surface = s;
-	_editor = e;
 }
 
 void AddGridRowCmd::exec(){
@@ -14,7 +13,6 @@ void AddGridRowCmd::exec(){
 	_vertices = _surface->getVertices();
 	_texCoords = _surface->getTexCoords();
 	_surface->setGridRows(_surface->getGridRows() + 1);
-	_editor->createJoints();
 }
 
 void AddGridRowCmd::undo(){
@@ -26,7 +24,6 @@ void AddGridRowCmd::undo(){
 	}
 	_surface->setVertices(v);
 	_surface->setTexCoords(_texCoords);
-	_editor->createJoints();
 }
 
 } // namespace piMapper
diff --git a/src/Commands/AddGridRowCmd.h b/src/Commands/AddGridRowCmd.h
index 9401e28..93c65ce 100644
--- a/src/Commands/AddGridRowCmd.h
+++ b/src/Commands/AddGridRowCmd.h
@@ -13,7 +13,7 @@ namespace piMapper {
 class AddGridRowCmd : public BaseUndoCmd {
 
 	public:
-		AddGridRowCmd(GridWarpSurface * s, ProjectionEditor * e);
+		AddGridRowCmd(GridWarpSurface * s);
 		void exec();
 		void undo();
 
@@ -21,7 +21,6 @@ class AddGridRowCmd : public BaseUndoCmd {
 		vector <ofVec3f> _vertices;
 		vector <ofVec2f> _texCoords;
 		GridWarpSurface * _surface;
-		ProjectionEditor * _editor;
 
 };
 
diff --git a/src/Commands/RmGridColCmd.cpp b/src/Commands/RmGridColCmd.cpp
index 0174b7c..a8af6fc 100644
--- a/src/Commands/RmGridColCmd.cpp
+++ b/src/Commands/RmGridColCmd.cpp
@@ -3,9 +3,8 @@
 namespace ofx {
 namespace piMapper {
 
-RmGridColCmd::RmGridColCmd(GridWarpSurface * s, ProjectionEditor * e){
+RmGridColCmd::RmGridColCmd(GridWarpSurface * s){
 	_surface = s;
-	_editor = e;
 	_doNotUndo = false;
 }
 
@@ -17,7 +16,6 @@ void RmGridColCmd::exec(){
 		_vertices = _surface->getVertices();
 		_texCoords = _surface->getTexCoords();
 		_surface->setGridCols(_surface->getGridCols() - 1);
-		_editor->createJoints();
 	}else{
 		_doNotUndo = true;
 	}
@@ -40,7 +38,6 @@ void RmGridColCmd::undo(){
 	
 	_surface->setVertices(v);
 	_surface->setTexCoords(_texCoords);
-	_editor->createJoints();
 }
 
 } // namespace piMapper
diff --git a/src/Commands/RmGridColCmd.h b/src/Commands/RmGridColCmd.h
index 271af51..7d2a695 100644
--- a/src/Commands/RmGridColCmd.h
+++ b/src/Commands/RmGridColCmd.h
@@ -13,7 +13,7 @@ namespace piMapper {
 class RmGridColCmd : public BaseUndoCmd {
 
 	public:
-		RmGridColCmd(GridWarpSurface * s, ProjectionEditor * e);
+		RmGridColCmd(GridWarpSurface * s);
 		void exec();
 		void undo();
 
@@ -21,7 +21,6 @@ class RmGridColCmd : public BaseUndoCmd {
 		vector <ofVec3f> _vertices;
 		vector <ofVec2f> _texCoords;
 		GridWarpSurface * _surface;
-		ProjectionEditor * _editor;
 		bool _doNotUndo;
 
 };
diff --git a/src/Commands/RmGridRowCmd.cpp b/src/Commands/RmGridRowCmd.cpp
index 94c6193..3420d8b 100644
--- a/src/Commands/RmGridRowCmd.cpp
+++ b/src/Commands/RmGridRowCmd.cpp
@@ -3,9 +3,8 @@
 namespace ofx {
 namespace piMapper {
 
-RmGridRowCmd::RmGridRowCmd(GridWarpSurface * s, ProjectionEditor * e){
+RmGridRowCmd::RmGridRowCmd(GridWarpSurface * s){
 	_surface = s;
-	_editor = e;
 	_doNotUndo = false;
 }
 
@@ -17,7 +16,6 @@ void RmGridRowCmd::exec(){
 		_vertices = _surface->getVertices();
 		_texCoords = _surface->getTexCoords();
 		_surface->setGridRows(_surface->getGridRows() - 1);
-		_editor->createJoints();
 	}else{
 		_doNotUndo = true;
 	}
@@ -40,7 +38,6 @@ void RmGridRowCmd::undo(){
 	
 	_surface->setVertices(v);
 	_surface->setTexCoords(_texCoords);
-	_editor->createJoints();
 }
 
 } // namespace piMapper
diff --git a/src/Commands/RmGridRowCmd.h b/src/Commands/RmGridRowCmd.h
index 5643b04..b5fc415 100644
--- a/src/Commands/RmGridRowCmd.h
+++ b/src/Commands/RmGridRowCmd.h
@@ -13,7 +13,7 @@ namespace piMapper {
 class RmGridRowCmd : public BaseUndoCmd {
 
 	public:
-		RmGridRowCmd(GridWarpSurface * s, ProjectionEditor * e);
+		RmGridRowCmd(GridWarpSurface * s);
 		void exec();
 		void undo();
 
@@ -21,7 +21,6 @@ class RmGridRowCmd : public BaseUndoCmd {
 		vector <ofVec3f> _vertices;
 		vector <ofVec2f> _texCoords;
 		GridWarpSurface * _surface;
-		ProjectionEditor * _editor;
 		bool _doNotUndo;
 
 };