Salome HOME
0020832: EDF 1359 SMESH : Automatic meshing of boundary layers
[plugins/ghs3dplugin.git] / src / GHS3DPlugin_GHS3D.hxx
index 50e7a0fa42c79acd9e06c3b2232476e7ab86a62c..2054a79469488f9517530e9ecac9b1e02af12469 100644 (file)
@@ -1,20 +1,42 @@
+//  Copyright (C) 2004-2010  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.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 //=============================================================================
 // File      : GHS3DPlugin_GHS3D.hxx
-//             Moved here from SMESH_GHS3D_3D.hxx
-// Created   : lundi 27 Janvier 2003
-// Author    : Nadir BOUHAMOU (CEA)
+// Author    : Edward AGAPOV, modified by Lioka RAZAFINDRAZAKA (CEA) 09/02/2007
 // Project   : SALOME
-// Copyright : CEA 2003
-// $Header$
 //=============================================================================
-
+//
 #ifndef _GHS3DPlugin_GHS3D_HXX_
 #define _GHS3DPlugin_GHS3D_HXX_
 
 #include "SMESH_3D_Algo.hxx"
-//#include "SMESH_Mesh.hxx"
 
+#include <map>
+#include <vector>
+
+class GHS3DPlugin_Hypothesis;
+class SMDS_MeshNode;
 class SMESH_Mesh;
+class StdMeshers_ViscousLayers;
+class TCollection_AsciiString;
+class _Ghs2smdsConvertor;
 
 class GHS3DPlugin_GHS3D: public SMESH_3D_Algo
 {
@@ -22,18 +44,45 @@ public:
   GHS3DPlugin_GHS3D(int hypId, int studyId, SMESH_Gen* gen);
   virtual ~GHS3DPlugin_GHS3D();
 
-  virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
+  virtual bool CheckHypothesis(SMESH_Mesh&         aMesh,
                                const TopoDS_Shape& aShape,
-                               SMESH_Hypothesis::Hypothesis_Status& aStatus);
+                               Hypothesis_Status&  aStatus);
+
+  virtual bool Compute(SMESH_Mesh&         aMesh,
+                       const TopoDS_Shape& aShape);
+
+  virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
+                        MapShapeNbElems& aResMap);
+
+  virtual bool Compute(SMESH_Mesh&         theMesh,
+                       SMESH_MesherHelper* aHelper);
+
+private:
 
-  virtual bool Compute(SMESH_Mesh& aMesh,
-                      const TopoDS_Shape& aShape);
+  bool storeErrorDescription(const TCollection_AsciiString& logFile,
+                             const _Ghs2smdsConvertor &     toSmdsConvertor );
+
+  int  _iShape;
+  int  _nbShape;
+  bool _keepFiles;
+  const GHS3DPlugin_Hypothesis* _hyp;
+  const StdMeshers_ViscousLayers* _viscousLayersHyp;
+};
+
+/*!
+ * \brief Convertor of GHS3D elements to SMDS ones
+ */
+class _Ghs2smdsConvertor
+{
+  const std::map <int,const SMDS_MeshNode*> * _ghs2NodeMap;
+  const std::vector <const SMDS_MeshNode*> *  _nodeByGhsId;
+
+public:
+  _Ghs2smdsConvertor( const std::map <int,const SMDS_MeshNode*> & ghs2NodeMap);
 
-  ostream & SaveTo(ostream & save);
-  istream & LoadFrom(istream & load);
-  friend ostream & operator << (ostream & save, GHS3DPlugin_GHS3D & hyp);
-  friend istream & operator >> (istream & load, GHS3DPlugin_GHS3D & hyp);
+  _Ghs2smdsConvertor( const std::vector <const SMDS_MeshNode*> &  nodeByGhsId);
 
+  const SMDS_MeshElement* getElement(const std::vector<int>& ghsNodes) const;
 };
 
 #endif