mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024023: Revamp the OCCT Handle -- downcast (automatic)
Automatic update by command "occt_upgrade . -downcast" C-style cast of Handle to that of derived type (now illegal) is replaced by call to DownCast() Const reference local variables of Handle type initialized by result of DownCast are replaced by normal variables.
This commit is contained in:
@@ -212,7 +212,7 @@ void TDataXtd_Constraint::SetPlane(const Handle(TNaming_NamedShape)& plane)
|
||||
//=======================================================================
|
||||
const Handle(TNaming_NamedShape)& TDataXtd_Constraint::GetPlane() const
|
||||
{
|
||||
return (Handle(TNaming_NamedShape)&) myPlane;
|
||||
return Handle(TNaming_NamedShape)::DownCast (myPlane);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -285,7 +285,7 @@ Standard_Boolean TDataXtd_Geometry::Plane(const Handle(TNaming_NamedShape)& NS,
|
||||
Handle(Geom_Surface) surface = BRep_Tool::Surface (face);
|
||||
if (!surface.IsNull()) {
|
||||
if (surface->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
|
||||
surface = ((Handle(Geom_RectangularTrimmedSurface)&) surface)->BasisSurface();
|
||||
surface = Handle(Geom_RectangularTrimmedSurface)::DownCast (surface)->BasisSurface();
|
||||
Handle(Geom_Plane) S = Handle(Geom_Plane)::DownCast(surface);
|
||||
if (!S.IsNull()) {
|
||||
G = S->Pln();
|
||||
@@ -326,7 +326,7 @@ Standard_Boolean TDataXtd_Geometry::Cylinder(const Handle(TNaming_NamedShape)& N
|
||||
Handle(Geom_Surface) surface = BRep_Tool::Surface (face);
|
||||
if (!surface.IsNull()) {
|
||||
if (surface->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
|
||||
surface = ((Handle(Geom_RectangularTrimmedSurface)&) surface)->BasisSurface();
|
||||
surface = Handle(Geom_RectangularTrimmedSurface)::DownCast (surface)->BasisSurface();
|
||||
Handle(Geom_CylindricalSurface) S = Handle(Geom_CylindricalSurface)::DownCast(surface);
|
||||
if (!S.IsNull()) {
|
||||
G = S->Cylinder();
|
||||
@@ -401,7 +401,7 @@ TDataXtd_GeometryEnum TDataXtd_Geometry::Type (const Handle(TNaming_NamedShape)
|
||||
Handle(Geom_Surface) surface = BRep_Tool::Surface (face);
|
||||
if (!surface.IsNull()) {
|
||||
if (surface->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
|
||||
surface = ((Handle(Geom_RectangularTrimmedSurface)&) surface)->BasisSurface();
|
||||
surface = Handle(Geom_RectangularTrimmedSurface)::DownCast (surface)->BasisSurface();
|
||||
}
|
||||
if (surface->IsInstance(STANDARD_TYPE(Geom_CylindricalSurface))) {
|
||||
type = TDataXtd_CYLINDER;
|
||||
|
Reference in New Issue
Block a user