b311480e |
1 | -- Created on: 1993-07-21 |
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 | class MakeBox from BRepPrimAPI inherits MakeShape from BRepBuilderAPI |
24 | |
25 | ---Purpose: Describes functions to build parallelepiped boxes. |
26 | -- A MakeBox object provides a framework for: |
27 | -- - defining the construction of a box, |
28 | -- - implementing the construction algorithm, and |
29 | -- - consulting the result. |
30 | |
31 | uses |
32 | Ax2 from gp, |
33 | Pnt from gp, |
34 | Face from TopoDS, |
35 | Shell from TopoDS, |
36 | Solid from TopoDS, |
37 | Wedge from BRepPrim |
38 | |
39 | raises |
40 | DomainError from Standard, |
41 | OutOfRange from Standard, |
42 | NotDone from StdFail |
43 | |
44 | is |
45 | |
46 | Create(dx, dy, dz : Real) |
47 | returns MakeBox from BRepPrimAPI |
48 | ---Purpose: Make a box with a corner at 0,0,0 and the other dx,dy,dz |
49 | ---Level: Public |
50 | raises |
51 | DomainError from Standard; -- if dx,dy,dz <= Precision::Confusion() |
52 | |
53 | Create(P : Pnt from gp; dx, dy, dz : Real) |
54 | returns MakeBox from BRepPrimAPI |
55 | ---Purpose: Make a box with a corner at P and size dx, dy, dz. |
56 | ---Level: Public |
57 | raises |
58 | DomainError from Standard; -- if dx,dy,dz <= Precision::Confusion() |
59 | |
60 | |
61 | Create(P1,P2 : Pnt from gp) |
62 | returns MakeBox from BRepPrimAPI |
63 | ---Purpose: Make a box with corners P1,P2. |
64 | ---Level: Public |
65 | raises |
66 | DomainError from Standard; -- if dx,dy,dz <= Precision::Confusion() |
67 | |
68 | |
69 | Create(Axes : Ax2 from gp; dx, dy, dz : Real) |
70 | returns MakeBox from BRepPrimAPI |
71 | ---Purpose: Ax2 is the left corner and the axis. |
72 | ---Level: Public |
73 | raises |
74 | DomainError from Standard; -- if dx,dy,dz <= Precision::Confusion() |
75 | |
76 | ---Purpose: Constructs a box such that its sides are parallel to the axes of |
77 | -- - the global coordinate system, or |
78 | -- - the local coordinate system Axis. and |
79 | -- - with a corner at (0, 0, 0) and of size (dx, dy, dz), or |
80 | -- - with a corner at point P and of size (dx, dy, dz), or |
81 | -- - with corners at points P1 and P2. |
82 | -- Exceptions |
83 | -- Standard_DomainError if: dx, dy, dz are less than or equal to |
84 | -- Precision::Confusion(), or |
85 | -- - the vector joining the points P1 and P2 has a |
86 | -- component projected onto the global coordinate |
87 | -- system less than or equal to Precision::Confusion(). |
88 | -- In these cases, the box would be flat. |
89 | |
90 | Wedge(me : in out) returns Wedge from BRepPrim |
91 | ---Purpose: Returns the internal algorithm. |
92 | -- |
93 | ---C++: return & |
94 | ---Level: Public |
95 | is static; |
96 | |
97 | |
98 | ---------------------------------------- |
99 | -- Results |
100 | ---------------------------------------- |
101 | |
102 | Build(me : in out) |
103 | ---Purpose: Stores the solid in myShape. |
104 | ---Level: Public |
105 | is redefined; |
106 | |
107 | |
108 | Shell(me : in out) returns Shell from TopoDS |
109 | ---C++: return const & |
110 | ---C++: alias "Standard_EXPORT operator TopoDS_Shell();" |
111 | ---Purpose: Returns the constructed box as a shell. |
112 | is static; |
113 | |
114 | Solid(me : in out) returns Solid from TopoDS |
115 | ---C++: return const & |
116 | ---C++: alias "Standard_EXPORT operator TopoDS_Solid();" |
117 | ---Purpose: Returns the constructed box as a solid. |
118 | is static; |
119 | |
120 | |
121 | BottomFace (me : in out) returns Face from TopoDS; |
122 | ---Purpose : Returns ZMin face |
123 | ---C++: return const & |
124 | |
125 | |
126 | BackFace (me : in out) returns Face from TopoDS; |
127 | ---Purpose : Returns XMin face |
128 | ---C++: return const & |
129 | |
130 | |
131 | FrontFace (me : in out) returns Face from TopoDS; |
132 | ---Purpose : Returns XMax face |
133 | ---C++: return const & |
134 | |
135 | |
136 | LeftFace (me : in out) returns Face from TopoDS; |
137 | ---Purpose : Returns YMin face |
138 | ---C++: return const & |
139 | |
140 | |
141 | RightFace (me : in out) returns Face from TopoDS; |
142 | ---Purpose : Returns YMax face |
143 | ---C++: return const & |
144 | |
145 | |
146 | TopFace (me : in out) returns Face from TopoDS; |
147 | ---Purpose : Returns ZMax face |
148 | ---C++: return const & |
149 | |
150 | |
151 | fields |
152 | |
153 | myWedge : Wedge from BRepPrim; |
154 | |
155 | end MakeBox; |