|
|
@ -6,30 +6,11 @@ namespace piMapper { |
|
|
|
BaseJoint::BaseJoint(){ |
|
|
|
setDefaultColors(); |
|
|
|
setDefaultProperties(); |
|
|
|
registerMouseEvents(); |
|
|
|
} |
|
|
|
|
|
|
|
BaseJoint::~BaseJoint(){ |
|
|
|
unregisterMouseEvents(); |
|
|
|
} |
|
|
|
|
|
|
|
void BaseJoint::registerMouseEvents(){ |
|
|
|
//ofAddListener(ofEvents().mousePressed, this, &BaseJoint::mousePressed);
|
|
|
|
//ofAddListener(ofEvents().mouseDragged, this, &BaseJoint::mouseDragged);
|
|
|
|
} |
|
|
|
|
|
|
|
void BaseJoint::unregisterMouseEvents(){ |
|
|
|
//ofRemoveListener(ofEvents().mousePressed, this, &BaseJoint::mousePressed);
|
|
|
|
//ofRemoveListener(ofEvents().mouseDragged, this, &BaseJoint::mouseDragged);
|
|
|
|
} |
|
|
|
|
|
|
|
void BaseJoint::mousePressed(ofMouseEventArgs & args){ |
|
|
|
cout << "BaseJoint::mousePressed()" << endl; |
|
|
|
|
|
|
|
if(hitTest(ofVec2f(args.x, args.y))){ |
|
|
|
// selected = true;
|
|
|
|
clickDistance = position - ofVec2f(args.x, args.y); |
|
|
|
// startDrag();
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -38,8 +19,6 @@ void BaseJoint::mouseReleased(int x, int y, int button){ |
|
|
|
} |
|
|
|
|
|
|
|
void BaseJoint::mouseDragged(ofMouseEventArgs & args){ |
|
|
|
cout << "BaseJoint::mouseDragged()" << endl; |
|
|
|
|
|
|
|
if(!bDrag){ |
|
|
|
return; |
|
|
|
} |
|
|
|