b311480e |
1 | // Created on: 1993-10-14 |
2 | // Created by: Remi LEQUETTE |
3 | // Copyright (c) 1993-1999 Matra Datavision |
4 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | // |
6 | // The content of this file is subject to the Open CASCADE Technology Public |
7 | // License Version 6.5 (the "License"). You may not use the content of this file |
8 | // except in compliance with the License. Please obtain a copy of the License |
9 | // at http://www.opencascade.org and read it completely before using this file. |
10 | // |
11 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | // |
14 | // The Original Code and all software distributed under the License is |
15 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | // Initial Developer hereby disclaims all such warranties, including without |
17 | // limitation, any warranties of merchantability, fitness for a particular |
18 | // purpose or non-infringement. Please see the License for the specific terms |
19 | // and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | |
23 | // Modified by skv - Fri Mar 4 15:50:09 2005 |
24 | // Add methods for supporting history. |
25 | |
26 | #include <BRepPrimAPI_MakePrism.ixx> |
27 | #include <BRepLib.hxx> |
28 | |
29 | // perform checks on the argument |
30 | |
31 | static const TopoDS_Shape& check(const TopoDS_Shape& S) |
32 | { |
33 | BRepLib::BuildCurves3d(S); |
34 | return S; |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : BRepPrimAPI_MakePrism |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | BRepPrimAPI_MakePrism::BRepPrimAPI_MakePrism(const TopoDS_Shape& S, |
43 | const gp_Vec& V, |
44 | const Standard_Boolean Copy, |
45 | const Standard_Boolean Canonize) : |
46 | myPrism(check(S),V,Copy,Canonize) |
47 | { |
48 | Build(); |
49 | } |
50 | |
51 | |
52 | //======================================================================= |
53 | //function : BRepPrimAPI_MakePrism |
54 | //purpose : |
55 | //======================================================================= |
56 | |
57 | BRepPrimAPI_MakePrism::BRepPrimAPI_MakePrism(const TopoDS_Shape& S, |
58 | const gp_Dir& D, |
59 | const Standard_Boolean Inf, |
60 | const Standard_Boolean Copy, |
61 | const Standard_Boolean Canonize) : |
62 | myPrism(check(S),D,Inf,Copy,Canonize) |
63 | { |
64 | Build(); |
65 | } |
66 | |
67 | |
68 | //======================================================================= |
69 | //function : Prism |
70 | //purpose : |
71 | //======================================================================= |
72 | |
73 | const BRepSweep_Prism& BRepPrimAPI_MakePrism::Prism()const |
74 | { |
75 | return myPrism; |
76 | } |
77 | |
78 | |
79 | //======================================================================= |
80 | //function : Build |
81 | //purpose : |
82 | //======================================================================= |
83 | |
84 | void BRepPrimAPI_MakePrism::Build() |
85 | { |
86 | myShape = myPrism.Shape(); |
87 | Done(); |
88 | } |
89 | |
90 | //======================================================================= |
91 | //function : FirstShape |
92 | //purpose : |
93 | //======================================================================= |
94 | |
95 | TopoDS_Shape BRepPrimAPI_MakePrism::FirstShape() |
96 | { |
97 | return myPrism.FirstShape(); |
98 | } |
99 | |
100 | |
101 | //======================================================================= |
102 | //function : LastShape |
103 | //purpose : |
104 | //======================================================================= |
105 | |
106 | TopoDS_Shape BRepPrimAPI_MakePrism::LastShape() |
107 | { |
108 | return myPrism.LastShape(); |
109 | } |
110 | |
111 | |
112 | //======================================================================= |
113 | //function : Generated |
114 | //purpose : |
115 | //======================================================================= |
116 | |
117 | const TopTools_ListOfShape& BRepPrimAPI_MakePrism::Generated (const TopoDS_Shape& S) |
118 | { |
119 | myGenerated.Clear(); |
120 | myGenerated.Append(myPrism.Shape (S)); |
121 | return myGenerated; |
122 | |
123 | } |
124 | |
125 | |
126 | // Modified by skv - Fri Mar 4 15:50:09 2005 Begin |
127 | |
128 | //======================================================================= |
129 | //function : FirstShape |
130 | //purpose : This method returns the bottom shape of the prism, generated |
131 | // with theShape (subShape of the generating shape) |
132 | //======================================================================= |
133 | |
134 | TopoDS_Shape BRepPrimAPI_MakePrism::FirstShape(const TopoDS_Shape &theShape) |
135 | { |
136 | return myPrism.FirstShape(theShape); |
137 | } |
138 | |
139 | |
140 | //======================================================================= |
141 | //function : LastShape |
142 | //purpose : This method returns the top shape of the prism, generated |
143 | // with theShape (subShape of the generating shape) |
144 | //======================================================================= |
145 | |
146 | TopoDS_Shape BRepPrimAPI_MakePrism::LastShape(const TopoDS_Shape &theShape) |
147 | { |
148 | return myPrism.LastShape(theShape); |
149 | } |
150 | |
151 | // Modified by skv - Fri Mar 4 15:50:09 2005 End |