]> SALOME platform Git repositories - plugins/ghs3dplugin.git/blobdiff - src/GHS3DPlugin/GHS3DPlugin_GHS3D.hxx
Salome HOME
Merge multi-study removal branch.
[plugins/ghs3dplugin.git] / src / GHS3DPlugin / GHS3DPlugin_GHS3D.hxx
index 776a1fa317eb33ac36cbf443004be976c11fb0e6..b01ea3c5c433dcaa2b38ba152251518a19d25368 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2004-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2004-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #ifndef _GHS3DPlugin_GHS3D_HXX_
 #define _GHS3DPlugin_GHS3D_HXX_
 
-#include "SMESH_Algo.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_Gen_i.hxx"
+#include <SMESH_Algo.hxx>
+#include <SMESH_Gen.hxx>
+#include <SMESH_Gen_i.hxx>
+#include <SMESH_ProxyMesh.hxx>
 
 #include <map>
 #include <vector>
 
-extern "C"
-{
-  #include "libmesh5.h"
-}
-
 #ifndef GMFVERSION
 #define GMFVERSION GmfDouble
 #endif
@@ -54,7 +50,8 @@ class TopoDS_Shape;
 class GHS3DPlugin_GHS3D: public SMESH_3D_Algo
 {
 public:
-  GHS3DPlugin_GHS3D(int hypId, int studyId, SMESH_Gen* gen);
+
+  GHS3DPlugin_GHS3D(int hypId, SMESH_Gen* gen);
   virtual ~GHS3DPlugin_GHS3D();
 
   virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
@@ -64,10 +61,8 @@ public:
   virtual bool Compute(SMESH_Mesh&         aMesh,
                        const TopoDS_Shape& aShape);
 
-#ifdef WITH_SMESH_CANCEL_COMPUTE
-    virtual void CancelCompute();
-    bool computeCanceled() { return _compute_canceled;};
-#endif
+  virtual void CancelCompute();
+  bool         computeCanceled() { return _computeCanceled; }
 
   virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
                         MapShapeNbElems& aResMap);
@@ -77,40 +72,54 @@ public:
 
   virtual void SubmeshRestored(SMESH_subMesh* subMesh);
 
-  bool importGMFMesh(const char* aGMFFileName, SMESH_Mesh& aMesh);
+  virtual void SetEventListener(SMESH_subMesh* subMesh);
+
+  bool         importGMFMesh(const char* aGMFFileName, SMESH_Mesh& aMesh);
+
+  virtual double GetProgress() const;
+
+
+  static const char* Name() { return "MG-Tetra"; }
+
+  static SMESH_ComputeErrorPtr getErrorDescription(const char*                logFile,
+                                                   const std::string&         log,
+                                                   const _Ghs2smdsConvertor & toSmdsConvertor,
+                                                   const bool                 isOK = false);
+
+protected:
+  const GHS3DPlugin_Hypothesis*   _hyp;
+  const StdMeshers_ViscousLayers* _viscousLayersHyp;
+  std::string                     _genericName;
 
 private:
 
-  bool storeErrorDescription(const TCollection_AsciiString& logFile,
-                             const _Ghs2smdsConvertor &     toSmdsConvertor );
   TopoDS_Shape entryToShape(std::string entry);
-  
-  int  _iShape;
-  int  _nbShape;
-  bool _keepFiles;
-  const GHS3DPlugin_Hypothesis* _hyp;
-  const StdMeshers_ViscousLayers* _viscousLayersHyp;
-  SALOMEDS::Study_var myStudy;
-  SMESH_Gen_i* smeshGen_i;
 
-#ifdef WITH_SMESH_CANCEL_COMPUTE
-  volatile bool _compute_canceled;
-#endif
+  int                 _iShape;
+  int                 _nbShape;
+  bool                _keepFiles;
+  bool                _removeLogOnSuccess;
+  bool                _logInStandardOutput;
 
+  bool                _isLibUsed;
+  double              _progressAdvance;
 };
 
 /*!
- * \brief Convertor of GHS3D elements to SMDS ones
+ * \brief Convertor of MG-Tetra elements to SMDS ones
  */
 class _Ghs2smdsConvertor
 {
   const std::map <int,const SMDS_MeshNode*> * _ghs2NodeMap;
   const std::vector <const SMDS_MeshNode*> *  _nodeByGhsId;
+  SMESH_ProxyMesh::Ptr                        _mesh;
 
 public:
-  _Ghs2smdsConvertor( const std::map <int,const SMDS_MeshNode*> & ghs2NodeMap);
+  _Ghs2smdsConvertor( const std::map <int,const SMDS_MeshNode*> & ghs2NodeMap,
+                      SMESH_ProxyMesh::Ptr                        mesh);
 
-  _Ghs2smdsConvertor( const std::vector <const SMDS_MeshNode*> &  nodeByGhsId);
+  _Ghs2smdsConvertor( const std::vector <const SMDS_MeshNode*> &  nodeByGhsId,
+                      SMESH_ProxyMesh::Ptr                        mesh);
 
   const SMDS_MeshElement* getElement(const std::vector<int>& ghsNodes) const;
 };