1 // File: GeomToStep_MakeElementarySurface.cxx
2 // Created: Tue Jun 22 14:28:02 1993
3 // Author: Martine LANGLOIS
6 #include <GeomToStep_MakeElementarySurface.ixx>
7 #include <StdFail_NotDone.hxx>
8 #include <StepGeom_ElementarySurface.hxx>
9 #include <GeomToStep_MakeElementarySurface.hxx>
10 #include <Geom_CylindricalSurface.hxx>
11 #include <Geom_ConicalSurface.hxx>
12 #include <Geom_SphericalSurface.hxx>
13 #include <Geom_ToroidalSurface.hxx>
14 #include <Geom_Plane.hxx>
15 #include <GeomToStep_MakeCylindricalSurface.hxx>
16 #include <GeomToStep_MakeConicalSurface.hxx>
17 #include <GeomToStep_MakeSphericalSurface.hxx>
18 #include <GeomToStep_MakeToroidalSurface.hxx>
19 #include <GeomToStep_MakePlane.hxx>
21 //=============================================================================
22 // Creation d' une ElementarySurface de prostep a partir d' une
23 // ElementarySurface de Geom
24 //=============================================================================
26 GeomToStep_MakeElementarySurface::GeomToStep_MakeElementarySurface
27 ( const Handle(Geom_ElementarySurface)& S)
30 if (S->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
31 Handle(Geom_CylindricalSurface) Sur =
32 Handle(Geom_CylindricalSurface)::DownCast(S);
33 GeomToStep_MakeCylindricalSurface MkCylindrical(Sur);
34 theElementarySurface = MkCylindrical.Value();
36 else if (S->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) {
37 Handle(Geom_ConicalSurface) Sur =
38 Handle(Geom_ConicalSurface)::DownCast(S);
39 GeomToStep_MakeConicalSurface MkConical(Sur);
40 theElementarySurface = MkConical.Value();
42 else if (S->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) {
43 Handle(Geom_SphericalSurface) Sur =
44 Handle(Geom_SphericalSurface)::DownCast(S);
45 GeomToStep_MakeSphericalSurface MkSpherical(Sur);
46 theElementarySurface = MkSpherical.Value();
48 else if (S->IsKind(STANDARD_TYPE(Geom_ToroidalSurface))) {
49 Handle(Geom_ToroidalSurface) Sur =
50 Handle(Geom_ToroidalSurface)::DownCast(S);
51 GeomToStep_MakeToroidalSurface MkToroidal(Sur);
52 theElementarySurface = MkToroidal.Value();
54 else if (S->IsKind(STANDARD_TYPE(Geom_Plane))) {
55 Handle(Geom_Plane) Sur = Handle(Geom_Plane)::DownCast(S);
56 GeomToStep_MakePlane MkPlane(Sur);
57 theElementarySurface = MkPlane.Value();
60 done = Standard_False;
64 //=============================================================================
66 //=============================================================================
68 const Handle(StepGeom_ElementarySurface) &
69 GeomToStep_MakeElementarySurface::Value() const
71 StdFail_NotDone_Raise_if(!done == Standard_True,"");
72 return theElementarySurface;