123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #ifndef CMIND_H
- #define CMIND_H
- #include "CNode.h"
- #include <QObject>
- class CMind : public QObject
- {
- Q_OBJECT
- public:
- explicit CMind(QObject *parent = nullptr);
-
- QList<CNodeData> nodeList() const;
- void setNodeList(QList<CNodeData> list);
- bool isNodeValid(CNodeData n) const;
- CNodeData node(int number) const;
- bool containsNode(int number) const;
- bool canAddNode(CNodeData n);
- void addNode(CNodeData n);
- void removeNode(int number);
- void updateNode(CNodeData n);
- CNodeData root() const;
- bool hasAncestor(int childNumber, int ancestorNumber) const;
-
- int maxNumber() const;
-
- int minNumber() const;
- void clear();
-
- int levelOfNode(CNodeData n) const;
-
- int levels() const;
-
- QList<CNodeData> nodesInLevel(int i) const;
-
- QList<CNodeData> nodesInFinalLevel() const;
-
- QList<CNodeData> subNodes(CNodeData n) const;
-
- int leavesOfNode(CNodeData n) const;
-
- int leaves() const;
- signals:
- void sigRemoveNode(int id);
- private:
- QList<int> numberList() const;
- private:
- QList<CNodeData> m_nodeList;
- };
- #endif
|