Salome HOME
yfr : Merge with v1.2
[modules/smesh.git] / src / SMESHDS / SMESHDS_Command.hxx
1 //  SMESH SMESHDS : management of mesh data and SMESH document
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   : SMESHDS_Command.hxx
25 //  Module : SMESH
26
27 #ifndef _SMESHDS_Command_HeaderFile
28 #define _SMESHDS_Command_HeaderFile
29
30 #ifndef _Standard_HeaderFile
31 #include <Standard.hxx>
32 #endif
33 #ifndef _Handle_SMESHDS_Command_HeaderFile
34 #include "Handle_SMESHDS_Command.hxx"
35 #endif
36
37 #ifndef _SMESHDS_CommandType_HeaderFile
38 #include "SMESHDS_CommandType.hxx"
39 #endif
40 #ifndef _Standard_Integer_HeaderFile
41 #include <Standard_Integer.hxx>
42 #endif
43 #ifndef _TColStd_ListOfReal_HeaderFile
44 #include <TColStd_ListOfReal.hxx>
45 #endif
46 #ifndef _TColStd_ListOfInteger_HeaderFile
47 #include <TColStd_ListOfInteger.hxx>
48 #endif
49 #ifndef _MMgt_TShared_HeaderFile
50 #include <MMgt_TShared.hxx>
51 #endif
52 #ifndef _Standard_Real_HeaderFile
53 #include <Standard_Real.hxx>
54 #endif
55 class TColStd_ListOfInteger;
56 class TColStd_ListOfReal;
57
58
59 class SMESHDS_Command : public MMgt_TShared {
60
61 public:
62
63     inline void* operator new(size_t,void* anAddress) 
64       {
65         return anAddress;
66       }
67     inline void* operator new(size_t size) 
68       { 
69         return Standard::Allocate(size); 
70       }
71     inline void  operator delete(void *anAddress) 
72       { 
73         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
74       }
75 //    inline void  operator delete(void *anAddress, size_t size) 
76 //      { 
77 //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
78 //      }
79  // Methods PUBLIC
80  // 
81 Standard_EXPORT SMESHDS_Command(const SMESHDS_CommandType aType);
82 Standard_EXPORT   void AddNode(const Standard_Integer NewNodeID,const Standard_Real x,const Standard_Real y,const Standard_Real z) ;
83 Standard_EXPORT   void AddEdge(const Standard_Integer NewEdgeID,const Standard_Integer idnode1,const Standard_Integer idnode2) ;
84 Standard_EXPORT   void AddFace(const Standard_Integer NewFaceID,const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3) ;
85 Standard_EXPORT   void AddFace(const Standard_Integer NewFaceID,const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3,const Standard_Integer idnode4) ;
86 Standard_EXPORT   void AddVolume(const Standard_Integer NewVolID,const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3,const Standard_Integer idnode4) ;
87 Standard_EXPORT   void AddVolume(const Standard_Integer NewVolID,const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3,const Standard_Integer idnode4,const Standard_Integer idnode5) ;
88 Standard_EXPORT   void AddVolume(const Standard_Integer NewVolID,const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3,const Standard_Integer idnode4,const Standard_Integer idnode5,const Standard_Integer idnode6) ;
89 Standard_EXPORT   void AddVolume(const Standard_Integer NewVolID,const Standard_Integer idnode1,const Standard_Integer idnode2,const Standard_Integer idnode3,const Standard_Integer idnode4,const Standard_Integer idnode5,const Standard_Integer idnode6,const Standard_Integer idnode7,const Standard_Integer idnode8) ;
90 Standard_EXPORT   void MoveNode(const Standard_Integer NewNodeID,const Standard_Real x,const Standard_Real y,const Standard_Real z) ;
91 Standard_EXPORT   void RemoveNode(const Standard_Integer NodeID) ;
92 Standard_EXPORT   void RemoveElement(const Standard_Integer ElementID) ;
93 Standard_EXPORT   SMESHDS_CommandType GetType() ;
94 Standard_EXPORT   Standard_Integer GetNumber() ;
95 Standard_EXPORT  const TColStd_ListOfInteger& GetIndexes() ;
96 Standard_EXPORT  const TColStd_ListOfReal& GetCoords() ;
97 Standard_EXPORT ~SMESHDS_Command();
98
99
100
101
102  // Type management
103  //
104  Standard_EXPORT friend Handle_Standard_Type& SMESHDS_Command_Type_();
105  Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
106  Standard_EXPORT Standard_Boolean              IsKind(const Handle(Standard_Type)&) const;
107
108 protected:
109
110  // Methods PROTECTED
111  // 
112
113
114  // Fields PROTECTED
115  //
116
117
118 private: 
119
120  // Methods PRIVATE
121  // 
122
123
124  // Fields PRIVATE
125  //
126 SMESHDS_CommandType myType;
127 Standard_Integer myNumber;
128 TColStd_ListOfReal myReals;
129 TColStd_ListOfInteger myIntegers;
130
131
132 };
133
134
135
136
137
138 // other inline functions and methods (like "C++: function call" methods)
139 //
140
141
142 #endif