42cf5bc1 |
1 | // Created on: 1996-09-03 |
2 | // Created by: Olga PILLOT |
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_MakeDPrism_HeaderFile |
18 | #define _BRepFeat_MakeDPrism_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TopoDS_Face.hxx> |
25 | #include <TopTools_DataMapOfShapeListOfShape.hxx> |
26 | #include <Standard_Real.hxx> |
27 | #include <TColGeom_SequenceOfCurve.hxx> |
28 | #include <TopTools_ListOfShape.hxx> |
29 | #include <BRepFeat_StatusError.hxx> |
30 | #include <BRepFeat_Form.hxx> |
31 | #include <Standard_Integer.hxx> |
32 | #include <Standard_Boolean.hxx> |
33 | class Geom_Curve; |
34 | class Standard_ConstructionError; |
35 | class TopoDS_Shape; |
36 | class TopoDS_Face; |
37 | class TopoDS_Edge; |
38 | |
39 | |
40 | //! Describes functions to build draft |
41 | //! prism topologies from basis shape surfaces. These can be depressions or protrusions. |
42 | //! The semantics of draft prism feature creation is based on the |
43 | //! construction of shapes: |
44 | //! - along a length |
45 | //! - up to a limiting face |
46 | //! - from a limiting face to a height. |
47 | //! The shape defining construction of the draft prism feature can be |
48 | //! either the supporting edge or the concerned area of a face. |
49 | //! In case of the supporting edge, this contour can be attached to a |
50 | //! face of the basis shape by binding. When the contour is bound to this |
51 | //! face, the information that the contour will slide on the face |
52 | //! becomes available to the relevant class methods. |
53 | //! In case of the concerned area of a face, you could, for example, cut |
54 | //! it out and move it to a different height which will define the |
55 | //! limiting face of a protrusion or depression. |
56 | class BRepFeat_MakeDPrism : public BRepFeat_Form |
57 | { |
58 | public: |
59 | |
60 | DEFINE_STANDARD_ALLOC |
61 | |
62 | |
63 | //! A face Pbase is selected in the shape |
64 | //! Sbase to serve as the basis for the draft prism. The |
65 | //! draft will be defined by the angle Angle and Fuse offers a choice between: |
66 | //! - removing matter with a Boolean cut using the setting 0 |
67 | //! - adding matter with Boolean fusion using the setting 1. |
68 | //! The sketch face Skface serves to determine the type of |
69 | //! operation. If it is inside the basis shape, a local |
70 | //! operation such as glueing can be performed. |
71 | //! Initializes the draft prism class |
72 | BRepFeat_MakeDPrism(const TopoDS_Shape& Sbase, const TopoDS_Face& Pbase, const TopoDS_Face& Skface, const Standard_Real Angle, const Standard_Integer Fuse, const Standard_Boolean Modify); |
73 | |
74 | Standard_EXPORT BRepFeat_MakeDPrism(); |
75 | |
76 | //! Initializes this algorithm for building draft prisms along surfaces. |
77 | //! A face Pbase is selected in the basis shape Sbase to |
78 | //! serve as the basis from the draft prism. The draft will be |
79 | //! defined by the angle Angle and Fuse offers a choice between: |
80 | //! - removing matter with a Boolean cut using the setting 0 |
81 | //! - adding matter with Boolean fusion using the setting 1. |
82 | //! The sketch face Skface serves to determine the type of |
83 | //! operation. If it is inside the basis shape, a local |
84 | //! operation such as glueing can be performed. |
85 | Standard_EXPORT void Init (const TopoDS_Shape& Sbase, const TopoDS_Face& Pbase, const TopoDS_Face& Skface, const Standard_Real Angle, const Standard_Integer Fuse, const Standard_Boolean Modify); |
86 | |
87 | //! Indicates that the edge <E> will slide on the face |
88 | //! <OnFace>. |
89 | //! Raises ConstructionError if the face does not belong to the |
90 | //! basis shape, or the edge to the prismed shape. |
91 | Standard_EXPORT void Add (const TopoDS_Edge& E, const TopoDS_Face& OnFace); |
92 | |
93 | Standard_EXPORT void Perform (const Standard_Real Height); |
94 | |
95 | Standard_EXPORT void Perform (const TopoDS_Shape& Until); |
96 | |
97 | //! Assigns one of the following semantics |
98 | //! - to a height Height |
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 | //! Realizes a semi-infinite prism, limited by the position of the prism base. |
105 | Standard_EXPORT void PerformUntilEnd(); |
106 | |
107 | //! Realizes a semi-infinite prism, limited by the face Funtil. |
108 | Standard_EXPORT void PerformFromEnd (const TopoDS_Shape& FUntil); |
109 | |
110 | //! Builds an infinite prism. The infinite descendants will not be kept in the result. |
111 | Standard_EXPORT void PerformThruAll(); |
112 | |
113 | //! Assigns both a limiting shape, Until from |
114 | //! TopoDS_Shape, and a height, Height at which to stop |
115 | //! generation of the prism feature. |
116 | Standard_EXPORT void PerformUntilHeight (const TopoDS_Shape& Until, const Standard_Real Height); |
117 | |
118 | Standard_EXPORT void Curves (TColGeom_SequenceOfCurve& S); |
119 | |
120 | Standard_EXPORT Handle(Geom_Curve) BarycCurve(); |
121 | |
122 | //! Determination of TopEdges and LatEdges. |
123 | //! sig = 1 -> TopEdges = FirstShape of the DPrism |
124 | //! sig = 2 -> TOpEdges = LastShape of the DPrism |
125 | Standard_EXPORT void BossEdges (const Standard_Integer sig); |
126 | |
127 | //! Returns the list of TopoDS Edges of the top of the boss. |
128 | Standard_EXPORT const TopTools_ListOfShape& TopEdges(); |
129 | |
130 | //! Returns the list of TopoDS Edges of the bottom of the boss. |
131 | Standard_EXPORT const TopTools_ListOfShape& LatEdges(); |
132 | |
133 | |
134 | |
135 | |
136 | protected: |
137 | |
138 | |
139 | |
140 | |
141 | |
142 | private: |
143 | |
144 | |
145 | |
146 | TopoDS_Face myPbase; |
147 | TopTools_DataMapOfShapeListOfShape mySlface; |
148 | Standard_Real myAngle; |
149 | TColGeom_SequenceOfCurve myCurves; |
150 | Handle(Geom_Curve) myBCurve; |
151 | TopTools_ListOfShape myTopEdges; |
152 | TopTools_ListOfShape myLatEdges; |
153 | BRepFeat_StatusError myStatusError; |
154 | |
155 | |
156 | }; |
157 | |
158 | |
159 | #include <BRepFeat_MakeDPrism.lxx> |
160 | |
161 | |
162 | |
163 | |
164 | |
165 | #endif // _BRepFeat_MakeDPrism_HeaderFile |