42cf5bc1 |
1 | // Created on: 1996-02-13 |
2 | // Created by: Jacques GOUSSARD |
3 | // Copyright (c) 1996-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 _BRepFeat_Form_HeaderFile |
18 | #define _BRepFeat_Form_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
42cf5bc1 |
24 | #include <TopTools_DataMapOfShapeListOfShape.hxx> |
25 | #include <TopoDS_Shape.hxx> |
26 | #include <TopTools_ListOfShape.hxx> |
27 | #include <BRepFeat_PerfSelection.hxx> |
28 | #include <TopoDS_Face.hxx> |
29 | #include <TopTools_DataMapOfShapeShape.hxx> |
30 | #include <BRepFeat_StatusError.hxx> |
31 | #include <BRepBuilderAPI_MakeShape.hxx> |
32 | #include <TColGeom_SequenceOfCurve.hxx> |
33 | #include <Standard_Integer.hxx> |
42cf5bc1 |
34 | class Geom_Curve; |
35 | class LocOpe_Gluer; |
36 | class BRepAlgoAPI_BooleanOperation; |
42cf5bc1 |
37 | |
38 | |
39 | //! Provides general functions to build form features. |
40 | //! Form features can be depressions or protrusions and include the following types: |
41 | //! - Cylinder |
42 | //! - Draft Prism |
43 | //! - Prism |
44 | //! - Revolved feature |
45 | //! - Pipe |
46 | //! In each case, you have a choice of operation type between the following: |
47 | //! - removing matter (a Boolean cut: Fuse setting 0) |
48 | //! - adding matter (Boolean fusion: Fuse setting 1) |
49 | //! The semantics of form feature creation is based on the construction of shapes: |
50 | //! - along a length |
51 | //! - up to a limiting face |
52 | //! - from a limiting face to a height |
53 | //! - above and/or below a plane |
54 | //! The shape defining construction of the feature can be either the |
55 | //! supporting edge or the concerned area of a face. |
56 | //! In case of the supporting edge, this contour can be attached to a |
57 | //! face of the basis shape by binding. When the contour is bound to this |
58 | //! face, the information that the contour will slide on the face |
59 | //! becomes available to the relevant class methods. In case of the |
60 | //! concerned area of a face, you could, for example, cut it out and |
61 | //! move it to a different height which will define the limiting face of a |
62 | //! protrusion or depression. |
63 | //! Topological definition with local operations of this sort makes |
64 | //! calculations simpler and faster than a global operation. The latter |
65 | //! would entail a second phase of removing unwanted matter to get the same result. |
66 | class BRepFeat_Form : public BRepBuilderAPI_MakeShape |
67 | { |
68 | public: |
69 | |
70 | DEFINE_STANDARD_ALLOC |
71 | |
72 | |
73 | //! returns the list of generated Faces. |
74 | Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& F) Standard_OVERRIDE; |
75 | |
76 | //! returns a list of the created faces |
77 | //! from the shape <S>. |
78 | Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE; |
79 | |
80 | Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& S) Standard_OVERRIDE; |
81 | |
82 | //! Returns the list of shapes created at the bottom of |
83 | //! the created form. It may be an empty list. |
84 | Standard_EXPORT const TopTools_ListOfShape& FirstShape() const; |
85 | |
86 | //! Returns the list of shapes created at the top of the |
87 | //! created form. It may be an empty list. |
88 | Standard_EXPORT const TopTools_ListOfShape& LastShape() const; |
89 | |
90 | //! Returns a list of the limiting and glueing edges |
91 | //! generated by the feature. These edges did not originally |
92 | //! exist in the basis shape. |
93 | //! The list provides the information necessary for |
94 | //! subsequent addition of fillets. It may be an empty list. |
95 | Standard_EXPORT const TopTools_ListOfShape& NewEdges() const; |
96 | |
97 | //! Returns a list of the tangent edges among the limiting |
98 | //! and glueing edges generated by the feature. These |
99 | //! edges did not originally exist in the basis shape and are |
100 | //! tangent to the face against which the feature is built. |
101 | //! The list provides the information necessary for |
102 | //! subsequent addition of fillets. It may be an empty list. |
103 | //! If an edge is tangent, no fillet is possible, and the edge |
104 | //! must subsequently be removed if you want to add a fillet. |
105 | Standard_EXPORT const TopTools_ListOfShape& TgtEdges() const; |
106 | |
107 | //! Initializes the topological construction if the basis shape is present. |
108 | void BasisShapeValid(); |
109 | |
110 | //! Initializes the topological construction if the generated shape S is present. |
111 | void GeneratedShapeValid(); |
112 | |
113 | |
114 | //! Initializes the topological construction if the shape is |
115 | //! present from the specified integer on. |
116 | void ShapeFromValid(); |
117 | |
118 | |
119 | //! Initializes the topological construction if the shape is |
120 | //! present until the specified integer. |
121 | void ShapeUntilValid(); |
122 | |
123 | |
124 | //! Initializes the topological construction if the glued face is present. |
125 | void GluedFacesValid(); |
126 | |
127 | |
128 | //! Initializes the topological construction if the sketch face |
129 | //! is present. If the sketch face is inside the basis shape, |
130 | //! local operations such as glueing can be performed. |
131 | void SketchFaceValid(); |
132 | |
133 | //! Initializes the topological construction if the selected face is present. |
134 | void PerfSelectionValid(); |
135 | |
136 | Standard_EXPORT virtual void Curves (TColGeom_SequenceOfCurve& S) = 0; |
137 | |
138 | Standard_EXPORT virtual Handle(Geom_Curve) BarycCurve() = 0; |
139 | |
140 | Standard_EXPORT BRepFeat_StatusError CurrentStatusError() const; |
141 | |
142 | |
143 | |
144 | |
145 | protected: |
146 | |
147 | |
148 | //! Redefines the empty constructor. |
149 | BRepFeat_Form(); |
150 | |
151 | //! General perform method... |
152 | Standard_EXPORT void GlobalPerform(); |
153 | |
154 | Standard_EXPORT void UpdateDescendants (const LocOpe_Gluer& G); |
155 | |
156 | Standard_EXPORT void UpdateDescendants (const BRepAlgoAPI_BooleanOperation& aBOP, const TopoDS_Shape& SResult, const Standard_Boolean SkipFace = Standard_False); |
157 | |
42cf5bc1 |
158 | Standard_EXPORT Standard_Boolean TransformShapeFU (const Standard_Integer flag); |
159 | |
160 | |
161 | Standard_Boolean myFuse; |
162 | Standard_Boolean myModify; |
163 | TopTools_DataMapOfShapeListOfShape myMap; |
164 | TopoDS_Shape myFShape; |
165 | TopoDS_Shape myLShape; |
166 | TopTools_ListOfShape myNewEdges; |
167 | TopTools_ListOfShape myTgtEdges; |
168 | BRepFeat_PerfSelection myPerfSelection; |
169 | Standard_Boolean myJustGluer; |
170 | Standard_Boolean myJustFeat; |
171 | TopoDS_Shape mySbase; |
172 | TopoDS_Face mySkface; |
173 | TopoDS_Shape myGShape; |
174 | TopoDS_Shape mySFrom; |
175 | TopoDS_Shape mySUntil; |
176 | TopTools_DataMapOfShapeShape myGluedF; |
177 | |
178 | |
179 | private: |
180 | |
181 | |
182 | |
183 | Standard_Boolean mySbOK; |
184 | Standard_Boolean mySkOK; |
185 | Standard_Boolean myGSOK; |
186 | Standard_Boolean mySFOK; |
187 | Standard_Boolean mySUOK; |
188 | Standard_Boolean myGFOK; |
189 | Standard_Boolean myPSOK; |
190 | BRepFeat_StatusError myStatusError; |
191 | |
192 | |
193 | }; |
194 | |
195 | |
196 | #include <BRepFeat_Form.lxx> |
197 | |
198 | |
199 | |
200 | |
201 | |
202 | #endif // _BRepFeat_Form_HeaderFile |