Salome HOME
sources v1.2
[modules/smesh.git] / src / SMDS / SMDS_MeshNode.hxx
1 //  SMESH SMDS : implementaion of Salome mesh data structure
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SMDS_MeshNode.hxx
25 //  Module : SMESH
26
27 #ifndef _SMDS_MeshNode_HeaderFile
28 #define _SMDS_MeshNode_HeaderFile
29
30 #ifndef _Standard_HeaderFile
31 #include <Standard.hxx>
32 #endif
33 #ifndef _Handle_SMDS_MeshNode_HeaderFile
34 #include "Handle_SMDS_MeshNode.hxx"
35 #endif
36
37 #ifndef _gp_Pnt_HeaderFile
38 #include <gp_Pnt.hxx>
39 #endif
40 #ifndef _SMDS_ListOfMeshElement_HeaderFile
41 #include "SMDS_ListOfMeshElement.hxx"
42 #endif
43 #ifndef _Handle_SMDS_Position_HeaderFile
44 #include "Handle_SMDS_Position.hxx"
45 #endif
46 #ifndef _SMDS_MeshElement_HeaderFile
47 #include "SMDS_MeshElement.hxx"
48 #endif
49 #ifndef _Standard_Integer_HeaderFile
50 #include <Standard_Integer.hxx>
51 #endif
52 #ifndef _Standard_Real_HeaderFile
53 #include <Standard_Real.hxx>
54 #endif
55 #ifndef _Standard_OStream_HeaderFile
56 #include <Standard_OStream.hxx>
57 #endif
58 #ifndef _Handle_SMDS_MeshElement_HeaderFile
59 #include "Handle_SMDS_MeshElement.hxx"
60 #endif
61 class SMDS_Position;
62 class gp_Pnt;
63 class SMDS_MeshElement;
64 class SMDS_ListOfMeshElement;
65
66
67 class SMDS_MeshNode : public SMDS_MeshElement {
68
69 public:
70
71     inline void* operator new(size_t,void* anAddress) 
72       {
73         return anAddress;
74       }
75     inline void* operator new(size_t size) 
76       { 
77         return Standard::Allocate(size); 
78       }
79     inline void  operator delete(void *anAddress) 
80       { 
81         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
82       }
83 //    inline void  operator delete(void *anAddress, size_t size) 
84 //      { 
85 //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
86 //      }
87  // Methods PUBLIC
88  // 
89 Standard_EXPORT SMDS_MeshNode(const Standard_Integer ID,const Standard_Real x,const Standard_Real y,const Standard_Real z);
90 Standard_EXPORT   void Print(Standard_OStream& OS) const;
91 Standard_EXPORT inline   Standard_Integer GetKey() const;
92 Standard_EXPORT inline   Standard_Real X() const;
93 Standard_EXPORT inline   Standard_Real Y() const;
94 Standard_EXPORT inline   Standard_Real Z() const;
95 Standard_EXPORT inline   gp_Pnt Pnt() const;
96 Standard_EXPORT inline   void SetPnt(const gp_Pnt& P) ;
97 Standard_EXPORT inline   void AddInverseElement(const Handle(SMDS_MeshElement)& ME) ;
98 Standard_EXPORT   void RemoveInverseElement(const Handle(SMDS_MeshElement)& parent) ;
99 Standard_EXPORT inline  const SMDS_ListOfMeshElement& InverseElements() const;
100 Standard_EXPORT inline   void ClearInverseElements() ;
101 Standard_EXPORT   void SetPosition(const Handle(SMDS_Position)& aPos) ;
102 Standard_EXPORT   Handle_SMDS_Position GetPosition() const;
103 Standard_EXPORT ~SMDS_MeshNode();
104
105
106
107
108  // Type management
109  //
110  Standard_EXPORT friend Handle_Standard_Type& SMDS_MeshNode_Type_();
111  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
112  Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
113
114 protected:
115
116  // Methods PROTECTED
117  // 
118
119
120  // Fields PROTECTED
121  //
122
123
124 private: 
125
126  // Methods PRIVATE
127  // 
128
129
130  // Fields PRIVATE
131  //
132 gp_Pnt myPnt;
133 SMDS_ListOfMeshElement myInverseElements;
134 Handle_SMDS_Position myPosition;
135
136
137 };
138
139
140 #include "SMDS_MeshNode.lxx"
141
142
143
144 // other inline functions and methods (like "C++: function call" methods)
145 //
146
147
148 #endif