Salome HOME
NRI : Change lGeometryClient by lGEOMClient.
[modules/smesh.git] / src / SMDS / SMDS_MeshElement.cxx
1 using namespace std;
2 // File:        SMDS_MeshElement.cxx
3 // Created:     Wed Jan 23 16:49:11 2002
4 // Author:      Jean-Michel BOULCOURT
5 //              <jmb@coulox.paris1.matra-dtv.fr>
6
7
8 #include "SMDS_MeshElement.ixx"
9
10 //=======================================================================
11 //function : SMDS_MeshElement
12 //purpose  : 
13 //=======================================================================
14
15 SMDS_MeshElement::SMDS_MeshElement(const Standard_Integer ID, const Standard_Integer nb,const SMDSAbs_ElementType Type) 
16   :myID(ID),myNbNodes(nb),myType(Type)
17 {
18 }
19
20 //=======================================================================
21 //function : GetConnections
22 //purpose  : 
23 //=======================================================================
24
25 Standard_Address SMDS_MeshElement::GetConnections() const
26 {
27   return (Standard_Address)&myID;
28 }
29
30
31 //=======================================================================
32 //function : GetConnection
33 //purpose  : 
34 //=======================================================================
35
36 Standard_Integer SMDS_MeshElement::GetConnection(const Standard_Integer rank) const
37 {
38   return myID;
39 }
40
41
42 //=======================================================================
43 //function : InverseElements
44 //purpose  : 
45 //=======================================================================
46
47 const SMDS_ListOfMeshElement& SMDS_MeshElement::InverseElements() const
48 {
49   static SMDS_ListOfMeshElement empty;
50   return empty;
51 }
52
53 //=======================================================================
54 //function : ClearInverseElements
55 //purpose  : 
56 //=======================================================================
57
58 void SMDS_MeshElement::ClearInverseElements()
59 {
60 }
61
62 //=======================================================================
63 //function : AddInverseElement
64 //purpose  : 
65 //=======================================================================
66
67 void SMDS_MeshElement::AddInverseElement(const Handle(SMDS_MeshElement)& elem)
68 {
69 }
70
71 //=======================================================================
72 //function : NbEdges
73 //purpose  : 
74 //=======================================================================
75
76 Standard_Integer SMDS_MeshElement::NbEdges() const
77 {
78   return 0;
79 }
80
81 //=======================================================================
82 //function : NbFaces
83 //purpose  : 
84 //=======================================================================
85
86 Standard_Integer SMDS_MeshElement::NbFaces() const
87 {
88   return 0;
89 }
90
91
92 //=======================================================================
93 //function : GetEdgeDefinedByNodes
94 //purpose  : 
95 //=======================================================================
96
97 void SMDS_MeshElement::GetEdgeDefinedByNodes(const Standard_Integer rank,
98                                              Standard_Integer& idnode1,
99                                              Standard_Integer& idnode2) const
100 {
101   idnode1 = 0;
102   idnode2 = 0;
103 }
104
105 //=======================================================================
106 //function : GetFaceDefinedByNodes
107 //purpose  : 
108 //=======================================================================
109
110 void SMDS_MeshElement::GetFaceDefinedByNodes(const Standard_Integer rank,
111                                              const Standard_Address idnode,
112                                              Standard_Integer& nb) const
113 {
114   nb = 0;
115 }
116
117 //=======================================================================
118 //function : SetNormal
119 //purpose  : 
120 //=======================================================================
121
122 void SMDS_MeshElement::SetNormal(const Standard_Integer rank,
123                                  const Standard_Real vx,
124                                  const Standard_Real vy,
125                                  const Standard_Real vz)
126
127 {
128   if (myNormals.IsNull()) {
129     myNormals = new TColgp_HArray1OfDir(1,NbNodes());
130   }
131   myNormals->SetValue(rank, gp_Dir(vx,vy,vz));
132 }
133
134 //=======================================================================
135 //function : SetNormal
136 //purpose  : 
137 //=======================================================================
138
139 void SMDS_MeshElement::SetNormal(const Standard_Integer rank,
140                                  const gp_Vec& V)
141 {
142   if (myNormals.IsNull()) {
143     myNormals = new TColgp_HArray1OfDir(1,NbNodes());
144   }
145   myNormals->SetValue(rank, gp_Dir(V));
146 }
147
148 //=======================================================================
149 //function : GetNormal
150 //purpose  : 
151 //=======================================================================
152
153 gp_Dir SMDS_MeshElement::GetNormal(const Standard_Integer rank) 
154 {
155   if (myNormals.IsNull()) {
156     myNormals = new TColgp_HArray1OfDir(1,NbNodes());
157   }
158   return myNormals->Value(rank);
159 }
160
161 //=======================================================================
162 //function : Print
163 //purpose  : 
164 //=======================================================================
165
166 void SMDS_MeshElement::Print(Standard_OStream& OS) const
167 {
168   OS << "dump of mesh element" << endl;
169 }
170
171
172 Standard_OStream& operator << (Standard_OStream& OS
173                               ,const Handle(SMDS_MeshElement)& ME) 
174 {
175   ME->Print(OS);
176   return OS;
177 }