Browse Source

Adjust `GridWarpSurface` related commands not to require projection editor

master
Krisjanis Rijnieks 9 years ago
parent
commit
025eed2d95
  1. 5
      src/Commands/AddGridColCmd.cpp
  2. 3
      src/Commands/AddGridColCmd.h
  3. 5
      src/Commands/AddGridRowCmd.cpp
  4. 3
      src/Commands/AddGridRowCmd.h
  5. 5
      src/Commands/RmGridColCmd.cpp
  6. 3
      src/Commands/RmGridColCmd.h
  7. 5
      src/Commands/RmGridRowCmd.cpp
  8. 3
      src/Commands/RmGridRowCmd.h

5
src/Commands/AddGridColCmd.cpp

@ -3,9 +3,8 @@
namespace ofx { namespace ofx {
namespace piMapper { namespace piMapper {
AddGridColCmd::AddGridColCmd(GridWarpSurface * s, ProjectionEditor * e){ AddGridColCmd::AddGridColCmd(GridWarpSurface * s){
_surface = s; _surface = s;
_editor = e;
} }
void AddGridColCmd::exec(){ void AddGridColCmd::exec(){
@ -14,7 +13,6 @@ void AddGridColCmd::exec(){
_vertices = _surface->getVertices(); _vertices = _surface->getVertices();
_texCoords = _surface->getTexCoords(); _texCoords = _surface->getTexCoords();
_surface->setGridCols(_surface->getGridCols() + 1); _surface->setGridCols(_surface->getGridCols() + 1);
_editor->createJoints();
} }
void AddGridColCmd::undo(){ void AddGridColCmd::undo(){
@ -26,7 +24,6 @@ void AddGridColCmd::undo(){
} }
_surface->setVertices(v); _surface->setVertices(v);
_surface->setTexCoords(_texCoords); _surface->setTexCoords(_texCoords);
_editor->createJoints();
} }
} // namespace piMapper } // namespace piMapper

3
src/Commands/AddGridColCmd.h

@ -13,7 +13,7 @@ namespace piMapper {
class AddGridColCmd : public BaseUndoCmd { class AddGridColCmd : public BaseUndoCmd {
public: public:
AddGridColCmd(GridWarpSurface * s, ProjectionEditor * e); AddGridColCmd(GridWarpSurface * s);
void exec(); void exec();
void undo(); void undo();
@ -21,7 +21,6 @@ class AddGridColCmd : public BaseUndoCmd {
vector <ofVec3f> _vertices; vector <ofVec3f> _vertices;
vector <ofVec2f> _texCoords; vector <ofVec2f> _texCoords;
GridWarpSurface * _surface; GridWarpSurface * _surface;
ProjectionEditor * _editor;
}; };

5
src/Commands/AddGridRowCmd.cpp

@ -3,9 +3,8 @@
namespace ofx { namespace ofx {
namespace piMapper { namespace piMapper {
AddGridRowCmd::AddGridRowCmd(GridWarpSurface * s, ProjectionEditor * e){ AddGridRowCmd::AddGridRowCmd(GridWarpSurface * s){
_surface = s; _surface = s;
_editor = e;
} }
void AddGridRowCmd::exec(){ void AddGridRowCmd::exec(){
@ -14,7 +13,6 @@ void AddGridRowCmd::exec(){
_vertices = _surface->getVertices(); _vertices = _surface->getVertices();
_texCoords = _surface->getTexCoords(); _texCoords = _surface->getTexCoords();
_surface->setGridRows(_surface->getGridRows() + 1); _surface->setGridRows(_surface->getGridRows() + 1);
_editor->createJoints();
} }
void AddGridRowCmd::undo(){ void AddGridRowCmd::undo(){
@ -26,7 +24,6 @@ void AddGridRowCmd::undo(){
} }
_surface->setVertices(v); _surface->setVertices(v);
_surface->setTexCoords(_texCoords); _surface->setTexCoords(_texCoords);
_editor->createJoints();
} }
} // namespace piMapper } // namespace piMapper

3
src/Commands/AddGridRowCmd.h

@ -13,7 +13,7 @@ namespace piMapper {
class AddGridRowCmd : public BaseUndoCmd { class AddGridRowCmd : public BaseUndoCmd {
public: public:
AddGridRowCmd(GridWarpSurface * s, ProjectionEditor * e); AddGridRowCmd(GridWarpSurface * s);
void exec(); void exec();
void undo(); void undo();
@ -21,7 +21,6 @@ class AddGridRowCmd : public BaseUndoCmd {
vector <ofVec3f> _vertices; vector <ofVec3f> _vertices;
vector <ofVec2f> _texCoords; vector <ofVec2f> _texCoords;
GridWarpSurface * _surface; GridWarpSurface * _surface;
ProjectionEditor * _editor;
}; };

5
src/Commands/RmGridColCmd.cpp

@ -3,9 +3,8 @@
namespace ofx { namespace ofx {
namespace piMapper { namespace piMapper {
RmGridColCmd::RmGridColCmd(GridWarpSurface * s, ProjectionEditor * e){ RmGridColCmd::RmGridColCmd(GridWarpSurface * s){
_surface = s; _surface = s;
_editor = e;
_doNotUndo = false; _doNotUndo = false;
} }
@ -17,7 +16,6 @@ void RmGridColCmd::exec(){
_vertices = _surface->getVertices(); _vertices = _surface->getVertices();
_texCoords = _surface->getTexCoords(); _texCoords = _surface->getTexCoords();
_surface->setGridCols(_surface->getGridCols() - 1); _surface->setGridCols(_surface->getGridCols() - 1);
_editor->createJoints();
}else{ }else{
_doNotUndo = true; _doNotUndo = true;
} }
@ -40,7 +38,6 @@ void RmGridColCmd::undo(){
_surface->setVertices(v); _surface->setVertices(v);
_surface->setTexCoords(_texCoords); _surface->setTexCoords(_texCoords);
_editor->createJoints();
} }
} // namespace piMapper } // namespace piMapper

3
src/Commands/RmGridColCmd.h

@ -13,7 +13,7 @@ namespace piMapper {
class RmGridColCmd : public BaseUndoCmd { class RmGridColCmd : public BaseUndoCmd {
public: public:
RmGridColCmd(GridWarpSurface * s, ProjectionEditor * e); RmGridColCmd(GridWarpSurface * s);
void exec(); void exec();
void undo(); void undo();
@ -21,7 +21,6 @@ class RmGridColCmd : public BaseUndoCmd {
vector <ofVec3f> _vertices; vector <ofVec3f> _vertices;
vector <ofVec2f> _texCoords; vector <ofVec2f> _texCoords;
GridWarpSurface * _surface; GridWarpSurface * _surface;
ProjectionEditor * _editor;
bool _doNotUndo; bool _doNotUndo;
}; };

5
src/Commands/RmGridRowCmd.cpp

@ -3,9 +3,8 @@
namespace ofx { namespace ofx {
namespace piMapper { namespace piMapper {
RmGridRowCmd::RmGridRowCmd(GridWarpSurface * s, ProjectionEditor * e){ RmGridRowCmd::RmGridRowCmd(GridWarpSurface * s){
_surface = s; _surface = s;
_editor = e;
_doNotUndo = false; _doNotUndo = false;
} }
@ -17,7 +16,6 @@ void RmGridRowCmd::exec(){
_vertices = _surface->getVertices(); _vertices = _surface->getVertices();
_texCoords = _surface->getTexCoords(); _texCoords = _surface->getTexCoords();
_surface->setGridRows(_surface->getGridRows() - 1); _surface->setGridRows(_surface->getGridRows() - 1);
_editor->createJoints();
}else{ }else{
_doNotUndo = true; _doNotUndo = true;
} }
@ -40,7 +38,6 @@ void RmGridRowCmd::undo(){
_surface->setVertices(v); _surface->setVertices(v);
_surface->setTexCoords(_texCoords); _surface->setTexCoords(_texCoords);
_editor->createJoints();
} }
} // namespace piMapper } // namespace piMapper

3
src/Commands/RmGridRowCmd.h

@ -13,7 +13,7 @@ namespace piMapper {
class RmGridRowCmd : public BaseUndoCmd { class RmGridRowCmd : public BaseUndoCmd {
public: public:
RmGridRowCmd(GridWarpSurface * s, ProjectionEditor * e); RmGridRowCmd(GridWarpSurface * s);
void exec(); void exec();
void undo(); void undo();
@ -21,7 +21,6 @@ class RmGridRowCmd : public BaseUndoCmd {
vector <ofVec3f> _vertices; vector <ofVec3f> _vertices;
vector <ofVec2f> _texCoords; vector <ofVec2f> _texCoords;
GridWarpSurface * _surface; GridWarpSurface * _surface;
ProjectionEditor * _editor;
bool _doNotUndo; bool _doNotUndo;
}; };

Loading…
Cancel
Save