6 #include "shapefactory.h" 23 const std::string &
getText()
const;
26 void setText(
const std::string &value);
29 void setTL(
const cv::Point &value);
55 virtual bool isAtPos(
const cv::Point &pos)
57 return rect.contains(pos);
61 virtual std::shared_ptr<Shape>
getShape(
int id);
63 virtual void translate(
const cv::Point &offset);
65 virtual const char *
getType()
const;
67 static const char * type;
75 virtual void writeInternals(cv::FileStorage &fs)
const;
76 virtual void readInternals(
const cv::FileNode &node);
79 virtual void draw(cv::Mat &canvas);
80 virtual bool mousePressed(
const cv::Point &pos,
bool onCreate =
false);
87 virtual const string &getCreateStatusMsg()
const;
88 virtual const string &getEditStatusMsg()
const;
99 std::shared_ptr<Handle> topLeft;
The ShapeFactory class.
Definition: shapefactory.h:24
void setText(const std::string &value)
set the displayed text
cv::Scalar getFontColor() const
get the font color
int getFontThickness() const
get the thickness of the font
virtual void draw(cv::Mat &canvas)
draw shape on the canvas
void setFontFace(int value)
set the font used
virtual const char * getType() const
getType is always implemented by derived to return the same static pointer per shape.
The Shape class hierarchy is for geomertric user interaction.
Definition: shape.h:32
void setFontColor(const cv::Scalar &value)
set the font color
virtual bool keyPressed(int &key)
keyPressed will be called by Canvas for active shapes
const std::string & getText() const
get the displayed text
virtual bool mouseReleased(const cv::Point &pos)
mouseReleased
virtual bool mousePressed(const cv::Point &pos, bool onCreate=false)
mousePressed
virtual bool mouseMoved(const cv::Point &pos)
mouseMoved
void setFontThickness(int value)
set the thickness of the font
void setTL(const cv::Point &value)
set position (top left corner)
int getFontFace() const
get the font used
virtual std::shared_ptr< Shape > getShape(int id)
getShape
double getFontScale() const
get the scale of the used font
The ShapeFactoryT class.
Definition: shapefactory.h:45
virtual bool isAtPos(const cv::Point &pos)
returns true if shape is at pos, false otherwise
Definition: textbox.h:55
void setFontScale(double value)
set the scale of the used font
This namespace holds all the classes of the CanvasCV library.
Definition: canvas.h:20
virtual std::list< Handle * > getConnectionTargets()
getConnectionTargets
The TextBox class.
Definition: textbox.h:19
virtual void lostFocus()
lostFocus is called by Canvas if we're in it and just became non-active