Browse Source

Use `SelVertexCmd` and fix `onVertexChanged` in `SurfaceManagerGui`

master
Krisjanis Rijnieks 9 years ago
parent
commit
7511e8300a
  1. 9
      src/Surfaces/SurfaceManagerGui.cpp
  2. 1
      src/Surfaces/SurfaceManagerGui.h

9
src/Surfaces/SurfaceManagerGui.cpp

@ -149,6 +149,9 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){
break; break;
} }
} }
_cmdManager->exec(new SelVertexCmd(surfaceManager, jointVertIndex));
_cmdManager->exec(new MvSurfaceVertCmd( _cmdManager->exec(new MvSurfaceVertCmd(
jointVertIndex, jointVertIndex,
surfaceManager->getSelectedSurface(), surfaceManager->getSelectedSurface(),
@ -342,8 +345,14 @@ ProjectionEditor * SurfaceManagerGui::getProjectionEditor(){
void SurfaceManagerGui::onVertexChanged(int & i){ void SurfaceManagerGui::onVertexChanged(int & i){
//cout << "VERTEX CHANGED: " << vertex.x << ", " << vertex.y << endl; //cout << "VERTEX CHANGED: " << vertex.x << ", " << vertex.y << endl;
bool isDragged = projectionEditor.getJoints()->at(i)->isDragged();
projectionEditor.createJoints(); projectionEditor.createJoints();
projectionEditor.getJoints()->at(i)->select(); projectionEditor.getJoints()->at(i)->select();
if(isDragged){
projectionEditor.getJoints()->at(i)->startDrag();
}else{
projectionEditor.getJoints()->at(i)->stopDrag();
}
} }
void SurfaceManagerGui::onVerticesChanged(vector<ofVec3f> & vertices){ void SurfaceManagerGui::onVerticesChanged(vector<ofVec3f> & vertices){

1
src/Surfaces/SurfaceManagerGui.h

@ -16,6 +16,7 @@
#include "MvSurfaceVertCmd.h" #include "MvSurfaceVertCmd.h"
#include "MvAllTexCoordsCmd.h" #include "MvAllTexCoordsCmd.h"
#include "MvTexCoordCmd.h" #include "MvTexCoordCmd.h"
#include "SelVertexCmd.h"
namespace ofx { namespace ofx {
namespace piMapper { namespace piMapper {

Loading…
Cancel
Save