Salome HOME
fix after review. Build completed
[modules/smesh.git] / src / SMESHDS / SMESHDS_Script.hxx
1 // Copyright (C) 2007-2020  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, or (at your option) any later version.
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 <smIdType.hxx>
35
36 #include <list>
37 #include <vector>
38
39
40 class SMESHDS_EXPORT SMESHDS_Script
41 {
42   public:
43         SMESHDS_Script(bool theIsEmbeddedMode);
44         ~SMESHDS_Script();
45   
46         void SetModified(bool theModified);
47         bool IsModified();
48
49         void AddNode(int NewNodeID, double x, double y, double z);
50         void Add0DElement(int New0DElementID, int idnode);
51         void AddEdge(int NewEdgeID, int idnode1, int idnode2);
52         void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
53         void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
54                 int idnode4);
55         void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
56                 smIdType idnode4);
57         void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
58                 smIdType idnode4, smIdType idnode5);
59         void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
60                 smIdType idnode4, smIdType idnode5, smIdType idnode6);
61         void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
62                 smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8);
63         void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
64                        smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
65                        smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12);
66
67         void AddPolygonalFace (const smIdType               NewFaceID,
68                                const std::vector<smIdType>& nodes_ids);
69         void AddQuadPolygonalFace (const smIdType               NewFaceID,
70                                         const std::vector<smIdType>& nodes_ids);
71         void AddPolyhedralVolume (const smIdType               NewVolID,
72                                   const std::vector<smIdType>& nodes_ids,
73                                   const std::vector<smIdType>& quantities);
74         void AddBall(int NewBallID, int node, double diameter);
75
76         // special methods for quadratic elements
77         void AddEdge(int NewEdgeID, int n1, int n2, int n12);
78         void AddFace(int NewFaceID, int n1, int n2, int n3,
79                      int n12, int n23, int n31);
80         void AddFace(int NewFaceID, int n1, int n2, int n3,
81                      int n12, int n23, int n31, int nCenter);
82         void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
83                      int n12, int n23, int n34, int n41);
84         void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
85                      int n12, int n23, int n34, int n41, int nCenter);
86         void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
87                        int n12, int n23, int n31, int n14, int n24, int n34);
88         void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5,
89                        int n12, int n23, int n34, int n41,
90                        int n15, int n25, int n35, int n45);
91         void AddVolume(int NewVolID, int n1, int n2, int n3,
92                        int n4, int n5, int n6,
93                        int n12, int n23, int n31,
94                        int n45, int n56, int n64,
95                        int n14, int n25, int n36);
96         void AddVolume(int NewVolID, int n1, int n2, int n3,
97                        int n4, int n5, int n6,
98                        int n12, int n23, int n31,
99                        int n45, int n56, int n64,
100                        int n14, int n25, int n36,
101                        int n1245, int n2356, int n1346);
102         void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
103                        int n5, int n6, int n7, int n8,
104                        int n12, int n23, int n34, int n41,
105                        int n56, int n67, int n78, int n85,
106                        int n15, int n26, int n37, int n48);
107         void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
108                        int n5,  int n6,  int n7,  int n8,
109                        int n12, int n23, int n34, int n41,
110                        int n56, int n67, int n78, int n85,
111                        int n15, int n26, int n37, int n48,
112                        int n1234,int n1256,int n2367,int n3478,
113                        int n1458,int n5678,int nCenter);
114         void MoveNode(int NewNodeID, double x, double y, double z);
115         void RemoveNode(int NodeID);
116         void RemoveElement(int ElementID);
117         void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
118         void ChangePolyhedronNodes(const int               ElementID,
119                                    const std::vector<int>& nodes_ids,
120                                    const std::vector<int>& quantities);
121         void Renumber (const bool isNodes, const int startID, const int deltaID);
122         void ClearMesh();
123         void Clear();
124         const std::list<SMESHDS_Command*> & GetCommands();
125
126   private:
127         SMESHDS_Command* getCommand(const SMESHDS_CommandType aType);
128
129         std::list<SMESHDS_Command*> myCommands;
130
131         bool myIsEmbeddedMode;
132         bool myIsModified;
133 };
134
135 #endif