1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024816: Tool for upgrading OCCT and dependent code

A new script adm/upgrade.tcl defines a Tcl procedure occt_upgrade, to be used for upgrading code of OCCT and applications for changes introduced by OCCT 7.0.
Batch script upgrade.bat is provided for convenience.
File upgrade.dat contains data (lists of classes) required for some upgrade steps.
Details on upgrade procedure are put in dox/dev_guides/upgrade/upgrade.md.

OCCT code corrected to improve compatibility with code based on previous versions of OCCT:
- Added conversion operator of handle to bool, for use in conditional expressions.
- Forward declaration of argument class restored in macro DEFINE_STANDARD_HANDLE.
- Includes of used classes added in some headers to avoid problem of missing includes in dependent code
- Type cast operators to base curve and surface added in GC and GCE2d classes to reduce porting issues.

Added test for local reference to handle initialized by temporary handle to derived class.

WOK and CDL User Guides removed.
This commit is contained in:
abv
2015-08-19 18:51:52 +03:00
parent 39bff09c9f
commit d1a67b9d1b
84 changed files with 2902 additions and 5856 deletions

View File

@@ -22,10 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class Geom_TrimmedCurve;
class StdFail_NotDone;
#include <Geom_TrimmedCurve.hxx>
class gp_Circ;
class gp_Pnt;
class gp_Vec;
@@ -88,30 +86,12 @@ public:
//! Returns the constructed arc of circle.
//! Exceptions StdFail_NotDone if no arc of circle is constructed.
Standard_EXPORT const Handle(Geom_TrimmedCurve)& Value() const;
operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
protected:
operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
operator const Handle(Geom_Curve)& () const { return Value(); }
private:
Handle(Geom_TrimmedCurve) TheArc;
};
#endif // _GC_MakeArcOfCircle_HeaderFile

View File

@@ -22,9 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class Geom_TrimmedCurve;
#include <Geom_TrimmedCurve.hxx>
class StdFail_NotDone;
class gp_Elips;
class gp_Pnt;
@@ -65,30 +64,12 @@ public:
//! Returns the constructed arc of ellipse.
Standard_EXPORT const Handle(Geom_TrimmedCurve)& Value() const;
operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
protected:
operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
operator const Handle(Geom_Curve)& () const { return Value(); }
private:
Handle(Geom_TrimmedCurve) TheArc;
};
#endif // _GC_MakeArcOfEllipse_HeaderFile

View File

@@ -22,9 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class Geom_TrimmedCurve;
#include <Geom_TrimmedCurve.hxx>
class StdFail_NotDone;
class gp_Hypr;
class gp_Pnt;
@@ -63,30 +62,13 @@ public:
//! Returns the constructed arc of hyperbola.
Standard_EXPORT const Handle(Geom_TrimmedCurve)& Value() const;
operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
protected:
operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
operator const Handle(Geom_Curve)& () const { return Value(); }
private:
Handle(Geom_TrimmedCurve) TheArc;
};
#endif // _GC_MakeArcOfHyperbola_HeaderFile

View File

@@ -22,9 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class Geom_TrimmedCurve;
#include <Geom_TrimmedCurve.hxx>
class StdFail_NotDone;
class gp_Parab;
class gp_Pnt;
@@ -60,30 +59,12 @@ public:
//! Returns the constructed arc of parabola.
Standard_EXPORT const Handle(Geom_TrimmedCurve)& Value() const;
operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
protected:
operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
operator const Handle(Geom_Curve)& () const { return Value(); }
private:
Handle(Geom_TrimmedCurve) TheArc;
};
#endif // _GC_MakeArcOfParabola_HeaderFile

View File

@@ -22,8 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
class Geom_Circle;
#include <Geom_Circle.hxx>
class StdFail_NotDone;
class gp_Circ;
class gp_Ax2;
@@ -99,30 +99,12 @@ public:
//! Exceptions
//! StdFail_NotDone if no circle is constructed.
Standard_EXPORT const Handle(Geom_Circle)& Value() const;
operator const Handle(Geom_Circle)& () const { return Value(); }
protected:
operator const Handle(Geom_Circle)& () const { return Value(); }
operator const Handle(Geom_Curve)& () const { return Value(); }
private:
Handle(Geom_Circle) TheCircle;
};
#endif // _GC_MakeCircle_HeaderFile

View File

@@ -22,8 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
class Geom_ConicalSurface;
#include <Geom_ConicalSurface.hxx>
class StdFail_NotDone;
class gp_Ax2;
class gp_Cone;
@@ -123,30 +123,12 @@ public:
//! Exceptions
//! StdFail_NotDone if no cone is constructed.
Standard_EXPORT const Handle(Geom_ConicalSurface)& Value() const;
operator const Handle(Geom_ConicalSurface)& () const { return Value(); }
protected:
operator const Handle(Geom_ConicalSurface)& () const { return Value(); }
operator const Handle(Geom_Surface)& () const { return Value(); }
private:
Handle(Geom_ConicalSurface) TheCone;
};
#endif // _GC_MakeConicalSurface_HeaderFile

View File

@@ -22,8 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
class Geom_CylindricalSurface;
#include <Geom_CylindricalSurface.hxx>
class StdFail_NotDone;
class gp_Ax2;
class gp_Cylinder;
@@ -111,30 +111,12 @@ public:
//! Returns the constructed cylinder.
//! Exceptions StdFail_NotDone if no cylinder is constructed.
Standard_EXPORT const Handle(Geom_CylindricalSurface)& Value() const;
operator const Handle(Geom_CylindricalSurface)& () const { return Value(); }
protected:
operator const Handle(Geom_CylindricalSurface)& () const { return Value(); }
operator const Handle(Geom_Surface)& () const { return Value(); }
private:
Handle(Geom_CylindricalSurface) TheCylinder;
};
#endif // _GC_MakeCylindricalSurface_HeaderFile

