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.ixx"
31 #include "SMESHDS_CommandType.hxx"
32 #include "utilities.h"
34 //=======================================================================
37 //=======================================================================
38 SMESHDS_Command::SMESHDS_Command(const SMESHDS_CommandType aType)
39 : myType(aType), myNumber(0)
42 //=======================================================================
45 //=======================================================================
46 void SMESHDS_Command::AddNode(const Standard_Integer NewNodeID,
47 const Standard_Real x,
48 const Standard_Real y,
49 const Standard_Real z)
51 if (!myType == SMESHDS_AddNode) {
52 MESSAGE("SMESHDS_Command::AddNode : Bad Type");
55 myIntegers.Append(NewNodeID);
62 //=======================================================================
65 //=======================================================================
66 void SMESHDS_Command::MoveNode(const Standard_Integer NodeID,
67 const Standard_Real x,
68 const Standard_Real y,
69 const Standard_Real z)
71 if (!myType == SMESHDS_MoveNode) {
72 MESSAGE("SMESHDS_Command::MoveNode : Bad Type");
75 myIntegers.Append(NodeID);
82 //=======================================================================
85 //=======================================================================
86 void SMESHDS_Command::AddEdge(const Standard_Integer NewEdgeID,
87 const Standard_Integer idnode1,
88 const Standard_Integer idnode2)
90 if (!myType == SMESHDS_AddEdge) {
91 MESSAGE("SMESHDS_Command::AddEdge : Bad Type");
94 myIntegers.Append(NewEdgeID);
95 myIntegers.Append(idnode1);
96 myIntegers.Append(idnode2);
100 //=======================================================================
103 //=======================================================================
104 void SMESHDS_Command::AddFace(const Standard_Integer NewFaceID,
105 const Standard_Integer idnode1,
106 const Standard_Integer idnode2,
107 const Standard_Integer idnode3)
109 if (!myType == SMESHDS_AddTriangle) {
110 MESSAGE("SMESHDS_Command::AddFace : Bad Type");
113 myIntegers.Append(NewFaceID);
114 myIntegers.Append(idnode1);
115 myIntegers.Append(idnode2);
116 myIntegers.Append(idnode3);
120 //=======================================================================
123 //=======================================================================
124 void SMESHDS_Command::AddFace(const Standard_Integer NewFaceID,
125 const Standard_Integer idnode1,
126 const Standard_Integer idnode2,
127 const Standard_Integer idnode3,
128 const Standard_Integer idnode4)
130 if (!myType == SMESHDS_AddQuadrangle) {
131 MESSAGE("SMESHDS_Command::AddFace : Bad Type");
134 myIntegers.Append(NewFaceID);
135 myIntegers.Append(idnode1);
136 myIntegers.Append(idnode2);
137 myIntegers.Append(idnode3);
138 myIntegers.Append(idnode4);
142 //=======================================================================
145 //=======================================================================
146 void SMESHDS_Command::AddVolume(const Standard_Integer NewVolID,
147 const Standard_Integer idnode1,
148 const Standard_Integer idnode2,
149 const Standard_Integer idnode3,
150 const Standard_Integer idnode4)
152 if (!myType == SMESHDS_AddTetrahedron) {
153 MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
156 myIntegers.Append(NewVolID);
157 myIntegers.Append(idnode1);
158 myIntegers.Append(idnode2);
159 myIntegers.Append(idnode3);
160 myIntegers.Append(idnode4);
164 //=======================================================================
167 //=======================================================================
168 void SMESHDS_Command::AddVolume(const Standard_Integer NewVolID,
169 const Standard_Integer idnode1,
170 const Standard_Integer idnode2,
171 const Standard_Integer idnode3,
172 const Standard_Integer idnode4,
173 const Standard_Integer idnode5)
175 if (!myType == SMESHDS_AddPyramid) {
176 MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
179 myIntegers.Append(NewVolID);
180 myIntegers.Append(idnode1);
181 myIntegers.Append(idnode2);
182 myIntegers.Append(idnode3);
183 myIntegers.Append(idnode4);
184 myIntegers.Append(idnode5);
188 //=======================================================================
191 //=======================================================================
192 void SMESHDS_Command::AddVolume(const Standard_Integer NewVolID,
193 const Standard_Integer idnode1,
194 const Standard_Integer idnode2,
195 const Standard_Integer idnode3,
196 const Standard_Integer idnode4,
197 const Standard_Integer idnode5,
198 const Standard_Integer idnode6)
200 if (!myType == SMESHDS_AddPrism) {
201 MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
204 myIntegers.Append(NewVolID);
205 myIntegers.Append(idnode1);
206 myIntegers.Append(idnode2);
207 myIntegers.Append(idnode3);
208 myIntegers.Append(idnode4);
209 myIntegers.Append(idnode5);
210 myIntegers.Append(idnode6);
214 //=======================================================================
217 //=======================================================================
218 void SMESHDS_Command::AddVolume(const Standard_Integer NewVolID,
219 const Standard_Integer idnode1,
220 const Standard_Integer idnode2,
221 const Standard_Integer idnode3,
222 const Standard_Integer idnode4,
223 const Standard_Integer idnode5,
224 const Standard_Integer idnode6,
225 const Standard_Integer idnode7,
226 const Standard_Integer idnode8)
228 if (!myType == SMESHDS_AddHexahedron) {
229 MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
232 myIntegers.Append(NewVolID);
233 myIntegers.Append(idnode1);
234 myIntegers.Append(idnode2);
235 myIntegers.Append(idnode3);
236 myIntegers.Append(idnode4);
237 myIntegers.Append(idnode5);
238 myIntegers.Append(idnode6);
239 myIntegers.Append(idnode7);
240 myIntegers.Append(idnode8);
244 //=======================================================================
247 //=======================================================================
248 void SMESHDS_Command::RemoveNode(const Standard_Integer NodeID)
250 if (!myType == SMESHDS_RemoveNode) {
251 MESSAGE("SMESHDS_Command::RemoveNode : Bad Type");
254 myIntegers.Append(NodeID);
258 //=======================================================================
261 //=======================================================================
262 void SMESHDS_Command::RemoveElement(const Standard_Integer ElementID)
264 if (!myType == SMESHDS_RemoveElement) {
265 MESSAGE("SMESHDS_Command::RemoveElement : Bad Type");
268 myIntegers.Append(ElementID);
272 //=======================================================================
275 //=======================================================================
276 SMESHDS_CommandType SMESHDS_Command::GetType()
281 //=======================================================================
284 //=======================================================================
285 Standard_Integer SMESHDS_Command::GetNumber()
290 //=======================================================================
293 //=======================================================================
294 const TColStd_ListOfInteger& SMESHDS_Command::GetIndexes()
299 //=======================================================================
302 //=======================================================================
303 const TColStd_ListOfReal& SMESHDS_Command::GetCoords()