42cf5bc1 |
1 | // Created on: 1995-06-13 |
2 | // Created by: Jacques GOUSSARD |
3 | // Copyright (c) 1995-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_HeaderFile |
18 | #define _BRepFeat_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TColgp_SequenceOfPnt.hxx> |
25 | #include <Standard_Real.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <TopAbs_Orientation.hxx> |
28 | #include <Standard_OStream.hxx> |
29 | #include <BRepFeat_StatusError.hxx> |
30 | class TopoDS_Shape; |
31 | class gp_Pnt; |
32 | class Geom_Curve; |
33 | class TopoDS_Face; |
34 | class BRepTopAdaptor_FClass2d; |
35 | class Geom2dAdaptor_Curve; |
36 | class TopoDS_Solid; |
37 | class BRepFeat_Builder; |
38 | class BRepFeat_MakeCylindricalHole; |
39 | class BRepFeat_SplitShape; |
40 | class BRepFeat_Form; |
41 | class BRepFeat_RibSlot; |
42 | class BRepFeat_MakePrism; |
43 | class BRepFeat_MakeRevol; |
44 | class BRepFeat_MakePipe; |
45 | class BRepFeat_Gluer; |
46 | class BRepFeat_MakeDPrism; |
47 | class BRepFeat_MakeLinearForm; |
48 | class BRepFeat_MakeRevolutionForm; |
49 | |
50 | |
51 | //! BRepFeat is necessary for the |
52 | //! creation and manipulation of both form and mechanical features in a |
53 | //! Boundary Representation framework. Form features can be depressions or |
54 | //! protrusions and include the following types: |
55 | //! - Cylinder |
56 | //! - Draft Prism |
57 | //! - Prism |
58 | //! - Revolved feature |
59 | //! - Pipe |
60 | //! Depending on whether you wish to make a depression or a protrusion, |
61 | //! you can choose your operation type between the following: |
62 | //! - removing matter (a Boolean cut: Fuse setting 0) |
63 | //! - adding matter (Boolean fusion: Fuse setting 1) |
64 | //! The semantics of form feature creation is based on the |
65 | //! construction of shapes: |
66 | //! - for a certain length in a certain direction |
67 | //! - up to a limiting face |
68 | //! - from a limiting face at a height |
69 | //! - above and/or below a plane |
70 | //! The shape defining the construction of a feature can be either a |
71 | //! supporting edge or a concerned area of a face. |
72 | //! In case of supporting edge, this contour can be attached to a face |
73 | //! of the basis shape by binding. When the contour is bound to this face, |
74 | //! the information that the contour will slide on the face becomes |
75 | //! available to the relevant class methods. In case of the concerned |
76 | //! area of a face, you could, for example, cut it out and move it at |
77 | //! a different height, which will define the limiting face of a |
78 | //! protrusion or depression. Topological definition with local |
79 | //! operations of this sort makes calculations simpler and faster |
80 | //! than a global operation. The latter would entail a second phase of |
81 | //! removing unwanted matter to get the same result. |
82 | //! Mechanical features include ribs - protrusions - and grooves (or |
83 | //! slots) - depressions along planar (linear) surfaces or revolution surfaces. |
84 | //! The semantics of mechanical features is based on giving |
85 | //! thickness to a contour. This thickness can either be unilateral |
86 | //! - on one side of the contour - or bilateral - on both sides. As in |
87 | //! the semantics of form features, the thickness is defined by |
88 | //! construction of shapes in specific contexts. |
89 | //! However, in case of mechanical features, development contexts |
90 | //! differ. Here they include extrusion: |
91 | //! - to a limiting face of the basis shape |
92 | //! - to or from a limiting plane |
93 | //! - to a height. |
94 | class BRepFeat |
95 | { |
96 | public: |
97 | |
98 | DEFINE_STANDARD_ALLOC |
99 | |
100 | |
101 | Standard_EXPORT static void SampleEdges (const TopoDS_Shape& S, TColgp_SequenceOfPnt& Pt); |
102 | |
103 | Standard_EXPORT static void Barycenter (const TopoDS_Shape& S, gp_Pnt& Pt); |
104 | |
105 | Standard_EXPORT static Standard_Real ParametricBarycenter (const TopoDS_Shape& S, const Handle(Geom_Curve)& C); |
106 | |
107 | //! Ori = True taking account the orientation |
108 | Standard_EXPORT static void ParametricMinMax (const TopoDS_Shape& S, const Handle(Geom_Curve)& C, Standard_Real& prmin, Standard_Real& prmax, Standard_Real& prbmin, Standard_Real& prbmax, Standard_Boolean& flag, const Standard_Boolean Ori = Standard_False); |
109 | |
110 | Standard_EXPORT static Standard_Boolean IsInside (const TopoDS_Face& F1, const TopoDS_Face& F2); |
111 | |
112 | Standard_EXPORT static Standard_Boolean IsInOut (const BRepTopAdaptor_FClass2d& FC, const Geom2dAdaptor_Curve& AC); |
113 | |
114 | Standard_EXPORT static void FaceUntil (const TopoDS_Shape& S, TopoDS_Face& F); |
115 | |
116 | Standard_EXPORT static TopoDS_Solid Tool (const TopoDS_Shape& SRef, const TopoDS_Face& Fac, const TopAbs_Orientation Orf); |
117 | |
118 | //! Prints the Error description of the State <St> as a String on |
119 | //! the Stream <S> and returns <S>. |
120 | Standard_EXPORT static Standard_OStream& Print (const BRepFeat_StatusError SE, Standard_OStream& S); |
121 | |
122 | |
123 | |
124 | |
125 | protected: |
126 | |
127 | |
128 | |
129 | |
130 | |
131 | private: |
132 | |
133 | |
134 | |
135 | |
136 | friend class BRepFeat_Builder; |
137 | friend class BRepFeat_MakeCylindricalHole; |
138 | friend class BRepFeat_SplitShape; |
139 | friend class BRepFeat_Form; |
140 | friend class BRepFeat_RibSlot; |
141 | friend class BRepFeat_MakePrism; |
142 | friend class BRepFeat_MakeRevol; |
143 | friend class BRepFeat_MakePipe; |
144 | friend class BRepFeat_Gluer; |
145 | friend class BRepFeat_MakeDPrism; |
146 | friend class BRepFeat_MakeLinearForm; |
147 | friend class BRepFeat_MakeRevolutionForm; |
148 | |
149 | }; |
150 | |
151 | |
152 | |
153 | |
154 | |
155 | |
156 | |
157 | #endif // _BRepFeat_HeaderFile |