42cf5bc1 |
1 | // Created on: 1996-03-08 |
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_Gluer_HeaderFile |
18 | #define _BRepFeat_Gluer_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <LocOpe_Gluer.hxx> |
25 | #include <BRepBuilderAPI_MakeShape.hxx> |
26 | #include <LocOpe_Operation.hxx> |
27 | #include <Standard_Boolean.hxx> |
28 | #include <TopTools_ListOfShape.hxx> |
29 | class TopoDS_Shape; |
30 | class TopoDS_Face; |
31 | class TopoDS_Edge; |
32 | |
33 | |
34 | //! One of the most significant aspects |
35 | //! of BRepFeat functionality is the use of local operations as opposed |
36 | //! to global ones. In a global operation, you would first |
37 | //! construct a form of the type you wanted in your final feature, and |
38 | //! then remove matter so that it could fit into your initial basis object. |
39 | //! In a local operation, however, you specify the domain of the feature |
40 | //! construction with aspects of the shape on which the feature is being |
41 | //! created. These semantics are expressed in terms of a member |
42 | //! shape of the basis shape from which - or up to which - matter will be |
43 | //! added or removed. As a result, local operations make calculations |
44 | //! simpler and faster than global operations. |
45 | //! Glueing uses wires or edges of a face in the basis shape. These are |
46 | //! to become a part of the feature. They are first cut out and then |
47 | //! projected to a plane outside or inside the basis shape. By |
48 | //! rebuilding the initial shape incorporating the edges and the |
49 | //! faces of the tool, protrusion features can be constructed. |
50 | class BRepFeat_Gluer : public BRepBuilderAPI_MakeShape |
51 | { |
52 | public: |
53 | |
54 | DEFINE_STANDARD_ALLOC |
55 | |
56 | |
57 | //! Initializes an empty constructor |
58 | BRepFeat_Gluer(); |
59 | |
60 | //! Initializes the shapes to be glued, the new shape |
61 | //! Snew and the basis shape Sbase. |
62 | BRepFeat_Gluer(const TopoDS_Shape& Snew, const TopoDS_Shape& Sbase); |
63 | |
64 | //! Initializes the new shape Snew and the basis shape |
65 | //! Sbase for the local glueing operation. |
66 | void Init (const TopoDS_Shape& Snew, const TopoDS_Shape& Sbase); |
67 | |
68 | //! Defines a contact between Fnew on the new shape |
69 | //! Snew and Fbase on the basis shape Sbase. Informs |
70 | //! other methods that Fnew in the new shape Snew is |
71 | //! connected to the face Fbase in the basis shape Sbase. |
72 | //! The contact faces of the glued shape must not have |
73 | //! parts outside the contact faces of the basis shape. |
74 | //! This indicates that glueing is possible. |
75 | void Bind (const TopoDS_Face& Fnew, const TopoDS_Face& Fbase); |
76 | |
77 | //! nforms other methods that the edge Enew in the new |
78 | //! shape is the same as the edge Ebase in the basis |
79 | //! shape and is therefore attached to the basis shape. This |
80 | //! indicates that glueing is possible. |
81 | void Bind (const TopoDS_Edge& Enew, const TopoDS_Edge& Ebase); |
82 | |
83 | //! Determine which operation type to use glueing or sliding. |
84 | LocOpe_Operation OpeType() const; |
85 | |
86 | //! Returns the basis shape of the compound shape. |
87 | const TopoDS_Shape& BasisShape() const; |
88 | |
89 | //! Returns the resulting compound shape. |
90 | const TopoDS_Shape& GluedShape() const; |
91 | |
92 | //! This is called by Shape(). It does nothing but |
93 | //! may be redefined. |
94 | Standard_EXPORT virtual void Build() Standard_OVERRIDE; |
95 | |
96 | //! returns the status of the Face after |
97 | //! the shape creation. |
98 | Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& F) Standard_OVERRIDE; |
99 | |
100 | //! returns the list of generated Faces. |
101 | Standard_EXPORT virtual const TopTools_ListOfShape& Modified (const TopoDS_Shape& F) Standard_OVERRIDE; |
102 | |
103 | |
104 | |
105 | |
106 | protected: |
107 | |
108 | |
109 | |
110 | |
111 | |
112 | private: |
113 | |
114 | |
115 | |
116 | LocOpe_Gluer myGluer; |
117 | |
118 | |
119 | }; |
120 | |
121 | |
122 | #include <BRepFeat_Gluer.lxx> |
123 | |
124 | |
125 | |
126 | |
127 | |
128 | #endif // _BRepFeat_Gluer_HeaderFile |