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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _TopOpeBRepBuild_FaceBuilder_HeaderFile
18 #define _TopOpeBRepBuild_FaceBuilder_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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;
36 class TopOpeBRepBuild_ShapeSet;
40 class TopOpeBRepBuild_FaceBuilder
47 Standard_EXPORT TopOpeBRepBuild_FaceBuilder();
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);
53 Standard_EXPORT void InitFaceBuilder (TopOpeBRepBuild_WireEdgeSet& ES, const TopoDS_Shape& F, const Standard_Boolean ForceClass);
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);
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);
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);
72 Standard_EXPORT const TopoDS_Shape& Face() const;
74 Standard_EXPORT Standard_Integer InitFace();
76 Standard_EXPORT Standard_Boolean MoreFace() const;
78 Standard_EXPORT void NextFace();
80 Standard_EXPORT Standard_Integer InitWire();
82 Standard_EXPORT Standard_Boolean MoreWire() const;
84 Standard_EXPORT void NextWire();
86 Standard_EXPORT Standard_Boolean IsOldWire() const;
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;
94 //! Iterates on myBlockIterator until finding a valid element
95 Standard_EXPORT void FindNextValidElement();
97 Standard_EXPORT Standard_Integer InitEdge();
99 Standard_EXPORT Standard_Boolean MoreEdge() const;
101 Standard_EXPORT void NextEdge();
103 //! Returns current new edge of current new wire.
104 Standard_EXPORT const TopoDS_Shape& Edge() const;
106 Standard_EXPORT Standard_Integer EdgeConnexity (const TopoDS_Shape& E) const;
108 Standard_EXPORT Standard_Integer AddEdgeWire (const TopoDS_Shape& E, TopoDS_Shape& W) const;
122 Standard_EXPORT void MakeLoops (TopOpeBRepBuild_ShapeSet& SS);
126 TopOpeBRepBuild_LoopSet myLoopSet;
127 TopOpeBRepBuild_BlockIterator myBlockIterator;
128 TopOpeBRepBuild_BlockBuilder myBlockBuilder;
129 TopOpeBRepBuild_FaceAreaBuilder myFaceAreaBuilder;
130 TopTools_DataMapOfShapeInteger myMOSI;
141 #endif // _TopOpeBRepBuild_FaceBuilder_HeaderFile