Skip to content

Commit 2ef374f

Browse files
committed
Coding - Updated macroses to c++17 standards
- Replace legacy Standard_OVERRIDE occurrences with C++ override specifier across many headers and sources (TKGeomBase, ProjLib, FEmTool, GeomLib, Visualization modules, AIS, Prs3d, PrsDim, Select3D/SelectMgr, StdSelect, V3d, etc.). This makes virtual function overrides explicit and improves compiler checks. - Replace Standard_FALLTHROUGH markers with the standard C++17 [[fallthrough]] attribute in switch statements to express intentional fall-throughs in a standards-compliant way. - Apply corresponding small signature/format adjustments where needed (keeping existing Standard_EXPORT and other project-specific macros). - No algorithmic or behavioral changes intended; changes are focused on code modernisation and suppressing compiler warnings while improving code clarity and safety. Files touched include (non-exhaustive): many headers and sources under src/ModelingData, src/Visualization (TKD3DHost, TKIVtk, TKOpenGl, TKMeshVS, TKV3d, TKService), and various Select3D/SelectMgr/StdSelect/Prs3d/PrsDim/AIS components.
1 parent 279da59 commit 2ef374f

1,535 files changed

Lines changed: 7909 additions & 7961 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dox/contribution/coding_rules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ A class with virtual function(s) ought to have a virtual destructor.
563563
### Overriding virtual methods
564564

565565
Declaration of overriding method should contains specifiers "virtual" and "override"
566-
(using Standard_OVERRIDE alias for compatibility with old compilers).
566+
(using override alias for compatibility with old compilers).
567567

568568
~~~~{.cpp}
569569
class MyPackage_BaseClass
@@ -580,7 +580,7 @@ class MyPackage_MyClass : public MyPackage_BaseClass
580580
581581
public:
582582
583-
Standard_EXPORT virtual Standard_Boolean Perform() Standard_OVERRIDE;
583+
Standard_EXPORT virtual Standard_Boolean Perform() override;
584584
585585
};
586586
~~~~

dox/upgrade/upgrade.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ class UserDriver : public OpenGl_GraphicDriver
939939
{
940940
public:
941941
//! Create instance of own view.
942-
virtual Handle(Graphic3d_CView) CreateView (const Handle(Graphic3d_StructureManager)& theMgr) Standard_OVERRIDE
942+
virtual Handle(Graphic3d_CView) CreateView (const Handle(Graphic3d_StructureManager)& theMgr) override
943943
{
944944
Handle(UserView) aView = new UserView (theMgr, this, myCaps, myDeviceLostFlag, &myStateCounter);
945945
myMapOfView.Add (aView);
@@ -1261,7 +1261,7 @@ The following Grid management methods within class V3d_Viewer do not implicitly
12611261

12621262
The duplicating interface methods accepting *Quantity_NameOfColor* (in addition to methods accepting *Quantity_Color*) of TKV3d toolkit have been removed.
12631263
In most cases this change should be transparent, however applications implementing such interface methods should also remove them
1264-
(compiler will automatically highlight this issue for methods marked with Standard_OVERRIDE keyword).
1264+
(compiler will automatically highlight this issue for methods marked with override keyword).
12651265

12661266
@subsection upgrade_720_Result_Of_BOP_On_Containers Result of Boolean operations on containers
12671267

samples/glfw/GlfwOcctWindow.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,28 +59,28 @@ class GlfwOcctWindow : public Aspect_Window
5959
public:
6060

6161
//! Returns native Window handle
62-
virtual Aspect_Drawable NativeHandle() const Standard_OVERRIDE;
62+
virtual Aspect_Drawable NativeHandle() const override;
6363

6464
//! Returns parent of native Window handle.
65-
virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE { return 0; }
65+
virtual Aspect_Drawable NativeParentHandle() const override { return 0; }
6666

6767
//! Applies the resizing to the window <me>
68-
virtual Aspect_TypeOfResize DoResize() Standard_OVERRIDE;
68+
virtual Aspect_TypeOfResize DoResize() override;
6969

7070
//! Returns True if the window <me> is opened and False if the window is closed.
71-
virtual Standard_Boolean IsMapped() const Standard_OVERRIDE;
71+
virtual Standard_Boolean IsMapped() const override;
7272

7373
//! Apply the mapping change to the window <me> and returns TRUE if the window is mapped at screen.
74-
virtual Standard_Boolean DoMapping() const Standard_OVERRIDE { return Standard_True; }
74+
virtual Standard_Boolean DoMapping() const override { return Standard_True; }
7575

7676
//! Opens the window <me>.
77-
virtual void Map() const Standard_OVERRIDE;
77+
virtual void Map() const override;
7878

7979
//! Closes the window <me>.
80-
virtual void Unmap() const Standard_OVERRIDE;
80+
virtual void Unmap() const override;
8181

8282
virtual void Position (Standard_Integer& theX1, Standard_Integer& theY1,
83-
Standard_Integer& theX2, Standard_Integer& theY2) const Standard_OVERRIDE
83+
Standard_Integer& theX2, Standard_Integer& theY2) const override
8484
{
8585
theX1 = myXLeft;
8686
theX2 = myXRight;
@@ -89,19 +89,19 @@ class GlfwOcctWindow : public Aspect_Window
8989
}
9090

9191
//! Returns The Window RATIO equal to the physical WIDTH/HEIGHT dimensions.
92-
virtual Standard_Real Ratio() const Standard_OVERRIDE
92+
virtual Standard_Real Ratio() const override
9393
{
9494
return Standard_Real (myXRight - myXLeft) / Standard_Real (myYBottom - myYTop);
9595
}
9696

9797
//! Return window size.
98-
virtual void Size (Standard_Integer& theWidth, Standard_Integer& theHeight) const Standard_OVERRIDE
98+
virtual void Size (Standard_Integer& theWidth, Standard_Integer& theHeight) const override
9999
{
100100
theWidth = myXRight - myXLeft;
101101
theHeight = myYBottom - myYTop;
102102
}
103103

104-
virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; }
104+
virtual Aspect_FBConfig NativeFBConfig() const override { return NULL; }
105105

