OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ViewerAPI.h
Go to the documentation of this file.
1#pragma once
2
3#include "Geometry.h"
4#include "OldTreeIcon.h"
5
6#include "OTCore/Color.h"
7#include "OTCore/CoreTypes.h"
13#include "OTGui/TableRange.h"
14#include "ViewChangedStates.h"
15
16#include <list>
17#include <vector>
18#include <string>
19
20#include <qcolor.h>
21
22class Model;
23class QPen;
24class FrontendAPI;
25namespace ot { class Property; }
26namespace ot { class WidgetView; }
27
28namespace ViewerAPI {
29
30 __declspec(dllexport) void setFrontendAPI(FrontendAPI* _api);
31
32 __declspec(dllexport) ot::UID createModel(void);
33 __declspec(dllexport) void activateModel(ot::UID osgModelID);
34 __declspec(dllexport) void deactivateCurrentlyActiveModel(void);
35 __declspec(dllexport) void deleteModel(ot::UID osgModelID);
36
37 __declspec(dllexport) ot::UID getActiveDataModel(void);
38 __declspec(dllexport) ot::UID getActiveViewerModel(void);
39
40 __declspec(dllexport) ot::UID createViewer(ot::UID osgModelID, double scaleWidth, double scaleHeight, int backgroundR, int backgroundG, int backgroundB, int overlayTextR, int overlayTextG, int overlayTextB);
41 __declspec(dllexport) ot::WidgetView* getViewerWidget(ot::UID viewer);
42
43 __declspec(dllexport) void resetAllViews1D(ot::UID osgModelID);
44 __declspec(dllexport) void resetAllViews3D(ot::UID osgModelID);
45 __declspec(dllexport) void refreshAllViews(ot::UID osgModelID);
46 __declspec(dllexport) void clearSelection(ot::UID osgModelID);
47 __declspec(dllexport) void refreshSelection(ot::UID osgModelID);
48 __declspec(dllexport) void selectObject(ot::UID osgModelID, ot::UID entityID);
49
50 __declspec(dllexport) void setTreeStateRecording(ot::UID osgModelID, bool flag);
51
52 __declspec(dllexport) void setSelectedTreeItems(const std::list<ot::UID>& _selectedTreeItems, std::list<unsigned long long>& _selectedModelItems, std::list<unsigned long long>& _selectedVisibleModelItems, bool _selectionFromTree);
53 __declspec(dllexport) void executeAction(unsigned long long buttonID);
54
55 __declspec(dllexport) void setHoverTreeItem(ot::UID hoverItemID);
56
57 __declspec(dllexport) void addNodeFromFacetData(ot::UID osgModelID, const std::string &treeName, double surfaceColorRGB[3], double edgeColorRGB[3], unsigned long long modelEntityID, const OldTreeIcon &treeIcons, bool backFaceCulling,
58 double offsetFactor, bool isEditable, std::vector<Geometry::Node> &nodes, std::list<Geometry::Triangle> &triangles, std::list<Geometry::Edge> &edges, std::map<ot::UID, std::string>& faceNameMap, std::string &errors,
59 bool selectChildren, bool manageParentVisibility, bool manageChildVisibility, bool showWhenSelected);
60 __declspec(dllexport) void addNodeFromFacetDataBase(ot::UID osgModelID, const std::string &treeName, double surfaceColorRGB[3], double edgeColorRGB[3], const std::string &materialType, const std::string &textureType, bool reflective, unsigned long long modelEntityID, const OldTreeIcon &treeIcons, bool backFaceCulling,
61 double offsetFactor, bool isHidden, bool isEditable, const std::string &projectName, unsigned long long entityID, unsigned long long entityVersion,
62 bool selectChildren, bool manageParentVisibility, bool manageChildVisibility, bool showWhenSelected, std::vector<double> &transformation);
63
64 __declspec(dllexport) void addVisualizationContainerNode(ot::UID osgModelID, const std::string &treeName, unsigned long long modelEntityID, const OldTreeIcon &treeIcons, bool editable);
65
66 __declspec(dllexport) void addVisualizationNode(ot::UID osgModelID, const std::string &treeName, unsigned long long modelEntityID, const OldTreeIcon &treeIcons, bool editable, ot::VisualisationTypes _visualisationTypes);
67 __declspec(dllexport) void addVTKNode(ot::UID osgModelID, const std::string &treeName, unsigned long long modelEntityID, const OldTreeIcon &treeIcons, bool isHidden, bool editable, const std::string &projectName, unsigned long long visualizationDataID, unsigned long long visualizationDataVersion);
68 __declspec(dllexport) void updateVTKNode(ot::UID osgModelID, unsigned long long modelEntityID, const std::string &projectName, unsigned long long visualizationDataID, unsigned long long visualizationDataVersion);
69
70 __declspec(dllexport) void addVisualizationAnnotationNode(ot::UID osgModelID, const std::string &name, unsigned long long modelEntityID,
71 const OldTreeIcon &treeIcons, bool isHidden,
72 const double edgeColorRGB[3],
73 const std::vector<std::array<double, 3>> &points,
74 const std::vector<std::array<double, 3>> &points_rgb,
75 const std::vector<std::array<double, 3>> &triangle_p1,
76 const std::vector<std::array<double, 3>> &triangle_p2,
77 const std::vector<std::array<double, 3>> &triangle_p3,
78 const std::vector<std::array<double, 3>> &triangle_rgb);
79 __declspec(dllexport) void addVisualizationAnnotationNodeDataBase(ot::UID osgModelID, const std::string &name, unsigned long long modelEntityID, const OldTreeIcon &treeIcons, bool isHidden, const std::string &projectName, unsigned long long entityID, unsigned long long entityVersion);
80 __declspec(dllexport) void addVisualizationMeshNodeFromFacetDataBase(ot::UID osgModelID, const std::string &name, unsigned long long modelEntityID, const OldTreeIcon &treeIcons, double edgeColorRGB[3], bool displayTetEdges, const std::string &projectName, unsigned long long entityID, unsigned long long entityVersion);
81 __declspec(dllexport) void addVisualizationMeshItemNodeFromFacetDataBase(ot::UID osgModelID, const std::string &name, unsigned long long modelEntityID, const OldTreeIcon &treeIcons, bool isHidden, const std::string &projectName, unsigned long long entityID, unsigned long long entityVersion, long long tetEdgesID, long long tetEdgesVersion);
82 __declspec(dllexport) void addVisualizationCartesianMeshNode(ot::UID osgModelID, const std::string &name, unsigned long long modelEntityID, const OldTreeIcon &treeIcons, bool isHidden, double edgeColorRGB[3], double meshLineColorRGB[3], bool showMeshLines, const std::vector<double> &meshCoordsX, const std::vector<double> &meshCoordsY, const std::vector<double> &meshCoordsZ,
83 const std::string &projectName, unsigned long long faceListEntityID, unsigned long long faceListEntityVersion, unsigned long long nodeListEntityID, unsigned long long nodeListEntityVersion);
84 __declspec(dllexport) void visualizationCartesianMeshNodeShowLines(ot::UID osgModelID, unsigned long long modelEntityID, bool showMeshLines);
85 __declspec(dllexport) void addVisualizationCartesianMeshItemNode(ot::UID osgModelID, const std::string &name, unsigned long long modelEntityID, const OldTreeIcon &treeIcons, bool isHidden, std::vector<int> &facesList, double color[3]);
86 __declspec(dllexport) void visualizationTetMeshNodeTetEdges(ot::UID osgModelID, unsigned long long modelEntityID, bool displayTetEdges);
87
88 __declspec(dllexport) void notifySceneNodeAboutViewChange(ot::UID osgModelID, const std::string& _sceneNodeName, const ot::ViewChangedStates& _state, const ot::WidgetViewBase::ViewType& _viewType);
89
90 __declspec(dllexport) std::list<std::string> getSelectedCurves(ot::UID osgModelID);
91 __declspec(dllexport) void removeSelectedCurveNodes(ot::UID osgModelID);
92
93 __declspec(dllexport) void addVisualizationPlot1DNode(ot::UID _osgModelID, const ot::Plot1DDataBaseCfg& _config);
94
95 __declspec(dllexport) void visualizationResult1DPropertiesChanged(ot::UID _osgModelID, ot::UID _entityID, ot::UID _version);
96 __declspec(dllexport) void visualizationPlot1DPropertiesChanged(ot::UID osgModelID, const ot::Plot1DCfg& _config);
97
98 __declspec(dllexport) void setEntityName(ot::UID modelEntityID, const std::string &newName);
99 __declspec(dllexport) void renameEntityPath(const std::string &oldPath, const std::string &newPath);
100
101 __declspec(dllexport) void updateObjectColor(ot::UID osgModelID, unsigned long long modelEntityID, double surfaceColorRGB[3], double edgeColorRGB[3], const std::string& materialType, const std::string& textureType, bool reflective);
102 __declspec(dllexport) void updateMeshColor(ot::UID osgModelID, unsigned long long modelEntityID, double colorRGB[3]);
103 __declspec(dllexport) void updateObjectFacetsFromDataBase(ot::UID osgModelID, unsigned long long modelEntityID, unsigned long long entityID, unsigned long long entityVersion);
104
105 __declspec(dllexport) void setClearColor(ot::UID viewrID, int backgroundR, int backgroundG, int backgroundB, int overlayTextR, int overlayTextG, int overlayTextB);
106
107 __declspec(dllexport) void setDataModel(ot::UID osgModelID, ot::UID dataModelID);
108
109 __declspec(dllexport) void getSelectedModelEntityIDs(std::list<unsigned long long> &selected);
110 __declspec(dllexport) void getSelectedVisibleModelEntityIDs(std::list<unsigned long long> &selected);
111 __declspec(dllexport) ot::UID getModelEntityIDFromTreeID(ot::UID treeID);
112 __declspec(dllexport) ot::UID getTreeIDFromModelEntityID(ot::UID treeID);
113
114 __declspec(dllexport) void removeShapes(ot::UID osgModelID, std::list<unsigned long long> modelEntityID);
115 __declspec(dllexport) void setShapeVisibility(ot::UID osgModelID, std::list<unsigned long long> visibleID, std::list<unsigned long long> hiddenID);
116 __declspec(dllexport) void hideEntities(ot::UID osgModelID, std::list<unsigned long long> hiddenID);
117
118 __declspec(dllexport) void showBranch(ot::UID osgModelID, const std::string &branchName);
119 __declspec(dllexport) void hideBranch(ot::UID osgModelID, const std::string &branchName);
120
121 __declspec(dllexport) void enterEntitySelectionMode(ot::UID osgModelID, ot::serviceID_t replyTo, const std::string &selectionType, bool allowMultipleSelection, const std::string &selectionFilter, const std::string &selectionAction, const std::string &selectionMessage, std::list<std::string> &optionNames, std::list<std::string> &optionValues);
122
123 __declspec(dllexport) void setFontPath(const std::string& _fontPath);
124
125 __declspec(dllexport) void setDataBaseConnection(const std::string &databaseURL, const std::string &userName, const std::string &password);
126
127 __declspec(dllexport) void prefetchDocumentsFromStorage(const std::string &projectName, std::list<std::pair<unsigned long long, unsigned long long>> &prefetchIDs);
128
129 __declspec(dllexport) void setTabNames(ot::UID _viewerID, const std::string & _osgViewTabName, const std::string & _plotTabName, const std::string & _versionGraphTabName);
130
131 __declspec(dllexport) ot::WidgetView* getPlotWidget(ot::UID _viewerID);
132
133 /********************************************************************************************/
134
135 __declspec(dllexport) void viewerTabChanged(const std::string& _tabTitle, ot::WidgetViewBase::ViewType _type);
136
137 __declspec(dllexport) void viewDataModifiedChanged(const std::string& _entityName, ot::WidgetViewBase::ViewType _type, bool _isModified);
138
139 __declspec(dllexport) void shortcutActivated(const std::string & _keySequence);
140
141 __declspec(dllexport) void createRubberband(ot::UID _viewerID, ot::serviceID_t _senderId, std::string & _note, const std::string & _configurationJson);
142
143 __declspec(dllexport) void settingsItemChanged(ot::UID _viewerID, const ot::Property* _property);
144
145 __declspec(dllexport) bool propertyGridValueChanged(ot::UID _viewerID, const ot::Property* _property);
146
147 __declspec(dllexport) void freeze3DView(unsigned long long osgModelID, bool flag);
148
149 Model *getModelFromID(ot::UID osgModelID);
150}
@ nodes
Definition MonitorSettings.h:17
@ edges
Definition MonitorSettings.h:17
The Model class is the main interface to the model. There may be multiple instances of this class....
Definition Model.h:94
Definition Plot1DCfg.h:19
Definition Plot1DDataBaseCfg.h:14
The Property class is used as a base class for all Properties that can be displayed and modified in t...
Definition Property.h:21
Definition VisualisationTypes.h:13
ViewType
Definition WidgetViewBase.h:49
The WidgetView class is used to integrate the Qt-ADS functionallity into open twin.
Definition WidgetView.h:33
Definition ViewerAPI.h:28
__declspec(dllexport) void setFrontendAPI(FrontendAPI *_api)
Model * getModelFromID(ot::UID osgModelID)
Definition ViewerAPI.cpp:552
__declspec(dllexport) void setHoverTreeItem(ot __declspec(dllexport) void addNodeFromFacetData(ot __declspec(dllexport) void addNodeFromFacetDataBase(ot __declspec(dllexport) void addVisualizationContainerNode(ot __declspec(dllexport) void addVisualizationNode(ot __declspec(dllexport) void addVTKNode(ot __declspec(dllexport) void updateVTKNode(ot __declspec(dllexport) void addVisualizationAnnotationNode(ot __declspec(dllexport) void addVisualizationAnnotationNodeDataBase(ot __declspec(dllexport) void addVisualizationMeshNodeFromFacetDataBase(ot __declspec(dllexport) void addVisualizationMeshItemNodeFromFacetDataBase(ot __declspec(dllexport) void addVisualizationCartesianMeshNode(ot __declspec(dllexport) void visualizationCartesianMeshNodeShowLines(ot __declspec(dllexport) void addVisualizationCartesianMeshItemNode(ot __declspec(dllexport) void visualizationTetMeshNodeTetEdges(ot __declspec(dllexport) void notifySceneNodeAboutViewChange(ot __declspec(dllexport) std __declspec(dllexport) void removeSelectedCurveNodes(ot __declspec(dllexport) void addVisualizationPlot1DNode(ot __declspec(dllexport) void visualizationResult1DPropertiesChanged(ot __declspec(dllexport) void visualizationPlot1DPropertiesChanged(ot __declspec(dllexport) void setEntityName(ot __declspec(dllexport) void renameEntityPath(const std __declspec(dllexport) void updateObjectColor(ot __declspec(dllexport) void updateMeshColor(ot __declspec(dllexport) void updateObjectFacetsFromDataBase(ot __declspec(dllexport) void setClearColor(ot __declspec(dllexport) void setDataModel(ot __declspec(dllexport) void getSelectedModelEntityIDs(std __declspec(dllexport) void getSelectedVisibleModelEntityIDs(std __declspec(dllexport) ot __declspec(dllexport) ot __declspec(dllexport) void removeShapes(ot __declspec(dllexport) void setShapeVisibility(ot __declspec(dllexport) void hideEntities(ot __declspec(dllexport) void showBranch(ot __declspec(dllexport) void hideBranch(ot __declspec(dllexport) void enterEntitySelectionMode(ot __declspec(dllexport) void setFontPath(const std __declspec(dllexport) void setDataBaseConnection(const std __declspec(dllexport) void prefetchDocumentsFromStorage(const std __declspec(dllexport) void setTabNames(ot __declspec(dllexport) ot __declspec(dllexport) void viewerTabChanged(const std __declspec(dllexport) void viewDataModifiedChanged(const std __declspec(dllexport) void shortcutActivated(const std __declspec(dllexport) void createRubberband(ot __declspec(dllexport) void settingsItemChanged(ot __declspec(dllexport) bool propertyGridValueChanged(ot bool flag
Definition ViewerAPI.h:147
Definition Connector.h:8
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27
unsigned short serviceID_t
ID type used to identify a service (16 bit unsigned integer).
Definition CoreTypes.h:14
ViewChangedStates
Definition ViewChangedStates.h:6