]> OCCT Git - occt.git/commitdiff
Coding - Deprecate Handle_* type usage #240
authordpasukhi <dpasukhi@opencascade.com>
Sun, 5 Jan 2025 12:41:34 +0000 (12:41 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Sun, 5 Jan 2025 14:48:27 +0000 (14:48 +0000)
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.

dox/user_guides/draw_test_harness/draw_test_harness.md
dox/user_guides/modeling_algos/modeling_algos.md
src/BRepTest/BRepTest_BasicCommands.cxx
src/PrsMgr/PrsMgr_Presentation3d.hxx
src/PrsMgr/PrsMgr_PresentationManager3d.hxx
src/QANCollection/QANCollection_Handle.cxx
src/Standard/Standard_Handle.hxx
src/Standard/Standard_Transient.hxx
src/Standard/Standard_WarningsDisable.hxx
src/TPrsStd/TPrsStd_AISPresentation.cxx
src/V3d/V3d_Light.hxx

index ea8316fdae79ef1dd76b47521673a8c073b9c681..c1942e30cf759e6ea8751fb63fb19a201585d93d 100644 (file)
@@ -825,7 +825,7 @@ DBRep::Set(char*,B);
 #### In DrawTrSurf package:
  
 ~~~~{.php}
-Handle_Geom_Geometry Get(Standard_CString& Name) ; 
+Handle(Geom_Geometry) Get(Standard_CString& Name) ; 
 ~~~~
 
 #### In DBRep package:
index 450473d44a92c3382aa0ef2146dfe133d389c862..d50f51543b2971e4af16568497a2180555dd2653 100644 (file)
@@ -137,7 +137,7 @@ This class is used to  interpolate a BSplineCurve passing through an array of po
 This class may be  instantiated as follows: 
 ~~~~{.cpp}
 Geom2dAPI_Interpolate 
-(const  Handle_TColgp_HArray1OfPnt2d& Points, 
+(const  Handle(TColgp_HArray1OfPnt2d)& Points, 
 const  Standard_Boolean PeriodicFlag, 
 const Standard_Real  Tolerance); 
 
@@ -165,7 +165,7 @@ Geom2dAPI_Interpolate(Points,
 This class may be  instantiated as follows: 
 ~~~~{.cpp}
 GeomAPI_Interpolate 
-(const  Handle_TColgp_HArray1OfPnt& Points, 
+(const  Handle(TColgp_HArray1OfPnt)& Points, 
 const  Standard_Boolean PeriodicFlag, 
 const Standard_Real  Tolerance); 
 
index ad81d7bc9032da9a427f77f2e42d913b3ff15c9e..412e6bc48b17583feb63499daa3416d91e590338 100644 (file)
@@ -878,7 +878,7 @@ static Standard_Integer gbounding(Draw_Interpretor& di,Standard_Integer n,const
     Standard_Boolean Is3d = Standard_True;
     Handle(Geom_Curve) C;
     Handle(Geom_Surface) S;
-    Handle_Geom2d_Curve C2d;
+    Handle(Geom2d_Curve) C2d;
     S = DrawTrSurf::GetSurface(a[1]);
     if (!S.IsNull())
     {
index 7b82a80a9bf174efbee5eeabd2614317d97bc767..d5eceda430016c01295c0fb10fc73cb02f951350 100644 (file)
@@ -21,6 +21,7 @@
 
 Standard_DEPRECATED("Deprecated alias to PrsMgr_Presentation3d")
 typedef PrsMgr_Presentation PrsMgr_Presentation3d;
+Standard_DEPRECATED("This typedef will be removed right after 7.9 release. Use Handle(T) directly instead.")
 typedef Handle_PrsMgr_Presentation Handle_PrsMgr_Presentation3d;
 
 #endif // _PrsMgr_Presentation3d_HeaderFile
index a79e0ad373a55d22bfca3778f9c9dc292b7dcf7a..3d77a9f7ba8dffb6d3864067f5685c56a5505c5b 100644 (file)
@@ -21,7 +21,9 @@
 
 Standard_DEPRECATED("Deprecated alias to PrsMgr_PresentationManager")
 typedef PrsMgr_PresentationManager PrsMgr_PresentationManager3d;
-Standard_DEPRECATED("Deprecated alias to PrsMgr_PresentationManager")
+#include <Standard_WarningsDisable.hxx>
+Standard_DEPRECATED("This typedef will be removed right after 7.9 release. Use Handle(T) directly instead.")
 typedef Handle_PrsMgr_PresentationManager Handle_PrsMgr_PresentationManager3d;
+#include <Standard_WarningsRestore.hxx>
 
 #endif // _PrsMgr_PresentationManager3d_HeaderFile
index 5ebadba24d96be7d2424e20d215f2831df7bb9b5..ff42ce4f99588bb925b33a782397c914892e7368 100644 (file)
@@ -148,7 +148,7 @@ static Standard_Integer QAHandleOps (Draw_Interpretor& theDI,
   // check operations with Handle_* classes
   Handle(Geom_Line) hLine = aLine;
   CHECK(theDI, ! hLine.IsNull(), "hhandle for non-null");
-
+#include <Standard_WarningsDisable.hxx>
   const Handle_Geom_Line& chLine = aLine; // cast to self const ref
   const Handle_Geom_Curve& chCurve = aLine; // cast to base const ref
   const Handle_Geom_Line& hhLine = hLine; // cast to self const ref
@@ -203,7 +203,7 @@ static Standard_Integer QAHandleOps (Draw_Interpretor& theDI,
 #else
   CHECK(theDI, hTmpRefBase.get() != aCurve2.get(),  "local reference to temporary handle object (Handle_ to base type)");
 #endif
-
+#include <Standard_WarningsRestore.hxx>
   Handle(Geom_Surface) aSurf;
   (void)aSurf;
 
index db2d94319a76996e7c35dad257f891b64b5ffc8b..1f7dba30452a11c12320480e18bcc380a276ccb6 100644 (file)
@@ -415,7 +415,7 @@ namespace std
 //! For compatibility with previous versions of OCCT, define Handle_Class alias for opencascade::handle<Class>.
 #if (defined(_MSC_VER) && _MSC_VER >= 1800) 
 //! For Visual Studio 2013+, define Handle_Class as non-template class to allow exporting this type in C++/CLI.
-#define DEFINE_STANDARD_HANDLECLASS(C1,C2,BC) class C1; class Handle_##C1 : public Handle(C1) \
+#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) \
 { \
 public: \
   Handle_##C1() {} \
@@ -428,7 +428,7 @@ public: \
 };
 #else
 //! For other compilers, use simple typedef
-#define DEFINE_STANDARD_HANDLECLASS(C1,C2,BC) class C1; typedef Handle(C1) Handle_##C1;
+#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;
 #endif
 
 #define DEFINE_STANDARD_HANDLE(C1,C2) DEFINE_STANDARD_HANDLECLASS(C1,C2,Standard_Transient)
index 024c631d2751f630302162dffcab432638c0d146..e0c449a633307462b78268f006e14209ebf3cec9 100644 (file)
@@ -120,6 +120,8 @@ private:
 };
 
 //! Definition of Handle_Standard_Transient as typedef for compatibility
+
+Standard_DEPRECATED("This typedef will be removed right after 7.9 release. Use Handle(T) directly instead.")
 typedef opencascade::handle<Standard_Transient> Handle_Standard_Transient;
 
 #endif 
index 25000d599115f27ff2c1c3ecc0947f2d0fc3e451..883373c3a00cc24f33b1fdd9ac951f40825783ee 100644 (file)
@@ -32,6 +32,7 @@
   #pragma clang diagnostic ignored "-Wall"
   #pragma clang diagnostic ignored "-Wextra"
   #pragma clang diagnostic ignored "-Wshorten-64-to-32"
+  #pragma clang diagnostic ignored "-Wdeprecated-declarations"
 #elif defined(_MSC_VER)
   #pragma warning(push, 0)
 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
index fd36a3cebfebce533e2d8df5a1b4c242c2c1a69c..7225fd5a0e55e94aa35f82ba32bec701d179cefc 100644 (file)
@@ -1010,7 +1010,7 @@ Handle(AIS_InteractiveContext) TPrsStd_AISPresentation::getAISContext() const
   if ( TPrsStd_AISViewer::Find(Label(), aViewer) )
     return aViewer->GetInteractiveContext();
 
-  return Handle_AIS_InteractiveContext();
+  return Handle(AIS_InteractiveContext)();
 }
 
 //=======================================================================
index ac99934b7a4bfdf9ff2dff79e6f250c8496e62b0..8ab674cbd75277356a9e2d6f762627e8d0ba1b56 100644 (file)
@@ -20,6 +20,9 @@
 #include <Graphic3d_CLight.hxx>
 
 typedef Graphic3d_CLight V3d_Light;
+#include <Standard_WarningsDisable.hxx>
+Standard_DEPRECATED("This typedef will be removed right after 7.9 release. Use Handle(T) directly instead.")
 typedef Handle_Graphic3d_CLight Handle_V3d_Light;
+#include <Standard_WarningsRestore.hxx>
 
 #endif // _V3d_Light_HeaderFile