Salome HOME
NRI : Change lGeometryClient by lGEOMClient.
[modules/smesh.git] / src / SMDS / SMDS_MeshEdge.cxx
1 using namespace std;
2 // File:        SMDS_MeshEdge.cxx
3 // Created:     Wed Jan 23 17:02:20 2002
4 // Author:      Jean-Michel BOULCOURT
5 //              <jmb@coulox.paris1.matra-dtv.fr>
6
7
8 #include "SMDS_MeshEdge.ixx"
9
10 //=======================================================================
11 //function : SMDS_MeshEdge
12 //purpose  : 
13 //=======================================================================
14
15 SMDS_MeshEdge::SMDS_MeshEdge(const Standard_Integer ID,
16                              const Standard_Integer idnode1, 
17                              const Standard_Integer idnode2) :
18 SMDS_MeshElement(ID,2,SMDSAbs_Edge)
19 {
20   SetConnections(idnode1,idnode2);
21   ComputeKey();
22 }
23
24 //=======================================================================
25 //function : SetConnections
26 //purpose  : 
27 //=======================================================================
28 void SMDS_MeshEdge::SetConnections(const Standard_Integer idnode1, 
29                                    const Standard_Integer idnode2)
30 {
31   Standard_Integer idmin = (idnode1 < idnode2? idnode1 : idnode2);
32
33   myNodes[0] = idmin;
34   if (idmin == idnode1) {
35     myNodes[1] = idnode2;
36   } else {
37     myNodes[1] = idnode1;
38   }
39 }
40
41 //=======================================================================
42 //function : Print
43 //purpose  : 
44 //=======================================================================
45
46 void SMDS_MeshEdge::Print(Standard_OStream& OS) const
47 {
48   OS << "edge <" << myID <<"> : (" << myNodes[0] << " , " << myNodes[1] << ") " << endl;  
49 }
50
51
52
53