]> SALOME platform Git repositories - plugins/ghs3dplugin.git/blob - src/GHS3DPlugin/MG_TetraHPC_API.hxx
Salome HOME
Update methods SaveTo and LoadFrom to include new hypothesis options. Solve problems...
[plugins/ghs3dplugin.git] / src / GHS3DPlugin / MG_TetraHPC_API.hxx
1 // Copyright (C) 2004-2022  CEA/DEN, EDF R&D
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __MG_TetraHPC_IO_HXX__
21 #define __MG_TetraHPC_IO_HXX__
22
23 #include "MG_Tetra_API.hxx"
24
25 #include <string>
26 #include <set>
27
28 /*!
29  * \brief Class providing a transparent switch between MG_TetraHPC usage as
30  *        a library and as an executable. API of libmesh5 inherited.
31  */
32 class MG_TetraHPC_API
33 {
34 public:
35
36   MG_TetraHPC_API( volatile bool& cancelled_flag, double& progress );
37   ~MG_TetraHPC_API();
38
39   bool IsLibrary();
40   bool IsExecutable() { return !IsLibrary(); }
41   void SetUseExecutable();
42
43   // IN to MESHGEMS
44   int  GmfOpenMesh(const char* theFile, int rdOrWr, int ver, int dim);
45   void GmfSetKwd(int iMesh, GmfKwdCod what, int nb );
46   void GmfSetLin(int iMesh, GmfKwdCod what, double x, double y, double z, int domain);
47   void GmfSetKwd(int iMesh, GmfKwdCod what, int nbNodes, int dummy, int type[] ); // sol type
48   void GmfSetLin(int iMesh, GmfKwdCod what, double vals[]); // sol
49   void GmfSetLin(int iMesh, GmfKwdCod what, int node1, int node2, int domain ); // edge
50   void GmfSetLin(int iMesh, GmfKwdCod what, int id ); // required
51   void GmfSetLin(int iMesh, GmfKwdCod what, int node1, int node2, int node3, int domain ); // tria
52
53   bool Compute( const std::string& cmdLine, std::string& errStr );
54
55   // OUT from MESHGEMS
56   int  GmfOpenMesh(const char* theFile, int rdOrWr, int * ver, int * dim);
57   int  GmfStatKwd( int iMesh, GmfKwdCod what );
58   void GmfGotoKwd( int iMesh, GmfKwdCod what );
59   void GmfGetLin( int iMesh, GmfKwdCod what, int* nbNodes, int* faceInd, int* ori, int* domain, int dummy );
60   void GmfGetLin(int iMesh, GmfKwdCod what, float* x, float* y, float *z, int* domain );
61   void GmfGetLin(int iMesh, GmfKwdCod what, double* x, double* y, double *z, int* domain );
62   void GmfGetLin(int iMesh, GmfKwdCod what, int* node );
63   void GmfGetLin(int iMesh, GmfKwdCod what, int* node1, int* node2, int* domain );
64   void GmfGetLin(int iMesh, GmfKwdCod what, int* node1, int* node2, int* node3, int* domain );
65   void GmfGetLin(int iMesh, GmfKwdCod what, int* node1, int* node2, int* node3, int* node4, int* domain );
66   void GmfGetLin(int iMesh, GmfKwdCod what, int* node1, int* node2, int* node3, int* node4, int* node5, int* node6, int* node7, int* node8, int* domain );
67   void GmfCloseMesh( int iMesh );
68
69   void SetLogFile( const std::string& logFileName ) { _logFile = logFileName; }
70   bool HasLog();
71   std::string GetLog();
72
73
74   struct LibData;
75
76 private:
77
78   bool          _useLib;
79   LibData*      _libData;
80   std::set<int> _openFiles;
81   std::string   _logFile;
82
83
84   // count mesh entities for MG license key generation
85   int           _nbNodes;
86   int           _nbEdges;
87   int           _nbFaces;
88   int           _nbVolumes;
89 };
90
91 #endif