0024734: Convertation of the generic classes to the non-generic. Part 4
[occt.git] / src / BRepPrimAPI / BRepPrimAPI_MakeOneAxis.cxx
1 // Created on: 1993-07-23
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <BRepPrimAPI_MakeOneAxis.ixx>
18 #include <BRepBuilderAPI.hxx>
19 #include <BRepPrim_OneAxis.hxx>
20 #include <TopoDS.hxx>
21
22 //=======================================================================
23 //function : Face
24 //purpose  : 
25 //=======================================================================
26
27 const TopoDS_Face&  BRepPrimAPI_MakeOneAxis::Face()
28 {
29   Build();
30   return ((BRepPrim_OneAxis*) OneAxis())->LateralFace();
31 }
32
33
34 //=======================================================================
35 //function : Shell
36 //purpose  : 
37 //=======================================================================
38
39 const TopoDS_Shell&  BRepPrimAPI_MakeOneAxis::Shell()
40 {
41   Build();
42   return ((BRepPrim_OneAxis*) OneAxis())->Shell();
43 }
44
45 //=======================================================================
46 //function : Build
47 //purpose  : 
48 //=======================================================================
49
50 void BRepPrimAPI_MakeOneAxis::Build()
51 {
52   BRep_Builder B;
53   B.MakeSolid(TopoDS::Solid(myShape));
54   B.Add(myShape,((BRepPrim_OneAxis*) OneAxis())->Shell());
55   myShape.Closed(Standard_True);
56   Done();
57 }
58
59 //=======================================================================
60 //function : Solid
61 //purpose  : 
62 //=======================================================================
63
64 const TopoDS_Solid&  BRepPrimAPI_MakeOneAxis::Solid()
65 {
66   Build();
67   return TopoDS::Solid(myShape);
68 }
69
70
71
72 //=======================================================================
73 //function : operator
74 //purpose  : 
75 //=======================================================================
76
77 BRepPrimAPI_MakeOneAxis::operator TopoDS_Face()
78 {
79   return Face();
80 }
81
82 //=======================================================================
83 //function : operator
84 //purpose  : 
85 //=======================================================================
86
87 BRepPrimAPI_MakeOneAxis::operator TopoDS_Shell()
88 {
89   return Shell();
90 }
91
92
93 //=======================================================================
94 //function : operator
95 //purpose  : 
96 //=======================================================================
97
98 BRepPrimAPI_MakeOneAxis::operator TopoDS_Solid()
99 {
100   return Solid();
101 }
102