CanvasCV: CanvasCV-doxygen/src/canvascv/shapes/labeledshapesconnector.h Source File
CanvasCV  1.0.0
labeledshapesconnector.h
1 #ifndef LABELEDSHAPESCONNECTOR_H
2 #define LABELEDSHAPESCONNECTOR_H
3 
4 #include "shapesconnector.h"
5 #include "textbox.h"
6 
7 namespace canvascv
8 {
9 
17 {
18 public:
19 
20  virtual const char *getType() const;
21 
22  TextBox &getTextBox();
23 
24  static const char * type;
25 
26 private:
27  friend class ShapeFactory;
28  template <class T> friend class ShapeFactoryT;
29 
30  LabeledShapesConnector(const cv::Point &pos);
31 
32  TextBox *label;
33 
34  virtual void reloadPointers(const std::list<Shape*> &lst, std::list<Shape*>::const_iterator &i)
35  {
36  ShapesConnector::reloadPointers(lst, i);
37  label = dynamic_cast<TextBox*>(*i++);
38  center->connect(*label->getConnectionTargets().front());
39  }
40 };
41 
42 }
43 
44 #endif // LABELEDSHAPESCONNECTOR_H
The ShapeFactory class.
Definition: shapefactory.h:24
The LabeledShapesConnector class.
Definition: labeledshapesconnector.h:16
void connect(Handle &other)
connect to a handle to change when we change
virtual const char * getType() const
getType is always implemented by derived to return the same static pointer per shape.
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
The TextBox class.
Definition: textbox.h:19
The ShapesConnector class.
Definition: shapesconnector.h:14