b311480e |
1 | // Created on: 1993-07-23 |
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 | #include <BRepPrimAPI_MakeWedge.ixx> |
18 | #include <TopoDS.hxx> |
19 | |
20 | |
21 | //======================================================================= |
22 | //function : BRepPrimAPI_MakeWedge |
23 | //purpose : |
24 | //======================================================================= |
25 | |
26 | BRepPrimAPI_MakeWedge::BRepPrimAPI_MakeWedge(const Standard_Real dx, |
27 | const Standard_Real dy, |
28 | const Standard_Real dz, |
29 | const Standard_Real ltx) : |
30 | myWedge(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(0,0,1),gp_Dir(1,0,0)), |
31 | dx,dy,dz,ltx) |
32 | { |
33 | } |
34 | |
35 | |
36 | //======================================================================= |
37 | //function : BRepPrimAPI_MakeWedge |
38 | //purpose : |
39 | //======================================================================= |
40 | |
41 | BRepPrimAPI_MakeWedge::BRepPrimAPI_MakeWedge(const gp_Ax2& Axes, |
42 | const Standard_Real dx, |
43 | const Standard_Real dy, |
44 | const Standard_Real dz, |
45 | const Standard_Real ltx) : |
46 | myWedge(Axes, |
47 | dx,dy,dz,ltx) |
48 | { |
49 | } |
50 | |
51 | |
52 | //======================================================================= |
53 | //function : BRepPrimAPI_MakeWedge |
54 | //purpose : |
55 | //======================================================================= |
56 | |
57 | BRepPrimAPI_MakeWedge::BRepPrimAPI_MakeWedge(const Standard_Real dx, |
58 | const Standard_Real dy, |
59 | const Standard_Real dz, |
60 | const Standard_Real xmin, |
61 | const Standard_Real zmin, |
62 | const Standard_Real xmax, |
63 | const Standard_Real zmax) : |
64 | myWedge(gp_Ax2(gp_Pnt(0,0,0),gp_Dir(0,0,1),gp_Dir(1,0,0)), |
65 | 0,0,0,zmin,xmin,dx,dy,dz,zmax,xmax) |
66 | { |
67 | } |
68 | |
69 | |
70 | //======================================================================= |
71 | //function : BRepPrimAPI_MakeWedge |
72 | //purpose : |
73 | //======================================================================= |
74 | |
75 | BRepPrimAPI_MakeWedge::BRepPrimAPI_MakeWedge(const gp_Ax2& Axes, |
76 | const Standard_Real dx, |
77 | const Standard_Real dy, |
78 | const Standard_Real dz, |
79 | const Standard_Real xmin, |
80 | const Standard_Real zmin, |
81 | const Standard_Real xmax, |
82 | const Standard_Real zmax) : |
83 | myWedge(Axes, |
84 | 0,0,0,zmin,xmin,dx,dy,dz,zmax,xmax) |
85 | { |
86 | } |
87 | |
88 | |
89 | //======================================================================= |
90 | //function : Wedge |
91 | //purpose : |
92 | //======================================================================= |
93 | |
94 | BRepPrim_Wedge& BRepPrimAPI_MakeWedge::Wedge() |
95 | { |
96 | return myWedge; |
97 | } |
98 | |
99 | |
100 | //======================================================================= |
101 | //function : Shell |
102 | //purpose : |
103 | //======================================================================= |
104 | |
105 | const TopoDS_Shell& BRepPrimAPI_MakeWedge::Shell() |
106 | { |
107 | Build(); |
108 | return myWedge.Shell(); |
109 | } |
110 | |
111 | |
112 | //======================================================================= |
113 | //function : Build |
114 | //purpose : |
115 | //======================================================================= |
116 | |
117 | void BRepPrimAPI_MakeWedge::Build() |
118 | { |
119 | BRep_Builder B; |
120 | B.MakeSolid(TopoDS::Solid(myShape)); |
121 | B.Add(myShape,myWedge.Shell()); |
7fd59977 |
122 | Done(); |
123 | } |
124 | |
125 | //======================================================================= |
126 | //function : Solid |
127 | //purpose : |
128 | //======================================================================= |
129 | |
130 | const TopoDS_Solid& BRepPrimAPI_MakeWedge::Solid() |
131 | { |
132 | Build(); |
133 | return TopoDS::Solid(myShape); |
134 | } |
135 | |
136 | |
137 | //======================================================================= |
138 | //function : operator |
139 | //purpose : |
140 | //======================================================================= |
141 | |
142 | BRepPrimAPI_MakeWedge::operator TopoDS_Shell() |
143 | { |
144 | return Shell(); |
145 | } |
146 | |
147 | |
148 | //======================================================================= |
149 | //function : operator |
150 | //purpose : |
151 | //======================================================================= |
152 | |
153 | BRepPrimAPI_MakeWedge::operator TopoDS_Solid() |
154 | { |
155 | return Solid(); |
156 | } |