1
0
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:
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 TreeModel_ItemProperties_H
#define TreeModel_ItemProperties_H
@@ -54,13 +54,20 @@ class TreeModel_ItemProperties : public Standard_Transient
//! container of values in a row of property table
struct TreeModel_RowValue
{
TreeModel_RowValue (const Standard_Integer theValueStartPosition, const QVariant& theKey, QVariant theValue)
: ValueStartPosition (theValueStartPosition), Key (theKey), Value (theValue) {}
TreeModel_RowValue(const Standard_Integer theValueStartPosition,
const QVariant& theKey,
QVariant theValue)
: ValueStartPosition(theValueStartPosition),
Key(theKey),
Value(theValue)
{
}
Standard_Integer ValueStartPosition; //!< start position of the key
QVariant Key; //!< value in the first column
QVariant Value; //!< value in the second column
QMap<int, QVariant> CustomValues; //!< custom values, e.g. key is Background, value is a defined color
QVariant Key; //!< value in the first column
QVariant Value; //!< value in the second column
QMap<int, QVariant>
CustomValues; //!< custom values, e.g. key is Background, value is a defined color
};
public:
@@ -71,10 +78,10 @@ public:
~TreeModel_ItemProperties() {}
//! Sets the current item
void SetItem (const TreeModel_ItemBasePtr& theItem) { myItem = theItem; }
void SetItem(const TreeModel_ItemBasePtr& theItem) { myItem = theItem; }
//! Fills properties with the stream value
Standard_EXPORT void InitByStream (const Standard_SStream& theStream);
Standard_EXPORT void InitByStream(const Standard_SStream& theStream);
//! Returns the current item
TreeModel_ItemBasePtr Item() const { return myItem; }
@@ -93,42 +100,43 @@ public:
//! \return an integer value
int ColumnCount() const { return 2; }
//! Returns content of the model index for the given role, it is obtained from internal container of values
//! \param theRow a model index row
//! \param theColumn a model index column
//! \param theRole a view role
//! \return value interpreted depending on the given role
Standard_EXPORT QVariant Data (const int theRow, const int theColumn, int theRole = Qt::DisplayRole) const;
//! Returns content of the model index for the given role, it is obtained from internal container
//! of values \param theRow a model index row \param theColumn a model index column \param theRole
//! a view role \return value interpreted depending on the given role
Standard_EXPORT QVariant Data(const int theRow,
const int theColumn,
int theRole = Qt::DisplayRole) const;
//! Returns type of edit control for the model index. By default, it is an empty control
//! \param theRow a model index row
//! \param theColumn a model index column
//! \return edit type
Standard_EXPORT ViewControl_EditType EditType (const int theRow, const int theColumn) const;
Standard_EXPORT ViewControl_EditType EditType(const int theRow, const int theColumn) const;
//! Sets content of the model index for the given role, it is applied to internal container of values
//! \param theRow a model index row
//! \param theColumn a model index column
//! \param theRole a view role
//! \return true if the value is changed
Standard_EXPORT bool SetData (const int theRow, const int theColumn, const QVariant& theValue,
int theRole = Qt::DisplayRole);
//! Sets content of the model index for the given role, it is applied to internal container of
//! values \param theRow a model index row \param theColumn a model index column \param theRole a
//! view role \return true if the value is changed
Standard_EXPORT bool SetData(const int theRow,
const int theColumn,
const QVariant& theValue,
int theRole = Qt::DisplayRole);
//! Returns presentation of the attribute to be visualized in the view
//! \thePresentations[out] container of presentation handles to be visualized
Standard_EXPORT void Presentations (NCollection_List<Handle(Standard_Transient)>& thePresentations);
Standard_EXPORT void Presentations(
NCollection_List<Handle(Standard_Transient)>& thePresentations);
//! Returns flags for the item: ItemIsEnabled | Qt::ItemIsSelectable.
//! Additional flag for the column 1 is Qt::ItemIsEditable.
//! \param theIndex a model index
//! \return flags
Standard_EXPORT Qt::ItemFlags TableFlags (const int theRow, const int theColumn) const;
Standard_EXPORT Qt::ItemFlags TableFlags(const int theRow, const int theColumn) const;
//! Returns stream value of the item to fulfill property panel.
//! \return stream value or dummy
Standard_EXPORT void ChildStream (const int theRowId,
TCollection_AsciiString& theKey,
Standard_DumpValue& theValue) const;
Standard_EXPORT void ChildStream(const int theRowId,
TCollection_AsciiString& theKey,
Standard_DumpValue& theValue) const;
//! Returns data object of the item.
//! \return object key
@@ -139,15 +147,24 @@ public:
const TCollection_AsciiString& StreamValue() const { return myStreamValue.myValue; }
//! Returns children stream values
//const NCollection_IndexedDataMap<TCollection_AsciiString, Standard_DumpValue>& Values() const { initItem(); return myValues; }
// const NCollection_IndexedDataMap<TCollection_AsciiString, Standard_DumpValue>& Values() const {
// initItem(); return myValues; }
//! Returns children stream values
const NCollection_IndexedDataMap<Standard_Integer, TreeModel_RowValue>& RowValues() const { initItem(); return myRowValues; }
const NCollection_IndexedDataMap<Standard_Integer, TreeModel_RowValue>& RowValues() const
{
initItem();
return myRowValues;
}
//! Returns children stream values
const NCollection_IndexedDataMap<TCollection_AsciiString, Standard_DumpValue>& Children() const { initItem(); return myChildren; }
const NCollection_IndexedDataMap<TCollection_AsciiString, Standard_DumpValue>& Children() const
{
initItem();
return myChildren;
}
DEFINE_STANDARD_RTTIEXT (TreeModel_ItemProperties, Standard_Transient)
DEFINE_STANDARD_RTTIEXT(TreeModel_ItemProperties, Standard_Transient)
protected:
//! Initializes the current item. It creates a backup of the specific item information
@@ -156,9 +173,10 @@ protected:
private:
TreeModel_ItemBasePtr myItem; //!< current item
TCollection_AsciiString myKey; //!< the item key
Standard_DumpValue myStreamValue; //!< the stream value
NCollection_IndexedDataMap<TCollection_AsciiString, Standard_DumpValue> myChildren; //!< the children
TCollection_AsciiString myKey; //!< the item key
Standard_DumpValue myStreamValue; //!< the stream value
NCollection_IndexedDataMap<TCollection_AsciiString, Standard_DumpValue>
myChildren; //!< the children
NCollection_IndexedDataMap<Standard_Integer, TreeModel_RowValue> myRowValues; //!< the values
};