diff --git a/src/Application/Application.cpp b/src/Application/Application.cpp index 8cd10b1..a382106 100644 --- a/src/Application/Application.cpp +++ b/src/Application/Application.cpp @@ -337,6 +337,23 @@ void Application::selectPrevVertex(){ } } +void Application::selectVertex(int surface, int vertex){ + if(getSurfaceManager()->size()){ + + // TODO: use one command instead of two + + getCmdManager()->exec( + new SelSurfaceCmd( + getSurfaceManager(), + getSurfaceManager()->getSurface(surface))); + + getCmdManager()->exec( + new SelVertexCmd( + getSurfaceManager(), + vertex)); + } +} + void Application::selectNextTexCoord(){ if(getSurfaceManager()->getSelectedSurface() != 0){ getCmdManager()->exec( diff --git a/src/Application/Application.h b/src/Application/Application.h index db384af..0e81208 100644 --- a/src/Application/Application.h +++ b/src/Application/Application.h @@ -104,6 +104,7 @@ class Application { void selectPrevSurface(); void selectNextVertex(); void selectPrevVertex(); + void selectVertex(int surface, int vertex); void selectNextTexCoord(); void selectPrevTexCoord(); diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index 15c36c4..4289c12 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -107,6 +107,10 @@ void ofxPiMapper::selectPrevVertex(){ _application.selectPrevVertex(); } +void ofxPiMapper::selectVertex(int surface, int vertex){ + _application.selectVertex(surface, vertex); +} + void ofxPiMapper::selectNextTexCoord(){ _application.selectNextTexCoord(); } diff --git a/src/ofxPiMapper.h b/src/ofxPiMapper.h index 3c51134..12c4205 100644 --- a/src/ofxPiMapper.h +++ b/src/ofxPiMapper.h @@ -57,6 +57,7 @@ class ofxPiMapper { void duplicateSurface(); void selectNextVertex(); void selectPrevVertex(); + void selectVertex(int surface, int vertex); void selectNextTexCoord(); void selectPrevTexCoord(); void moveLayerUp();