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