The Shape class hierarchy is for geomertric user interaction.
More...
#include <shape.h>
|
typedef std::function< void(Shape *, Event)> | CBPerShape |
| signature of a callback which gets the Event
|
|
|
| Shape () |
| constructor
|
|
| Shape (const Shape &other) |
| copy constructor
|
|
virtual | ~Shape () |
| virtual destructor
|
|
void | notifyOnEvent (CBPerShape cb) |
| used to register for notifications on shape More...
|
|
virtual std::list< Handle * > | getConnectionTargets ()=0 |
| getConnectionTargets More...
|
|
cv::Scalar | getOutlineColor () const |
| get the outline color
|
|
virtual void | setOutlineColor (const cv::Scalar &value) |
| set the outline color
|
|
cv::Scalar | getFillColor () const |
| get the fill color (fill color is not very useful for shapes right now)
|
|
virtual void | setFillColor (const cv::Scalar &value) |
| set the fill color (fill color is not very useful for shapes right now)
|
|
bool | getLocked () const |
| is the shape locked (can't be moved/edited)
|
|
virtual void | setLocked (bool value) |
| set the shape lock state (can/can't be moved/edited)
|
|
bool | getVisible () const |
| is the shape visible
|
|
virtual void | setVisible (bool value) |
| set the shape visible state
|
|
virtual const char * | getType () const =0 |
| getType is always implemented by derived to return the same static pointer per shape. More...
|
|
int | getThickness () const |
| get line thickness to use when drawing
|
|
virtual void | setThickness (int value) |
| set line thickness to use when drawing
|
|
int | getLineType () const |
| get the line type (LINE_4, LINE_8, LINE_AA)
|
|
virtual void | setLineType (int value) |
| set the line type (LINE_4, LINE_8, LINE_AA)
|
|
virtual bool | isAtPos (const cv::Point &pos)=0 |
| returns true if shape is at pos, false otherwise
|
|
int | getId () |
| return a unique id for this shape
|
|
Use shapes to get on screen selections and landmark settings from your user.
- See also
- ThemeRepository for using themes.
-
Canvas for creating shapes.
- Note
- All shapes are create either with the mouse or by the Canvas::createShape() methods. This method will return a shared_ptr<T> instance, which you don't have to keep since another one is kept by the Canvas in which the shape is placed. Never use delete on a Shape pointer.
- Examples:
- example_linecrossing.cpp, and example_shapes_widgets.cpp.
Enumerator |
---|
SELECT |
shape selected
|
UNSELECT |
shape unselected
|
REMOVED |
shape removed
|
virtual void canvascv::Shape::draw |
( |
cv::Mat & |
canvas | ) |
|
|
protectedpure virtual |
virtual std::list<Handle*> canvascv::Shape::getConnectionTargets |
( |
| ) |
|
|
pure virtual |
virtual std::shared_ptr<Shape> canvascv::Shape::getShape |
( |
int |
id | ) |
|
|
protectedvirtual |
virtual const char* canvascv::Shape::getType |
( |
| ) |
const |
|
pure virtual |
- Returns
- const char * pointer to string with shape type name
Implemented in canvascv::Line, canvascv::LineCrossing, canvascv::TextBox, canvascv::ShapesConnector, canvascv::Handle, canvascv::Polygon, canvascv::Rectangle, canvascv::LabeledShapesConnector, canvascv::Arrow, and canvascv::Ellipse.
- Examples:
- example_linecrossing.cpp, and example_shapes_widgets.cpp.
virtual bool canvascv::Shape::keyPressed |
( |
int & |
key | ) |
|
|
protectedvirtual |
virtual bool canvascv::Shape::mouseMoved |
( |
const cv::Point & |
pos | ) |
|
|
protectedpure virtual |
virtual bool canvascv::Shape::mousePressed |
( |
const cv::Point & |
pos, |
|
|
bool |
onCreate = false |
|
) |
| |
|
protectedpure virtual |
virtual bool canvascv::Shape::mouseReleased |
( |
const cv::Point & |
pos | ) |
|
|
protectedpure virtual |
void canvascv::Shape::notifyOnEvent |
( |
CBPerShape |
cb | ) |
|
- Parameters
-
cb | to invoke on shape event |
The documentation for this class was generated from the following file:
- CanvasCV-doxygen/src/canvascv/shapes/shape.h