1 // Created on: 1998-11-25
2 // Created by: Xuan PHAM PHU
3 // Copyright (c) 1998-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 _TopOpeBRepTool_CORRISO_HeaderFile
18 #define _TopOpeBRepTool_CORRISO_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23 
24 #include <TopoDS_Face.hxx>
25 #include <GeomAdaptor_Surface.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_Real.hxx>
28 #include <TopoDS_Shape.hxx>
29 #include <TopTools_ListOfShape.hxx>
30 #include <TopOpeBRepTool_DataMapOfOrientedShapeC2DF.hxx>
31 #include <TopTools_DataMapOfShapeListOfShape.hxx>
32 #include <Standard_Integer.hxx>
33 #include <TopTools_DataMapOfOrientedShapeInteger.hxx>
34 class TopoDS_Face;
35 class GeomAdaptor_Surface;
36 class TopoDS_Shape;
37 class TopoDS_Edge;
38 class TopOpeBRepTool_C2DF;
39 class TopoDS_Vertex;
40 
41 
42 //! Fref is built on x-periodic surface (x=u,v).
43 //! S built on Fref's geometry, should be UVClosed.
44 //!
45 //! Give us E, an edge of S. 2drep(E) is not UV connexed.
46 //! We translate 2drep(E) in xdir*xperiod if necessary.
47 //!
48 //! call : TopOpeBRepTool_CORRISO Tool(Fref);
49 //! Tool.Init(S);
50 //! if (!Tool.UVClosed()) {
51 //! // initialize EdsToCheck,nfybounds,stopatfirst
52 //!
53 //! Tool.EdgeWithFaultyUV(EdsToCheck,nfybounds,FyEds,stopatfirst);
54 //! if (Tool.SetUVClosed()) S = Tool.GetnewS();
55 //! }
56 class TopOpeBRepTool_CORRISO
57 {
58 public:
59 
60   DEFINE_STANDARD_ALLOC
61 
62 
63   Standard_EXPORT TopOpeBRepTool_CORRISO();
64 
65   Standard_EXPORT TopOpeBRepTool_CORRISO(const TopoDS_Face& FRef);
66 
67   Standard_EXPORT const TopoDS_Face& Fref() const;
68 
69   Standard_EXPORT const GeomAdaptor_Surface& GASref() const;
70 
71   Standard_EXPORT Standard_Boolean Refclosed (const Standard_Integer x, Standard_Real& xperiod) const;
72 
73   Standard_EXPORT Standard_Boolean Init (const TopoDS_Shape& S);
74 
75   Standard_EXPORT const TopoDS_Shape& S() const;
76 
77   Standard_EXPORT const TopTools_ListOfShape& Eds() const;
78 
79   Standard_EXPORT Standard_Boolean UVClosed() const;
80 
81   Standard_EXPORT Standard_Real Tol (const Standard_Integer I, const Standard_Real tol3d) const;
82 
83   Standard_EXPORT Standard_Boolean PurgeFyClosingE (const TopTools_ListOfShape& ClEds, TopTools_ListOfShape& fyClEds) const;
84 
85   Standard_EXPORT Standard_Integer EdgeOUTofBoundsUV (const TopoDS_Edge& E, const Standard_Boolean onU, const Standard_Real tolx, Standard_Real& parspE) const;
86 
87   Standard_EXPORT Standard_Boolean EdgesOUTofBoundsUV (const TopTools_ListOfShape& EdsToCheck, const Standard_Boolean onU, const Standard_Real tolx, TopTools_DataMapOfOrientedShapeInteger& FyEds) const;
88 
89   Standard_EXPORT Standard_Boolean EdgeWithFaultyUV (const TopoDS_Edge& E, Standard_Integer& Ivfaulty) const;
90 
91   Standard_EXPORT Standard_Boolean EdgesWithFaultyUV (const TopTools_ListOfShape& EdsToCheck, const Standard_Integer nfybounds, TopTools_DataMapOfOrientedShapeInteger& FyEds, const Standard_Boolean stopatfirst = Standard_False) const;
92 
93   Standard_EXPORT Standard_Boolean EdgeWithFaultyUV (const TopTools_ListOfShape& EdsToCheck, const Standard_Integer nfybounds, TopoDS_Shape& fyE, Standard_Integer& Ifaulty) const;
94 
95   Standard_EXPORT Standard_Boolean TrslUV (const Standard_Boolean onU, const TopTools_DataMapOfOrientedShapeInteger& FyEds);
96 
97   Standard_EXPORT Standard_Boolean GetnewS (TopoDS_Face& newS) const;
98 
99   Standard_EXPORT Standard_Boolean UVRep (const TopoDS_Edge& E, TopOpeBRepTool_C2DF& C2DF) const;
100 
101   Standard_EXPORT Standard_Boolean SetUVRep (const TopoDS_Edge& E, const TopOpeBRepTool_C2DF& C2DF);
102 
103   Standard_EXPORT Standard_Boolean Connexity (const TopoDS_Vertex& V, TopTools_ListOfShape& Eds) const;
104 
105   Standard_EXPORT Standard_Boolean SetConnexity (const TopoDS_Vertex& V, const TopTools_ListOfShape& Eds);
106 
107   Standard_EXPORT Standard_Boolean AddNewConnexity (const TopoDS_Vertex& V, const TopoDS_Edge& E);
108 
109   Standard_EXPORT Standard_Boolean RemoveOldConnexity (const TopoDS_Vertex& V, const TopoDS_Edge& E);
110 
111 
112 
113 
114 protected:
115 
116 
117 
118 
119 
120 private:
121 
122 
123 
124   TopoDS_Face myFref;
125   GeomAdaptor_Surface myGAS;
126   Standard_Boolean myUclosed;
127   Standard_Boolean myVclosed;
128   Standard_Real myUper;
129   Standard_Real myVper;
130   TopoDS_Shape myS;
131   TopTools_ListOfShape myEds;
132   TopOpeBRepTool_DataMapOfOrientedShapeC2DF myERep2d;
133   TopTools_DataMapOfShapeListOfShape myVEds;
134 
135 
136 };
137 
138 
139 
140 
141 
142 
143 
144 #endif // _TopOpeBRepTool_CORRISO_HeaderFile
145