42cf5bc1 |
1 | // Created on: 1994-10-03 |
2 | // Created by: Bruno DUMORTIER |
3 | // Copyright (c) 1994-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 _BRepFill_Evolved_HeaderFile |
18 | #define _BRepFill_Evolved_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TopoDS_Face.hxx> |
25 | #include <TopoDS_Wire.hxx> |
26 | #include <TopoDS_Shape.hxx> |
27 | #include <Standard_Boolean.hxx> |
28 | #include <GeomAbs_JoinType.hxx> |
29 | #include <BRepFill_DataMapOfShapeDataMapOfShapeListOfShape.hxx> |
30 | #include <TopTools_ListOfShape.hxx> |
31 | #include <TopTools_DataMapOfShapeShape.hxx> |
32 | class Standard_ConstructionError; |
33 | class Standard_NoSuchObject; |
34 | class TopoDS_Wire; |
35 | class gp_Ax3; |
36 | class TopoDS_Face; |
37 | class TopoDS_Shape; |
38 | class BRepMAT2d_BisectingLocus; |
39 | class BRepMAT2d_LinkTopoBilo; |
40 | class BRepTools_Quilt; |
41 | class TopLoc_Location; |
42 | class TopoDS_Edge; |
43 | class TopoDS_Vertex; |
44 | |
45 | |
46 | //! Constructs an evolved volume from a spine (wire or face) |
47 | //! and a profile ( wire). |
48 | class BRepFill_Evolved |
49 | { |
50 | public: |
51 | |
52 | DEFINE_STANDARD_ALLOC |
53 | |
54 | |
55 | Standard_EXPORT BRepFill_Evolved(); |
56 | |
57 | //! Creates an evolved shape by sweeping the <Profile> |
58 | //! along the <Spine>. <AxeProf> is used to set the |
59 | //! position of <Profile> along <Spine> as follows: |
60 | //! <AxeProf> slides on the profile with direction |
61 | //! colinear to the normal to <Spine>, and its |
62 | //! <XDirection> mixed with the tangent to <Spine>. |
63 | Standard_EXPORT BRepFill_Evolved(const TopoDS_Wire& Spine, const TopoDS_Wire& Profile, const gp_Ax3& AxeProf, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean Solid = Standard_False); |
64 | |
65 | //! Creates an evolved shape by sweeping the <Profile> |
66 | //! along the <Spine> |
67 | Standard_EXPORT BRepFill_Evolved(const TopoDS_Face& Spine, const TopoDS_Wire& Profile, const gp_Ax3& AxeProf, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean Solid = Standard_False); |
68 | |
69 | //! Performs an evolved shape by sweeping the <Profile> |
70 | //! along the <Spine> |
71 | Standard_EXPORT void Perform (const TopoDS_Wire& Spine, const TopoDS_Wire& Profile, const gp_Ax3& AxeProf, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean Solid = Standard_False); |
72 | |
73 | //! Performs an evolved shape by sweeping the <Profile> |
74 | //! along the <Spine> |
75 | Standard_EXPORT void Perform (const TopoDS_Face& Spine, const TopoDS_Wire& Profile, const gp_Ax3& AxeProf, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean Solid = Standard_False); |
76 | |
77 | Standard_EXPORT Standard_Boolean IsDone() const; |
78 | |
79 | //! returns the generated shape. |
80 | Standard_EXPORT const TopoDS_Shape& Shape() const; |
81 | |
82 | //! Returns the shapes created from a subshape |
83 | //! <SpineShape> of the spine and a subshape |
84 | //! <ProfShape> on the profile. |
85 | Standard_EXPORT const TopTools_ListOfShape& GeneratedShapes (const TopoDS_Shape& SpineShape, const TopoDS_Shape& ProfShape) const; |
86 | |
87 | Standard_EXPORT GeomAbs_JoinType JoinType() const; |
88 | |
89 | //! Return the face Top if <Solid> is True in the constructor. |
90 | Standard_EXPORT const TopoDS_Shape& Top() const; |
91 | |
92 | //! Return the face Bottom if <Solid> is True in the constructor. |
93 | Standard_EXPORT const TopoDS_Shape& Bottom() const; |
94 | |
95 | |
96 | |
97 | |
98 | protected: |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | private: |
105 | |
106 | |
107 | Standard_EXPORT void PrivatePerform (const TopoDS_Face& Spine, const TopoDS_Wire& Profile, const gp_Ax3& AxeProf, const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean Solid = Standard_False); |
108 | |
109 | Standard_EXPORT void SetWork (const TopoDS_Face& Spine, const TopoDS_Wire& Profile); |
110 | |
111 | Standard_EXPORT void ElementaryPerform (const TopoDS_Face& Spine, const TopoDS_Wire& Profile, const BRepMAT2d_BisectingLocus& Locus, BRepMAT2d_LinkTopoBilo& Link, const GeomAbs_JoinType Join = GeomAbs_Arc); |
112 | |
113 | Standard_EXPORT void PlanarPerform (const TopoDS_Face& Spine, const TopoDS_Wire& Profile, const BRepMAT2d_BisectingLocus& Locus, BRepMAT2d_LinkTopoBilo& Link, const GeomAbs_JoinType Join = GeomAbs_Arc); |
114 | |
115 | Standard_EXPORT void VerticalPerform (const TopoDS_Face& Spine, const TopoDS_Wire& Profile, const BRepMAT2d_BisectingLocus& Locus, BRepMAT2d_LinkTopoBilo& Link, const GeomAbs_JoinType Join = GeomAbs_Arc); |
116 | |
117 | Standard_EXPORT BRepFill_DataMapOfShapeDataMapOfShapeListOfShape& Generated(); |
118 | |
119 | Standard_EXPORT void Add (BRepFill_Evolved& Vevo, const TopoDS_Wire& Prof, BRepTools_Quilt& Glue); |
120 | |
121 | Standard_EXPORT TopoDS_Shape& ChangeShape(); |
122 | |
123 | Standard_EXPORT void Transfert (BRepFill_Evolved& Vevo, const TopTools_DataMapOfShapeShape& MapProf, const TopTools_DataMapOfShapeShape& MapSpine, const TopLoc_Location& LS, const TopLoc_Location& InitLS, const TopLoc_Location& InitLP); |
124 | |
125 | //! Prepare the profil as follow |
126 | //! - Project the profile in the yOz Plane |
127 | //! - Cut the profile at the extrema of distance from the |
128 | //! Profile to the Oz Axis. |
129 | //! - building the new wires with the cutting edges. |
130 | Standard_EXPORT void PrepareProfile (TopTools_ListOfShape& WorkProf, TopTools_DataMapOfShapeShape& MapProf) const; |
131 | |
132 | //! Prepare the spine as follow |
133 | //! - Cut the spine-Edges at the extrema of curvature and |
134 | //! at the inflexion points. |
135 | Standard_EXPORT void PrepareSpine (TopoDS_Face& WorkSpine, TopTools_DataMapOfShapeShape& SpineProf) const; |
136 | |
137 | Standard_EXPORT void MakePipe (const TopoDS_Edge& SpineEdge, const gp_Ax3& ProfRef); |
138 | |
139 | Standard_EXPORT void MakeRevol (const TopoDS_Edge& SpineEdge, const TopoDS_Vertex& SpineVertex, const gp_Ax3& ProfRef); |
140 | |
141 | //! Find the location transforming the planar shape <Shape> |
142 | //! in the plane xOy |
143 | //! if the Shape is not planar. |
144 | Standard_EXPORT TopLoc_Location FindLocation (const TopoDS_Face& Face) const; |
145 | |
146 | //! Apply the Location <LS> to <mySpine> and <LP> to |
147 | //! <myProfil> |
148 | //! in order to set the Shapes in the work space. |
149 | Standard_EXPORT void TransformInitWork (const TopLoc_Location& LS, const TopLoc_Location& LP); |
150 | |
151 | Standard_EXPORT void ContinuityOnOffsetEdge (const TopTools_ListOfShape& WorkProf); |
152 | |
153 | Standard_EXPORT void AddTopAndBottom (BRepTools_Quilt& Glue); |
154 | |
155 | Standard_EXPORT void MakeSolid(); |
156 | |
157 | |
158 | TopoDS_Face mySpine; |
159 | TopoDS_Wire myProfile; |
160 | TopoDS_Shape myShape; |
161 | Standard_Boolean myIsDone; |
162 | Standard_Boolean mySpineType; |
163 | GeomAbs_JoinType myJoinType; |
164 | BRepFill_DataMapOfShapeDataMapOfShapeListOfShape myMap; |
165 | TopoDS_Shape myTop; |
166 | TopoDS_Shape myBottom; |
167 | |
168 | |
169 | }; |
170 | |
171 | |
172 | |
173 | |
174 | |
175 | |
176 | |
177 | #endif // _BRepFill_Evolved_HeaderFile |