0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / GeomToStep / GeomToStep_MakeElementarySurface.cxx
CommitLineData
b311480e 1// Created on: 1993-06-22
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.
7fd59977 16
42cf5bc1 17
7fd59977 18#include <Geom_ConicalSurface.hxx>
42cf5bc1 19#include <Geom_CylindricalSurface.hxx>
20#include <Geom_ElementarySurface.hxx>
21#include <Geom_Plane.hxx>
7fd59977 22#include <Geom_SphericalSurface.hxx>
23#include <Geom_ToroidalSurface.hxx>
7fd59977 24#include <GeomToStep_MakeConicalSurface.hxx>
42cf5bc1 25#include <GeomToStep_MakeCylindricalSurface.hxx>
26#include <GeomToStep_MakeElementarySurface.hxx>
27#include <GeomToStep_MakePlane.hxx>
7fd59977 28#include <GeomToStep_MakeSphericalSurface.hxx>
29#include <GeomToStep_MakeToroidalSurface.hxx>
42cf5bc1 30#include <StdFail_NotDone.hxx>
31#include <StepGeom_ConicalSurface.hxx>
32#include <StepGeom_CylindricalSurface.hxx>
33#include <StepGeom_ElementarySurface.hxx>
34#include <StepGeom_Plane.hxx>
35#include <StepGeom_SphericalSurface.hxx>
36#include <StepGeom_ToroidalSurface.hxx>
7fd59977 37
38//=============================================================================
39// Creation d' une ElementarySurface de prostep a partir d' une
40// ElementarySurface de Geom
41//=============================================================================
7fd59977 42GeomToStep_MakeElementarySurface::GeomToStep_MakeElementarySurface
43 ( const Handle(Geom_ElementarySurface)& S)
44{
45 done = Standard_True;
46 if (S->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
47 Handle(Geom_CylindricalSurface) Sur =
48 Handle(Geom_CylindricalSurface)::DownCast(S);
49 GeomToStep_MakeCylindricalSurface MkCylindrical(Sur);
50 theElementarySurface = MkCylindrical.Value();
51 }
52 else if (S->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) {
53 Handle(Geom_ConicalSurface) Sur =
54 Handle(Geom_ConicalSurface)::DownCast(S);
55 GeomToStep_MakeConicalSurface MkConical(Sur);
56 theElementarySurface = MkConical.Value();
57 }
58 else if (S->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) {
59 Handle(Geom_SphericalSurface) Sur =
60 Handle(Geom_SphericalSurface)::DownCast(S);
61 GeomToStep_MakeSphericalSurface MkSpherical(Sur);
62 theElementarySurface = MkSpherical.Value();
63 }
64 else if (S->IsKind(STANDARD_TYPE(Geom_ToroidalSurface))) {
65 Handle(Geom_ToroidalSurface) Sur =
66 Handle(Geom_ToroidalSurface)::DownCast(S);
67 GeomToStep_MakeToroidalSurface MkToroidal(Sur);
68 theElementarySurface = MkToroidal.Value();
69 }
70 else if (S->IsKind(STANDARD_TYPE(Geom_Plane))) {
71 Handle(Geom_Plane) Sur = Handle(Geom_Plane)::DownCast(S);
72 GeomToStep_MakePlane MkPlane(Sur);
73 theElementarySurface = MkPlane.Value();
74 }
75 else
76 done = Standard_False;
77}
78
79
80//=============================================================================
81// renvoi des valeurs
82//=============================================================================
83
84const Handle(StepGeom_ElementarySurface) &
85 GeomToStep_MakeElementarySurface::Value() const
86{
2d2b3d53 87 StdFail_NotDone_Raise_if (!done, "GeomToStep_MakeElementarySurface::Value() - no result");
7fd59977 88 return theElementarySurface;
89}