1 // Created on: 1993-05-06
2 // Created by: Yves FRICAUD
3 // Copyright (c) 1993-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.
18 #include <MAT_Node.hxx>
19 #include <Precision.hxx>
20 #include <Standard_Type.hxx>
22 IMPLEMENT_STANDARD_RTTIEXT(MAT_Node,Standard_Transient)
24 //=============================================================================
27 //=============================================================================
28 MAT_Node::MAT_Node(const Standard_Integer GeomIndex,
29 const Handle(MAT_Arc)& LinkedArc,
30 const Standard_Real Distance)
35 aLinkedArc = LinkedArc.get();
38 //=============================================================================
39 //function : GeomIndex
41 //=============================================================================
42 Standard_Integer MAT_Node::GeomIndex() const
47 //=============================================================================
50 //=============================================================================
51 Standard_Integer MAT_Node::Index() const
56 //=============================================================================
57 //function : LinkedArcs
59 //=============================================================================
60 void MAT_Node::LinkedArcs(MAT_SequenceOfArc& S) const
63 Handle(MAT_Node) Me = this;
64 Handle(MAT_Arc) LA((MAT_Arc*)aLinkedArc);
68 if (LA->HasNeighbour(Me, MAT_Left)) {
69 Handle(MAT_Arc) CA = LA->Neighbour(Me, MAT_Left);
72 CA = CA->Neighbour(Me, MAT_Left);
77 //=============================================================================
80 //=============================================================================
81 void MAT_Node::NearElts(MAT_SequenceOfBasicElt& S) const
85 Handle(MAT_Node) Me = this;
86 Handle(MAT_Arc) LA((MAT_Arc*)aLinkedArc);
88 S.Append(LA->FirstElement());
89 S.Append(LA->SecondElement());
91 if (LA->HasNeighbour(Me, MAT_Left)) {
93 Handle(MAT_Arc) CA = LA->Neighbour(Me, MAT_Left);
94 Standard_Boolean Pair = Standard_False;
96 //---------------------------------------------------------
97 // Recuperation des deux elements separes pour un arc sur
99 //---------------------------------------------------------
103 S.Append(CA->FirstElement());
104 S.Append(CA->SecondElement());
107 Pair = Standard_True;
109 CA = CA->Neighbour(Me, MAT_Left);
114 //=============================================================================
115 //function : Distance
117 //=============================================================================
118 Standard_Real MAT_Node::Distance() const
124 //=============================================================================
125 //function : PendingNode
127 //=============================================================================
128 Standard_Boolean MAT_Node::PendingNode() const
130 Handle(MAT_Node) Me = this;
131 return (!((MAT_Arc*)aLinkedArc)->HasNeighbour(Me,MAT_Left));
134 //=============================================================================
135 //function : NodeOnFig
137 //=============================================================================
138 Standard_Boolean MAT_Node::OnBasicElt() const
140 return (Distance() == 0.0);
143 //=============================================================================
144 //function : NodeInfinite
146 //=============================================================================
147 Standard_Boolean MAT_Node::Infinite() const
149 return (Distance() == Precision::Infinite());
152 //=============================================================================
153 //function : SetLinkedArcs
155 //=============================================================================
156 void MAT_Node::SetLinkedArc (const Handle(MAT_Arc)& LinkedArc)
158 aLinkedArc = LinkedArc.get();
161 //=============================================================================
162 //function : SetIndex
164 //=============================================================================
165 void MAT_Node::SetIndex (const Standard_Integer anIndex)