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_SurfaceOfLinearExtrusion.hxx> |
19 | #include <Geom_SurfaceOfRevolution.hxx> |
42cf5bc1 |
20 | #include <Geom_SweptSurface.hxx> |
7fd59977 |
21 | #include <GeomToStep_MakeSurfaceOfLinearExtrusion.hxx> |
22 | #include <GeomToStep_MakeSurfaceOfRevolution.hxx> |
42cf5bc1 |
23 | #include <GeomToStep_MakeSweptSurface.hxx> |
24 | #include <StdFail_NotDone.hxx> |
25 | #include <StepGeom_SurfaceOfLinearExtrusion.hxx> |
26 | #include <StepGeom_SurfaceOfRevolution.hxx> |
27 | #include <StepGeom_SweptSurface.hxx> |
7fd59977 |
28 | #include <TCollection_HAsciiString.hxx> |
29 | |
30 | //============================================================================= |
31 | // Creation d' une SweptSurface de prostep a partir d' une |
32 | // SweptSurface de Geom |
33 | //============================================================================= |
7fd59977 |
34 | GeomToStep_MakeSweptSurface::GeomToStep_MakeSweptSurface |
35 | ( const Handle(Geom_SweptSurface)& S) |
36 | { |
37 | done = Standard_True; |
38 | if (S->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))) { |
39 | Handle(Geom_SurfaceOfLinearExtrusion) Sur = |
40 | Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(S); |
41 | GeomToStep_MakeSurfaceOfLinearExtrusion MkLinear(Sur); |
42 | theSweptSurface = MkLinear.Value(); |
43 | } |
44 | else if (S->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) { |
45 | Handle(Geom_SurfaceOfRevolution) Sur = |
46 | Handle(Geom_SurfaceOfRevolution)::DownCast(S); |
47 | GeomToStep_MakeSurfaceOfRevolution MkRevol(Sur); |
48 | theSweptSurface = MkRevol.Value(); |
49 | } |
50 | else |
51 | done = Standard_False; |
52 | } |
53 | |
54 | |
55 | //============================================================================= |
56 | // renvoi des valeurs |
57 | //============================================================================= |
58 | |
59 | const Handle(StepGeom_SweptSurface) & |
60 | GeomToStep_MakeSweptSurface::Value() const |
61 | { |
2d2b3d53 |
62 | StdFail_NotDone_Raise_if (!done, "GeomToStep_MakeSweptSurface::Value() - no result"); |
7fd59977 |
63 | return theSweptSurface; |
64 | } |