]> SALOME platform Git repositories - modules/gui.git/blob - src/SALOME_SWIG/SALOMEGUI_Swig.i
Salome HOME
00614acadb8de9423af85c0d12742daaae865aa1
[modules/gui.git] / src / SALOME_SWIG / SALOMEGUI_Swig.i
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
24 //  File   : SALOMEGUI_Swig.i
25 //  Author : Paul RASCLE, EDF
26 //
27 %{
28 #include "SALOMEGUI_Swig.hxx"
29 %}
30
31 %include "cpointer.i"
32 %include "std_string.i"
33 %include "std_list.i"
34
35 #if SWIG_VERSION >= 0x010329
36 %template() std::list<std::string>;
37 #endif
38
39 /* Exception handler for all functions */
40 %exception {
41   class PyAllowThreadsGuard {
42    public:
43     // Py_BEGIN_ALLOW_THREADS
44     PyAllowThreadsGuard() { _save = PyEval_SaveThread(); }
45     // Py_END_ALLOW_THREADS
46     ~PyAllowThreadsGuard() { PyEval_RestoreThread( _save ); }
47    private:
48     PyThreadState* _save;
49   };
50
51   PyAllowThreadsGuard guard;
52
53   $action
54 }
55
56 class SALOMEGUI_Swig
57 {
58 public:
59   SALOMEGUI_Swig();
60   virtual ~SALOMEGUI_Swig();
61
62   /* check GUI */
63   bool hasDesktop();
64
65   /* update object browser*/
66   void updateObjBrowser(bool);
67
68   /* get active study */
69   int getActiveStudyId();
70   const char *getActiveStudyName();
71
72   /* get component name/username */
73   const char* getComponentName( const char* ComponentUserName );
74   const char* getComponentUserName( const char* ComponentName );
75
76   /* selection processing */
77   int SelectedCount();
78   const char *getSelected(int i);
79   void AddIObject(const char *Entry);
80   void RemoveIObject(const char *Entry);
81   void ClearIObjects();
82
83   /* display/erase */
84   void Display(const char *Entry);
85   void DisplayOnly(const char *Entry);
86   void Erase(const char *Entry);
87   void DisplayAll();
88   void EraseAll();
89   bool IsInCurrentView(const char *Entry);
90   void UpdateView();
91
92   /* view operations */
93   void FitAll();
94   void FitSelection();
95   void FitIObjects(const std::list<std::string>&);
96   void ResetView();
97   void ViewTop();
98   void ViewBottom();
99   void ViewLeft();
100   void ViewRight();
101   void ViewFront();
102   void ViewBack();
103
104   /* view parameters */
105   const char* getViewParameters();
106   void setCameraPosition( double x, double y, double z );
107   void setCameraFocalPoint( double x, double y, double z );
108   void setCameraViewUp( double x, double y, double z );
109   void setViewScale( double parallelScale,double x, double y, double z );
110 };