Schim
terminal.h
1 #ifndef TERMINAL_H
2 #define TERMINAL_H
3 
4 #include "model/object.h"
5 #include "model/entity.h"
6 
7 #include <QList>
8 
14 class Component;
15 
16 class Terminal : public Object
17 {
18 public:
19  class Prong;
20  class WideProng;
21 
22  Terminal();
23 
24  // GETTERS
25  QList<Prong> getProngs() const;
26  QPointF getSheetPos() const;
27  Component *getParent() const;
28 
29  // SETTERS
30  void setParent(Component *component);
31  void addProng(float prong);
32 
33  // OBJECT INTERFACE
34  Object *clone() const override;
35  QPointF getPos() const override;
36  void setPos(const QPointF &pos) override;
37 
38 private:
39  // ATTRIBUTES
40  QList<float> prongs;
41  QPointF pos;
42  Component *component{};
43 };
44 
46 {
47 public:
48  enum Type {
49  Simple, Wide
50  };
51 
52  Prong(float angle, Terminal *terminal);
53 
54  float getAngle() const;
55  void setAngle(float angle);
56  Terminal *getTerminal() const;
57 
58 protected:
59  float angle = 0;
60  Terminal *terminal{};
61 };
62 
64 {
65 public:
66 private:
67  float angle2 = 0;
68 };
69 
70 
71 #endif // TERMINAL_H
The abstract base class for all objects in a sheet.
Definition: object.h:21
QPointF getPos() const override
Return the position of the object in the sheet.
Definition: terminal.h:16
Model of an electrical component.
Definition: component.h:16
void setPos(const QPointF &pos) override
Set the position of the object in the sheet.
Definition: terminal.h:45
Definition: terminal.h:63