OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
FrontendAPI.h
Go to the documentation of this file.
1#pragma once
2
3// Viewer header
4#include "OldTreeIcon.h"
5
6// OpenTwin header
7#include "OTCore/CoreTypes.h"
10
11// std header
12#include <list>
13#include <string>
14#include <vector>
15
16namespace ot { class WidgetView; };
17namespace ot { class TextEditor; };
18
19class __declspec(dllexport) FrontendAPI {
20public:
21 static void setInstance(FrontendAPI* _api);
22 static FrontendAPI* instance(void);
23
24 FrontendAPI() {};
25 virtual ~FrontendAPI() {};
26
27 virtual void createTree(void) {};
28 virtual void clearTree(void) {};
29 virtual ot::UID addTreeItem(const std::string& treePath, bool editable, bool selectChildren) { return 0; };
30 virtual void removeTreeItems(std::list<ot::UID> treeItemIDList) {};
31 virtual void selectTreeItem(ot::UID treeItemID) {};
32 virtual void selectSingleTreeItem(ot::UID treeItemID) {};
33 virtual void expandSingleTreeItem(ot::UID treeItemID) {};
34 virtual bool isTreeItemExpanded(ot::UID treeItemID) { return false; };
35 virtual void toggleTreeItemSelection(ot::UID treeItemID, bool considerChilds) {};
36 virtual void clearTreeSelection(void) {};
37 virtual void setTreeItemIcon(ot::UID treeItemID, int iconSize, const std::string& iconName) {};
38 virtual void setTreeItemText(ot::UID treeItemID, const std::string& text) {};
39 virtual void refreshSelection(void) {};
40 virtual void addKeyShortcut(const std::string& keySequence) {};
41 virtual void fillPropertyGrid(const ot::PropertyGridCfg& _configuration) {};
42 virtual void setDoublePropertyValue(const std::string& _groupName, const std::string& _itemName, double value) {};
43 virtual double getDoublePropertyValue(const std::string& _groupName, const std::string& _itemName) { return 0.0; };
44 virtual void lockSelectionAndModification(bool flag) {};
45 virtual void removeViewer(ot::UID viewerID) {};
46
47 virtual void closeView(const std::string& _entityName, ot::WidgetViewBase::ViewType _viewType) {};
48
49 virtual unsigned long long addMenuPage(const std::string& pageName) { return 0; };
50 virtual unsigned long long addMenuGroup(unsigned long long menuPageID, const std::string& groupName) { return 0; };
51 virtual unsigned long long addMenuSubGroup(unsigned long long _menuGroupID, const std::string& _subGroupName) { return 0; };
52 virtual unsigned long long addMenuPushButton(unsigned long long menuGroupID, const std::string& buttonName, const std::string& iconName) { return 0; };
53 virtual unsigned long long addMenuPushButton(unsigned long long menuGroupID, const std::string& buttonName, const std::string& iconName, const std::string& keySequence) { return 0; };
54 virtual void setMenuPushButtonToolTip(unsigned long long _buttonID, const std::string& _toolTip) {};
55
56 virtual void setCurrentMenuPage(const std::string& _pageName) {};
57 virtual std::string getCurrentMenuPage(void) { return std::string(); };
58
59 virtual void removeUIElements(std::list<unsigned long long>& itemIDList) {};
60 virtual void removeGraphicsElements(ot::UID _modelID) {};
61
62 virtual void displayText(const std::string& text) {};
63
64 virtual ot::WidgetView* getCurrentView(void) { return nullptr; };
65
66 virtual bool getCurrentViewIsModified(void) { return false; };
67
68 virtual void setCurrentVisualizationTabFromEntityName(const std::string& _entityName, ot::WidgetViewBase::ViewType _viewType) {};
69 virtual void setCurrentVisualizationTabFromTitle(const std::string& _tabTitle) {};
70 virtual std::string getCurrentVisualizationTabTitle(void) { return ""; };
71
72 virtual void requestSaveForCurrentVisualizationTab(void) {};
73
74 virtual void enableDisableControls(const ot::UIDList& _enabledControls, const ot::UIDList& _disabledControls) {};
75
76 virtual void entitiesSelected(ot::serviceID_t replyTo, const std::string& selectionAction, const std::string& selectionInfo, std::list<std::string>& optionNames, std::list<std::string>& optionValues) {};
77
78 virtual void fatalError(const std::string& message) {};
79
80 virtual void rubberbandFinished(ot::serviceID_t creatorId, const std::string& note, const std::string& pointJson, const std::vector<double>& transform) {}
81
82 virtual void updateSettings(const ot::PropertyGridCfg& _config) {};
83
84 virtual void loadSettings(ot::PropertyGridCfg& _config) {};
85
86 virtual void saveSettings(const ot::PropertyGridCfg& _config) {};
87
88 virtual void updateVTKEntity(unsigned long long modelEntityID) {};
89
90 virtual void messageModelService(const std::string& _message) {};
91
92 virtual std::string getOpenFileName(const std::string& _title, const std::string& _path, const std::string& _filters) { return std::string(); };
93 virtual std::string getSaveFileName(const std::string& _title, const std::string& _path, const std::string& _filters) { return std::string(); };
94
95private:
96 static FrontendAPI*& getInstance(void);
97};
bsoncxx::types::value value
Definition DocumentManager.h:16
Definition PropertyGridCfg.h:21
ViewType
Definition WidgetViewBase.h:49
The WidgetView class is used to integrate the Qt-ADS functionallity into open twin.
Definition WidgetView.h:33
Definition Connector.h:8
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27
std::list< UID > UIDList
Unique identifier list.
Definition CoreTypes.h:31
unsigned short serviceID_t
ID type used to identify a service (16 bit unsigned integer).
Definition CoreTypes.h:14