ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvLayoutManager Class Reference

Layout manager for MainWindow. More...

#include <ecvLayoutManager.h>

Inheritance diagram for ecvLayoutManager:
Collaboration diagram for ecvLayoutManager:

Public Member Functions

 ecvLayoutManager (QMainWindow *mainWindow, ccPluginUIManager *pluginManager)
 Constructor. More...
 
virtual ~ecvLayoutManager ()
 Destructor. More...
 
void setupDefaultLayout ()
 Setup default layout for the main window. More...
 
void repositionUnifiedPluginToolbar ()
 Reposition the unified plugin toolbar to the end of the first row. More...
 
void hideAdditionalPluginToolbars ()
 
void saveGUILayout ()
 Save current GUI layout to settings. More...
 
void restoreGUILayout (bool forceDefault=false)
 Restore GUI layout from settings. More...
 
void saveCustomLayout ()
 Save current layout as custom layout. More...
 
void restoreDefaultLayout ()
 Restore the default layout. More...
 
bool restoreCustomLayout ()
 Restore previously saved custom layout. More...
 
void setAutoSaveEnabled (bool enabled)
 Set whether to auto-save layout on close. More...
 
bool isAutoSaveEnabled () const
 Get whether auto-save is enabled. More...
 
void registerRightSideToolBar (QToolBar *toolbar)
 Register a toolbar to be placed on the right side. More...
 
void registerLeftSideToolBar (QToolBar *toolbar)
 Register a toolbar to be placed on the left side. More...
 
void registerBottomDockWidget (QDockWidget *dockWidget)
 Register a dock widget to be placed at the bottom. More...
 
void registerRightSideDockWidget (QDockWidget *dockWidget)
 Register a dock widget to be placed on the right side. More...
 
void setToolbarIconSize (QToolBar *toolbar, int screenWidth)
 

Detailed Description

Layout manager for MainWindow.

This class handles all layout-related operations including:

  • Setting up default layout
  • Managing toolbar positions and sizes
  • Handling plugin toolbar unification
  • Saving and restoring layout state

Definition at line 34 of file ecvLayoutManager.h.

Constructor & Destructor Documentation

◆ ecvLayoutManager()

ecvLayoutManager::ecvLayoutManager ( QMainWindow *  mainWindow,
ccPluginUIManager pluginManager 
)
explicit

Constructor.

Definition at line 25 of file ecvLayoutManager.cpp.

◆ ~ecvLayoutManager()

ecvLayoutManager::~ecvLayoutManager ( )
virtual

Destructor.

Definition at line 35 of file ecvLayoutManager.cpp.

Member Function Documentation

◆ hideAdditionalPluginToolbars()

void ecvLayoutManager::hideAdditionalPluginToolbars ( )

Hide additional plugin toolbars that have been merged into UnifiedPluginToolbar

Definition at line 176 of file ecvLayoutManager.cpp.

References ccPluginUIManager::additionalPluginToolbars(), and ccPluginUIManager::isPythonPluginToolbar().

Referenced by restoreGUILayout(), and saveGUILayout().

◆ isAutoSaveEnabled()

bool ecvLayoutManager::isAutoSaveEnabled ( ) const
inline

Get whether auto-save is enabled.

Definition at line 82 of file ecvLayoutManager.h.

◆ registerBottomDockWidget()

void ecvLayoutManager::registerBottomDockWidget ( QDockWidget *  dockWidget)

Register a dock widget to be placed at the bottom.

Definition at line 602 of file ecvLayoutManager.cpp.

Referenced by MainWindow::MainWindow().

◆ registerLeftSideToolBar()

void ecvLayoutManager::registerLeftSideToolBar ( QToolBar *  toolbar)

Register a toolbar to be placed on the left side.

Definition at line 596 of file ecvLayoutManager.cpp.

Referenced by MainWindow::MainWindow().

◆ registerRightSideDockWidget()

void ecvLayoutManager::registerRightSideDockWidget ( QDockWidget *  dockWidget)

Register a dock widget to be placed on the right side.

Definition at line 608 of file ecvLayoutManager.cpp.

Referenced by MainWindow::MainWindow().

◆ registerRightSideToolBar()

void ecvLayoutManager::registerRightSideToolBar ( QToolBar *  toolbar)

Register a toolbar to be placed on the right side.

Definition at line 590 of file ecvLayoutManager.cpp.

Referenced by MainWindow::initPlugins().

◆ repositionUnifiedPluginToolbar()

void ecvLayoutManager::repositionUnifiedPluginToolbar ( )

Reposition the unified plugin toolbar to the end of the first row.

Definition at line 201 of file ecvLayoutManager.cpp.

References CVLog::Warning().

Referenced by restoreGUILayout().

◆ restoreCustomLayout()

bool ecvLayoutManager::restoreCustomLayout ( )

Restore previously saved custom layout.

Returns
true if custom layout exists and was restored, false otherwise

Definition at line 646 of file ecvLayoutManager.cpp.

References ecvPS::CustomLayoutGeom(), ecvPS::CustomLayoutState(), CVLog::Error(), CVLog::PrintVerbose(), and CVLog::Warning().

◆ restoreDefaultLayout()

void ecvLayoutManager::restoreDefaultLayout ( )

◆ restoreGUILayout()

void ecvLayoutManager::restoreGUILayout ( bool  forceDefault = false)

Restore GUI layout from settings.

Parameters
forceDefaultIf true, ignore saved settings and use default layout

Definition at line 540 of file ecvLayoutManager.cpp.

References hideAdditionalPluginToolbars(), ecvPS::MainWinGeom(), ecvPS::MainWinState(), CVLog::PrintVerbose(), repositionUnifiedPluginToolbar(), setToolbarIconSize(), and setupDefaultLayout().

◆ saveCustomLayout()

void ecvLayoutManager::saveCustomLayout ( )

Save current layout as custom layout.

Definition at line 614 of file ecvLayoutManager.cpp.

References ecvPS::CustomLayoutGeom(), ecvPS::CustomLayoutState(), CVLog::Error(), and CVLog::PrintVerbose().

◆ saveGUILayout()

void ecvLayoutManager::saveGUILayout ( )

Save current GUI layout to settings.

Definition at line 514 of file ecvLayoutManager.cpp.

References hideAdditionalPluginToolbars(), ecvPS::MainWinGeom(), ecvPS::MainWinState(), and CVLog::PrintVerbose().

Referenced by restoreDefaultLayout(), and MainWindow::saveGUIElementsPos().

◆ setAutoSaveEnabled()

void ecvLayoutManager::setAutoSaveEnabled ( bool  enabled)
inline

Set whether to auto-save layout on close.

Definition at line 79 of file ecvLayoutManager.h.

◆ setToolbarIconSize()

void ecvLayoutManager::setToolbarIconSize ( QToolBar *  toolbar,
int  screenWidth 
)

Set icon size and style for a toolbar based on screen resolution This is the unified method for setting toolbar icon size across all toolbars

Definition at line 117 of file ecvLayoutManager.cpp.

Referenced by restoreGUILayout().

◆ setupDefaultLayout()

void ecvLayoutManager::setupDefaultLayout ( )

Setup default layout for the main window.

This includes toolbar positioning, dock widget layout, and window sizing based on screen resolution

Definition at line 496 of file ecvLayoutManager.cpp.

References CVLog::PrintDebug(), and CVLog::PrintVerbose().

Referenced by restoreDefaultLayout(), and restoreGUILayout().


The documentation for this class was generated from the following files: