####################################################################
MACRO(PYQT4_WRAP_SIP_EXT outfiles)
FOREACH(_input ${ARGN})
- FILE(STRINGS ${_input} _sip_modules REGEX "%Module")
- FILE(STRINGS ${_input} _sip_includes REGEX "%Include")
- FILE(STRINGS ${_input} _sip_classes REGEX "^class ")
+
SET(_output)
-
- FOREACH(_sip_module ${_sip_modules})
- STRING(REGEX MATCH ".*%Module *\\( *name=.*\\).*" _mod_name "${_sip_module}")
- IF (_mod_name)
- STRING(REGEX REPLACE ".*%Module *\\( *name=(.*).*\\).*" "\\1" _mod_name ${_sip_module})
- ELSE()
- STRING(REGEX REPLACE ".*%Module *(.*)" "\\1" _mod_name ${_sip_module})
- ENDIF()
- SET(_mod_header "sipAPI${_mod_name}.h")
- SET(_mod_source "sip${_mod_name}cmodule${PYQT_CXX_EXT}")
- LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/${_mod_source})
- SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/${_mod_source})
- ENDFOREACH()
-
- FOREACH(_sip_include ${_sip_includes})
- STRING(REGEX REPLACE ".*%Include +(.*)\\.sip *" "\\1" _include_name ${_sip_include})
- SET(_include_source "sip${_mod_name}${_include_name}${PYQT_CXX_EXT}")
- LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/${_include_source})
- SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/${_include_source})
- ENDFOREACH()
-
- FOREACH(_sip_class ${_sip_classes})
- STRING(REGEX MATCH ".*class +.* *:" _class_name "${_sip_class}")
- IF (_class_name)
- STRING(REGEX REPLACE ".*class +(.*) *:.*" "\\1" _class_name ${_sip_class})
- ELSE()
- STRING(REGEX REPLACE ".*class *(.*)" "\\1" _class_name ${_sip_class})
- ENDIF()
- STRING(STRIP ${_class_name} _class_name)
- SET(_class_source "sip${_mod_name}${_class_name}${PYQT_CXX_EXT}")
- LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/${_class_source})
- SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/${_class_source})
- ENDFOREACH()
-
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPycmodule.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPycmodule.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ArtificialObject.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ArtificialObject.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Bathymetry.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Bathymetry.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_CalculationCase.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_CalculationCase.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Document.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Document.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Entity.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Entity.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IAltitudeObject.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IAltitudeObject.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Image.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Image.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ImmersibleZone.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ImmersibleZone.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IPolyline.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IPolyline.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_NaturalObject.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_NaturalObject.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Object.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Object.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ProfileUZ.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ProfileUZ.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Region.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Region.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_River.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_River.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Zone.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Zone.cc)
+
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100Handle_HYDROData_Entity.cc)
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100Handle_HYDROData_Entity.cc)
+
ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
COMMAND ${SIP_EXECUTABLE} ${PYQT_SIPFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+%ExportedHeaderCode
+#include <NCollection_Sequence.hxx>
+%End
+
+%MappedType NCollection_Sequence<Handle_HYDROData_Entity>
+{
+%TypeHeaderCode
+#include <NCollection_Sequence.hxx>
+%End
+
+%ConvertFromTypeCode
+ // Create the list.
+ PyObject *l;
+
+ if ((l = PyList_New(sipCpp->Length())) == NULL)
+ return NULL;
+
+ // Set the list elements.
+ for (int i = 0; i < sipCpp->Length(); ++i)
+ {
+ HYDROData_Entity* aPntr = createPointer(sipCpp->Value(i));
+
+ PyObject *tobj;
+
+ if ((tobj = sipConvertFromNewType(aPntr, sipFindType( aPntr->DynamicType()->Name() ), sipTransferObj)) == NULL)
+ {
+ Py_DECREF(l);
+ {
+ Handle_HYDROData_Entity anEnt( aPntr );
+ }
+
+ return NULL;
+ }
+
+ PyList_SET_ITEM(l, i, tobj);
+ }
+
+ return l;
+%End
+
+%ConvertToTypeCode
+ SIP_SSIZE_T len;
+
+ // Check the type if that is all that is required.
+ if (sipIsErr == NULL)
+ {
+ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
+ return 0;
+
+ for (SIP_SSIZE_T i = 0; i < len; ++i)
+ {
+ PyObject *itm = PySequence_ITEM(sipPy, i);
+ bool ok = (itm && sipCanConvertToType(itm, sipType_HYDROData_Entity, SIP_NOT_NONE));
+
+ Py_XDECREF(itm);
+
+ if (!ok)
+ return 0;
+ }
+
+ return 1;
+ }
+
+ NCollection_Sequence<Handle_HYDROData_Entity> *ql =
+ new NCollection_Sequence<Handle_HYDROData_Entity>;
+ len = PySequence_Size(sipPy);
+
+ for (SIP_SSIZE_T i = 0; i < len; ++i)
+ {
+ PyObject *itm = PySequence_ITEM(sipPy, i);
+ int state;
+ HYDROData_Entity *t =
+ reinterpret_cast<HYDROData_Entity *>(sipConvertToType(itm, sipType_HYDROData_Entity, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
+
+ Py_DECREF(itm);
+
+ if (*sipIsErr)
+ {
+ sipReleaseType(t, sipType_HYDROData_Entity, state);
+
+ delete ql;
+ return 0;
+ }
+
+ Handle_HYDROData_Entity anEnt( t );
+ ql->Append( anEnt );
+
+ //sipReleaseType(t, sipType_HYDROData_Entity, state);
+ }
+
+ *sipCppPtr = ql;
+
+ return sipGetState(sipTransferObj);
+%End
+};
+
+typedef NCollection_Sequence<Handle_HYDROData_Entity> HYDROData_SequenceOfObjects;