42cf5bc1 |
1 | // Created on: 1996-09-03 |
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_MakePipe_HeaderFile |
18 | #define _BRepFeat_MakePipe_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TopoDS_Shape.hxx> |
25 | #include <TopoDS_Face.hxx> |
26 | #include <TopTools_DataMapOfShapeListOfShape.hxx> |
27 | #include <TopoDS_Wire.hxx> |
28 | #include <TColGeom_SequenceOfCurve.hxx> |
29 | #include <BRepFeat_Form.hxx> |
30 | #include <Standard_Integer.hxx> |
31 | #include <Standard_Boolean.hxx> |
32 | class Geom_Curve; |
33 | class Standard_ConstructionError; |
34 | class TopoDS_Shape; |
35 | class TopoDS_Face; |
36 | class TopoDS_Wire; |
37 | class TopoDS_Edge; |
38 | |
39 | |
40 | //! Constructs compound shapes with pipe |
41 | //! features. These can be depressions or protrusions. |
42 | //! The semantics of pipe feature creation is based on the construction of shapes: |
43 | //! - along a length |
44 | //! - up to a limiting face |
45 | //! - from a limiting face to a height. |
46 | //! The shape defining construction of the pipe feature can be either the supporting edge or |
47 | //! the concerned area of a face. |
48 | //! In case of the supporting edge, this contour |
49 | //! can be attached to a face of the basis shape |
50 | //! by binding. When the contour is bound to this |
51 | //! face, the information that the contour will |
52 | //! slide on the face becomes available to the relevant class methods. |
53 | //! In case of the concerned area of a face, you |
54 | //! could, for example, cut it out and move it to a |
55 | //! different height which will define the limiting |
56 | //! face of a protrusion or depression. |
57 | class BRepFeat_MakePipe : public BRepFeat_Form |
58 | { |
59 | public: |
60 | |
61 | DEFINE_STANDARD_ALLOC |
62 | |
63 | |
64 | //! initializes the pipe class. |
65 | BRepFeat_MakePipe(); |
66 | |
67 | //! A face Pbase is selected in the |
68 | //! shape Sbase to serve as the basis for the |
69 | //! pipe. It will be defined by the wire Spine. |
70 | //! Fuse offers a choice between: |
71 | //! - removing matter with a Boolean cut using the setting 0 |
72 | //! - adding matter with Boolean fusion using the setting 1. |
73 | //! The sketch face Skface serves to determine |
74 | //! the type of operation. If it is inside the basis |
75 | //! shape, a local operation such as glueing can be performed. |
76 | BRepFeat_MakePipe(const TopoDS_Shape& Sbase, const TopoDS_Shape& Pbase, const TopoDS_Face& Skface, const TopoDS_Wire& Spine, const Standard_Integer Fuse, const Standard_Boolean Modify); |
77 | |
78 | //! Initializes this algorithm for adding pipes to shapes. |
79 | //! A face Pbase is selected in the shape Sbase to |
80 | //! serve as the basis for the pipe. It will be defined by the wire Spine. |
81 | //! Fuse offers a choice between: |
82 | //! - removing matter with a Boolean cut using the setting 0 |
83 | //! - adding matter with Boolean fusion using the setting 1. |
84 | //! The sketch face Skface serves to determine |
85 | //! the type of operation. If it is inside the basis |
86 | //! shape, a local operation such as glueing can be performed. |
87 | Standard_EXPORT void Init (const TopoDS_Shape& Sbase, const TopoDS_Shape& Pbase, const TopoDS_Face& Skface, const TopoDS_Wire& Spine, const Standard_Integer Fuse, const Standard_Boolean Modify); |
88 | |
89 | //! Indicates that the edge <E> will slide on the face |
90 | //! <OnFace>. Raises ConstructionError if the face does not belong to the |
91 | //! basis shape, or the edge to the prismed shape. |
92 | Standard_EXPORT void Add (const TopoDS_Edge& E, const TopoDS_Face& OnFace); |
93 | |
94 | Standard_EXPORT void Perform(); |
95 | |
96 | Standard_EXPORT void Perform (const TopoDS_Shape& Until); |
97 | |
98 | //! Assigns one of the following semantics |
99 | //! - to a face Until |
100 | //! - from a face From to a height Until. |
101 | //! Reconstructs the feature topologically according to the semantic option chosen. |
102 | Standard_EXPORT void Perform (const TopoDS_Shape& From, const TopoDS_Shape& Until); |
103 | |
104 | Standard_EXPORT void Curves (TColGeom_SequenceOfCurve& S); |
105 | |
106 | Standard_EXPORT Handle(Geom_Curve) BarycCurve(); |
107 | |
108 | |
109 | |
110 | |
111 | protected: |
112 | |
113 | |
114 | |
115 | |
116 | |
117 | private: |
118 | |
119 | |
120 | |
121 | TopoDS_Shape myPbase; |
122 | TopoDS_Face mySkface; |
123 | TopTools_DataMapOfShapeListOfShape mySlface; |
124 | TopoDS_Wire mySpine; |
125 | TColGeom_SequenceOfCurve myCurves; |
126 | Handle(Geom_Curve) myBCurve; |
127 | |
128 | |
129 | }; |
130 | |
131 | |
132 | #include <BRepFeat_MakePipe.lxx> |
133 | |
134 | |
135 | |
136 | |
137 | |
138 | #endif // _BRepFeat_MakePipe_HeaderFile |