Salome HOME
Merge from V6_main (04/10/2012)
[plugins/hexoticplugin.git] / src / HexoticPlugin / HexoticPlugin_Hexotic.hxx
1 // Copyright (C) 2007-2012  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.
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 // ---
21 // File   : HexoticPlugin_Hexotic.hxx
22 // Author : Lioka RAZAFINDRAZAKA (CEA)
23 // ---
24 //
25 #ifndef _HexoticPlugin_Hexotic_HXX_
26 #define _HexoticPlugin_Hexotic_HXX_
27
28 #include "HexoticPlugin_Defs.hxx"
29
30 #include "SMESH_Algo.hxx"
31 #include "SMESH_Mesh.hxx"
32 #include "Utils_SALOME_Exception.hxx"
33
34 #ifdef WITH_BLSURFPLUGIN
35 #include "BLSURFPlugin_Hypothesis.hxx"
36 #endif
37
38 #include <string>
39
40 class SMESH_Mesh;
41 class HexoticPlugin_Hypothesis;
42 class TCollection_AsciiString;
43
44 class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hexotic: public SMESH_3D_Algo
45 {
46 public:
47   HexoticPlugin_Hexotic(int hypId, int studyId, SMESH_Gen* gen);
48   virtual ~HexoticPlugin_Hexotic();
49
50 #ifdef WITH_BLSURFPLUGIN
51   bool CheckBLSURFHypothesis(SMESH_Mesh&         aMesh,
52                              const TopoDS_Shape& aShape);
53 #endif
54
55   virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
56                                const TopoDS_Shape&                  aShape,
57                                SMESH_Hypothesis::Hypothesis_Status& aStatus);
58
59   void SetParameters(const HexoticPlugin_Hypothesis* hyp);
60
61   virtual bool Compute(SMESH_Mesh& aMesh,  const TopoDS_Shape& aShape);
62
63   virtual bool Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHelper);
64
65 #ifdef WITH_SMESH_CANCEL_COMPUTE
66     virtual void CancelCompute();
67     bool computeCanceled() { return _compute_canceled;};
68 #endif
69
70   virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
71                         MapShapeNbElems& aResMap);
72
73 protected:
74   const HexoticPlugin_Hypothesis* _hypothesis;
75
76 private:
77
78   std::string getHexoticCommand(const TCollection_AsciiString& Hexotic_In,
79                                 const TCollection_AsciiString& Hexotic_Out) const;
80
81   int  _iShape;
82   int  _nbShape;
83   int  _hexesMinLevel;
84   int  _hexesMaxLevel;
85   double _hexesMinSize;
86   double _hexesMaxSize;
87   bool _hexoticIgnoreRidges;
88   bool _hexoticInvalidElements;
89   bool _hexoticFilesKept;
90   int  _hexoticSharpAngleThreshold;
91   int  _hexoticNbProc;
92   std::string  _hexoticWorkingDirectory;
93   int _hexoticVerbosity;
94   int _hexoticSdMode;
95   SMDS_MeshNode** _tabNode;
96   
97 #ifdef WITH_BLSURFPLUGIN
98   const BLSURFPlugin_Hypothesis* _blsurfHypo;
99 #endif
100
101 #ifdef WITH_SMESH_CANCEL_COMPUTE
102   volatile bool _compute_canceled;
103 #endif
104 };
105
106 #endif