4 #include "compoundshape.h" 25 return cv::pointPolygonTest(vertices, pos,
false) >= 0;
37 template <
typename _TP>
40 virtual bool isAtPos(
const cv::Point &pos)
47 virtual void translate(
const cv::Point &offset);
49 virtual const char *
getType()
const;
51 static const char * type;
60 virtual void draw(cv::Mat &canvas);
61 virtual bool mousePressed(
const cv::Point &pos,
bool onCreate =
false);
65 virtual const string &getCreateStatusMsg()
const;
66 virtual const string &getEditStatusMsg()
const;
69 virtual void reloadPointers(
const std::list<Shape*> &lst, std::list<Shape*>::const_iterator &i);
70 std::list<Handle*> handles;
71 std::vector<cv::Point> vertices;
74 template <
typename _TP>
78 for (
Handle *handle : handles)
80 out.push_back((*handle)());
virtual bool mousePressed(const cv::Point &pos, bool onCreate=false)
mousePressed
The ShapeFactory class.
Definition: shapefactory.h:24
virtual bool isAtPos(const cv::Point &pos)
returns true if shape is at pos, false otherwise
Definition: polygon.h:40
virtual const char * getType() const
getType is always implemented by derived to return the same static pointer per shape.
void getPoints(vector< Point_< _TP >> &out)
getPoints
virtual bool keyPressed(int &key)
keyPressed will be called by Canvas for active shapes
virtual void draw(cv::Mat &canvas)
draw shape on the canvas
virtual bool mouseMoved(const cv::Point &pos)
mouseMoved
virtual void lostFocus()
lostFocus is called by Canvas if we're in it and just became non-active
The CompoundShape class.
Definition: compoundshape.h:20
The ShapeFactoryT class.
Definition: shapefactory.h:45
This namespace holds all the classes of the CanvasCV library.
Definition: canvas.h:20
virtual std::list< Handle * > getConnectionTargets()
getConnectionTargets
virtual bool mouseReleased(const cv::Point &pos)
mouseReleased
bool isPointInPoly(const cv::Point &pos) const
returns true if pos is in the polygon
Definition: polygon.h:21
The Polygon class.
Definition: polygon.h:16
The Handle class.
Definition: handle.h:19