1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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 MessageModel_ItemRoot_H
#define MessageModel_ItemRoot_H
@@ -31,24 +31,31 @@ typedef QExplicitlySharedDataPointer<MessageModel_ItemRoot> MessageModel_ItemRoo
struct MessageModel_ReportInformation
{
//! Constructor
MessageModel_ReportInformation (Handle(Message_Report) theReport, const TCollection_AsciiString& theDescription)
: myReport (theReport), myDescription (theDescription) {}
MessageModel_ReportInformation(Handle(Message_Report) theReport,
const TCollection_AsciiString& theDescription)
: myReport(theReport),
myDescription(theDescription)
{
}
Handle(Message_Report) myReport; //! report
Handle(Message_Report) myReport; //! report
TCollection_AsciiString myDescription; //! report description
};
//! \class MessageModel_ItemRoot
//! Collects message reports that should be visualized in tree view. Reports are cached and if reports are not needed,
//! cache should be cleared using RemoveAllReports
//! Parent is NULL, children are MessageModel_ItemReport items.
//! Collects message reports that should be visualized in tree view. Reports are cached and if
//! reports are not needed, cache should be cleared using RemoveAllReports Parent is NULL, children
//! are MessageModel_ItemReport items.
class MessageModel_ItemRoot : public MessageModel_ItemBase
{
public:
//! Creates an item wrapped by a shared pointer
static MessageModel_ItemRootPtr CreateItem (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
{ return MessageModel_ItemRootPtr (new MessageModel_ItemRoot (theParent, theRow, theColumn)); }
static MessageModel_ItemRootPtr CreateItem(TreeModel_ItemBasePtr theParent,
const int theRow,
const int theColumn)
{
return MessageModel_ItemRootPtr(new MessageModel_ItemRoot(theParent, theRow, theColumn));
}
//! Destructor
virtual ~MessageModel_ItemRoot() Standard_OVERRIDE {};
@@ -56,20 +63,24 @@ public:
//! Appends new report
//! \param theReport a report instance
//! \param theReportDescription an additional report information
void AddReport (const Handle(Message_Report)& theReport, const TCollection_AsciiString& theReportDescription)
{ myReports.Append (MessageModel_ReportInformation (theReport, theReportDescription)); }
void AddReport(const Handle(Message_Report)& theReport,
const TCollection_AsciiString& theReportDescription)
{
myReports.Append(MessageModel_ReportInformation(theReport, theReportDescription));
}
//! Set report, se it into the given row index
//! \param theRowId a report child row
//! \param theReport a report instance
//! \param theReportDescription an additional report information
Standard_EXPORT void SetReport (const int theRowId, const Handle(Message_Report)& theReport,
const TCollection_AsciiString& theReportDescription = "");
Standard_EXPORT void SetReport(const int theRowId,
const Handle(Message_Report)& theReport,
const TCollection_AsciiString& theReportDescription = "");
//! Returns true if report exists is in the list of the current reports
//! \param theReport a report instance
//! \return boolean value
Standard_EXPORT Standard_Boolean HasReport (const Handle(Message_Report)& theReport);
Standard_EXPORT Standard_Boolean HasReport(const Handle(Message_Report)& theReport);
//!< Returns processed reports
const NCollection_List<MessageModel_ReportInformation>& Reports() const { return myReports; }
@@ -79,18 +90,19 @@ public:
//! Returns report by the number
//! \param theRowId an index of the report in the internal container.
Standard_EXPORT const Handle(Message_Report)& GetReport (const int theRowId, TCollection_AsciiString& theReportDescription);
Standard_EXPORT const Handle(Message_Report)& GetReport(
const int theRowId,
TCollection_AsciiString& theReportDescription);
//! Set the item name
//! \param theName text value
void SetName (const TCollection_AsciiString& theName) { myName = theName; }
void SetName(const TCollection_AsciiString& theName) { myName = theName; }
protected:
//! Return data value for the role.
//! \param theRole a value role
//! \return the value
virtual QVariant initValue (const int theRole) const Standard_OVERRIDE;
virtual QVariant initValue(const int theRole) const Standard_OVERRIDE;
//! \return number of children.
virtual int initRowCount() const Standard_OVERRIDE { return myReports.Size(); }
@@ -99,19 +111,19 @@ protected:
//! \param theRow the child row position
//! \param theColumn the child column position
//! \return the created item
virtual TreeModel_ItemBasePtr createChild (int theRow, int theColumn) Standard_OVERRIDE;
virtual TreeModel_ItemBasePtr createChild(int theRow, int theColumn) Standard_OVERRIDE;
private:
//! Constructor
//! param theParent a parent item
MessageModel_ItemRoot (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
: MessageModel_ItemBase (theParent, theRow, theColumn) {}
MessageModel_ItemRoot(TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
: MessageModel_ItemBase(theParent, theRow, theColumn)
{
}
private:
NCollection_List<MessageModel_ReportInformation> myReports; //!< reports sent by algorithms
TCollection_AsciiString myName; //!< DisplayRole data, if defined
TCollection_AsciiString myName; //!< DisplayRole data, if defined
};
#endif