0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / TopOpeBRepBuild / TopOpeBRepBuild_CorrectFace2d.hxx
1 // Created on: 2000-01-25
2 // Created by: Peter KURNEV
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _TopOpeBRepBuild_CorrectFace2d_HeaderFile
17 #define _TopOpeBRepBuild_CorrectFace2d_HeaderFile
18
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
22
23 #include <TopoDS_Face.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Real.hxx>
27 #include <TopoDS_Wire.hxx>
28 #include <TopTools_ListOfShape.hxx>
29 #include <TopTools_IndexedMapOfOrientedShape.hxx>
30 #include <Standard_Address.hxx>
31 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
32 class TopoDS_Face;
33 class TopoDS_Edge;
34 class gp_Pnt2d;
35 class TopoDS_Shape;
36 class gp_Vec2d;
37 class Geom2d_Curve;
38 class TopoDS_Wire;
39 class Bnd_Box2d;
40
41
42
43 class TopOpeBRepBuild_CorrectFace2d 
44 {
45 public:
46
47   DEFINE_STANDARD_ALLOC
48
49   
50   Standard_EXPORT TopOpeBRepBuild_CorrectFace2d();
51   
52   Standard_EXPORT TopOpeBRepBuild_CorrectFace2d(const TopoDS_Face& aFace, const TopTools_IndexedMapOfOrientedShape& anAvoidMap, TopTools_IndexedDataMapOfShapeShape& aMap);
53   
54   Standard_EXPORT const TopoDS_Face& Face() const;
55   
56   Standard_EXPORT void Perform();
57   
58   Standard_EXPORT Standard_Boolean IsDone() const;
59   
60   Standard_EXPORT Standard_Integer ErrorStatus() const;
61   
62   Standard_EXPORT const TopoDS_Face& CorrectedFace() const;
63   
64   Standard_EXPORT void SetMapOfTrans2dInfo (TopTools_IndexedDataMapOfShapeShape& aMap);
65   
66   Standard_EXPORT TopTools_IndexedDataMapOfShapeShape& MapOfTrans2dInfo();
67   
68   Standard_EXPORT static void GetP2dFL (const TopoDS_Face& aFace, const TopoDS_Edge& anEdge, gp_Pnt2d& P2dF, gp_Pnt2d& P2dL);
69   
70   Standard_EXPORT static void CheckList (const TopoDS_Face& aFace, TopTools_ListOfShape& aHeadList);
71
72
73
74
75 protected:
76
77
78
79
80
81 private:
82
83   
84   Standard_EXPORT void CheckFace();
85   
86   Standard_EXPORT Standard_Integer MakeRightWire();
87   
88   Standard_EXPORT void MakeHeadList (const TopoDS_Shape& aFirstEdge, TopTools_ListOfShape& aHeadList) const;
89   
90   Standard_EXPORT void TranslateCurve2d (const TopoDS_Edge& anEdge, const TopoDS_Face& aFace, const gp_Vec2d& aTranslateVec, Handle(Geom2d_Curve)& aCurve2d);
91   
92   Standard_EXPORT Standard_Integer OuterWire (TopoDS_Wire& anOuterWire) const;
93   
94   Standard_EXPORT void BndBoxWire (const TopoDS_Wire& aWire, Bnd_Box2d& aB2d) const;
95   
96   Standard_EXPORT void MoveWire2d (TopoDS_Wire& aWire, const gp_Vec2d& aTrV);
97   
98   Standard_EXPORT void MoveWires2d (TopoDS_Wire& aWire);
99   
100   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Geom2d_Curve)& C, const TopoDS_Face& F, const Standard_Real Tol);
101   
102   Standard_EXPORT void UpdateEdge (const TopoDS_Edge& E, const Handle(Geom2d_Curve)& C1, const Handle(Geom2d_Curve)& C2, const TopoDS_Face& F, const Standard_Real Tol);
103   
104   Standard_EXPORT void BuildCopyData (const TopoDS_Face& F, const TopTools_IndexedMapOfOrientedShape& anAvoidMap, TopoDS_Face& aCopyFace, TopTools_IndexedMapOfOrientedShape& aCopyAvoidMap, const Standard_Boolean aNeedToUsePMap);
105   
106   Standard_EXPORT Standard_Integer ConnectWire (TopoDS_Face& aCopyFace, const TopTools_IndexedMapOfOrientedShape& aCopyAvoidMap, const Standard_Boolean aTryToConnectFlag);
107
108
109   TopoDS_Face myFace;
110   TopoDS_Face myCorrectedFace;
111   Standard_Boolean myIsDone;
112   Standard_Integer myErrorStatus;
113   Standard_Real myFaceTolerance;
114   TopoDS_Wire myCurrentWire;
115   TopTools_ListOfShape myOrderedWireList;
116   TopTools_IndexedMapOfOrientedShape myAvoidMap;
117   Standard_Address myMap;
118   TopoDS_Face myCopyFace;
119   TopTools_IndexedMapOfOrientedShape myCopyAvoidMap;
120   TopTools_IndexedDataMapOfShapeShape myEdMapInversed;
121
122
123 };
124
125
126
127
128
129
130
131 #endif // _TopOpeBRepBuild_CorrectFace2d_HeaderFile