42cf5bc1 |
1 | // Created on: 1997-04-14 |
2 | // Created by: Olga PILLOT |
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_MakeLinearForm_HeaderFile |
18 | #define _BRepFeat_MakeLinearForm_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <gp_Vec.hxx> |
25 | #include <Standard_Real.hxx> |
26 | #include <TopTools_DataMapOfShapeListOfShape.hxx> |
27 | #include <TopTools_ListOfShape.hxx> |
28 | #include <BRepFeat_RibSlot.hxx> |
29 | #include <Standard_Integer.hxx> |
30 | #include <Standard_Boolean.hxx> |
31 | class Geom_Curve; |
32 | class Geom_Plane; |
33 | class Standard_ConstructionError; |
34 | class TopoDS_Shape; |
35 | class TopoDS_Wire; |
36 | class gp_Vec; |
37 | class TopoDS_Edge; |
38 | class TopoDS_Face; |
39 | class gp_Pnt; |
40 | |
41 | |
42 | //! Builds a rib or a groove along a developable, planar surface. |
43 | //! The semantics of mechanical features is built around |
44 | //! giving thickness to a contour. This thickness can either |
45 | //! be symmetrical - on one side of the contour - or |
46 | //! dissymmetrical - on both sides. As in the semantics of |
47 | //! form features, the thickness is defined by construction of |
48 | //! shapes in specific contexts. |
49 | //! The development contexts differ, however, in case of |
50 | //! mechanical features. Here they include extrusion: |
51 | //! - to a limiting face of the basis shape |
52 | //! - to or from a limiting plane |
53 | //! - to a height. |
54 | class BRepFeat_MakeLinearForm : public BRepFeat_RibSlot |
55 | { |
56 | public: |
57 | |
58 | DEFINE_STANDARD_ALLOC |
59 | |
60 | |
61 | //! initializes the linear form class |
62 | BRepFeat_MakeLinearForm(); |
63 | |
64 | //! contour W, a shape Sbase and a |
65 | //! plane P are initialized to serve as the basic |
66 | //! elements in the construction of the rib or groove. |
67 | //! Direction and Direction1 give The vectors for |
68 | //! defining the direction(s) in which thickness will be built up. |
69 | //! Fuse offers a choice between: |
70 | //! - removing matter with a Boolean cut using the |
71 | //! setting 0 in case of the groove |
72 | //! - adding matter with Boolean fusion using the |
73 | //! setting 1 in case of the rib. |
74 | BRepFeat_MakeLinearForm(const TopoDS_Shape& Sbase, const TopoDS_Wire& W, const Handle(Geom_Plane)& P, const gp_Vec& Direction, const gp_Vec& Direction1, const Standard_Integer Fuse, const Standard_Boolean Modify); |
75 | |
76 | //! Initializes this construction algorithm. |
77 | //! A contour W, a shape Sbase and a plane P are |
78 | //! initialized to serve as the basic elements in the |
79 | //! construction of the rib or groove. The vectors for |
80 | //! defining the direction(s) in which thickness will be built |
81 | //! up are given by Direction and Direction1. |
82 | //! Fuse offers a choice between: |
83 | //! - removing matter with a Boolean cut using the setting |
84 | //! 0 in case of the groove |
85 | //! - adding matter with Boolean fusion using the setting 1 |
86 | //! in case of the rib. |
87 | Standard_EXPORT void Init (const TopoDS_Shape& Sbase, const TopoDS_Wire& W, const Handle(Geom_Plane)& P, const gp_Vec& Direction, const gp_Vec& Direction1, const Standard_Integer Fuse, const Standard_Boolean Modify); |
88 | |
89 | //! Indicates that the edge <E> will slide on the face |
90 | //! <OnFace>. |
91 | //! Raises ConstructionError if the face does not belong to the |
92 | //! basis shape, or the edge to the prismed shape. |
93 | Standard_EXPORT void Add (const TopoDS_Edge& E, const TopoDS_Face& OnFace); |
94 | |
95 | //! Performs a prism from the wire to the plane along the |
96 | //! basis shape Sbase. Reconstructs the feature topologically. |
97 | Standard_EXPORT void Perform(); |
98 | |
99 | //! Limits construction of the linear form feature by using |
100 | //! one of the following three semantics: |
101 | //! - from a limiting plane |
102 | //! - to a limiting plane |
103 | //! - from one limiting plane to another. |
104 | //! The setting is provided by a flag, flag, which can be set |
105 | //! to from and/or until. The third semantic possibility above |
106 | //! is selected by showing both from and until at the same time. |
107 | Standard_EXPORT void TransformShapeFU (const Standard_Integer flag); |
108 | |
109 | Standard_EXPORT Standard_Boolean Propagate (TopTools_ListOfShape& L, const TopoDS_Face& F, const gp_Pnt& FPoint, const gp_Pnt& LPoint, Standard_Boolean& falseside); |
110 | |
111 | |
112 | |
113 | |
114 | protected: |
115 | |
116 | |
117 | |
118 | |
119 | |
120 | private: |
121 | |
122 | |
123 | |
124 | Handle(Geom_Curve) myCrv; |
125 | gp_Vec myDir; |
126 | gp_Vec myDir1; |
127 | Handle(Geom_Plane) myPln; |
128 | Standard_Real myBnd; |
129 | TopTools_DataMapOfShapeListOfShape mySlface; |
130 | TopTools_ListOfShape myListOfEdges; |
131 | Standard_Real myTol; |
132 | |
133 | |
134 | }; |
135 | |
136 | |
137 | #include <BRepFeat_MakeLinearForm.lxx> |
138 | |
139 | |
140 | |
141 | |
142 | |
143 | #endif // _BRepFeat_MakeLinearForm_HeaderFile |