ofxPiMapper fixed for C++17 & oF 12.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

44 lines
959 B

#ifndef H_OFX_BASE_JOINT
#define H_OFX_BASE_JOINT
#include "ofMain.h"
class ofxBaseJoint {
public:
ofxBaseJoint();
~ofxBaseJoint();
void registerMouseEvents();
void unregisterMouseEvents();
ofVec2f position;
bool enabled;
bool visible;
bool selected;
void mousePressed(ofMouseEventArgs& args);
void mouseReleased(int x, int y, int button);
void mouseDragged(ofMouseEventArgs& args);
void startDrag();
void stopDrag();
bool isDragged();
virtual void update(){};
virtual void draw(){};
virtual bool hitTest(ofVec2f position){};
protected:
ofColor fillColor;
ofColor strokeColor;
ofColor fillColorSelected;
ofColor strokeColorSelected;
float strokeWidth;
ofVec2f clickDistance; // How far from the center of the joint the user has clicked?
bool bDrag;
private:
void setDefaultColors();
void setDefaultProperties();
};
#endif