1 // Copyright (C) 2007-2008 OPEN CASCADE, CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 // File : ghs3dprl_mesh_wrap.h
22 // Author : Christian VAN WAMBEKE (CEA) (from Hexotic plugin Lioka RAZAFINDRAZAKA)
26 #ifndef GHS3DPRL_MESH_WRAP_H
27 #define GHS3DPRL_MESH_WRAP_H
33 //Med File V 2.2 attributes
39 #include <med_proto.h>
43 #include <libxml/tree.h>
44 #include <libxml/parser.h>
45 #include <libxml/xpath.h>
46 #include <libxml/xpathInternals.h>
49 using namespace med_2_2;
52 //contains size=size of vector and the vector (med_int or med_float)
56 static long memoryuse;
57 static long memorymax;
59 med_int *tmint; //integer med
60 med_float *tmflo; //float med
63 CVWtab(long nb, med_int *pmint);
64 CVWtab(long nb, med_float *pmflo);
66 bool CVWtab_deallocate();
67 bool is_equal(CVWtab *tab2);
70 typedef map<QString, int> fend;
71 typedef map<QString, fend> fagr;
74 void newfam(QString nom);
75 void newgro(QString nom);
81 xmlNodePtr xml_groups();
82 void add(QString nomfam, QString nomgro);
84 bool get_number_of_new_family(int sign,med_int *num,QString *tmp);
85 med_int find_family_on_groups(med_int fam1, med_int fam2);
86 fend fuse_goups(med_int fam1, med_int fam2);
89 class ghs3dprl_mesh_wrap
92 QString medname,casename,path,pathini,filemed,format;
93 QRegExp deletegroups; //regular expression
96 nofile,nbfiles,nbfilestot,
100 med_idt fid,fidjoint;
104 string filemaster,domainname;
105 char distfilename[MED_TAILLE_DESC];
106 xmlDocPtr master_doc;
107 xmlNodePtr root_node,node,node2,
108 joints_node,info_node,files_node,mesh_node;
110 QHash<QString,CVWtab*> mestab;
114 char nommaa[MED_TAILLE_NOM+1];
115 char maillage_description[MED_TAILLE_DESC+1];
116 char nomcoo[3*MED_TAILLE_PNOM+1];
117 char unicoo[3*MED_TAILLE_PNOM+1];
118 med_int *famnodesskin; //from skin.med...
119 med_int *famseg2skin; //...valid on global index/numerotation
120 med_int *famtria3skin;
122 //to final files .med with tetrahedra
123 char nomfinal[MED_TAILLE_NOM+1];
124 med_int *famnodes,nbnodes,famnewnodes,famallnodes; //to final files .med with tetrahedra
125 med_int *famseg2,nbseg2,famnewseg2,famallseg2;
126 med_int *famtria3,nbtria3,famnewtria3,famalltria3;
127 med_int *famtetra4,nbtetra4,famnewtetra4,famalltetra4;
130 bool list_keys_mesh_wrap(); //list keys
131 bool list_onekey_mesh_wrap(const QString &key);
132 long remove_key_mesh_wrap(const QRegExp &rxp);
133 long nb_key_mesh_wrap(const QRegExp &rxp);
134 long remove_all_keys_mesh_wrap();
135 bool insert_key(const QString &key,CVWtab *tab);
136 CVWtab* restore_key(const QString &key);
139 bool set_one_more_family(med_int *fami, med_int *more, med_int nb);
140 med_int create_families(med_idt fid,int sign);
141 void add_family(med_int num,QString newgro);
142 void cout_families_and_groups();
150 bool test_msg_wrap();
151 bool test_vertices_wrap();
154 long SwapOutOfMemory_key_mesh_wrap(const QRegExp &rxp,long ifgreaterthan=0);
155 bool ReadFileMSGnew(const QString FileName);
156 bool ReadFileGLO(const QString FileName);
157 bool ReadFileFACES(const QString FileName);
158 bool ReadFileNOBOITE(const QString FileName);
159 bool ReadFileNOBOITEB(const QString FileName);
160 bool ReadFilePOINTS(const QString FileName);
161 bool Find_VerticesDomainToVerticesSkin();
162 bool Write_masterxmlMEDfile();
163 bool Write_MEDfiles_v0(bool deletekeys=FALSE);
164 bool Write_MEDfiles_v1(bool deletekeys=FALSE);
165 bool Write_MEDfiles_v2(bool deletekeys=FALSE);