Salome HOME
Fix compilation problem on Debian Sarge
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_BLSURF.hxx
1 //  Copyright (C) 2007-2008  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 // File    : BLSURFPlugin_BLSURF.hxx
21 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
22 //           & Aurelien ALLEAUME (DISTENE)
23 //           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
24 // ---
25 //
26 #ifndef _BLSURFPlugin_BLSURF_HXX_
27 #define _BLSURFPlugin_BLSURF_HXX_
28
29 #include <Python.h>
30 #include "SMESH_2D_Algo.hxx"
31 #include "SMESH_Mesh.hxx"
32 #include <SMESH_Gen_i.hxx>
33 #include <SALOMEconfig.h>
34 #include CORBA_CLIENT_HEADER(SALOMEDS)
35 #include CORBA_CLIENT_HEADER(GEOM_Gen)
36 #include "Utils_SALOME_Exception.hxx"
37 extern "C"{
38 #include "distene/api.h"
39 }
40
41 class BLSURFPlugin_Hypothesis;
42 class TopoDS_Shape;
43
44 class BLSURFPlugin_BLSURF: public SMESH_2D_Algo {
45   public:
46     BLSURFPlugin_BLSURF(int hypId, int studyId, SMESH_Gen* gen);
47
48     TopoDS_Shape entryToShape(std::string entry);
49
50     virtual ~BLSURFPlugin_BLSURF();
51
52     virtual bool CheckHypothesis(SMESH_Mesh&                          aMesh,
53                                  const TopoDS_Shape&                  aShape,
54                                  SMESH_Hypothesis::Hypothesis_Status& aStatus);
55
56     void SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t *bls);
57
58     virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
59
60     virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
61                           MapShapeNbElems& aResMap);
62
63     ostream & SaveTo(ostream & save);
64     istream & LoadFrom(istream & load);
65     friend ostream & operator << (ostream & save, BLSURFPlugin_BLSURF & hyp);
66     friend istream & operator >> (istream & load, BLSURFPlugin_BLSURF & hyp);
67
68   protected:
69     const BLSURFPlugin_Hypothesis* _hypothesis;
70
71   private:
72       PyObject *          main_mod;
73       PyObject *          main_dict;
74       SALOMEDS::Study_var myStudy;
75       SMESH_Gen_i*        smeshGen_i;
76 };
77
78 #endif