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