0024023: Revamp the OCCT Handle -- downcast (automatic)
[occt.git] / src / StepToGeom / StepToGeom_MakeElementarySurface.cxx
CommitLineData
b311480e 1// Created on: 1993-07-02
2// Created by: Martine LANGLOIS
3// Copyright (c) 1993-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
b311480e 16
7fd59977 17//:p0 abv 19.02.99: management of 'done' flag improved
18
19#include <StepToGeom_MakeElementarySurface.ixx>
20#include <StepGeom_ElementarySurface.hxx>
21#include <StepGeom_CylindricalSurface.hxx>
22#include <StepGeom_ConicalSurface.hxx>
23#include <StepGeom_SphericalSurface.hxx>
24#include <StepGeom_ToroidalSurface.hxx>
25#include <StepGeom_Plane.hxx>
26#include <StepToGeom_MakeCylindricalSurface.hxx>
27#include <StepToGeom_MakeConicalSurface.hxx>
28#include <StepToGeom_MakeSphericalSurface.hxx>
29#include <StepToGeom_MakeToroidalSurface.hxx>
30#include <StepToGeom_MakePlane.hxx>
31
32//=============================================================================
33// Creation d' une ElementarySurface de Geom a partir d' une
34// ElementarySurface de Step
35//=============================================================================
36
37Standard_Boolean StepToGeom_MakeElementarySurface::Convert (const Handle(StepGeom_ElementarySurface)& SS, Handle(Geom_ElementarySurface)& CS)
38{
39 if (SS->IsKind(STANDARD_TYPE(StepGeom_Plane))) {
40 const Handle(StepGeom_Plane) Sur = Handle(StepGeom_Plane)::DownCast(SS);
c5f3a425 41 return StepToGeom_MakePlane::Convert(Sur,Handle(Geom_Plane)::DownCast (CS));
7fd59977 42 }
43 if (SS->IsKind(STANDARD_TYPE(StepGeom_CylindricalSurface))) {
44 const Handle(StepGeom_CylindricalSurface) Sur = Handle(StepGeom_CylindricalSurface)::DownCast(SS);
c5f3a425 45 return StepToGeom_MakeCylindricalSurface::Convert(Sur,Handle(Geom_CylindricalSurface)::DownCast (CS));
7fd59977 46 }
47 if (SS->IsKind(STANDARD_TYPE(StepGeom_ConicalSurface))) {
48 const Handle(StepGeom_ConicalSurface) Sur = Handle(StepGeom_ConicalSurface)::DownCast(SS);
c5f3a425 49 return StepToGeom_MakeConicalSurface::Convert(Sur,Handle(Geom_ConicalSurface)::DownCast (CS));
7fd59977 50 }
51 if (SS->IsKind(STANDARD_TYPE(StepGeom_SphericalSurface))) {
52 const Handle(StepGeom_SphericalSurface) Sur = Handle(StepGeom_SphericalSurface)::DownCast(SS);
c5f3a425 53 return StepToGeom_MakeSphericalSurface::Convert(Sur,Handle(Geom_SphericalSurface)::DownCast (CS));
7fd59977 54 }
55 if (SS->IsKind(STANDARD_TYPE(StepGeom_ToroidalSurface))) {
56 const Handle(StepGeom_ToroidalSurface) Sur = Handle(StepGeom_ToroidalSurface)::DownCast(SS);
c5f3a425 57 return StepToGeom_MakeToroidalSurface::Convert(Sur,Handle(Geom_ToroidalSurface)::DownCast (CS));
7fd59977 58 }
59 return Standard_False;
60}