0030850: Visualization, OpenGl_Text - text within trihedron persistence jitters when...
[occt.git] / src / TopOpeBRepBuild / TopOpeBRepBuild_WireEdgeSet.hxx
1 // Created on: 1993-06-16
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1993-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_WireEdgeSet_HeaderFile
18 #define _TopOpeBRepBuild_WireEdgeSet_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_ShapeSet.hxx>
26 #include <Standard_Address.hxx>
27 #include <TopTools_ListOfShape.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <TopAbs_Orientation.hxx>
30 #include <Standard_Integer.hxx>
31 #include <TCollection_AsciiString.hxx>
32 class TopoDS_Shape;
33 class TopoDS_Face;
34 class gp_Pnt2d;
35 class gp_Vec2d;
36 class TopoDS_Edge;
37 class TCollection_AsciiString;
38
39
40 //! a bound is a wire, a boundelement is an edge.
41 //! The ShapeSet stores :
42 //! - a list of wire (bounds),
43 //! - a list of edge (boundelements) to start reconstructions,
44 //! - a map of vertex giving the list of edge incident to a vertex.
45 class TopOpeBRepBuild_WireEdgeSet  : public TopOpeBRepBuild_ShapeSet
46 {
47 public:
48
49   DEFINE_STANDARD_ALLOC
50
51   
52   //! Creates a WireEdgeSet to build edges connected by vertices
53   //! on face F. Edges of the WireEdgeSet must have a representation
54   //! on surface of face F.
55   Standard_EXPORT TopOpeBRepBuild_WireEdgeSet(const TopoDS_Shape& F, const Standard_Address Addr = NULL);
56   
57   //! value of field myFace
58   Standard_EXPORT const TopoDS_Face& Face() const;
59   
60   Standard_EXPORT virtual void AddShape (const TopoDS_Shape& S) Standard_OVERRIDE;
61   
62   Standard_EXPORT virtual void AddStartElement (const TopoDS_Shape& S) Standard_OVERRIDE;
63   
64   Standard_EXPORT virtual void AddElement (const TopoDS_Shape& S) Standard_OVERRIDE;
65   
66   Standard_EXPORT virtual void InitNeighbours (const TopoDS_Shape& E) Standard_OVERRIDE;
67   
68
69   //! Build the list of neighbour edges of edge myCurrentShape
70   //! Initialize iterator of neighbour edges to edge myCurrentShape
71   Standard_EXPORT virtual void FindNeighbours() Standard_OVERRIDE;
72   
73   Standard_EXPORT virtual const TopTools_ListOfShape& MakeNeighboursList (const TopoDS_Shape& E, const TopoDS_Shape& V) Standard_OVERRIDE;
74   
75   Standard_EXPORT static void IsUVISO (const TopoDS_Edge& E, const TopoDS_Face& F, Standard_Boolean& uiso, Standard_Boolean& viso);
76   
77   Standard_EXPORT virtual void DumpSS() Standard_OVERRIDE;
78   
79   Standard_EXPORT virtual TCollection_AsciiString SName (const TopoDS_Shape& S, const TCollection_AsciiString& sb = "", const TCollection_AsciiString& sa = "") const Standard_OVERRIDE;
80   
81   Standard_EXPORT virtual TCollection_AsciiString SName (const TopTools_ListOfShape& S, const TCollection_AsciiString& sb = "", const TCollection_AsciiString& sa = "") const Standard_OVERRIDE;
82   
83   Standard_EXPORT virtual TCollection_AsciiString SNameori (const TopoDS_Shape& S, const TCollection_AsciiString& sb = "", const TCollection_AsciiString& sa = "") const Standard_OVERRIDE;
84   
85   Standard_EXPORT virtual TCollection_AsciiString SNameori (const TopTools_ListOfShape& S, const TCollection_AsciiString& sb = "", const TCollection_AsciiString& sa = "") const Standard_OVERRIDE;
86
87
88
89
90 protected:
91
92
93
94
95
96 private:
97
98   
99
100   //! Indicates whether vertex V is a good connexity vertex between
101   //! edges E1 and E2.
102   //! i.e, returns True if V is shared by E1 and E2 and if V has different
103   //! orientations on E1 and E2.
104   //! If V is shared by E1 and E2, returns the orientation of V on E1 and E2
105   Standard_EXPORT Standard_Boolean VertexConnectsEdges (const TopoDS_Shape& V, const TopoDS_Shape& E1, const TopoDS_Shape& E2, TopAbs_Orientation& O1, TopAbs_Orientation& O2) const;
106   
107   Standard_EXPORT Standard_Boolean VertexConnectsEdgesClosing (const TopoDS_Shape& V, const TopoDS_Shape& E1, const TopoDS_Shape& E2) const;
108   
109   Standard_EXPORT Standard_Integer NbClosingShapes (const TopTools_ListOfShape& L) const;
110   
111   Standard_EXPORT void LocalD1 (const TopoDS_Shape& F, const TopoDS_Shape& E, const TopoDS_Shape& V, gp_Pnt2d& p2, gp_Vec2d& v2) const;
112   
113   //! indicates if the edge <E> is a closing edge of myFace
114   Standard_EXPORT Standard_Boolean IsClosed (const TopoDS_Shape& E) const;
115   
116   //! indicates if the edge <E> is a closing edge on U of myFace
117   Standard_EXPORT Standard_Boolean IsUClosed (const TopoDS_Shape& E) const;
118   
119   //! indicates if the edge <E> is a closing edge on V of myFace
120   Standard_EXPORT Standard_Boolean IsVClosed (const TopoDS_Shape& E) const;
121   
122   Standard_EXPORT TCollection_AsciiString SNameVEE (const TopoDS_Shape& V, const TopoDS_Shape& E1, const TopoDS_Shape& E2) const;
123   
124   Standard_EXPORT TCollection_AsciiString SNameVEL (const TopoDS_Shape& V, const TopoDS_Shape& E, const TopTools_ListOfShape& L) const;
125
126
127   TopoDS_Face myFace;
128
129
130 };
131
132
133
134
135
136
137
138 #endif // _TopOpeBRepBuild_WireEdgeSet_HeaderFile