View File

@@ -22,8 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
class Geom_Ellipse;
#include <Geom_Ellipse.hxx>
class StdFail_NotDone;
class gp_Elips;
class gp_Ax2;
@@ -77,30 +77,12 @@ public:
//! Returns the constructed ellipse.
//! Exceptions StdFail_NotDone if no ellipse is constructed.
Standard_EXPORT const Handle(Geom_Ellipse)& Value() const;
operator const Handle(Geom_Ellipse)& () const { return Value(); }
protected:
operator const Handle(Geom_Ellipse)& () const { return Value(); }
operator const Handle(Geom_Curve)& () const { return Value(); }
private:
Handle(Geom_Ellipse) TheEllipse;
};
#endif // _GC_MakeEllipse_HeaderFile

View File

@@ -22,8 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
class Geom_Hyperbola;
#include <Geom_Hyperbola.hxx>
class StdFail_NotDone;
class gp_Hypr;
class gp_Ax2;
@@ -87,30 +87,12 @@ public:
//! Returns the constructed hyperbola.
//! Exceptions StdFail_NotDone if no hyperbola is constructed.
Standard_EXPORT const Handle(Geom_Hyperbola)& Value() const;
operator const Handle(Geom_Hyperbola)& () const { return Value(); }
protected:
operator const Handle(Geom_Hyperbola)& () const { return Value(); }
operator const Handle(Geom_Curve)& () const { return Value(); }
private:
Handle(Geom_Hyperbola) TheHyperbola;
};
#endif // _GC_MakeHyperbola_HeaderFile

View File

@@ -22,7 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
class Geom_Line;
#include <Geom_Line.hxx>
class StdFail_NotDone;
class gp_Ax1;
class gp_Lin;
@@ -75,30 +76,12 @@ public:
//! Returns the constructed line.
//! Exceptions StdFail_NotDone if no line is constructed.
Standard_EXPORT const Handle(Geom_Line)& Value() const;
operator const Handle(Geom_Line)& () const { return Value(); }
protected:
operator const Handle(Geom_Line)& () const { return Value(); }
operator const Handle(Geom_Curve)& () const { return Value(); }
private:
Handle(Geom_Line) TheLine;
};
#endif // _GC_MakeLine_HeaderFile

View File

@@ -22,8 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
class Geom_Plane;
#include <Geom_Plane.hxx>
class StdFail_NotDone;
class gp_Ax2;
class gp_Pln;
@@ -100,30 +100,12 @@ public:
//! Returns the constructed plane.
//! Exceptions StdFail_NotDone if no plane is constructed.
Standard_EXPORT const Handle(Geom_Plane)& Value() const;
operator const Handle(Geom_Plane)& () const { return Value(); }
protected:
operator const Handle(Geom_Plane)& () const { return Value(); }
operator const Handle(Geom_Surface)& () const { return Value(); }
private:
Handle(Geom_Plane) ThePlane;
};
#endif // _GC_MakePlane_HeaderFile

View File

@@ -22,8 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
class Geom_TrimmedCurve;
#include <Geom_TrimmedCurve.hxx>
class StdFail_NotDone;
class gp_Pnt;
class gp_Lin;
@@ -66,30 +66,12 @@ public:
//! Returns the constructed line segment.
Standard_EXPORT const Handle(Geom_TrimmedCurve)& Value() const;
operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
protected:
operator const Handle(Geom_TrimmedCurve)& () const { return Value(); }
operator const Handle(Geom_Curve)& () const { return Value(); }
private:
Handle(Geom_TrimmedCurve) TheSegment;
};
#endif // _GC_MakeSegment_HeaderFile

View File

@@ -22,8 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
class Geom_RectangularTrimmedSurface;
#include <Geom_RectangularTrimmedSurface.hxx>
class StdFail_NotDone;
class gp_Pnt;
@@ -75,30 +75,12 @@ public:
//! Returns the constructed trimmed cone.
//! StdFail_NotDone if no trimmed cone is constructed.
Standard_EXPORT const Handle(Geom_RectangularTrimmedSurface)& Value() const;
operator const Handle(Geom_RectangularTrimmedSurface)& () const { return Value(); }
protected:
operator const Handle(Geom_RectangularTrimmedSurface)& () const { return Value(); }
operator const Handle(Geom_Surface)& () const { return Value(); }
private:
Handle(Geom_RectangularTrimmedSurface) TheCone;
};
#endif // _GC_MakeTrimmedCone_HeaderFile

View File

@@ -22,8 +22,8 @@
#include <Standard_Handle.hxx>
#include <GC_Root.hxx>
#include <Standard_Real.hxx>
class Geom_RectangularTrimmedSurface;
#include <Geom_RectangularTrimmedSurface.hxx>
class StdFail_NotDone;
class gp_Pnt;
class gp_Circ;
@@ -93,30 +93,12 @@ public:
//! Exceptions
//! StdFail_NotDone if no trimmed cylinder is constructed.
Standard_EXPORT const Handle(Geom_RectangularTrimmedSurface)& Value() const;
operator const Handle(Geom_RectangularTrimmedSurface)& () const { return Value(); }
protected:
operator const Handle(Geom_RectangularTrimmedSurface)& () const { return Value(); }
operator const Handle(Geom_Surface)& () const { return Value(); }
private:
Handle(Geom_RectangularTrimmedSurface) TheCyl;
};
#endif // _GC_MakeTrimmedCylinder_HeaderFile