Warnings on vc14 were eliminated
[occt.git] / src / BRepPrimAPI / BRepPrimAPI_MakePrism.cxx
1 // Created on: 1993-10-14
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 // Modified by skv - Fri Mar  4 15:50:09 2005
18 // Add methods for supporting history.
19
20 #include <BRepLib.hxx>
21 #include <BRepPrimAPI_MakePrism.hxx>
22 #include <BRepSweep_Prism.hxx>
23 #include <gp_Dir.hxx>
24 #include <gp_Vec.hxx>
25 #include <TopoDS_Shape.hxx>
26
27 // perform checks on the argument
28 static const TopoDS_Shape& check(const TopoDS_Shape& S)
29 {
30  BRepLib::BuildCurves3d(S);
31    return S;
32 }
33
34 //=======================================================================
35 //function : BRepPrimAPI_MakePrism
36 //purpose  : 
37 //=======================================================================
38
39 BRepPrimAPI_MakePrism::BRepPrimAPI_MakePrism(const TopoDS_Shape& S,
40                                      const gp_Vec& V, 
41                                      const Standard_Boolean Copy,
42                                      const Standard_Boolean Canonize) :
43        myPrism(check(S),V,Copy,Canonize)
44 {
45   Build();
46 }
47
48
49 //=======================================================================
50 //function : BRepPrimAPI_MakePrism
51 //purpose  : 
52 //=======================================================================
53
54 BRepPrimAPI_MakePrism::BRepPrimAPI_MakePrism(const TopoDS_Shape& S, 
55                                      const gp_Dir& D,
56                                      const Standard_Boolean Inf, 
57                                      const Standard_Boolean Copy,
58                                      const Standard_Boolean Canonize) :
59        myPrism(check(S),D,Inf,Copy,Canonize)
60 {
61   Build();
62 }
63
64
65 //=======================================================================
66 //function : Prism
67 //purpose  : 
68 //=======================================================================
69
70 const BRepSweep_Prism&  BRepPrimAPI_MakePrism::Prism()const 
71 {
72   return myPrism;
73 }
74
75
76 //=======================================================================
77 //function : Build
78 //purpose  : 
79 //=======================================================================
80
81 void  BRepPrimAPI_MakePrism::Build()
82 {
83   myShape = myPrism.Shape();
84   Done();
85 }
86
87 //=======================================================================
88 //function : FirstShape
89 //purpose  : 
90 //=======================================================================
91
92 TopoDS_Shape BRepPrimAPI_MakePrism::FirstShape()
93 {
94   return myPrism.FirstShape();
95 }
96
97
98 //=======================================================================
99 //function : LastShape
100 //purpose  : 
101 //=======================================================================
102
103 TopoDS_Shape BRepPrimAPI_MakePrism::LastShape()
104 {
105   return myPrism.LastShape();
106 }
107
108
109 //=======================================================================
110 //function : Generated
111 //purpose  : 
112 //=======================================================================
113
114 const TopTools_ListOfShape& BRepPrimAPI_MakePrism::Generated (const TopoDS_Shape& S)
115 {
116   myGenerated.Clear();
117   myGenerated.Append(myPrism.Shape (S));
118   return myGenerated;
119
120 }
121
122
123 // Modified by skv - Fri Mar  4 15:50:09 2005 Begin
124
125 //=======================================================================
126 //function : FirstShape
127 //purpose  : This method returns the bottom shape of the prism, generated
128 //           with theShape (subShape of the generating shape)
129 //=======================================================================
130
131 TopoDS_Shape BRepPrimAPI_MakePrism::FirstShape(const TopoDS_Shape &theShape)
132 {
133   return myPrism.FirstShape(theShape);
134 }
135
136
137 //=======================================================================
138 //function : LastShape
139 //purpose  : This method returns the top shape of the prism, generated
140 //           with theShape (subShape of the generating shape)
141 //=======================================================================
142
143 TopoDS_Shape BRepPrimAPI_MakePrism::LastShape(const TopoDS_Shape &theShape)
144 {
145   return myPrism.LastShape(theShape);
146 }
147
148 // Modified by skv - Fri Mar  4 15:50:09 2005 End