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.
#include <inspector/DFBrowser_ItemBase.hxx>
@@ -36,8 +36,12 @@
// function : Constructor
// purpose :
// =======================================================================
DFBrowser_ItemBase::DFBrowser_ItemBase (TreeModel_ItemBasePtr theParent, const int theRow, const int theColumn)
: TreeModel_ItemBase (theParent, theRow, theColumn), myModule (0), myIsUseAdditionalInfo (true)
DFBrowser_ItemBase::DFBrowser_ItemBase(TreeModel_ItemBasePtr theParent,
const int theRow,
const int theColumn)
: TreeModel_ItemBase(theParent, theRow, theColumn),
myModule(0),
myIsUseAdditionalInfo(true)
{
}
@@ -47,7 +51,7 @@ DFBrowser_ItemBase::DFBrowser_ItemBase (TreeModel_ItemBasePtr theParent, const i
// =======================================================================
void DFBrowser_ItemBase::Reset()
{
setLabel (TDF_Label());
setLabel(TDF_Label());
TreeModel_ItemBase::Reset();
}
@@ -65,18 +69,24 @@ TDF_Label DFBrowser_ItemBase::GetLabel() const
// function : data
// purpose :
// =======================================================================
QVariant DFBrowser_ItemBase::data (const QModelIndex& theIndex, int theRole) const
QVariant DFBrowser_ItemBase::data(const QModelIndex& theIndex, int theRole) const
{
int aRole = theRole;
if (Column() == 0 && useAdditionalInfo())
{
switch (theRole)
{
case Qt::DisplayRole: { aRole = DFBrowserPane_ItemRole_DisplayExtended; break; }
case Qt::ToolTipRole: { aRole = DFBrowserPane_ItemRole_ToolTipExtended; break; }
case Qt::DisplayRole: {
aRole = DFBrowserPane_ItemRole_DisplayExtended;
break;
}
case Qt::ToolTipRole: {
aRole = DFBrowserPane_ItemRole_ToolTipExtended;
break;
}
}
}
return TreeModel_ItemBase::data (theIndex, aRole);
return TreeModel_ItemBase::data(theIndex, aRole);
}
// =======================================================================
@@ -96,32 +106,33 @@ int DFBrowser_ItemBase::initRowCount() const
// function : initValue
// purpose :
// =======================================================================
QVariant DFBrowser_ItemBase::initValue (const int theItemRole) const
QVariant DFBrowser_ItemBase::initValue(const int theItemRole) const
{
switch (theItemRole)
{
case Qt::DisplayRole:
case Qt::EditRole:
case Qt::ToolTipRole:
return DFBrowser_Tools::GetLabelInfo (myLabel, false);
return DFBrowser_Tools::GetLabelInfo(myLabel, false);
case DFBrowserPane_ItemRole_DisplayExtended:
case DFBrowserPane_ItemRole_ToolTipExtended:
return DFBrowser_Tools::GetLabelInfo (myLabel, true);
case Qt::ForegroundRole:
{
QVariant aValue = QColor (Qt::black);
return DFBrowser_Tools::GetLabelInfo(myLabel, true);
case Qt::ForegroundRole: {
QVariant aValue = QColor(Qt::black);
if (DFBrowser_Tools::IsEmptyLabel(GetLabel()))
aValue = QColor (Qt::lightGray);
aValue = QColor(Qt::lightGray);
else
{ // TEMPORARY HERE : should be moved in the pane of TDataStd_Name kind of attribute
Handle(TDataStd_Name) aName;
if (useAdditionalInfo() && myLabel.FindAttribute (TDataStd_Name::GetID(), aName))
aValue = QColor (Qt::darkGreen);
if (useAdditionalInfo() && myLabel.FindAttribute(TDataStd_Name::GetID(), aName))
aValue = QColor(Qt::darkGreen);
}
return aValue;
}
case Qt::DecorationRole: return DFBrowser_Tools::GetLabelIcon (myLabel);
default: break;
case Qt::DecorationRole:
return DFBrowser_Tools::GetLabelIcon(myLabel);
default:
break;
}
return QVariant();
}
@@ -130,11 +141,11 @@ QVariant DFBrowser_ItemBase::initValue (const int theItemRole) const
// function : createChild
// purpose :
// =======================================================================
TreeModel_ItemBasePtr DFBrowser_ItemBase::createChild (int theRow, int theColumn)
TreeModel_ItemBasePtr DFBrowser_ItemBase::createChild(int theRow, int theColumn)
{
TreeModel_ItemBasePtr anItem = DFBrowser_Item::CreateItem (currentItem(), theRow, theColumn);
DFBrowser_ItemBasePtr aBaseItem = itemDynamicCast<DFBrowser_ItemBase> (anItem);
aBaseItem->SetModule (GetModule());
TreeModel_ItemBasePtr anItem = DFBrowser_Item::CreateItem(currentItem(), theRow, theColumn);
DFBrowser_ItemBasePtr aBaseItem = itemDynamicCast<DFBrowser_ItemBase>(anItem);
aBaseItem->SetModule(GetModule());
return anItem;
}
@@ -143,10 +154,9 @@ TreeModel_ItemBasePtr DFBrowser_ItemBase::createChild (int theRow, int theColumn
// function : SetUseAdditionalInfo
// purpose :
// =======================================================================
bool DFBrowser_ItemBase::SetUseAdditionalInfo (const bool theValue)
bool DFBrowser_ItemBase::SetUseAdditionalInfo(const bool theValue)
{
bool aPreviousValue = myIsUseAdditionalInfo;
bool aPreviousValue = myIsUseAdditionalInfo;
myIsUseAdditionalInfo = theValue;
return aPreviousValue;
}