Board  0.9.4
ShapeVisitor.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
26 #ifndef _BOARD_SHAPE_VISITOR_H_
27 #define _BOARD_SHAPE_VISITOR_H_
28 
29 #if __cplusplus<201100
30 #define override
31 #endif
32 
33 
34 namespace LibBoard {
35 
36  struct Shape;
37  struct ShapeList;
38  struct Board;
39 
40  struct ShapeVisitor {
41  virtual void visit( Shape & shape ) = 0;
42  virtual void visit( Shape & shape ) const = 0;
43  };
44 
47  void visit( Shape & ) override;
48  void visit( Shape & ) const override;
49  const ShapeList & shapeList() const;
50  private:
51  ShapeList & _shapeList;
52  };
53 
54  struct BoundingBoxViewer : public ShapeVisitor {
55  void visit( Shape & ) override;
56  void visit( Shape & ) const override;
57  };
58 
59 
60 }
61 
62 
63 #if __cplusplus<201100
64 #undef override
65 #endif
66 
67 
68 #endif /* _BOARD_SHAPE_VISITOR_H_ */
Abstract structure for a 2D shape.
Definition: Shapes.h:62
Definition: Board.h:41
Definition: ShapeVisitor.h:54
Definition: ShapeVisitor.h:45
A group of shapes.
Definition: ShapeList.h:45
Definition: ShapeVisitor.h:40