Browse Source

Add todos to `SurfaceManagerGui`

As the first step for improving the GUI vs system separation
master
Krisjanis Rijnieks 9 years ago
parent
commit
e4a955f3fa
  1. 12
      src/Surfaces/SurfaceManagerGui.cpp

12
src/Surfaces/SurfaceManagerGui.cpp

@ -110,6 +110,8 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){
} }
if(jointIndex != -1){ if(jointIndex != -1){
// TODO: emit event through the GUI singleton
_cmdManager->exec(new MvTexCoordCmd(jointIndex, &textureEditor)); _cmdManager->exec(new MvTexCoordCmd(jointIndex, &textureEditor));
} }
@ -126,6 +128,7 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){
clickPosition = ofVec2f(args.x, args.y); clickPosition = ofVec2f(args.x, args.y);
startDrag(); startDrag();
// TODO: emit event through the gui singleton
_cmdManager->exec(new MvAllTexCoordsCmd( _cmdManager->exec(new MvAllTexCoordsCmd(
surfaceManager->getSelectedSurface(), surfaceManager->getSelectedSurface(),
&textureEditor)); &textureEditor));
@ -150,8 +153,10 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){
} }
} }
// TODO: emit event through the gui singleton
_cmdManager->exec(new SelVertexCmd(surfaceManager, jointVertIndex)); _cmdManager->exec(new SelVertexCmd(surfaceManager, jointVertIndex));
// TODO: emit event through the gui singleton
_cmdManager->exec(new MvSurfaceVertCmd( _cmdManager->exec(new MvSurfaceVertCmd(
jointVertIndex, jointVertIndex,
surfaceManager->getSelectedSurface(), surfaceManager->getSelectedSurface(),
@ -167,6 +172,8 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){
// Do not repeat this command if attempting to select an // Do not repeat this command if attempting to select an
// already selected surface. // already selected surface.
if(surfaceManager->getSelectedSurface() != surfaceManager->getSurface(i)){ if(surfaceManager->getSelectedSurface() != surfaceManager->getSurface(i)){
// TODO: emit event through gui singleton
_cmdManager->exec(new SelSurfaceCmd( _cmdManager->exec(new SelSurfaceCmd(
surfaceManager, surfaceManager,
surfaceManager->getSurface(i) )); surfaceManager->getSurface(i) ));
@ -185,6 +192,7 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){
clickPosition = ofVec2f(args.x, args.y); clickPosition = ofVec2f(args.x, args.y);
startDrag(); startDrag();
// TODO: emit event through the gui singleton
_cmdManager->exec( _cmdManager->exec(
new MvSurfaceCmd( new MvSurfaceCmd(
surfaceManager->getSelectedSurface(), surfaceManager->getSelectedSurface(),
@ -194,6 +202,8 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){
if(!bSurfaceSelected){ if(!bSurfaceSelected){
// unselect if no surface selected // unselect if no surface selected
projectionEditor.clearJoints(); projectionEditor.clearJoints();
// TODO: emit event though the gui singleton
_cmdManager->exec(new DeselectSurfaceCmd(surfaceManager)); _cmdManager->exec(new DeselectSurfaceCmd(surfaceManager));
} }
}else if(guiMode == GuiMode::SOURCE_SELECTION){} }else if(guiMode == GuiMode::SOURCE_SELECTION){}
@ -207,6 +217,8 @@ void SurfaceManagerGui::mouseReleased(ofMouseEventArgs & args){
// Check if surface has moved // Check if surface has moved
if(surfaceManager->getSelectedSurface()){ if(surfaceManager->getSelectedSurface()){
if(!surfaceManager->getSelectedSurface()->getMoved()){ if(!surfaceManager->getSelectedSurface()->getMoved()){
// TODO: emit event through the gui singleton
_cmdManager->undo(); _cmdManager->undo();
} }
} }

Loading…
Cancel
Save