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>
8 #include "SMDS_MeshElement.ixx"
10 //=======================================================================
11 //function : SMDS_MeshElement
13 //=======================================================================
15 SMDS_MeshElement::SMDS_MeshElement(const Standard_Integer ID, const Standard_Integer nb,const SMDSAbs_ElementType Type)
16 :myID(ID),myNbNodes(nb),myType(Type)
20 //=======================================================================
21 //function : GetConnections
23 //=======================================================================
25 Standard_Address SMDS_MeshElement::GetConnections() const
27 return (Standard_Address)&myID;
31 //=======================================================================
32 //function : GetConnection
34 //=======================================================================
36 Standard_Integer SMDS_MeshElement::GetConnection(const Standard_Integer rank) const
42 //=======================================================================
43 //function : InverseElements
45 //=======================================================================
47 const SMDS_ListOfMeshElement& SMDS_MeshElement::InverseElements() const
49 static SMDS_ListOfMeshElement empty;
53 //=======================================================================
54 //function : ClearInverseElements
56 //=======================================================================
58 void SMDS_MeshElement::ClearInverseElements()
62 //=======================================================================
63 //function : AddInverseElement
65 //=======================================================================
67 void SMDS_MeshElement::AddInverseElement(const Handle(SMDS_MeshElement)& elem)
71 //=======================================================================
74 //=======================================================================
76 Standard_Integer SMDS_MeshElement::NbEdges() const
81 //=======================================================================
84 //=======================================================================
86 Standard_Integer SMDS_MeshElement::NbFaces() const
92 //=======================================================================
93 //function : GetEdgeDefinedByNodes
95 //=======================================================================
97 void SMDS_MeshElement::GetEdgeDefinedByNodes(const Standard_Integer rank,
98 Standard_Integer& idnode1,
99 Standard_Integer& idnode2) const
105 //=======================================================================
106 //function : GetFaceDefinedByNodes
108 //=======================================================================
110 void SMDS_MeshElement::GetFaceDefinedByNodes(const Standard_Integer rank,
111 const Standard_Address idnode,
112 Standard_Integer& nb) const
117 //=======================================================================
118 //function : SetNormal
120 //=======================================================================
122 void SMDS_MeshElement::SetNormal(const Standard_Integer rank,
123 const Standard_Real vx,
124 const Standard_Real vy,
125 const Standard_Real vz)
128 if (myNormals.IsNull()) {
129 myNormals = new TColgp_HArray1OfDir(1,NbNodes());
131 myNormals->SetValue(rank, gp_Dir(vx,vy,vz));
134 //=======================================================================
135 //function : SetNormal
137 //=======================================================================
139 void SMDS_MeshElement::SetNormal(const Standard_Integer rank,
142 if (myNormals.IsNull()) {
143 myNormals = new TColgp_HArray1OfDir(1,NbNodes());
145 myNormals->SetValue(rank, gp_Dir(V));
148 //=======================================================================
149 //function : GetNormal
151 //=======================================================================
153 gp_Dir SMDS_MeshElement::GetNormal(const Standard_Integer rank)
155 if (myNormals.IsNull()) {
156 myNormals = new TColgp_HArray1OfDir(1,NbNodes());
158 return myNormals->Value(rank);
161 //=======================================================================
164 //=======================================================================
166 void SMDS_MeshElement::Print(Standard_OStream& OS) const
168 OS << "dump of mesh element" << endl;
172 Standard_OStream& operator << (Standard_OStream& OS
173 ,const Handle(SMDS_MeshElement)& ME)