|
@ -19,21 +19,21 @@ SurfaceManagerGui::~SurfaceManagerGui(){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void SurfaceManagerGui::registerMouseEvents(){ |
|
|
void SurfaceManagerGui::registerMouseEvents(){ |
|
|
ofAddListener(ofEvents().mousePressed, this, |
|
|
//ofAddListener(ofEvents().mousePressed, this,
|
|
|
&SurfaceManagerGui::mousePressed); |
|
|
// &SurfaceManagerGui::mousePressed);
|
|
|
ofAddListener(ofEvents().mouseReleased, this, |
|
|
//ofAddListener(ofEvents().mouseReleased, this,
|
|
|
&SurfaceManagerGui::mouseReleased); |
|
|
// &SurfaceManagerGui::mouseReleased);
|
|
|
ofAddListener(ofEvents().mouseDragged, this, |
|
|
//ofAddListener(ofEvents().mouseDragged, this,
|
|
|
&SurfaceManagerGui::mouseDragged); |
|
|
// &SurfaceManagerGui::mouseDragged);
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void SurfaceManagerGui::unregisterMouseEvents(){ |
|
|
void SurfaceManagerGui::unregisterMouseEvents(){ |
|
|
ofRemoveListener(ofEvents().mousePressed, this, |
|
|
//ofRemoveListener(ofEvents().mousePressed, this,
|
|
|
&SurfaceManagerGui::mousePressed); |
|
|
// &SurfaceManagerGui::mousePressed);
|
|
|
ofRemoveListener(ofEvents().mouseReleased, this, |
|
|
//ofRemoveListener(ofEvents().mouseReleased, this,
|
|
|
&SurfaceManagerGui::mouseReleased); |
|
|
// &SurfaceManagerGui::mouseReleased);
|
|
|
ofRemoveListener(ofEvents().mouseDragged, this, |
|
|
//ofRemoveListener(ofEvents().mouseDragged, this,
|
|
|
&SurfaceManagerGui::mouseDragged); |
|
|
// &SurfaceManagerGui::mouseDragged);
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void SurfaceManagerGui::draw(){ |
|
|
void SurfaceManagerGui::draw(){ |
|
@ -78,6 +78,8 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){ |
|
|
|
|
|
|
|
|
if(hitJoint != 0){ |
|
|
if(hitJoint != 0){ |
|
|
|
|
|
|
|
|
|
|
|
hitJoint->mousePressed(args); |
|
|
|
|
|
|
|
|
textureEditor.unselectAllJoints(); |
|
|
textureEditor.unselectAllJoints(); |
|
|
hitJoint->select(); |
|
|
hitJoint->select(); |
|
|
hitJoint->startDrag(); |
|
|
hitJoint->startDrag(); |
|
@ -155,13 +157,14 @@ void SurfaceManagerGui::mouseReleased(ofMouseEventArgs & args){ |
|
|
if(!surfaceManager->getSelectedSurface()->getMoved()){ |
|
|
if(!surfaceManager->getSelectedSurface()->getMoved()){ |
|
|
|
|
|
|
|
|
// TODO: emit event through the gui singleton
|
|
|
// TODO: emit event through the gui singleton
|
|
|
_cmdManager->undo(); |
|
|
//_cmdManager->undo();
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void SurfaceManagerGui::mouseDragged(ofMouseEventArgs & args){ |
|
|
void SurfaceManagerGui::mouseDragged(ofMouseEventArgs & args){ |
|
|
|
|
|
textureEditor.mouseDragged(args); |
|
|
|
|
|
|
|
|
if(bDrag){ |
|
|
if(bDrag){ |
|
|
ofVec2f mousePosition = ofVec2f(args.x, args.y); |
|
|
ofVec2f mousePosition = ofVec2f(args.x, args.y); |
|
|
ofVec2f distance = mousePosition - clickPosition; |
|
|
ofVec2f distance = mousePosition - clickPosition; |
|
|