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