0027961: Visualization - remove unused and no more working OpenGl_AVIWriter
[occt.git] / src / BRepMesh / BRepMesh_Edge.hxx
1 // Copyright (c) 2013 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _BRepMesh_Edge_HeaderFile
15 #define _BRepMesh_Edge_HeaderFile
16
17 #include <Standard.hxx>
18 #include <Standard_DefineAlloc.hxx>
19 #include <Standard_Macro.hxx>
20 #include <BRepMesh_DegreeOfFreedom.hxx>
21 #include <BRepMesh_OrientedEdge.hxx>
22
23 //! Light weighted structure representing link of the mesh.
24 class BRepMesh_Edge : public BRepMesh_OrientedEdge
25 {
26 public:
27
28     //! Default constructor.
29   BRepMesh_Edge()
30     : BRepMesh_OrientedEdge(),
31       myMovability(BRepMesh_Deleted)
32   {
33   }
34
35   //! Constructs a link between two vertices.
36   BRepMesh_Edge(
37     const Standard_Integer         theFirstNode,
38     const Standard_Integer         theLastNode,
39     const BRepMesh_DegreeOfFreedom theMovability)
40     : BRepMesh_OrientedEdge(theFirstNode, theLastNode),
41       myMovability(theMovability)
42   {
43   }
44
45   //! Returns movability flag of the Link.
46   inline BRepMesh_DegreeOfFreedom Movability() const
47   {
48     return myMovability;
49   }
50
51   //! Sets movability flag of the Link.
52   //! @param theMovability flag to be set.
53   inline void SetMovability(const BRepMesh_DegreeOfFreedom theMovability)
54   {
55     myMovability = theMovability;
56   }
57
58   //! Checks if the given edge and this one have the same orientation.
59   //! @param theOther edge to be checked against this one.
60   //! \retrun TRUE if edges have the same orientation, FALSE if not.
61   inline Standard_Boolean IsSameOrientation(const BRepMesh_Edge& theOther) const
62   {
63     return BRepMesh_OrientedEdge::IsEqual(theOther);
64   }
65
66   //! Checks for equality with another edge.
67   //! @param theOther edge to be checked against this one.
68   //! @return TRUE if equal, FALSE if not.
69   inline Standard_Boolean IsEqual(const BRepMesh_Edge& theOther) const
70   {
71     if (myMovability == BRepMesh_Deleted || theOther.myMovability == BRepMesh_Deleted)
72       return Standard_False;
73
74     return IsSameOrientation(theOther) ||
75       (FirstNode() == theOther.LastNode() && LastNode() == theOther.FirstNode());
76   }
77
78   //! Alias for IsEqual.
79   Standard_Boolean operator ==(const BRepMesh_Edge& Other) const
80   {
81     return IsEqual(Other);
82   }
83
84 private:
85
86   BRepMesh_DegreeOfFreedom  myMovability;
87 };
88
89 inline Standard_Integer HashCode(const BRepMesh_Edge&   theEdge,
90                                  const Standard_Integer theUpper)
91 {
92   return theEdge.HashCode(theUpper);
93 }
94
95 #endif