42cf5bc1 |
1 | // Created on: 1997-10-14 |
2 | // Created by: Olga KOULECHOVA |
3 | // Copyright (c) 1997-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_MakeRevolutionForm_HeaderFile |
18 | #define _BRepFeat_MakeRevolutionForm_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <gp_Ax1.hxx> |
25 | #include <Standard_Real.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <TopTools_DataMapOfShapeListOfShape.hxx> |
28 | #include <TopTools_ListOfShape.hxx> |
29 | #include <BRepFeat_RibSlot.hxx> |
30 | #include <Standard_Integer.hxx> |
31 | class Geom_Plane; |
32 | class Standard_ConstructionError; |
33 | class TopoDS_Shape; |
34 | class TopoDS_Wire; |
35 | class gp_Ax1; |
36 | class TopoDS_Edge; |
37 | class TopoDS_Face; |
38 | class gp_Pnt; |
39 | |
40 | |
41 | //! MakeRevolutionForm Generates a surface of |
42 | //! revolution in the feature as it slides along a |
43 | //! revolved face in the basis shape. |
44 | //! The semantics of mechanical features is built |
45 | //! around giving thickness to a contour. This |
46 | //! thickness can either be unilateral - on one side |
47 | //! of the contour - or bilateral - on both sides. As |
48 | //! in the semantics of form features, the thickness |
49 | //! is defined by construction of shapes in specific contexts. |
50 | //! The development contexts differ, however,in |
51 | //! case of mechanical features. Here they include extrusion: |
52 | //! - to a limiting face of the basis shape |
53 | //! - to or from a limiting plane |
54 | //! - to a height. |
55 | class BRepFeat_MakeRevolutionForm : public BRepFeat_RibSlot |
56 | { |
57 | public: |
58 | |
59 | DEFINE_STANDARD_ALLOC |
60 | |
61 | |
62 | //! initializes the linear form class. |
63 | BRepFeat_MakeRevolutionForm(); |
64 | |
65 | //! a contour W, a shape Sbase and a plane P are initialized to serve as |
66 | //! the basic elements in the construction of the rib or groove. The axis Axis of the |
67 | //! revolved surface in the basis shape defines the feature's axis of revolution. |
68 | //! Height1 and Height2 may be used as limits to the construction of the feature. |
69 | //! Fuse offers a choice between: |
70 | //! - removing matter with a Boolean cut using the setting 0 in case of the groove |
71 | //! - adding matter with Boolean fusion using the setting 1 in case of the rib. |
72 | BRepFeat_MakeRevolutionForm(const TopoDS_Shape& Sbase, const TopoDS_Wire& W, const Handle(Geom_Plane)& Plane, const gp_Ax1& Axis, const Standard_Real Height1, const Standard_Real Height2, const Standard_Integer Fuse, Standard_Boolean& Sliding); |
73 | |
74 | //! Initializes this construction algorithm |
75 | //! A contour W, a shape Sbase and a plane P are initialized to serve as the basic elements |
76 | //! in the construction of the rib or groove. The axis Axis of the revolved surface in the basis |
77 | //! shape defines the feature's axis of revolution. Height1 and Height2 may be |
78 | //! used as limits to the construction of the feature. |
79 | //! Fuse offers a choice between: |
80 | //! - removing matter with a Boolean cut using the setting 0 in case of the groove |
81 | //! - adding matter with Boolean fusion using the setting 1 in case of the rib. |
82 | Standard_EXPORT void Init (const TopoDS_Shape& Sbase, const TopoDS_Wire& W, const Handle(Geom_Plane)& Plane, const gp_Ax1& Axis, const Standard_Real Height1, const Standard_Real Height2, const Standard_Integer Fuse, Standard_Boolean& Sliding); |
83 | |
84 | //! Indicates that the edge <E> will slide on the face |
85 | //! <OnFace>. Raises ConstructionError if the face does not belong to the |
86 | //! basis shape, or the edge to the prismed shape. |
87 | Standard_EXPORT void Add (const TopoDS_Edge& E, const TopoDS_Face& OnFace); |
88 | |
89 | //! Performs a prism from the wire to the plane |
90 | //! along the basis shape S. Reconstructs the feature topologically. |
91 | Standard_EXPORT void Perform(); |
92 | |
93 | Standard_EXPORT Standard_Boolean Propagate (TopTools_ListOfShape& L, const TopoDS_Face& F, const gp_Pnt& FPoint, const gp_Pnt& LPoint, Standard_Boolean& falseside); |
94 | |
95 | |
96 | |
97 | |
98 | protected: |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | private: |
105 | |
106 | |
107 | |
108 | gp_Ax1 myAxe; |
109 | Standard_Real myHeight1; |
110 | Standard_Real myHeight2; |
111 | Standard_Boolean mySliding; |
112 | Handle(Geom_Plane) myPln; |
113 | Standard_Real myBnd; |
114 | TopTools_DataMapOfShapeListOfShape mySlface; |
115 | TopTools_ListOfShape myListOfEdges; |
116 | Standard_Real myTol; |
117 | Standard_Real myAngle1; |
118 | Standard_Real myAngle2; |
119 | |
120 | |
121 | }; |
122 | |
123 | |
124 | #include <BRepFeat_MakeRevolutionForm.lxx> |
125 | |
126 | |
127 | |
128 | |
129 | |
130 | #endif // _BRepFeat_MakeRevolutionForm_HeaderFile |