106106
protected:
107107
Handle(Aspect_DisplayConnection) myDisplay;

samples/ios/UIKitSample/UIKitSample/CafShapePrs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class CafShapePrs : public XCAFPrs_AISObject
5151
const CafDataMapOfShapeColor& ShapeColors() const { return myShapeColors; }
5252

5353
//! Override default style.
54-
virtual void DefaultStyle (XCAFPrs_Style& theStyle) const Standard_OVERRIDE
54+
virtual void DefaultStyle (XCAFPrs_Style& theStyle) const override
5555
{
5656
theStyle = myDefStyle;
5757
}

samples/mfc/standard/01_Geometry/src/GeometryView2D.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CGeometryView2D : public OCC_2dView
3939
#endif
4040

4141
//! Return interactive context for 2d presentations.
42-
virtual const Handle(AIS_InteractiveContext)& GetAISContext() const Standard_OVERRIDE;
42+
virtual const Handle(AIS_InteractiveContext)& GetAISContext() const override;
4343

4444
// Generated message map functions
4545
protected:

samples/mfc/standard/04_HLR/src/HLRView2D.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CHLRView2D : public OCC_2dView
2323
DECLARE_MESSAGE_MAP()
2424

2525
//! Return interactive context for HLR presentations.
26-
virtual const Handle(AIS_InteractiveContext)& GetAISContext() const Standard_OVERRIDE;
26+
virtual const Handle(AIS_InteractiveContext)& GetAISContext() const override;
2727

2828
// Implementation
2929
public:

samples/mfc/standard/Common/OCC_2dDoc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Standard_EXPORT OCC_2dDoc : public OCC_BaseDoc
3232

3333
virtual void Popup (const Standard_Integer theMouseX,
3434
const Standard_Integer theMouseY,
35-
const Handle(V3d_View)& theView) Standard_OVERRIDE;
35+
const Handle(V3d_View)& theView) override;
3636
};
3737

3838
#endif // !defined(AFX_OCC_2dDOC_H__2E048CC7_38F9_11D7_8611_0060B0EE281E__INCLUDED_)

samples/mfc/standard/Common/OCC_3dBaseDoc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Standard_EXPORT OCC_3dBaseDoc : public OCC_BaseDoc
5151

5252
virtual void Popup (const Standard_Integer theMouseX,
5353
const Standard_Integer theMouseY,
54-
const Handle(V3d_View)& theView) Standard_OVERRIDE;
54+
const Handle(V3d_View)& theView) override;
5555

5656
static void Fit();
5757

samples/mfc/standard/Common/OCC_BaseView.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ class Standard_EXPORT OCC_BaseView : public CView, public AIS_ViewController
5353

5454
//! Handle view redraw.
5555
virtual void handleViewRedraw (const Handle(AIS_InteractiveContext)& theCtx,
56-
const Handle(V3d_View)& theView) Standard_OVERRIDE;
56+
const Handle(V3d_View)& theView) override;
5757

5858
//! Callback called by handleMoveTo() on Selection in 3D Viewer.
5959
virtual void OnSelectionChanged (const Handle(AIS_InteractiveContext)& theCtx,
60-
const Handle(V3d_View)& theView) Standard_OVERRIDE;
60+
const Handle(V3d_View)& theView) override;
6161

6262
//! Return interactive context.
6363
virtual const Handle(AIS_InteractiveContext)& GetAISContext() const;
@@ -79,8 +79,8 @@ class Standard_EXPORT OCC_BaseView : public CView, public AIS_ViewController
7979

8080
public:
8181

82-
virtual BOOL PreCreateWindow (CREATESTRUCT& cs) Standard_OVERRIDE;
83-
virtual void PostNcDestroy() Standard_OVERRIDE;
82+
virtual BOOL PreCreateWindow (CREATESTRUCT& cs) override;
83+
virtual void PostNcDestroy() override;
8484

8585
protected:
8686

@@ -98,8 +98,8 @@ class Standard_EXPORT OCC_BaseView : public CView, public AIS_ViewController
9898
protected:
9999
DECLARE_MESSAGE_MAP()
100100
public:
101-
virtual void OnInitialUpdate() Standard_OVERRIDE;
102-
virtual void OnDraw (CDC* /*pDC*/) Standard_OVERRIDE;
101+
virtual void OnInitialUpdate() override;
102+
virtual void OnDraw (CDC* /*pDC*/) override;
103103
afx_msg void OnSize (UINT nType, int cx, int cy);
104104
afx_msg BOOL OnMouseWheel (UINT theFlags, short theDelta, CPoint thePoint);
105105
afx_msg void OnMouseMove (UINT theFlags, CPoint thePoint);

samples/qt/Common/src/OcctWindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class OcctWindow : public Aspect_Window
7676

7777
virtual void Size( Standard_Integer& theWidth, Standard_Integer& theHeight ) const;
7878

79-
virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; }
79+
virtual Aspect_FBConfig NativeFBConfig() const override { return NULL; }
8080

8181
DEFINE_STANDARD_RTTIEXT(OcctWindow,Aspect_Window)
8282

0 commit comments

Comments
 (0)