Browse Source

Connect ofxPiMapper::selectNext and PrevVertex to TextureMappingMode

master
Krisjanis Rijnieks 9 years ago
parent
commit
3d75763382
  1. 28
      src/Application/Modes/TextureMappingMode.cpp
  2. 2
      src/Application/Modes/TextureMappingMode.h

28
src/Application/Modes/TextureMappingMode.cpp

@ -113,19 +113,11 @@ void TextureMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & args){
break;
case '>':
if(app->getSurfaceManager()->getSelectedSurface() == 0){
return;
}
app->getCmdManager()->exec(
new SelNextTexCoordCmd(&Gui::instance()->getTextureEditorWidget()));
selectNextVertex(app);
break;
case '<':
if(app->getSurfaceManager()->getSelectedSurface() == 0){
return;
}
app->getCmdManager()->exec(
new SelPrevTexCoordCmd(&Gui::instance()->getTextureEditorWidget()));
selectPrevVertex(app);
break;
case ' ':
@ -322,6 +314,22 @@ void TextureMappingMode::moveSelection(Application * app, ofVec2f by){
}
}
void TextureMappingMode::selectNextVertex(Application * app){
if(app->getSurfaceManager()->getSelectedSurface() != 0){
app->getCmdManager()->exec(
new SelNextTexCoordCmd(
&Gui::instance()->getTextureEditorWidget()));
}
}
void TextureMappingMode::selectPrevVertex(Application * app){
if(app->getSurfaceManager()->getSelectedSurface() != 0){
app->getCmdManager()->exec(
new SelPrevTexCoordCmd(
&Gui::instance()->getTextureEditorWidget()));
}
}
ofPoint TextureMappingMode::getTranslation(){
return _canvasTranslate;
}

2
src/Application/Modes/TextureMappingMode.h

@ -39,6 +39,8 @@ class TextureMappingMode : public ApplicationBaseMode {
void drawTexture(Application * app);
void moveSelection(Application * app, ofVec2f by);
void selectNextVertex(Application * app);
void selectPrevVertex(Application * app);
void setTranslation(ofPoint p);
void setDrawMode(int m);

Loading…
Cancel
Save