ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvMainAppInterface.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // Qt
11 #include <QString>
12 
13 // CV_DB_LIB
14 #include <ecvHObject.h>
15 #include <ecvHObjectCaster.h>
16 
17 class QMainWindow;
18 class QWidget;
20 class ccOverlayDialog;
21 class ccPickingHub;
22 
25 public:
26  virtual ~ecvMainAppInterface() = default;
27 
29  virtual QMainWindow* getMainWindow() = 0;
30 
32 
45  Qt::Corner pos) = 0;
46 
48 
51  virtual void unregisterOverlayDialog(ccOverlayDialog* dlg) = 0;
52 
54  virtual void updateOverlayDialogsPlacement() = 0;
55 
56  // virtual void updateScreen() = 0;
57 
60 
62  virtual ccHObject* loadFile(QString filename, bool silent) = 0;
63 
64  virtual void addToDB(ccHObject* obj,
65  bool updateZoom = false,
66  bool autoExpandDBTree = true,
67  bool checkDimensions = false,
68  bool autoRedraw = true) = 0;
69 
71 
75  virtual void removeFromDB(ccHObject* obj, bool autoDelete = true) = 0;
76 
78 
81  ccHObject* parent = nullptr;
82  int childFlags = 0;
83  int parentFlags = 0;
84  };
85 
87 
91  ccHObject* obj) = 0;
92 
94 
98  const ccHObjectContext& context) = 0;
99 
101 
104  virtual void setSelectedInDB(ccHObject* obj, bool selected) = 0;
105 
107  virtual const ccHObject::Container& getSelectedEntities() const = 0;
108 
110  bool haveSelection() const { return !getSelectedEntities().empty(); }
111 
113  bool haveOneSelection() const { return getSelectedEntities().size() == 1; }
114 
120  };
121 
124  // \param level message level (standard, warning, error)
125  //**/
126  virtual void dispToConsole(
127  QString message,
129 
131  virtual void forceConsoleDisplay() = 0;
132 
134  virtual ccHObject* dbRootObject() = 0;
135 
139  //**/
140  // virtual void redrawAll(bool only2D = false) = 0;
141 
143 
147  virtual void refreshAll(bool only2D = false, bool forceRedraw = true) = 0;
148  virtual void redrawAll(bool only2D = false, bool forceRedraw = true) {
149  refreshAll(only2D, forceRedraw);
150  };
151 
153  virtual void enableAll() = 0;
154 
156  virtual void disableAll() = 0;
157 
158  virtual void refreshSelected(bool only2D = false,
159  bool forceRedraw = true) = 0;
160  virtual void refreshObject(ccHObject* obj,
161  bool only2D = false,
162  bool forceRedraw = true) = 0;
164  bool only2D = false,
165  bool forceRedraw = true) = 0;
166  virtual void resetSelectedBBox() = 0;
168  // virtual void enableAll() = 0;
169 
171  // virtual void disableAll() = 0;
172 
174  // virtual void disableAllBut(MainWindow* win) = 0;
175 
178 
181  virtual void updateUI() = 0;
182 
184 
186  virtual void freezeUI(bool state) = 0;
187 
190 
191  // virtual int getDevicePixelRatio() const = 0;
192 
194  virtual void spawnHistogramDialog(const std::vector<unsigned>& histoValues,
195  double minVal,
196  double maxVal,
197  QString title,
198  QString xAxisLabel) = 0;
199 
201  virtual ccPickingHub* pickingHub() { return nullptr; }
202 
204  virtual void setView(CC_VIEW_ORIENTATION view) = 0;
207  // virtual void toggleActiveWindowSunLight() = 0
208  // virtual void toggleActiveWindowCustomLight() = 0;
209  virtual void zoomOnSelectedEntities() = 0;
210  virtual void zoomOnEntities(ccHObject* obj) = 0;
211  virtual void setGlobalZoom() = 0;
212 
213  virtual void increasePointSize() = 0;
214  virtual void decreasePointSize() = 0;
215 
216  virtual void addWidgetToQMdiArea(QWidget* viewWidget) = 0;
217  virtual QWidget* getActiveWindow() = 0;
218 
219  virtual void toggleExclusiveFullScreen(bool state) = 0;
220  virtual void toggle3DView(bool state) = 0;
221 };
CC_VIEW_ORIENTATION
View orientation.
Definition: CVConst.h:102
std::string filename
Color scales manager/container.
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
Generic overlay dialog interface.
Point/triangle picking hub.
Definition: ecvPickingHub.h:29
QSharedPointer< ccUniqueIDGenerator > Shared
Shared type.
Definition: ecvObject.h:28
Main application interface (for plugins)
virtual void updateUI()=0
virtual ccHObject * dbRootObject()=0
Returns DB root (as a ccHObject)
virtual void toggleActiveWindowCenteredPerspective()=0
virtual void setGlobalZoom()=0
virtual void disableAll()=0
Disables all windows.
virtual QMainWindow * getMainWindow()=0
Returns main window.
virtual QWidget * getActiveWindow()=0
virtual void freezeUI(bool state)=0
Freezes/unfreezes UI.
bool haveSelection() const
Checks if we have any selections.
virtual void refreshSelected(bool only2D=false, bool forceRedraw=true)=0
ConsoleMessageLevel
Console message level (see dispToConsole)
virtual void setView(CC_VIEW_ORIENTATION view)=0
virtual ~ecvMainAppInterface()=default
virtual void decreasePointSize()=0
virtual void updateOverlayDialogsPlacement()=0
Forces the update of all registered MDI 'overlay' dialogs.
virtual void enableAll()=0
Enables all windows.
virtual void toggle3DView(bool state)=0
virtual void refreshAll(bool only2D=false, bool forceRedraw=true)=0
Redraws all GL windows that have the 'refresh' flag on.
virtual void increasePointSize()=0
virtual void toggleActiveWindowViewerBasedPerspective()=0
virtual const ccHObject::Container & getSelectedEntities() const =0
Returns currently selected entities ("read only")
virtual void zoomOnEntities(ccHObject *obj)=0
virtual void refreshObject(ccHObject *obj, bool only2D=false, bool forceRedraw=true)=0
virtual void putObjectBackIntoDBTree(ccHObject *obj, const ccHObjectContext &context)=0
Adds back object to DB tree.
bool haveOneSelection() const
Checks if we have exactly one selection.
virtual void setSelectedInDB(ccHObject *obj, bool selected)=0
Selects or unselects an entity (in db tree)
virtual ccHObject * loadFile(QString filename, bool silent)=0
Attempts to load a file.
virtual void addToDB(ccHObject *obj, bool updateZoom=false, bool autoExpandDBTree=true, bool checkDimensions=false, bool autoRedraw=true)=0
virtual void spawnHistogramDialog(const std::vector< unsigned > &histoValues, double minVal, double maxVal, QString title, QString xAxisLabel)=0
virtual void resetSelectedBBox()=0
virtual void dispToConsole(QString message, ConsoleMessageLevel level=STD_CONSOLE_MESSAGE)=0
virtual void toggleExclusiveFullScreen(bool state)=0
virtual ccUniqueIDGenerator::Shared getUniqueIDGenerator()=0
Returns the unique ID generator.
virtual void zoomOnSelectedEntities()=0
virtual ccHObjectContext removeObjectTemporarilyFromDBTree(ccHObject *obj)=0
Removes object temporarily from DB tree.
virtual void removeFromDB(ccHObject *obj, bool autoDelete=true)=0
Removes an entity from main db tree.
virtual void refreshObjects(ccHObject::Container objs, bool only2D=false, bool forceRedraw=true)=0
virtual ccColorScalesManager * getColorScalesManager()=0
Returns color scale manager (unique instance)
virtual ccPickingHub * pickingHub()
virtual void redrawAll(bool only2D=false, bool forceRedraw=true)
virtual void registerOverlayDialog(ccOverlayDialog *dlg, Qt::Corner pos)=0
Registers a MDI area 'overlay' dialog.
virtual void addWidgetToQMdiArea(QWidget *viewWidget)=0
virtual void forceConsoleDisplay()=0
Forces display of console widget.
virtual void unregisterOverlayDialog(ccOverlayDialog *dlg)=0
Unregisters a MDI area 'overlay' dialog.
ImGuiContext * context
Definition: Window.cpp:76
Backup "context" for an object.