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

@@ -14,7 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AppStd_Application.hxx>
#include <DDataStd.hxx>
#include <DDF.hxx>
@@ -24,20 +23,18 @@
#include <Draw_Interpretor.hxx>
#include <Draw_PluginMacro.hxx>
//=======================================================================
//function : AllComands
//purpose :
//=======================================================================
//=================================================================================================
void DPrsStd::AllCommands (Draw_Interpretor& theCommands)
void DPrsStd::AllCommands(Draw_Interpretor& theCommands)
{
static Standard_Boolean done = Standard_False;
if (done) return;
if (done)
return;
done = Standard_True;
DPrsStd::AISPresentationCommands(theCommands);
DPrsStd::AISViewerCommands(theCommands);
//DPrsStd::BasicCommands(theCommands);
DPrsStd::AISPresentationCommands(theCommands);
DPrsStd::AISViewerCommands(theCommands);
// DPrsStd::BasicCommands(theCommands);
}
//==============================================================================
@@ -46,12 +43,13 @@ void DPrsStd::AllCommands (Draw_Interpretor& theCommands)
void DPrsStd::Factory(Draw_Interpretor& theDI)
{
static Standard_Boolean DPrsStdFactoryDone = Standard_False;
if (DPrsStdFactoryDone) return;
if (DPrsStdFactoryDone)
return;
DPrsStdFactoryDone = Standard_True;
DDF::AllCommands(theDI);
DNaming::AllCommands(theDI);
DDataStd::AllCommands(theDI);
DDataStd::AllCommands(theDI);
DPrsStd::AllCommands(theDI);
DDocStd::AllCommands(theDI);
#ifdef OCCT_DEBUG

View File

@@ -22,54 +22,32 @@
#include <Draw_Interpretor.hxx>
//! commands for presentation based on AIS
//! ======================================
class DPrsStd
class DPrsStd
{
public:
DEFINE_STANDARD_ALLOC
//! Presentation commands
//! =====================
//! to load all sketch commands
Standard_EXPORT static void AllCommands (Draw_Interpretor& I);
Standard_EXPORT static void AllCommands(Draw_Interpretor& I);
//! to display....etc... ais presentation
Standard_EXPORT static void AISPresentationCommands (Draw_Interpretor& I);
Standard_EXPORT static void AISPresentationCommands(Draw_Interpretor& I);
//! to repaint...etc... ais viewer
Standard_EXPORT static void AISViewerCommands (Draw_Interpretor& I);
Standard_EXPORT static void AISViewerCommands(Draw_Interpretor& I);
//! set/get position attribute
Standard_EXPORT static void BasicCommands (Draw_Interpretor& I);
Standard_EXPORT static void BasicCommands(Draw_Interpretor& I);
//! Loads all Draw commands of TKDCAF. Used for plugin.
Standard_EXPORT static void Factory (Draw_Interpretor& theDI);
Standard_EXPORT static void Factory(Draw_Interpretor& theDI);
protected:
private:
};
#endif // _DPrsStd_HeaderFile

File diff suppressed because it is too large Load Diff

View File

@@ -21,24 +21,24 @@
#include <TCollection_AsciiString.hxx>
#include <TDocStd_Document.hxx>
#include <TDF_Label.hxx>
#include <TDF_Data.hxx>
#include <TDF_Data.hxx>
#include <DDF.hxx>
#include <DDocStd.hxx>
#include <ViewerTest.hxx>
#include <V3d_View.hxx>
#include <TPrsStd_AISPresentation.hxx>
#include <TPrsStd_AISViewer.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveContext.hxx>
//=======================================================================
//function : DPrsStd_AISInitViewer
//purpose : AISInitViewer (DOC)
// function : DPrsStd_AISInitViewer
// purpose : AISInitViewer (DOC)
//=======================================================================
static Standard_Integer DPrsStd_AISInitViewer (Draw_Interpretor& theDI,
Standard_Integer theArgNb,
const char** theArgVec)
{
static Standard_Integer DPrsStd_AISInitViewer(Draw_Interpretor& theDI,
Standard_Integer theArgNb,
const char** theArgVec)
{
if (theArgNb != 2)
{
std::cout << "DPrsStd_AISInitViewer : Error\n";
@@ -46,66 +46,58 @@ static Standard_Integer DPrsStd_AISInitViewer (Draw_Interpretor& theDI,
}
Handle(TDocStd_Document) aDoc;
if (!DDocStd::GetDocument (theArgVec[1], aDoc))
if (!DDocStd::GetDocument(theArgVec[1], aDoc))
{
return 1;
}
TDF_Label aRoot = aDoc->GetData()->Root();
TDF_Label aRoot = aDoc->GetData()->Root();
Handle(TPrsStd_AISViewer) aDocViewer;
TCollection_AsciiString aViewName = TCollection_AsciiString ("Driver1/Document_") + theArgVec[1] + "/View1";
if (!TPrsStd_AISViewer::Find (aRoot, aDocViewer))
TCollection_AsciiString aViewName =
TCollection_AsciiString("Driver1/Document_") + theArgVec[1] + "/View1";
if (!TPrsStd_AISViewer::Find(aRoot, aDocViewer))
{
ViewerTest::ViewerInit (aViewName);
aDocViewer = TPrsStd_AISViewer::New (aRoot, ViewerTest::GetAISContext());
ViewerTest::ViewerInit(aViewName);
aDocViewer = TPrsStd_AISViewer::New(aRoot, ViewerTest::GetAISContext());
}
DDF::ReturnLabel (theDI, aDocViewer->Label());
DDF::ReturnLabel(theDI, aDocViewer->Label());
return 0;
}
//=================================================================================================
//=======================================================================
//function : TPrsStd_AISRepaint
//purpose :
//=======================================================================
static Standard_Integer DPrsStd_AISRepaint (Draw_Interpretor& di,
Standard_Integer nb,
const char** arg)
{
if (nb == 2) {
static Standard_Integer DPrsStd_AISRepaint(Draw_Interpretor& di,
Standard_Integer nb,
const char** arg)
{
if (nb == 2)
{
Handle(TDocStd_Document) D;
if (!DDocStd::GetDocument(arg[1],D)) return 1;
TDF_Label acces = D->GetData()->Root();
if (!DDocStd::GetDocument(arg[1], D))
return 1;
TDF_Label acces = D->GetData()->Root();
TPrsStd_AISViewer::Update(acces);
return 0;
}
di << "DPrsStd_AISRepaint : Error\n";
return 1;
return 1;
}
//=======================================================================
//function : AISViewerCommands
//purpose :
//=======================================================================
//=================================================================================================
void DPrsStd::AISViewerCommands (Draw_Interpretor& theCommands)
{
void DPrsStd::AISViewerCommands(Draw_Interpretor& theCommands)
{
static Standard_Boolean done = Standard_False;
if (done) return;
done = Standard_True;
const char* g = "DPrsStd : standard presentation commands" ;
// standard commands working on AISViewer
theCommands.Add ("AISInitViewer",
"AISInitViewer (DOC)",
__FILE__, DPrsStd_AISInitViewer, g);
if (done)
return;
done = Standard_True;
const char* g = "DPrsStd : standard presentation commands";
theCommands.Add ("AISRepaint",
"update the AIS viewer",
__FILE__, DPrsStd_AISRepaint, g);
// standard commands working on AISViewer
theCommands.Add("AISInitViewer", "AISInitViewer (DOC)", __FILE__, DPrsStd_AISInitViewer, g);
theCommands.Add("AISRepaint", "update the AIS viewer", __FILE__, DPrsStd_AISRepaint, g);
}