1 // Copyright (C) 2007-2023 CEA, EDF
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.
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 : HYBRIDPlugin_HYBRID.hxx
22 // Author : Christian VAN WAMBEKE (CEA) (from GHS3D plugin V730)
25 #ifndef _HYBRIDPlugin_HYBRID_HXX_
26 #define _HYBRIDPlugin_HYBRID_HXX_
28 #include "SMESH_Algo.hxx"
29 #include "SMESH_Gen.hxx"
30 #include "SMESH_Gen_i.hxx"
35 class HYBRIDPlugin_Hypothesis;
38 class StdMeshers_ViscousLayers;
39 class TCollection_AsciiString;
40 class _Ghs2smdsConvertor;
43 class HYBRIDPlugin_HYBRID: public SMESH_3D_Algo
46 HYBRIDPlugin_HYBRID(int hypId, SMESH_Gen* gen);
47 virtual ~HYBRIDPlugin_HYBRID();
49 virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
50 const TopoDS_Shape& aShape,
51 Hypothesis_Status& aStatus);
53 virtual bool Compute(SMESH_Mesh& aMesh,
54 const TopoDS_Shape& aShape);
56 virtual void CancelCompute();
57 bool computeCanceled() { return _computeCanceled; }
59 virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
60 MapShapeNbElems& aResMap);
62 virtual bool Compute(SMESH_Mesh& theMesh,
63 SMESH_MesherHelper* aHelper);
65 virtual void SubmeshRestored(SMESH_subMesh* subMesh);
67 virtual void SetEventListener(SMESH_subMesh* subMesh);
69 bool importGMFMesh(const char* aGMFFileName, SMESH_Mesh& aMesh);
71 static const char* Name() { return "HYBRID_3D"; }
73 const HYBRIDPlugin_Hypothesis* getHyp() {return _hyp ;}
76 const HYBRIDPlugin_Hypothesis* _hyp;
77 //const StdMeshers_ViscousLayers* _viscousLayersHyp;
78 std::string _genericName;
82 bool storeErrorDescription(const char* logFile,
83 const std::string& log,
84 const _Ghs2smdsConvertor & toSmdsConvertor );
85 TopoDS_Shape entryToShape(std::string entry);
90 bool _removeLogOnSuccess;
91 bool _logInStandardOutput;
95 * \brief Convertor of HYBRID elements to SMDS ones
97 class _Ghs2smdsConvertor
99 const std::map <int,const SMDS_MeshNode*> * _ghs2NodeMap;
100 const std::vector <const SMDS_MeshNode*> * _nodeByGhsId;
103 _Ghs2smdsConvertor( const std::map <int,const SMDS_MeshNode*> & ghs2NodeMap);
105 _Ghs2smdsConvertor( const std::vector <const SMDS_MeshNode*> & nodeByGhsId);
107 const SMDS_MeshElement* getElement(const std::vector<int>& ghsNodes) const;