1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-13 14:27:08 +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:
dpasukhi
2025-01-25 20:15:22 +00:00
parent dbba6f1289
commit a5a7b3185b
14005 changed files with 1273539 additions and 1195567 deletions

View File

@@ -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 TInspector_Window_H
#define TInspector_Window_H
@@ -47,23 +47,27 @@ class TInspector_Window : public QObject
{
Q_OBJECT
private:
//! Container of plugin information
struct TInspector_ToolInfo
{
//! Constructor
TInspector_ToolInfo (const TCollection_AsciiString& theName = TCollection_AsciiString())
: myName(theName), myCommunicator (0), myButton (0), myWidget (0) {}
TInspector_ToolInfo(const TCollection_AsciiString& theName = TCollection_AsciiString())
: myName(theName),
myCommunicator(0),
myButton(0),
myWidget(0)
{
}
TCollection_AsciiString myName; //!< plugin name
TCollection_AsciiString myName; //!< plugin name
TInspectorAPI_Communicator* myCommunicator; //!< plugin communicator
QPushButton* myButton; //!< button with plugin name, that will be added into TInspector window layout
QPushButton*
myButton; //!< button with plugin name, that will be added into TInspector window layout
QWidget* myWidget; //!< parent widget of the plugin
};
public:
//! Constructor
Standard_EXPORT TInspector_Window();
@@ -72,25 +76,25 @@ public:
//! Appends the plugin names into internal container
//! \param thePluginName a name of the plugin
Standard_EXPORT void RegisterPlugin (const TCollection_AsciiString& thePluginName);
Standard_EXPORT void RegisterPlugin(const TCollection_AsciiString& thePluginName);
//! Returns list of registered plugins
//! \return container of plugin names
Standard_EXPORT NCollection_List<TCollection_AsciiString> RegisteredPlugins() const;
//! Stores parameters for the plugin. If the plugin name is empty, it inits all plugins with the parameters
//! \param thePluginName a name of the plugin
//! \param theParameters container of parameters(e.g. AIS_InteractiveContext, TDocStd_Application)
//! \param theAppend boolean state whether the parameters should be added to existing
Standard_EXPORT void Init (const TCollection_AsciiString& thePluginName,
const NCollection_List<Handle(Standard_Transient)>& theParameters,
const Standard_Boolean theAppend = Standard_False);
//! Stores parameters for the plugin. If the plugin name is empty, it inits all plugins with the
//! parameters \param thePluginName a name of the plugin \param theParameters container of
//! parameters(e.g. AIS_InteractiveContext, TDocStd_Application) \param theAppend boolean state
//! whether the parameters should be added to existing
Standard_EXPORT void Init(const TCollection_AsciiString& thePluginName,
const NCollection_List<Handle(Standard_Transient)>& theParameters,
const Standard_Boolean theAppend = Standard_False);
//! Appends to container of parameters the given name, if the given parameter is active, cal UpdateContent
//! \param thePluginName a name of the plugin
//! \param theParameters container of parameters(e.g. AIS_InteractiveContext, TDocStd_Application)
Standard_EXPORT void OpenFile (const TCollection_AsciiString& thePluginName,
const TCollection_AsciiString& theFileName);
//! Appends to container of parameters the given name, if the given parameter is active, cal
//! UpdateContent \param thePluginName a name of the plugin \param theParameters container of
//! parameters(e.g. AIS_InteractiveContext, TDocStd_Application)
Standard_EXPORT void OpenFile(const TCollection_AsciiString& thePluginName,
const TCollection_AsciiString& theFileName);
//! Calls UpdateContent for the active plugin
Standard_EXPORT void UpdateContent();
@@ -100,34 +104,39 @@ public:
//! Activates the plugin. Loads the plugin if it has not been loaded yet
//! \param thePluginName a name of the plugin
Standard_EXPORT void ActivateTool (const TCollection_AsciiString& thePluginName);
Standard_EXPORT void ActivateTool(const TCollection_AsciiString& thePluginName);
//! Sets item selected in the active plugin
//! \param theItemNames a container of name of items in plugin that should become selected
Standard_EXPORT void SetSelected (const NCollection_List<TCollection_AsciiString>& theItemNames);
Standard_EXPORT void SetSelected(const NCollection_List<TCollection_AsciiString>& theItemNames);
//! Sets objects to be selected in the plugin
//! \param theObjects an objects
Standard_EXPORT void SetSelected (const NCollection_List<Handle(Standard_Transient)>& theObjects);
Standard_EXPORT void SetSelected(const NCollection_List<Handle(Standard_Transient)>& theObjects);
//! Sets open button. Stores into objectName for the button the name of the current plugin to know where
//! the file should be applied
//! \param theButton a button
Standard_EXPORT void SetOpenButton (QPushButton* theButton);
//! Sets open button. Stores into objectName for the button the name of the current plugin to know
//! where the file should be applied \param theButton a button
Standard_EXPORT void SetOpenButton(QPushButton* theButton);
//! Loads plugin, appends the plugin widget into layout, stores the plugin information
//! \param thePluginName a name of the plugin
//! \param theInfo an output parameter for plugin info
Standard_EXPORT bool LoadPlugin (const TCollection_AsciiString& thePluginName, TInspector_ToolInfo& theInfo);
Standard_EXPORT bool LoadPlugin(const TCollection_AsciiString& thePluginName,
TInspector_ToolInfo& theInfo);
//! Sets path to a directory for temporary plugin files. If parameter is empty, using default directory
//! \param thePath a path
void SetTemporaryDirectory (const TCollection_AsciiString& thePath)
{ myParameters->SetTemporaryDirectory (thePath.IsEmpty() ? myDefaultDirectory : thePath); }
//! Sets path to a directory for temporary plugin files. If parameter is empty, using default
//! directory \param thePath a path
void SetTemporaryDirectory(const TCollection_AsciiString& thePath)
{
myParameters->SetTemporaryDirectory(thePath.IsEmpty() ? myDefaultDirectory : thePath);
}
//! Returns path to a directory for temporary plugin files
//! \return path
TCollection_AsciiString GetTemporaryDirectory() const { return myParameters->GetTemporaryDirectory(); }
TCollection_AsciiString GetTemporaryDirectory() const
{
return myParameters->GetTemporaryDirectory();
}
//! Returns plugins parameters container
//! \return instance of parameters container
@@ -135,15 +144,15 @@ public:
//! 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);
//! Puts in the stream information about communicator
//! \param theStream stream for output
Standard_EXPORT void Dump (Standard_OStream& theStream) const;
Standard_EXPORT void Dump(Standard_OStream& theStream) const;
public slots:
//! Stores preferences (current state) of all plugins into a preferences file
@@ -160,22 +169,23 @@ protected slots:
//! Updates available actions by the active plugin
void onShowActionsMenu();
//! Updates the TInspector window title giving object name of plugin widget (available only in Qt5)
//! Updates the TInspector window title giving object name of plugin widget (available only in
//! Qt5)
void onCommuncatorNameChanged();
protected:
//! Activates plugin by the plugin info
//! Activates plugin by the plugin info
//! \param theToolInfo an information about plugin
bool activeToolInfo (TInspector_ToolInfo& theToolInfo) const;
bool activeToolInfo(TInspector_ToolInfo& theToolInfo) const;
//! Returns true if there is plugin registered by the given name
//! \param thePluginName a name of the plugin
//! \param theToolInfo an output parameter for plugin information
//! \param theToolId an index in internal map
//! \return true if the plugin is found
bool findPlugin (const TCollection_AsciiString& thePluginName, TInspector_ToolInfo& theToolInfo,
int& theToolId);
bool findPlugin(const TCollection_AsciiString& thePluginName,
TInspector_ToolInfo& theToolInfo,
int& theToolId);
//! Applies desktop preferences to window
void applyPreferences();
@@ -185,19 +195,18 @@ protected:
TCollection_AsciiString defaultTemporaryDirectory() const;
private:
QWidget* myEmptyWidget; //!< widget that is active in tools stack while no one plugin is loaded
QMainWindow* myMainWindow; //!< main control of the window
QStackedWidget* myToolsStack; //!< stack widget of plugin windows
QWidget* myButtonWidget; //!< container of plugin buttons
QPushButton* myOpenButton; //!< button to open file for the active plugin
QHBoxLayout* myButtonLay; //!< layout of plugin buttons
QButtonGroup* myButtonGroup; //!< exclusive toggled button
QToolButton* myActionsWidget; //!< tool button for plugin actions
QList<TInspector_ToolInfo> myToolNames; //!< container of plugin names
Handle(TInspectorAPI_PluginParameters) myParameters; //!< plugins parameters container
TInspector_Shortcut* myShortcut; //!< listener of key events
TCollection_AsciiString myDefaultDirectory; //!< default directory
QMainWindow* myMainWindow; //!< main control of the window
QStackedWidget* myToolsStack; //!< stack widget of plugin windows
QWidget* myButtonWidget; //!< container of plugin buttons
QPushButton* myOpenButton; //!< button to open file for the active plugin
QHBoxLayout* myButtonLay; //!< layout of plugin buttons
QButtonGroup* myButtonGroup; //!< exclusive toggled button
QToolButton* myActionsWidget; //!< tool button for plugin actions
QList<TInspector_ToolInfo> myToolNames; //!< container of plugin names
Handle(TInspectorAPI_PluginParameters) myParameters; //!< plugins parameters container
TInspector_Shortcut* myShortcut; //!< listener of key events
TCollection_AsciiString myDefaultDirectory; //!< default directory
};
#endif