Salome HOME
6bf220c2d4553eea783b191716153c0ff4146ac3
[modules/geom.git] / src / GEOM_SWIG_WITHIHM / libGEOM_Swig.i
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
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      : libGeometry_Swig.i
21 //  Created   : Tue Mar 26 15:04:48 2002
22 //  Author    : Nicolas REJNERI, Paul RASCLE
23 //  Project   : SALOME
24 //  Module    : GEOM
25 //  $Header$
26 //
27 %module libGEOM_Swig
28
29 %{
30 #include "libGEOM_Swig.h"
31 %}
32
33 /*
34   managing C++ exception in the Python API
35 */
36 %exception
37 {
38   class PyAllowThreadsGuard {
39    public:
40     // Py_BEGIN_ALLOW_THREADS
41     PyAllowThreadsGuard() { _save = PyEval_SaveThread(); }
42     // Py_END_ALLOW_THREADS
43     ~PyAllowThreadsGuard() { PyEval_RestoreThread(_save); }
44    private:
45     PyThreadState *_save;
46   };
47
48   PyAllowThreadsGuard guard;
49
50   $action
51 }
52
53 class GEOM_Swig
54 {
55  public:
56   GEOM_Swig();
57   ~GEOM_Swig();
58
59   void createAndDisplayGO(const char* Entry, bool isUpdated =true);
60   void eraseGO(const char* Entry, bool allWindows);
61   void createAndDisplayFitAllGO(const char* Entry);
62   void UpdateViewer();
63   int  getIndexTopology(const char *SubEntry, const char *Entry);
64   const char* getShapeTypeString(const char *Entry);
65
66   void setDisplayMode(const char* Entry, int mode, bool isUpdated =true);
67   void setVectorsMode(const char* Entry, bool isSet, bool isUpdated =true);
68   void setColor(const char* Entry, int red, int green, int blue, bool isUpdated =true);
69   void setTransparency(const char* Entry, float transp, bool isUpdated =true);
70   void setIsos(const char* Entry, int nbU, int nbV, bool isUpdated =true);
71   void setDeflection(const char* Entry, float deflect);
72   const char* getShapeTypeIcon(const char *Ior);
73
74   bool initGeomGen();
75 };
76