42cf5bc1 |
1 | // Created on: 1995-12-21 |
2 | // Created by: Jean Yves LEBEY |
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 _TopOpeBRepBuild_FaceBuilder_HeaderFile |
18 | #define _TopOpeBRepBuild_FaceBuilder_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TopoDS_Face.hxx> |
25 | #include <TopOpeBRepBuild_LoopSet.hxx> |
26 | #include <TopOpeBRepBuild_BlockIterator.hxx> |
27 | #include <TopOpeBRepBuild_BlockBuilder.hxx> |
28 | #include <TopOpeBRepBuild_FaceAreaBuilder.hxx> |
29 | #include <TopTools_DataMapOfShapeInteger.hxx> |
30 | #include <Standard_Boolean.hxx> |
31 | #include <TopTools_IndexedDataMapOfShapeShape.hxx> |
32 | #include <TopTools_IndexedMapOfShape.hxx> |
33 | #include <Standard_Integer.hxx> |
34 | class TopOpeBRepBuild_WireEdgeSet; |
35 | class TopoDS_Shape; |
36 | class TopOpeBRepBuild_ShapeSet; |
37 | |
38 | |
39 | |
40 | class TopOpeBRepBuild_FaceBuilder |
41 | { |
42 | public: |
43 | |
44 | DEFINE_STANDARD_ALLOC |
45 | |
46 | |
47 | Standard_EXPORT TopOpeBRepBuild_FaceBuilder(); |
48 | |
49 | //! Create a FaceBuilder to build the faces on |
50 | //! the shapes (wires, blocks of edge) described by <LS>. |
51 | Standard_EXPORT TopOpeBRepBuild_FaceBuilder(TopOpeBRepBuild_WireEdgeSet& ES, const TopoDS_Shape& F, const Standard_Boolean ForceClass = Standard_False); |
52 | |
53 | Standard_EXPORT void InitFaceBuilder (TopOpeBRepBuild_WireEdgeSet& ES, const TopoDS_Shape& F, const Standard_Boolean ForceClass); |
54 | |
55 | //! Removes are non 3d-closed wires. |
56 | //! Fills up maps <mapVVsameG> and <mapVon1Edge>, in order to |
57 | //! correct 3d-closed but unclosed (topologic connexity) wires. |
58 | //! modifies myBlockBuilder |
59 | Standard_EXPORT void DetectUnclosedWire (TopTools_IndexedDataMapOfShapeShape& mapVVsameG, TopTools_IndexedDataMapOfShapeShape& mapVon1Edge); |
60 | |
61 | //! Using the given maps, change the topology of the 3d-closed |
62 | //! wires, in order to get closed wires. |
63 | Standard_EXPORT void CorrectGclosedWire (const TopTools_IndexedDataMapOfShapeShape& mapVVref, const TopTools_IndexedDataMapOfShapeShape& mapVon1Edge); |
64 | |
65 | //! Removes edges appearing twice (FORWARD,REVERSED) with a bounding |
66 | //! vertex not connected to any other edge. |
67 | //! mapE contains edges found. |
68 | //! modifies myBlockBuilder. |
69 | Standard_EXPORT void DetectPseudoInternalEdge (TopTools_IndexedMapOfShape& mapE); |
70 | |
71 | //! return myFace |
72 | Standard_EXPORT const TopoDS_Shape& Face() const; |
73 | |
74 | Standard_EXPORT Standard_Integer InitFace(); |
75 | |
76 | Standard_EXPORT Standard_Boolean MoreFace() const; |
77 | |
78 | Standard_EXPORT void NextFace(); |
79 | |
80 | Standard_EXPORT Standard_Integer InitWire(); |
81 | |
82 | Standard_EXPORT Standard_Boolean MoreWire() const; |
83 | |
84 | Standard_EXPORT void NextWire(); |
85 | |
86 | Standard_EXPORT Standard_Boolean IsOldWire() const; |
87 | |
88 | //! Returns current wire |
89 | //! This wire may be : |
90 | //! * an old wire OldWire(), which has not been reconstructed; |
91 | //! * a new wire made of edges described by ...NewEdge() methods. |
92 | Standard_EXPORT const TopoDS_Shape& OldWire() const; |
93 | |
94 | //! Iterates on myBlockIterator until finding a valid element |
95 | Standard_EXPORT void FindNextValidElement(); |
96 | |
97 | Standard_EXPORT Standard_Integer InitEdge(); |
98 | |
99 | Standard_EXPORT Standard_Boolean MoreEdge() const; |
100 | |
101 | Standard_EXPORT void NextEdge(); |
102 | |
103 | //! Returns current new edge of current new wire. |
104 | Standard_EXPORT const TopoDS_Shape& Edge() const; |
105 | |
106 | Standard_EXPORT Standard_Integer EdgeConnexity (const TopoDS_Shape& E) const; |
107 | |
108 | Standard_EXPORT Standard_Integer AddEdgeWire (const TopoDS_Shape& E, TopoDS_Shape& W) const; |
109 | |
110 | |
111 | |
112 | |
113 | protected: |
114 | |
115 | |
116 | |
117 | |
118 | |
119 | private: |
120 | |
121 | |
122 | Standard_EXPORT void MakeLoops (TopOpeBRepBuild_ShapeSet& SS); |
123 | |
124 | |
125 | TopoDS_Face myFace; |
126 | TopOpeBRepBuild_LoopSet myLoopSet; |
127 | TopOpeBRepBuild_BlockIterator myBlockIterator; |
128 | TopOpeBRepBuild_BlockBuilder myBlockBuilder; |
129 | TopOpeBRepBuild_FaceAreaBuilder myFaceAreaBuilder; |
130 | TopTools_DataMapOfShapeInteger myMOSI; |
131 | |
132 | |
133 | }; |
134 | |
135 | |
136 | |
137 | |
138 | |
139 | |
140 | |
141 | #endif // _TopOpeBRepBuild_FaceBuilder_HeaderFile |