42cf5bc1 |
1 | // Created on: 1993-06-22 |
2 | // Created by: Laurent BOURESCHE |
3 | // Copyright (c) 1993-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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 |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _BRepSweep_Prism_HeaderFile |
18 | #define _BRepSweep_Prism_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <BRepSweep_Translation.hxx> |
25 | #include <Standard_Boolean.hxx> |
26 | class Standard_ConstructionError; |
27 | class TopoDS_Shape; |
28 | class gp_Vec; |
29 | class gp_Dir; |
30 | class Sweep_NumShape; |
31 | class TopLoc_Location; |
32 | |
33 | |
34 | //! Provides natural constructors to build BRepSweep |
35 | //! translated swept Primitives. |
36 | class BRepSweep_Prism |
37 | { |
38 | public: |
39 | |
40 | DEFINE_STANDARD_ALLOC |
41 | |
42 | |
43 | //! Builds the prism of base S and vector V. If C is true, |
44 | //! S is copied. If Canonize is true then generated surfaces |
45 | //! are attempted to be canonized in simple types |
46 | Standard_EXPORT BRepSweep_Prism(const TopoDS_Shape& S, const gp_Vec& V, const Standard_Boolean Copy = Standard_False, const Standard_Boolean Canonize = Standard_True); |
47 | |
48 | //! Builds a semi-infinite or an infinite prism of base S. |
49 | //! If Copy is true S is copied. If Inf is true the prism |
50 | //! is infinite, if Inf is false the prism is infinite in |
51 | //! the direction D. If Canonize is true then generated surfaces |
52 | //! are attempted to be canonized in simple types |
53 | Standard_EXPORT BRepSweep_Prism(const TopoDS_Shape& S, const gp_Dir& D, const Standard_Boolean Inf = Standard_True, const Standard_Boolean Copy = Standard_False, const Standard_Boolean Canonize = Standard_True); |
54 | |
55 | //! Returns the TopoDS Shape attached to the prism. |
56 | Standard_EXPORT TopoDS_Shape Shape(); |
57 | |
58 | //! Returns the TopoDS Shape generated with aGenS |
59 | //! (subShape of the generating shape). |
60 | Standard_EXPORT TopoDS_Shape Shape (const TopoDS_Shape& aGenS); |
61 | |
62 | //! Returns the TopoDS Shape of the bottom of the prism. |
63 | Standard_EXPORT TopoDS_Shape FirstShape(); |
64 | |
65 | //! Returns the TopoDS Shape of the bottom of the prism. |
66 | //! generated with aGenS (subShape of the generating |
67 | //! shape). |
68 | Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& aGenS); |
69 | |
70 | //! Returns the TopoDS Shape of the top of the prism. |
71 | Standard_EXPORT TopoDS_Shape LastShape(); |
72 | |
73 | //! Returns the TopoDS Shape of the top of the prism. |
74 | //! generated with aGenS (subShape of the generating |
75 | //! shape). |
76 | Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& aGenS); |
77 | |
78 | //! Returns the Vector of the Prism, if it is an infinite |
79 | //! prism the Vec is unitar. |
80 | Standard_EXPORT gp_Vec Vec() const; |
81 | |
82 | |
83 | |
84 | |
85 | protected: |
86 | |
87 | |
88 | |
89 | |
90 | |
91 | private: |
92 | |
93 | |
94 | //! used to build the NumShape of a limited prism. |
95 | Standard_EXPORT Sweep_NumShape NumShape() const; |
96 | |
97 | //! used to build the NumShape of an infinite prism. |
98 | Standard_EXPORT Sweep_NumShape NumShape (const Standard_Boolean Inf) const; |
99 | |
100 | //! used to build the Location. |
101 | Standard_EXPORT TopLoc_Location Location (const gp_Vec& V) const; |
102 | |
103 | |
104 | BRepSweep_Translation myTranslation; |
105 | |
106 | |
107 | }; |
108 | |
109 | |
110 | |
111 | |
112 | |
113 | |
114 | |
115 | #endif // _BRepSweep_Prism_HeaderFile |