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