0024023: Revamp the OCCT Handle -- downcast (automatic)
[occt.git] / src / TDataXtd / TDataXtd_Geometry.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 50a8451..a8a1669
@@ -1,9 +1,16 @@
-// File:       TDataXtd_Geometry.cxx
-// Created:    Mon Apr  6 17:51:45 2009
-//             <sergey.zaritchny@opencascade.com>
-//Copyright:    Open CasCade SA 2009
-
-
+// Created on: 2009-04-06
+// Copyright (c) 2009-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 #include <TDataXtd_Geometry.ixx>
 #include <TDataStd.hxx>
@@ -278,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();
@@ -319,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();
@@ -382,7 +389,7 @@ TDataXtd_GeometryEnum  TDataXtd_Geometry::Type (const Handle(TNaming_NamedShape)
        }
        break;
       }
-#ifdef DEB      
+#ifdef OCCT_DEBUG
       else {
        Standard_Failure::Raise("curve Null dans TDataXtd_Geometry");
       }
@@ -394,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;
@@ -403,7 +410,7 @@ TDataXtd_GeometryEnum  TDataXtd_Geometry::Type (const Handle(TNaming_NamedShape)
          type = TDataXtd_PLANE;
        }
       } 
-#ifdef DEB      
+#ifdef OCCT_DEBUG
       else {
        Standard_Failure::Raise("surface Null dans TDataXtd_Geometry");
       }
@@ -487,7 +494,7 @@ void TDataXtd_Geometry::Restore (const Handle(TDF_Attribute)& With)
 //purpose  : 
 //=======================================================================
 
-void TDataXtd_Geometry::Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const { 
+void TDataXtd_Geometry::Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)&) const { 
   Handle(TDataXtd_Geometry)::DownCast(Into)->SetType(myType);
 }