diff --git a/src/Surfaces/SurfaceManagerGui.cpp b/src/Surfaces/SurfaceManagerGui.cpp index 751fe71..917cfd6 100644 --- a/src/Surfaces/SurfaceManagerGui.cpp +++ b/src/Surfaces/SurfaceManagerGui.cpp @@ -149,6 +149,9 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){ break; } } + + _cmdManager->exec(new SelVertexCmd(surfaceManager, jointVertIndex)); + _cmdManager->exec(new MvSurfaceVertCmd( jointVertIndex, surfaceManager->getSelectedSurface(), @@ -342,8 +345,14 @@ ProjectionEditor * SurfaceManagerGui::getProjectionEditor(){ 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(); + if(isDragged){ + projectionEditor.getJoints()->at(i)->startDrag(); + }else{ + projectionEditor.getJoints()->at(i)->stopDrag(); + } } void SurfaceManagerGui::onVerticesChanged(vector & vertices){ diff --git a/src/Surfaces/SurfaceManagerGui.h b/src/Surfaces/SurfaceManagerGui.h index 210d977..0f240ee 100644 --- a/src/Surfaces/SurfaceManagerGui.h +++ b/src/Surfaces/SurfaceManagerGui.h @@ -16,6 +16,7 @@ #include "MvSurfaceVertCmd.h" #include "MvAllTexCoordsCmd.h" #include "MvTexCoordCmd.h" +#include "SelVertexCmd.h" namespace ofx { namespace piMapper {