Schim
compositeobject.h
1 #ifndef COMPOSITEOBJECT_H
2 #define COMPOSITEOBJECT_H
3 
4 #include "model/object.h"
5 #include "model/entity.h"
6 #include "model/variable.h"
7 
16 class CompositeObject : public Object, public Entity
17 {
18 public:
19  // CONSTRUCTORS
22  CompositeObject(const CompositeObject &obj);
23  virtual ~CompositeObject();
24  Object *clone() const override;
25 
26  // GETTERS
27  QPointF getPos() const override;
28  QList<Object *> &getConstituents();
29  const QList<Object *> &getConstituents() const;
30 
31  // SETTERS
32  void setPos(const QPointF &pos) override;
33  void add(Object *obj);
34  void add(const QList<Object*> &list);
42  virtual void remove(Object *obj);
43 
44  // OPERATORS
45  bool operator==(const CompositeObject &obj) const;
46  bool operator!=(const CompositeObject &obj) const;
47 
48 protected:
49  QList<Object *> constituents;
50  // TODO determine appropriate container
51  QPointF pos{};
52 };
53 
54 #endif // COMPOSITEOBJECT_H
The abstract base class for all objects in a sheet.
Definition: object.h:21
void setPos(const QPointF &pos) override
Set the position of the object in the sheet.
QPointF getPos() const override
Return the position of the object in the sheet.
Base class for entities.
Definition: entity.h:32
An object that consists of other child objects.
Definition: compositeobject.h:16