mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Coding - Apply .clang-format formatting #286
Update empty method guards to new style with regex (see PR). Used clang-format 18.1.8. New actions to validate code formatting is added. Update .clang-format with disabling of include sorting. It is temporary changes, then include will be sorted. Apply formatting for /src and /tools folder. The files with .hxx,.cxx,.lxx,.h,.pxx,.hpp,*.cpp extensions.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef DFBrowser_Window_H
|
||||
#define DFBrowser_Window_H
|
||||
@@ -51,14 +51,13 @@ class QWidget;
|
||||
|
||||
//! \class DFBrowser_Window
|
||||
//! Window that unites all DFBrowser controls.
|
||||
//! External functionality : it processes plugin parameters, updates controls content and places itself in parent layout.
|
||||
//! It Synchronizes controls content depending on current selection.
|
||||
//! It shows context popup menu for OCAF tree view.
|
||||
//! External functionality : it processes plugin parameters, updates controls content and places
|
||||
//! itself in parent layout. It Synchronizes controls content depending on current selection. It
|
||||
//! shows context popup menu for OCAF tree view.
|
||||
class DFBrowser_Window : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
Standard_EXPORT DFBrowser_Window();
|
||||
|
||||
@@ -67,39 +66,44 @@ public:
|
||||
|
||||
//! Appends main window into layout of the parent if the parent is child of QWidget
|
||||
//! \param theParent a parent class
|
||||
Standard_EXPORT void SetParent (void* theParent);
|
||||
Standard_EXPORT void SetParent(void* theParent);
|
||||
|
||||
//! Sets parameters container, it should be used when the plugin is initialized or in update content
|
||||
//! \param theParameters a parameters container
|
||||
void SetParameters (const Handle(TInspectorAPI_PluginParameters)& theParameters) { myParameters = theParameters; }
|
||||
//! Sets parameters container, it should be used when the plugin is initialized or in update
|
||||
//! content \param theParameters a parameters container
|
||||
void SetParameters(const Handle(TInspectorAPI_PluginParameters)& theParameters)
|
||||
{
|
||||
myParameters = theParameters;
|
||||
}
|
||||
|
||||
//! Provides container for actions available in inspector on general level
|
||||
//! \param theMenu if Qt implementation, it is QMenu object
|
||||
Standard_EXPORT virtual void FillActionsMenu (void* theMenu);
|
||||
Standard_EXPORT virtual void FillActionsMenu(void* theMenu);
|
||||
|
||||
//! Returns plugin preferences: dock widgets state, tree view columns.
|
||||
//! \param theItem container of preference elements
|
||||
Standard_EXPORT void GetPreferences (TInspectorAPI_PreferencesDataMap& theItem);
|
||||
Standard_EXPORT void GetPreferences(TInspectorAPI_PreferencesDataMap& theItem);
|
||||
|
||||
//! Applies plugin preferences
|
||||
//! \param theItem container of preference elements
|
||||
Standard_EXPORT void SetPreferences (const TInspectorAPI_PreferencesDataMap& theItem);
|
||||
Standard_EXPORT void SetPreferences(const TInspectorAPI_PreferencesDataMap& theItem);
|
||||
|
||||
//! Applies parameters to Init controls, opens files if there are in parameters, updates OCAF tree view model
|
||||
//! Applies parameters to Init controls, opens files if there are in parameters, updates OCAF tree
|
||||
//! view model
|
||||
Standard_EXPORT void UpdateContent();
|
||||
|
||||
//! Fills controls of the plugin by parameters:
|
||||
//! - Find TDocStd_Application and fills OCAF tree model if it differs from the current application
|
||||
//! - Find TDocStd_Application and fills OCAF tree model if it differs from the current
|
||||
//! application
|
||||
//! - Fine AIS_InteractiveObject and fills View if it if it differs from the current context
|
||||
//! - If it is the first call, it creates module, fills selection models
|
||||
//! \param theParameters a parameters container
|
||||
Standard_EXPORT void Init (const NCollection_List<Handle(Standard_Transient)>& theParameters);
|
||||
Standard_EXPORT void Init(const NCollection_List<Handle(Standard_Transient)>& theParameters);
|
||||
|
||||
//! Opens application by the name, it may be either OCAF document or STEP file.
|
||||
//! Before opening it cleans tree view history, current selections,
|
||||
//! reset OCAF tree view model. After opening document, it fills all controls by the created application.
|
||||
//! \param theFileName a file name to be opened
|
||||
Standard_EXPORT void OpenFile (const TCollection_AsciiString& theFileName);
|
||||
//! reset OCAF tree view model. After opening document, it fills all controls by the created
|
||||
//! application. \param theFileName a file name to be opened
|
||||
Standard_EXPORT void OpenFile(const TCollection_AsciiString& theFileName);
|
||||
|
||||
//! Returns main control
|
||||
QWidget* GetMainWindow() const { return myMainWindow; }
|
||||
@@ -125,9 +129,9 @@ private slots:
|
||||
//! Cleans history in tree level line
|
||||
void onBeforeUpdateTreeModel();
|
||||
|
||||
//! Shows context menu for tree view selected item. It contains clear view or BREP operations items
|
||||
//! \param thePosition a clicked point
|
||||
void onTreeViewContextMenuRequested (const QPoint& thePosition);
|
||||
//! Shows context menu for tree view selected item. It contains clear view or BREP operations
|
||||
//! items \param thePosition a clicked point
|
||||
void onTreeViewContextMenuRequested(const QPoint& thePosition);
|
||||
|
||||
//! Expands two next levels for all selected item
|
||||
void onExpand();
|
||||
@@ -138,13 +142,14 @@ private slots:
|
||||
//! Collapses all levels for all selected items
|
||||
void onCollapseAll();
|
||||
|
||||
//! Setting flag whether DumpJSon should be applied to build tree model items structure
|
||||
//! Setting flag whether DumpJSon should be applied to build tree model items structure
|
||||
void onUseDumpJson();
|
||||
|
||||
//! Updates all controls by changed selection in OCAF tree view
|
||||
//! \param theSelected list of selected tree view items
|
||||
//! \param theDeselected list of deselected tree view items
|
||||
void onTreeViewSelectionChanged (const QItemSelection& theSelected, const QItemSelection& theDeselected);
|
||||
void onTreeViewSelectionChanged(const QItemSelection& theSelected,
|
||||
const QItemSelection& theDeselected);
|
||||
|
||||
//! Changes attribute pane stack content depending on search control text
|
||||
void onSearchActivated();
|
||||
@@ -153,12 +158,13 @@ private slots:
|
||||
//! - export to shape viewer
|
||||
//! - display presentation of the pane
|
||||
//! - display references
|
||||
void onPaneSelectionChanged (const QItemSelection& theSelected, const QItemSelection& theDeselected,
|
||||
QItemSelectionModel* theModel);
|
||||
void onPaneSelectionChanged(const QItemSelection& theSelected,
|
||||
const QItemSelection& theDeselected,
|
||||
QItemSelectionModel* theModel);
|
||||
|
||||
//! Selects the item in OCAF tree view
|
||||
//! \param theIndex OCAF tree view index
|
||||
void onTreeLevelLineSelected (const QModelIndex& theIndex);
|
||||
void onTreeLevelLineSelected(const QModelIndex& theIndex);
|
||||
|
||||
//! Updates OCAF tree model
|
||||
void onUpdateClicked();
|
||||
@@ -166,72 +172,78 @@ private slots:
|
||||
//! Highlights OCAF tree model item
|
||||
//! \param thePath a container of entries to the item
|
||||
//! \param theValue a label entry or attribute name
|
||||
void onSearchPathSelected (const QStringList& thePath, const QString& theValue);
|
||||
void onSearchPathSelected(const QStringList& thePath, const QString& theValue);
|
||||
|
||||
//! Selects OCAF tree model item
|
||||
//! \param thePath a container of entries to the item
|
||||
//! \param theValue a label entry or attribute name
|
||||
void onSearchPathDoubleClicked (const QStringList& thePath, const QString& theValue);
|
||||
void onSearchPathDoubleClicked(const QStringList& thePath, const QString& theValue);
|
||||
|
||||
//! Highlights OCAF tree model item
|
||||
//! \param theIndex an OCAF tree model index
|
||||
void onLevelSelected (const QModelIndex& theIndex);
|
||||
void onLevelSelected(const QModelIndex& theIndex);
|
||||
|
||||
//! Selects OCAF tree model item
|
||||
//! \param theIndex an OCAF tree model index
|
||||
void onLevelDoubleClicked (const QModelIndex& theIndex);
|
||||
void onLevelDoubleClicked(const QModelIndex& theIndex);
|
||||
|
||||
private:
|
||||
|
||||
//! Inits OCAF tree view with the given model
|
||||
//! \param theModel a model
|
||||
void setOCAFModel (QAbstractItemModel* theModel);
|
||||
void setOCAFModel(QAbstractItemModel* theModel);
|
||||
|
||||
//! Sets expanded levels in OCAF tree view. Do recursive expand of items.
|
||||
//! \param theTreeView an OCAF tree view
|
||||
//! \param theParentIndex an index which children should be expanded
|
||||
//! \param theLevels a number of levels to be expanded, or -1 for all levels
|
||||
static void setExpandedLevels (QTreeView* theTreeView, const QModelIndex& theParentIndex, const int theLevels);
|
||||
static void setExpandedLevels(QTreeView* theTreeView,
|
||||
const QModelIndex& theParentIndex,
|
||||
const int theLevels);
|
||||
|
||||
//! Marks items highlighted in OCAF tree view model and move view scroll to the first item
|
||||
//! \param theIndices a container of OCAF tree view model indices
|
||||
void highlightIndices (const QModelIndexList& theIndices);
|
||||
void highlightIndices(const QModelIndexList& theIndices);
|
||||
|
||||
//! Returns candidate to be the window title. It is either name of opened STEP file or the application path
|
||||
//! \return string value
|
||||
//! Returns candidate to be the window title. It is either name of opened STEP file or the
|
||||
//! application path \return string value
|
||||
QString getWindowTitle() const;
|
||||
|
||||
protected:
|
||||
//! Returns presentation for the OCAF tree model index. To do this, it uses attribute pane for
|
||||
//! this item \param theIndex a model index \return presentation or NULL
|
||||
Handle(AIS_InteractiveObject) findPresentation(const QModelIndex& theIndex);
|
||||
|
||||
//! Returns presentation for the OCAF tree model index. To do this, it uses attribute pane for this item
|
||||
//! \param theIndex a model index
|
||||
//! \return presentation or NULL
|
||||
Handle(AIS_InteractiveObject) findPresentation (const QModelIndex& theIndex);
|
||||
//! Returns presentations for the OCAF tree model indices. To do this, it uses attribute pane for
|
||||
//! this items \param theIndex a model index \return container of presentations or NULL
|
||||
void findPresentations(const QModelIndexList& theIndices,
|
||||
AIS_ListOfInteractive& thePresentations);
|
||||
|
||||
//! Returns presentations for the OCAF tree model indices. To do this, it uses attribute pane for this items
|
||||
//! \param theIndex a model index
|
||||
//! \return container of presentations or NULL
|
||||
void findPresentations (const QModelIndexList& theIndices, AIS_ListOfInteractive& thePresentations);
|
||||
|
||||
//! Updates content of Property Panel dock widget. It contains button to activate DumpJson or view with content of it.
|
||||
//! Updates content of Property Panel dock widget. It contains button to activate DumpJson or view
|
||||
//! with content of it.
|
||||
void updatePropertyPanelWidget();
|
||||
|
||||
private:
|
||||
|
||||
DFBrowser_Module* myModule; //!< current module
|
||||
QWidget* myParent; //!< widget, comes when Init window, the window control lays in the layout, updates window title
|
||||
QMainWindow* myMainWindow; //!< main control for all components
|
||||
QWidget* myParent; //!< widget, comes when Init window, the window control lays in the layout,
|
||||
//!< updates window title
|
||||
QMainWindow* myMainWindow; //!< main control for all components
|
||||
DFBrowser_TreeLevelLine* myTreeLevelLine; //!< navigate line of tree levels to the selected item
|
||||
QTreeView* myTreeView; //!< OCAF tree view
|
||||
QDockWidget* myPropertyPanelWidget; //!< property pane dockable widget
|
||||
QWidget* myUseDumpJson; //!< button to activate/deactivate using of DumpJson
|
||||
DFBrowser_PropertyPanel* myPropertyPanel; //!< property panel shows full information about attribute or search view
|
||||
ViewControl_PropertyView* myPropertyView; //!< property control to display model item values if exist
|
||||
View_Window* myViewWindow; //!< V3d view to visualize presentations/references if it can be build for a selected item
|
||||
QTreeView* myTreeView; //!< OCAF tree view
|
||||
QDockWidget* myPropertyPanelWidget; //!< property pane dockable widget
|
||||
QWidget* myUseDumpJson; //!< button to activate/deactivate using of DumpJson
|
||||
DFBrowser_PropertyPanel*
|
||||
myPropertyPanel; //!< property panel shows full information about attribute or search view
|
||||
ViewControl_PropertyView*
|
||||
myPropertyView; //!< property control to display model item values if exist
|
||||
View_Window* myViewWindow; //!< V3d view to visualize presentations/references if it can be build
|
||||
//!< for a selected item
|
||||
DFBrowser_DumpView* myDumpView; //!< Text editor where "Dump" method output is shown
|
||||
ViewControl_MessageDialog* myExportToShapeViewDialog; //!< dialog about exporting TopoDS_Shape to ShapeView plugin
|
||||
Handle(TInspectorAPI_PluginParameters) myParameters; //!< contains application, context, files that should be opened
|
||||
QString myOpenedFileName; //!< cached name of opened file between parent is set, apply it by parent setting and nullify
|
||||
ViewControl_MessageDialog*
|
||||
myExportToShapeViewDialog; //!< dialog about exporting TopoDS_Shape to ShapeView plugin
|
||||
Handle(TInspectorAPI_PluginParameters)
|
||||
myParameters; //!< contains application, context, files that should be opened
|
||||
QString myOpenedFileName; //!< cached name of opened file between parent is set, apply it by
|
||||
//!< parent setting and nullify
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user