Skip to content

Commit 3d6c211

Browse files
committed
Coding - Deprecate Handle_* type usage #240
Handle_* require special processing in Windows and it is already not needed for VS15+ In 7.9 dev will be reorginized to use typedef even for MSVC. In 8.0 will be fully removed.
1 parent 9687f73 commit 3d6c211

File tree

11 files changed

+19
-10
lines changed

11 files changed

+19
-10
lines changed

dox/user_guides/draw_test_harness/draw_test_harness.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ DBRep::Set(char*,B);
825825
#### In DrawTrSurf package:
826826

827827
~~~~{.php}
828-
Handle_Geom_Geometry Get(Standard_CString& Name) ;
828+
Handle(Geom_Geometry) Get(Standard_CString& Name) ;
829829
~~~~
830830

831831
#### In DBRep package:

dox/user_guides/modeling_algos/modeling_algos.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ This class is used to interpolate a BSplineCurve passing through an array of po
137137
This class may be instantiated as follows:
138138
~~~~{.cpp}
139139
Geom2dAPI_Interpolate
140-
(const Handle_TColgp_HArray1OfPnt2d& Points,
140+
(const Handle(TColgp_HArray1OfPnt2d)& Points,
141141
const Standard_Boolean PeriodicFlag,
142142
const Standard_Real Tolerance);
143143
@@ -165,7 +165,7 @@ Geom2dAPI_Interpolate(Points,
165165
This class may be instantiated as follows:
166166
~~~~{.cpp}
167167
GeomAPI_Interpolate
168-
(const Handle_TColgp_HArray1OfPnt& Points,
168+
(const Handle(TColgp_HArray1OfPnt)& Points,
169169
const Standard_Boolean PeriodicFlag,
170170
const Standard_Real Tolerance);
171171

src/BRepTest/BRepTest_BasicCommands.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ static Standard_Integer gbounding(Draw_Interpretor& di,Standard_Integer n,const
878878
Standard_Boolean Is3d = Standard_True;
879879
Handle(Geom_Curve) C;
880880
Handle(Geom_Surface) S;
881-
Handle_Geom2d_Curve C2d;
881+
Handle(Geom2d_Curve) C2d;
882882
S = DrawTrSurf::GetSurface(a[1]);
883883
if (!S.IsNull())
884884
{

src/PrsMgr/PrsMgr_Presentation3d.hxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
Standard_DEPRECATED("Deprecated alias to PrsMgr_Presentation3d")
2323
typedef PrsMgr_Presentation PrsMgr_Presentation3d;
24+
Standard_DEPRECATED("This typedef will be removed right after 7.9 release. Use Handle(T) directly instead.")
2425
typedef Handle_PrsMgr_Presentation Handle_PrsMgr_Presentation3d;
2526

2627
#endif // _PrsMgr_Presentation3d_HeaderFile

src/PrsMgr/PrsMgr_PresentationManager3d.hxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121

2222
Standard_DEPRECATED("Deprecated alias to PrsMgr_PresentationManager")
2323
typedef PrsMgr_PresentationManager PrsMgr_PresentationManager3d;
24-
Standard_DEPRECATED("Deprecated alias to PrsMgr_PresentationManager")
24+
#include <Standard_WarningsDisable.hxx>
25+
Standard_DEPRECATED("This typedef will be removed right after 7.9 release. Use Handle(T) directly instead.")
2526
typedef Handle_PrsMgr_PresentationManager Handle_PrsMgr_PresentationManager3d;
27+
#include <Standard_WarningsRestore.hxx>
2628

2729
#endif // _PrsMgr_PresentationManager3d_HeaderFile

src/QANCollection/QANCollection_Handle.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static Standard_Integer QAHandleOps (Draw_Interpretor& theDI,
148148
// check operations with Handle_* classes
149149
Handle(Geom_Line) hLine = aLine;
150150
CHECK(theDI, ! hLine.IsNull(), "hhandle for non-null");
151-
151+
#include <Standard_WarningsDisable.hxx>
152152
const Handle_Geom_Line& chLine = aLine; // cast to self const ref
153153
const Handle_Geom_Curve& chCurve = aLine; // cast to base const ref
154154
const Handle_Geom_Line& hhLine = hLine; // cast to self const ref
@@ -203,7 +203,7 @@ static Standard_Integer QAHandleOps (Draw_Interpretor& theDI,
203203
#else
204204
CHECK(theDI, hTmpRefBase.get() != aCurve2.get(), "local reference to temporary handle object (Handle_ to base type)");
205205
#endif
206-
206+
#include <Standard_WarningsRestore.hxx>
207207
Handle(Geom_Surface) aSurf;
208208
(void)aSurf;
209209

src/Standard/Standard_Handle.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ namespace std
415415
//! For compatibility with previous versions of OCCT, define Handle_Class alias for opencascade::handle<Class>.
416416
#if (defined(_MSC_VER) && _MSC_VER >= 1800)
417417
//! For Visual Studio 2013+, define Handle_Class as non-template class to allow exporting this type in C++/CLI.
418-
#define DEFINE_STANDARD_HANDLECLASS(C1,C2,BC) class C1; class Handle_##C1 : public Handle(C1) \
418+
#define DEFINE_STANDARD_HANDLECLASS(C1,C2,BC) class C1; class Standard_DEPRECATED("This class will be removed right after 7.9 release. Use Handle(T) directly instead.") Handle_##C1 : public Handle(C1) \
419419
{ \
420420
public: \
421421
Handle_##C1() {} \
@@ -428,7 +428,7 @@ public: \
428428
};
429429
#else
430430
//! For other compilers, use simple typedef
431-
#define DEFINE_STANDARD_HANDLECLASS(C1,C2,BC) class C1; typedef Handle(C1) Handle_##C1;
431+
#define DEFINE_STANDARD_HANDLECLASS(C1,C2,BC) class C1; Standard_DEPRECATED("This typedef will be removed right after 7.9 release. Use Handle(T) directly instead.") typedef Handle(C1) Handle_##C1;
432432
#endif
433433

434434
#define DEFINE_STANDARD_HANDLE(C1,C2) DEFINE_STANDARD_HANDLECLASS(C1,C2,Standard_Transient)

src/Standard/Standard_Transient.hxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ private:
120120
};
121121

122122
//! Definition of Handle_Standard_Transient as typedef for compatibility
123+
124+
Standard_DEPRECATED("This typedef will be removed right after 7.9 release. Use Handle(T) directly instead.")
123125
typedef opencascade::handle<Standard_Transient> Handle_Standard_Transient;
124126

125127
#endif

src/Standard/Standard_WarningsDisable.hxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#pragma clang diagnostic ignored "-Wall"
3333
#pragma clang diagnostic ignored "-Wextra"
3434
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
35+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
3536
#elif defined(_MSC_VER)
3637
#pragma warning(push, 0)
3738
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))

src/TPrsStd/TPrsStd_AISPresentation.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ Handle(AIS_InteractiveContext) TPrsStd_AISPresentation::getAISContext() const
10101010
if ( TPrsStd_AISViewer::Find(Label(), aViewer) )
10111011
return aViewer->GetInteractiveContext();
10121012

1013-
return Handle_AIS_InteractiveContext();
1013+
return Handle(AIS_InteractiveContext)();
10141014
}
10151015

10161016
//=======================================================================

0 commit comments

Comments
 (0)