OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
VersionGraphManager.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10
11// Qt header
12#include <QtCore/qobject.h>
13
14namespace ot {
15
16 class LineEdit;
17 class ComboBox;
18
20 Q_OBJECT
21 public:
29 static std::string viewModeToString(ViewMode _mode);
30 static ViewMode stringToViewMode(const std::string& _mode);
31
33 virtual ~VersionGraphManager();
34
35 virtual QWidget* getQWidget(void) override { return m_root; };
36 virtual const QWidget* getQWidget(void) const override { return m_root; };
37
38 VersionGraph* getGraph(void) { return m_graph; };
39 const VersionGraph* getGraph(void) const { return m_graph; };
40
41 void setupConfig(VersionGraphCfg&& _config);
42
43 void setCurrentViewMode(ViewMode _mode);
44 ViewMode getCurrentViewMode(void) const;
45
46 VersionGraphVersionCfg& insertVersion(VersionGraphVersionCfg&& _config);
47
48 VersionGraphVersionCfg* insertVersion(const ConstJsonObject& _versionConfig);
49
50 void activateVersion(const std::string& _versionName, const std::string& _activeBranchVersionName);
51
52 void removeVersion(const std::string& _versionName);
53
54 void removeVersions(const std::list<std::string>& _versionNames);
55
56 bool versionIsBranchNode(const std::string& _versionName);
57
58 public Q_SLOTS:
59 void updateCurrentGraph(void);
60
61 private:
62 class VersionInfo;
63
67 bool isVersionGreater(const std::string& _left, const std::string& _right) const;
68
69 bool findParentVersionInOtherBranches(const VersionGraphVersionCfg& _version, const std::list<std::list<VersionGraphVersionCfg>>& _branches, VersionInfo& _parentInfo);
70
72 bool checkFilterValid(const VersionGraphVersionCfg* _versionConfig, const QString& _filterText) const;
73
77 bool filterVersion(ViewMode _viewMode, const std::string& _activeVersionName, const std::string& _filterText, const VersionInfo& _parentInfo, const VersionInfo& _versionInfo, const VersionInfo& _childsInfo);
78
82 bool filterModeAll(const std::string& _activeVersionName, const std::string& _filterText, const VersionInfo& _parentInfo, const VersionInfo& _versionInfo, const VersionInfo& _childsInfo);
83
84 bool filterModeCompact(const std::string& _activeVersionName, const std::string& _filterText, const VersionInfo& _parentInfo, const VersionInfo& _versionInfo, const VersionInfo& _childsInfo);
85 bool filterModeCompactLabeled(const std::string& _activeVersionName, const std::string& _filterText, const VersionInfo& _parentInfo, const VersionInfo& _versionInfo, const VersionInfo& _childsInfo);
86 bool filterModeLabeledOnly(const std::string& _activeVersionName, const std::string& _filterText, const VersionInfo& _parentInfo, const VersionInfo& _versionInfo, const VersionInfo& _childsInfo);
87 bool filterModeIterator(const std::string& _activeVersionName, const std::string& _filterText, const VersionInfo& _parentInfo, const VersionInfo& _versionInfo, const VersionInfo& _childsInfo);
88
89 bool checkTextFilter(const VersionInfo& _versionInfo, const std::string& _filter) const;
90
91 /*void startProcessCompact(bool _includeLabeledVersions, const QString& _filterText);
92 void processCompactItem(VersionGraphVersionCfg* _parent, const VersionGraphVersionCfg* _config, const std::string& _activeVersion, bool _isDirectParent, bool _includeLabeledVersions, const QString& _filterText);
93 void processLabeledOnlyItem(VersionGraphVersionCfg* _parent, const VersionGraphVersionCfg* _config, const std::string& _activeVersion, bool _isDirectParent, const QString& _filterText);
94 */
95 QWidget* m_root;
96 VersionGraph* m_graph;
97 LineEdit* m_textFilter;
98 ComboBox* m_modeSelector;
99
100 VersionGraphCfg m_config;
101 };
102
103}
#define OT_WIDGETS_API_EXPORT
Definition OTWidgetsAPIExport.h:12
Definition ComboBox.h:17
Definition LineEdit.h:17
Definition QWidgetInterface.h:18
Definition VersionGraphCfg.h:16
Definition VersionGraph.h:16
Definition VersionGraphManager.h:19
const VersionGraph * getGraph(void) const
Definition VersionGraphManager.h:39
virtual const QWidget * getQWidget(void) const override
Definition VersionGraphManager.h:36
ViewMode
Definition VersionGraphManager.h:22
@ Compact
Definition VersionGraphManager.h:24
@ CompactLabeled
Definition VersionGraphManager.h:25
@ ViewAll
Definition VersionGraphManager.h:23
@ LabeledOnly
Definition VersionGraphManager.h:26
virtual QWidget * getQWidget(void) override
Returns a pointer to the root widget of this object.
Definition VersionGraphManager.h:35
VersionGraph * getGraph(void)
Definition VersionGraphManager.h:38
Definition VersionGraphVersionCfg.h:24
Definition Connector.h:8
rapidjson::GenericObject< true, rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > > > ConstJsonObject
Read only JSON Object.
Definition JSON.h:35