Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/smesh.git] / src / SMESHDS / SMESHDS_Script.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  SMESH SMESHDS : management of mesh data and SMESH document
24 //  File   : SMESHDS_Script.hxx
25 //  Module : SMESH
26 //
27 #ifndef _SMESHDS_Script_HeaderFile
28 #define _SMESHDS_Script_HeaderFile
29
30 #include "SMESH_SMESHDS.hxx"
31
32 #include "SMESHDS_Command.hxx"
33
34 #include <list>
35 #include <vector>
36
37
38 class SMESHDS_EXPORT SMESHDS_Script
39 {
40   public:
41         SMESHDS_Script(bool theIsEmbeddedMode);
42         ~SMESHDS_Script();
43   
44         void SetModified(bool theModified);
45         bool IsModified();
46
47         void AddNode(int NewNodeID, double x, double y, double z);
48         void Add0DElement(int New0DElementID, int idnode);
49         void AddEdge(int NewEdgeID, int idnode1, int idnode2);
50         void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
51         void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
52                 int idnode4);
53         void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
54                 int idnode4);
55         void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
56                 int idnode4, int idnode5);
57         void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
58                 int idnode4, int idnode5, int idnode6);
59         void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
60                 int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
61         void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
62                        int idnode4, int idnode5, int idnode6, int idnode7, int idnode8,
63                        int idnode9, int idnode10, int idnode11, int idnode12);
64
65         void AddPolygonalFace (const int               NewFaceID,
66                                const std::vector<int>& nodes_ids);
67         void AddPolyhedralVolume (const int               NewVolID,
68                                   const std::vector<int>& nodes_ids,
69                                   const std::vector<int>& quantities);
70         void AddBall(int NewBallID, int node, double diameter);
71
72         // special methods for quadratic elements
73         void AddEdge(int NewEdgeID, int n1, int n2, int n12);
74         void AddFace(int NewFaceID, int n1, int n2, int n3,
75                      int n12, int n23, int n31);
76         void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
77                      int n12, int n23, int n34, int n41);
78         void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
79                      int n12, int n23, int n34, int n41, int nCenter);
80         void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
81                        int n12, int n23, int n31, int n14, int n24, int n34);
82         void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5,
83                        int n12, int n23, int n34, int n41,
84                        int n15, int n25, int n35, int n45);
85         void AddVolume(int NewVolID, int n1, int n2, int n3,
86                        int n4, int n5, int n6,
87                        int n12, int n23, int n31,
88                        int n45, int n56, int n64,
89                        int n14, int n25, int n36);
90         void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
91                        int n5, int n6, int n7, int n8,
92                        int n12, int n23, int n34, int n41,
93                        int n56, int n67, int n78, int n85,
94                        int n15, int n26, int n37, int n48);
95         void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
96                        int n5,  int n6,  int n7,  int n8,
97                        int n12, int n23, int n34, int n41,
98                        int n56, int n67, int n78, int n85,
99                        int n15, int n26, int n37, int n48,
100                        int n1234,int n1256,int n2367,int n3478,
101                        int n1458,int n5678,int nCenter);
102         void MoveNode(int NewNodeID, double x, double y, double z);
103         void RemoveNode(int NodeID);
104         void RemoveElement(int ElementID);
105         void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
106         void ChangePolyhedronNodes(const int               ElementID,
107                                    const std::vector<int>& nodes_ids,
108                                    const std::vector<int>& quantities);
109         void Renumber (const bool isNodes, const int startID, const int deltaID);
110         void ClearMesh();
111         void Clear();
112         const std::list<SMESHDS_Command*> & GetCommands();
113
114   private:
115         SMESHDS_Command* getCommand(const SMESHDS_CommandType aType);
116
117         std::list<SMESHDS_Command*> myCommands;
118
119         bool myIsEmbeddedMode;
120         bool myIsModified;
121 };
122
123 #endif