42cf5bc1 |
1 | // Created on: 1993-10-12 |
2 | // Created by: Remi LEQUETTE |
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 _BRepPrimAPI_MakeRevol_HeaderFile |
18 | #define _BRepPrimAPI_MakeRevol_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <BRepSweep_Revol.hxx> |
25 | #include <TopTools_ListOfShape.hxx> |
26 | #include <BRepPrimAPI_MakeSweep.hxx> |
7e4ff648 |
27 | #include <BRepTools_History.hxx> |
42cf5bc1 |
28 | class TopoDS_Shape; |
29 | class gp_Ax1; |
42cf5bc1 |
30 | |
31 | |
32 | //! Class to make revolved sweep topologies. |
33 | //! |
34 | //! a revolved sweep is defined by : |
35 | //! |
36 | //! * A basis topology which is swept. |
37 | //! |
38 | //! The basis topology must not contain solids |
39 | //! (neither composite solids.). |
40 | //! |
41 | //! The basis topology may be copied or shared in |
42 | //! the result. |
43 | //! |
44 | //! * A rotation axis and angle : |
45 | //! |
46 | //! - The axis is an Ax1 from gp. |
47 | //! |
48 | //! - The angle is in [0, 2*Pi]. |
49 | //! |
50 | //! - The angle default value is 2*Pi. |
51 | //! |
52 | //! The result is a topology with a higher dimension : |
53 | //! |
54 | //! - Vertex -> Edge. |
55 | //! - Edge -> Face. |
56 | //! - Wire -> Shell. |
57 | //! - Face -> Solid. |
58 | //! - Shell -> CompSolid. |
59 | //! |
60 | //! Sweeping a Compound sweeps the elements of the |
61 | //! compound and creates a compound with the |
62 | //! results. |
63 | class BRepPrimAPI_MakeRevol : public BRepPrimAPI_MakeSweep |
64 | { |
65 | public: |
66 | |
67 | DEFINE_STANDARD_ALLOC |
42cf5bc1 |
68 | |
69 | //! Builds the Revol of base S, axis A and angle D. If C |
70 | //! is true, S is copied. |
71 | Standard_EXPORT BRepPrimAPI_MakeRevol(const TopoDS_Shape& S, const gp_Ax1& A, const Standard_Real D, const Standard_Boolean Copy = Standard_False); |
72 | |
73 | //! Builds the Revol of base S, axis A and angle 2*Pi. If |
74 | //! C is true, S is copied. |
75 | Standard_EXPORT BRepPrimAPI_MakeRevol(const TopoDS_Shape& S, const gp_Ax1& A, const Standard_Boolean Copy = Standard_False); |
76 | |
77 | //! Returns the internal sweeping algorithm. |
78 | Standard_EXPORT const BRepSweep_Revol& Revol() const; |
79 | |
80 | //! Builds the resulting shape (redefined from MakeShape). |
d03c0898 |
81 | Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; |
42cf5bc1 |
82 | |
83 | //! Returns the first shape of the revol (coinciding with |
84 | //! the generating shape). |
79104795 |
85 | Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE; |
42cf5bc1 |
86 | |
87 | //! Returns the TopoDS Shape of the end of the revol. |
79104795 |
88 | Standard_EXPORT TopoDS_Shape LastShape() Standard_OVERRIDE; |
42cf5bc1 |
89 | |
7e4ff648 |
90 | //! Returns list of shape generated from shape S |
91 | //! Warning: shape S must be shape of type VERTEX, EDGE, FACE, SOLID. |
92 | //! For shapes of other types method always returns empty list |
42cf5bc1 |
93 | Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE; |
80eeb3ce |
94 | |
95 | //! Returns true if the shape S has been deleted. |
96 | Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& S) Standard_OVERRIDE; |
97 | |
42cf5bc1 |
98 | |
99 | //! Returns the TopoDS Shape of the beginning of the revolution, |
100 | //! generated with theShape (subShape of the generating shape). |
101 | Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& theShape); |
102 | |
103 | //! Returns the TopoDS Shape of the end of the revolution, |
104 | //! generated with theShape (subShape of the generating shape). |
105 | Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& theShape); |
106 | |
107 | //! Check if there are degenerated edges in the result. |
108 | Standard_EXPORT Standard_Boolean HasDegenerated() const; |
42cf5bc1 |
109 | |
6f241137 |
110 | //! Returns the list of degenerated edges |
111 | Standard_EXPORT const TopTools_ListOfShape& Degenerated() const; |
42cf5bc1 |
112 | |
42cf5bc1 |
113 | protected: |
114 | |
6f241137 |
115 | //! Checks possibilities of producing self-intersection surface |
116 | //! returns true if all surfaces are valid |
117 | Standard_EXPORT Standard_Boolean CheckValidity(const TopoDS_Shape& theShape, const gp_Ax1& theA); |
42cf5bc1 |
118 | |
119 | private: |
120 | |
121 | |
122 | |
123 | BRepSweep_Revol myRevol; |
124 | TopTools_ListOfShape myDegenerated; |
7e4ff648 |
125 | Handle(BRepTools_History) myHist; |
6f241137 |
126 | Standard_Boolean myIsBuild; |
42cf5bc1 |
127 | |
128 | |
129 | }; |
130 | |
131 | |
132 | |
133 | |
134 | |
135 | |
136 | |
137 | #endif // _BRepPrimAPI_MakeRevol_HeaderFile |