1 // Copyright (C) 2007-2014 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, 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"
41 #define GMFVERSION GmfDouble
43 #define GMFDIMENSION 3
45 class HYBRIDPlugin_Hypothesis;
48 class StdMeshers_ViscousLayers;
49 class TCollection_AsciiString;
50 class _Ghs2smdsConvertor;
53 class HYBRIDPlugin_HYBRID: public SMESH_3D_Algo
56 HYBRIDPlugin_HYBRID(int hypId, int studyId, SMESH_Gen* gen);
57 virtual ~HYBRIDPlugin_HYBRID();
59 virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
60 const TopoDS_Shape& aShape,
61 Hypothesis_Status& aStatus);
63 virtual bool Compute(SMESH_Mesh& aMesh,
64 const TopoDS_Shape& aShape);
66 virtual void CancelCompute();
67 bool computeCanceled() { return _compute_canceled;};
69 virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
70 MapShapeNbElems& aResMap);
72 virtual bool Compute(SMESH_Mesh& theMesh,
73 SMESH_MesherHelper* aHelper);
75 virtual void SubmeshRestored(SMESH_subMesh* subMesh);
77 virtual void SetEventListener(SMESH_subMesh* subMesh);
79 bool importGMFMesh(const char* aGMFFileName, SMESH_Mesh& aMesh);
81 static const char* Name() { return "HYBRID_3D"; }
84 const HYBRIDPlugin_Hypothesis* _hyp;
85 const StdMeshers_ViscousLayers* _viscousLayersHyp;
86 std::string _genericName;
90 bool storeErrorDescription(const TCollection_AsciiString& logFile,
91 const _Ghs2smdsConvertor & toSmdsConvertor );
92 TopoDS_Shape entryToShape(std::string entry);
97 bool _removeLogOnSuccess;
98 bool _logInStandardOutput;
99 SALOMEDS::Study_var myStudy;
100 SMESH_Gen_i* smeshGen_i;
102 volatile bool _compute_canceled;
106 * \brief Convertor of HYBRID elements to SMDS ones
108 class _Ghs2smdsConvertor
110 const std::map <int,const SMDS_MeshNode*> * _ghs2NodeMap;
111 const std::vector <const SMDS_MeshNode*> * _nodeByGhsId;
114 _Ghs2smdsConvertor( const std::map <int,const SMDS_MeshNode*> & ghs2NodeMap);
116 _Ghs2smdsConvertor( const std::vector <const SMDS_MeshNode*> & nodeByGhsId);
118 const SMDS_MeshElement* getElement(const std::vector<int>& ghsNodes) const;