1 // Copyright (C) 2006-2008 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.
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
19 // ----------------------------------------------------------------------------
21 %define SALOMEDOCSTRING
22 "Implementation of nodes for SALOME platform."
25 %module(docstring=SALOMEDOCSTRING) SALOMERuntime
27 //work around SWIG bug #1863647
28 #define PySwigIterator SALOMERuntime_PySwigIterator
30 %feature("autodoc", "1");
32 %include engtypemaps.i
34 // ----------------------------------------------------------------------------
37 #include "RuntimeSALOME.hxx"
38 #include "SALOMEDispatcher.hxx"
39 #include "SalomeProc.hxx"
40 #include "PythonNode.hxx"
41 #include "PythonPorts.hxx"
42 #include "PresetNode.hxx"
43 #include "PresetPorts.hxx"
44 #include "CORBANode.hxx"
45 #include "CORBAPorts.hxx"
46 #include "StudyNodes.hxx"
47 #include "StudyPorts.hxx"
48 #include "TypeConversions.hxx"
49 #include "TypeCode.hxx"
50 #include "VisitorSaveSalomeSchema.hxx"
54 // ----------------------------------------------------------------------------
60 PyObject* omnipy = PyImport_ImportModule((char*)"_omnipy");
63 PyErr_SetString(PyExc_ImportError,(char*)"Cannot import _omnipy");
66 PyObject* pyapi = PyObject_GetAttrString(omnipy, (char*)"API");
67 api = (omniORBPYAPI*)PyCObject_AsVoidPtr(pyapi);
71 // ----------------------------------------------------------------------------
74 %typemap(out) YACS_ORB::Observer_ptr
76 $result = api->cxxObjRefToPyObjRef($1, 1);
79 %typemap(in) YACS_ORB::Observer_ptr
83 CORBA::Object_ptr obj = api->pyObjRefToCxxObjRef($input,1);
84 $1 = YACS_ORB::Observer::_narrow(obj);
88 PyErr_SetString(PyExc_RuntimeError, "not a valid CORBA object ptr");
93 %typemap(out) YACS::ENGINE::PyObj * "Py_INCREF($1); $result = $1;";
97 // ----------------------------------------------------------------------------
101 %rename(getSALOMERuntime) YACS::ENGINE::getSALOMERuntime; // to suppress a 503 warning
102 %ignore omniORBpyAPI;
104 %include "RuntimeSALOME.hxx"
105 %include "SALOMEDispatcher.hxx"
106 %include "SalomeProc.hxx"
107 %include "PythonNode.hxx"
108 %include "PythonPorts.hxx"
109 %include "XMLPorts.hxx"
110 %include "PresetNode.hxx"
111 %include "PresetPorts.hxx"
112 %include "CORBANode.hxx"
113 %include "CORBAPorts.hxx"
114 %include "StudyNodes.hxx"
115 %include "StudyPorts.hxx"
117 %extend YACS::ENGINE::OutputPresetPort
119 void setDataPy(PyObject *ob)
121 std::string sss = convertPyObjectXml(self->edGetType(),ob);