20 #ifndef ofxOuiShapeEditor_hpp 21 #define ofxOuiShapeEditor_hpp 23 #include "../core/ofxOuiCommon.hpp" 63 enum class Type { Translation, Scaling, Rotation, Done };
76 float width_,
float height_,
float angle_);
122 template <
typename T,
typename args,
class ListenerClass>
123 void onEditShape(T *owner,
void (ListenerClass::*listenerMethod)(args)) {
124 using namespace std::placeholders;
139 ShapeEditor(
float x_ = 0,
float y_ = 0,
float width_ = 0,
float height_ = 0,
158 virtual bool inside(
float x_,
float y_);
223 std::function<void(ofxOui::ShapeEditor::EditEvent &)>
float y
y position(top)
Definition: ofxOuiShapeEditor.hpp:177
virtual void keyReleased(ofKeyEventArgs &e)
Definition: ofxOuiShapeEditor.cpp:209
MouseDraggingMode
Type of mouse interaction mode.
Definition: ofxOuiShapeEditor.hpp:53
ofPoint mouse_offset_
Definition: ofxOuiShapeEditor.hpp:221
Type
type of editing event
Definition: ofxOuiShapeEditor.hpp:63
float width
editor width
Definition: ofxOuiShapeEditor.hpp:182
std::function< void(ofxOui::ShapeEditor::EditEvent &)> shape_editor_event_callback_
Definition: ofxOuiShapeEditor.hpp:224
virtual ShapeEditor::Selector insideSelector(float x_, float y_)
checks if a point is inside a selector of the shape editor (corner or mid-edge)
Definition: ofxOuiShapeEditor.cpp:108
float width
width of the shape editor box
Definition: ofxOuiShapeEditor.hpp:101
virtual void draw()
OF-like draw function.
Definition: ofxOuiShapeEditor.cpp:60
Selector
Index of the selector of the shape.
Definition: ofxOuiShapeEditor.hpp:36
Type type
type of editing event
Definition: ofxOuiShapeEditor.hpp:86
ShapeEditor * sender
pointer to the sender component
Definition: ofxOuiShapeEditor.hpp:81
virtual void mouseDraggedSymmetric(ofMouseEventArgs &e)
Definition: ofxOuiShapeEditor.cpp:258
virtual void mousePressed(ofMouseEventArgs &e)
Definition: ofxOuiShapeEditor.cpp:155
float height
editor height
Definition: ofxOuiShapeEditor.hpp:187
float reference_angle_
Definition: ofxOuiShapeEditor.hpp:222
float angle
editor angle
Definition: ofxOuiShapeEditor.hpp:192
float frame_width
width of the editor frame
Definition: ofxOuiShapeEditor.hpp:197
ShapeEditor(float x_=0, float y_=0, float width_=0, float height_=0, float angle_=0)
Constructor.
Definition: ofxOuiShapeEditor.cpp:22
virtual ~ShapeEditor()
Destructor.
Definition: ofxOuiShapeEditor.cpp:46
virtual void mouseDragged(ofMouseEventArgs &e)
Definition: ofxOuiShapeEditor.cpp:169
float height
height of the shape editor box
Definition: ofxOuiShapeEditor.hpp:106
virtual void mouseDraggedNormal(ofMouseEventArgs &e)
Definition: ofxOuiShapeEditor.cpp:220
float x
x position of the shape editor box
Definition: ofxOuiShapeEditor.hpp:91
Definition: ofxOuiColormap.hpp:25
ofColor color
color of the editor frame
Definition: ofxOuiShapeEditor.hpp:202
virtual void keyPressed(ofKeyEventArgs &e)
Definition: ofxOuiShapeEditor.cpp:199
float angle
angle of the shape editor box
Definition: ofxOuiShapeEditor.hpp:111
float y
y position of the shape editor box
Definition: ofxOuiShapeEditor.hpp:96
Selector dragging_
Definition: ofxOuiShapeEditor.hpp:219
float x
x position (left)
Definition: ofxOuiShapeEditor.hpp:172
float selector_size
size of the corner and edge selectors
Definition: ofxOuiShapeEditor.hpp:207
MouseDraggingMode dragging_mode_
Definition: ofxOuiShapeEditor.hpp:220
virtual bool inside(float x_, float y_)
checks if a point is inside the shape editor
Definition: ofxOuiShapeEditor.cpp:101
virtual void mouseReleased(ofMouseEventArgs &e)
Definition: ofxOuiShapeEditor.cpp:189
virtual void mouseDraggedRotation(ofMouseEventArgs &e)
Definition: ofxOuiShapeEditor.cpp:274
Event arguments for shape editing events.
Definition: ofxOuiShapeEditor.hpp:58
void onEditShape(T *owner, void(ListenerClass::*listenerMethod)(args))
Set callback function for shape editing events.
Definition: ofxOuiShapeEditor.hpp:123
Shape editor.
Definition: ofxOuiShapeEditor.hpp:31