1 // SMESH SMESHDS : management of mesh data and SMESH document
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_Command.cxx
25 // Author : Yves FRICAUD, OCC
30 #include "SMESHDS_Command.hxx"
31 #include "utilities.h"
33 //=======================================================================
36 //=======================================================================
37 SMESHDS_Command::SMESHDS_Command(const SMESHDS_CommandType aType):myType(aType),
42 //=======================================================================
45 //=======================================================================
46 void SMESHDS_Command::AddNode(int NewNodeID, double x, double y, double z)
48 if (!myType == SMESHDS_AddNode)
50 MESSAGE("SMESHDS_Command::AddNode : Bad Type");
53 myIntegers.push_back(NewNodeID);
60 //=======================================================================
63 //=======================================================================
64 void SMESHDS_Command::MoveNode(int NodeID, double x, double y, double z)
66 if (!myType == SMESHDS_MoveNode)
68 MESSAGE("SMESHDS_Command::MoveNode : Bad Type");
71 myIntegers.push_back(NodeID);
78 //=======================================================================
81 //=======================================================================
82 void SMESHDS_Command::AddEdge(int NewEdgeID, int idnode1, int idnode2)
84 if (!myType == SMESHDS_AddEdge)
86 MESSAGE("SMESHDS_Command::AddEdge : Bad Type");
89 myIntegers.push_back(NewEdgeID);
90 myIntegers.push_back(idnode1);
91 myIntegers.push_back(idnode2);
95 //=======================================================================
98 //=======================================================================
99 void SMESHDS_Command::AddFace(int NewFaceID,
100 int idnode1, int idnode2, int idnode3)
102 if (!myType == SMESHDS_AddTriangle)
104 MESSAGE("SMESHDS_Command::AddFace : Bad Type");
107 myIntegers.push_back(NewFaceID);
108 myIntegers.push_back(idnode1);
109 myIntegers.push_back(idnode2);
110 myIntegers.push_back(idnode3);
114 //=======================================================================
117 //=======================================================================
118 void SMESHDS_Command::AddFace(int NewFaceID,
119 int idnode1, int idnode2, int idnode3, int idnode4)
121 if (!myType == SMESHDS_AddQuadrangle)
123 MESSAGE("SMESHDS_Command::AddFace : Bad Type");
126 myIntegers.push_back(NewFaceID);
127 myIntegers.push_back(idnode1);
128 myIntegers.push_back(idnode2);
129 myIntegers.push_back(idnode3);
130 myIntegers.push_back(idnode4);
134 //=======================================================================
137 //=======================================================================
138 void SMESHDS_Command::AddVolume(int NewVolID,
139 int idnode1, int idnode2, int idnode3, int idnode4)
141 if (!myType == SMESHDS_AddTetrahedron)
143 MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
146 myIntegers.push_back(NewVolID);
147 myIntegers.push_back(idnode1);
148 myIntegers.push_back(idnode2);
149 myIntegers.push_back(idnode3);
150 myIntegers.push_back(idnode4);
154 //=======================================================================
157 //=======================================================================
158 void SMESHDS_Command::AddVolume(int NewVolID,
159 int idnode1, int idnode2, int idnode3, int idnode4, int idnode5)
161 if (!myType == SMESHDS_AddPyramid)
163 MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
166 myIntegers.push_back(NewVolID);
167 myIntegers.push_back(idnode1);
168 myIntegers.push_back(idnode2);
169 myIntegers.push_back(idnode3);
170 myIntegers.push_back(idnode4);
171 myIntegers.push_back(idnode5);
175 //=======================================================================
178 //=======================================================================
179 void SMESHDS_Command::AddVolume(int NewVolID,
181 int idnode2, int idnode3, int idnode4, int idnode5, int idnode6)
183 if (!myType == SMESHDS_AddPrism)
185 MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
188 myIntegers.push_back(NewVolID);
189 myIntegers.push_back(idnode1);
190 myIntegers.push_back(idnode2);
191 myIntegers.push_back(idnode3);
192 myIntegers.push_back(idnode4);
193 myIntegers.push_back(idnode5);
194 myIntegers.push_back(idnode6);
198 //=======================================================================
201 //=======================================================================
202 void SMESHDS_Command::AddVolume(int NewVolID,
206 int idnode4, int idnode5, int idnode6, int idnode7, int idnode8)
208 if (!myType == SMESHDS_AddHexahedron)
210 MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
213 myIntegers.push_back(NewVolID);
214 myIntegers.push_back(idnode1);
215 myIntegers.push_back(idnode2);
216 myIntegers.push_back(idnode3);
217 myIntegers.push_back(idnode4);
218 myIntegers.push_back(idnode5);
219 myIntegers.push_back(idnode6);
220 myIntegers.push_back(idnode7);
221 myIntegers.push_back(idnode8);
225 //=======================================================================
228 //=======================================================================
229 void SMESHDS_Command::RemoveNode(int NodeID)
231 if (!myType == SMESHDS_RemoveNode)
233 MESSAGE("SMESHDS_Command::RemoveNode : Bad Type");
236 myIntegers.push_back(NodeID);
240 //=======================================================================
243 //=======================================================================
244 void SMESHDS_Command::RemoveElement(int ElementID)
246 if (!myType == SMESHDS_RemoveElement)
248 MESSAGE("SMESHDS_Command::RemoveElement : Bad Type");
251 myIntegers.push_back(ElementID);
255 //=======================================================================
258 //=======================================================================
259 SMESHDS_CommandType SMESHDS_Command::GetType()
264 //=======================================================================
267 //=======================================================================
268 int SMESHDS_Command::GetNumber()
273 //=======================================================================
276 //=======================================================================
277 const list < int >&SMESHDS_Command::GetIndexes()
282 //=======================================================================
285 //=======================================================================
286 const list < double >&SMESHDS_Command::GetCoords()