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;
}
}
_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<ofVec3f> & vertices){

1
src/Surfaces/SurfaceManagerGui.h

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

Loading…
Cancel
Save