sipHYDROPyHYDROData_BathymetryAltitudePoint.cc
sipHYDROPyHYDROData_Bathymetry.cc
sipHYDROPyHYDROData_CalculationCase.cc
+ sipHYDROPyHYDROData_CompleteCalcCase.cc
sipHYDROPyHYDROData_Channel.cc
sipHYDROPyHYDROData_Confluence.cc
sipHYDROPyHYDROData_Digue.cc
sipHYDROPyNCollection_Sequence0100gp_XYZ.cc
sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc
sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc
+ sipHYDROPyNCollection_Sequence0600opencascadehandle0100HYDROData_Entity.cc
sipHYDROPyNCollection_Sequence1800.cc
sipHYDROPyNCollection_Sequence2400.cc
sipHYDROPyNCollection_Sequence2600.cc
sipHYDROPystdvector0100HYDROData_BathymetryAltitudePoint.cc
+ sipHYDROPystdvector0101HYDROData_Entity.cc
sipHYDROPystdvector1800.cc
sipHYDROPystdvector2400.cc
sipHYDROPystdvector2600.cc
%Include HYDROData_ArtificialObject.sip
%Include HYDROData_Bathymetry.sip
%Include HYDROData_CalculationCase.sip
+%Include HYDROData_CompleteCalcCase.sip
%Include HYDROData_Channel.sip
%Include HYDROData_Confluence.sip
%Include HYDROData_Digue.sip
}
%End
+
+ /**
+ * Add a polyline (as a constraint for the mesh).
+ */
+ bool AddInterPoly( HYDROData_PolylineXY theInterPolyline ) [bool ( opencascade::handle<HYDROData_PolylineXY>& )];
+ %MethodCode
+ Handle(HYDROData_PolylineXY) aRef =
+ Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
+ if ( !aRef.IsNull() )
+ {
+ Py_BEGIN_ALLOW_THREADS
+ if ( sipSelfWasArg ) {
+ sipRes = sipCpp->HYDROData_CalculationCase::AddInterPoly( aRef );
+ } else {
+ sipRes = sipCpp->AddInterPoly( aRef );
+ }
+ Py_END_ALLOW_THREADS
+ }
+ %End
+
+ /**
+ * Remove a polyline (as a constraint for the mesh).
+ */
+ void RemoveInterPolyObject( HYDROData_PolylineXY theInterPolyline ) [void ( opencascade::handle<HYDROData_PolylineXY>& )];
+ %MethodCode
+ Handle(HYDROData_PolylineXY) aRef =
+ Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
+ if ( !aRef.IsNull() )
+ {
+ Py_BEGIN_ALLOW_THREADS
+ if ( sipSelfWasArg ) {
+ sipCpp->HYDROData_CalculationCase::RemoveInterPolyObject( aRef );
+ } else {
+ sipCpp->RemoveInterPolyObject( aRef );
+ }
+ Py_END_ALLOW_THREADS
+ }
+ %End
+
/**
* Sets reference boundary polyline object for calculation case.
*/
--- /dev/null
+// Copyright (C) 2014-2015 EDF-R&D
+// 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, or (at your option) any later version.
+//
+// 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 <HYDROData_CompleteCalcCase.h>
+#include <HYDROData_Document.h>
+%End
+
+class HYDROData_CompleteCalcCase
+{
+
+%TypeHeaderCode
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+#include <HYDROData_CompleteCalcCase.h>
+#include <HYDROData_Document.h>
+%End
+
+public:
+
+ /**
+ * Add new geometry object for calculation case.
+ */
+ static SIP_PYTUPLE AddObjects( HYDROData_Document doc,
+ HYDROData_CalculationCase theCalcCase,
+ std::vector<HYDROData_Entity*> theNewObjects,
+ bool IsUseOrigNamingOfNewRegions)
+ [ bool ( const opencascade::handle<HYDROData_Document>&,
+ opencascade::handle<HYDROData_CalculationCase>&,
+ NCollection_Sequence<opencascade::handle<HYDROData_Entity> >,
+ bool,
+ bool&,
+ NCollection_Sequence< opencascade::handle<HYDROData_Region> >& )];
+ %MethodCode
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document();
+ Handle(HYDROData_CalculationCase) aCase = Handle(HYDROData_CalculationCase)::DownCast( createHandle( a1 ) );
+ NCollection_Sequence<Handle(HYDROData_Entity)> objs;
+ for (size_t i = 0; i != a2->size(); i++)
+ {
+ DEBTRACE("item " << i);
+ Handle(HYDROData_Entity) anEnt = createHandle( (*a2)[i] );
+ objs.Append(anEnt);
+ }
+ bool res = false;
+ bool isIntersectionOfNewObj = false;
+ NCollection_Sequence<Handle(HYDROData_Region)> theNewRegions;
+ DEBTRACE(" --- 0");
+ if ( !aDoc.IsNull() && !aCase.IsNull() )
+ {
+ DEBTRACE("before HYDROData_CompleteCalcCase::AddObjects");
+ Py_BEGIN_ALLOW_THREADS
+ res = HYDROData_CompleteCalcCase::AddObjects( aDoc, aCase, objs, a3, isIntersectionOfNewObj, theNewRegions );
+ Py_END_ALLOW_THREADS
+ DEBTRACE("after");
+ DEBTRACE("res " << res);
+ DEBTRACE("isIntersectionOfNewObj " << isIntersectionOfNewObj);
+ DEBTRACE("theNewRegions size " << theNewRegions.Size());
+ }
+ PyObject* t;
+ if (res && isIntersectionOfNewObj)
+ {
+ DEBTRACE(" --- 1a");
+ t = Py_BuildValue("(iiO)", res, isIntersectionOfNewObj, theNewRegions);
+ DEBTRACE(" --- 2a");
+ }
+ else
+ {
+ DEBTRACE(" --- 1b");
+ t = Py_BuildValue("(ii)", res, isIntersectionOfNewObj);
+ DEBTRACE(" --- 2b");
+ }
+
+ sipRes = t;
+ %End
+
+protected:
+
+ /**
+ * Creates new object in the internal data structure. Use higher level objects
+ * to create objects with real content.
+ */
+ HYDROData_CompleteCalcCase();
+
+ /**
+ * Destructs properties of the object and object itself, removes it from the document.
+ */
+ ~HYDROData_CompleteCalcCase();
+};
virtual ~HYDROData_Entity();
};
+
+
+%MappedType std::vector<HYDROData_Entity*>
+{
+%TypeHeaderCode
+#include <vector>
+%End
+
+%ConvertFromTypeCode
+ // Create the list.
+ PyObject *l;
+
+ if ( ( l = PyList_New( sipCpp->size() ) ) == NULL )
+ return NULL;
+
+ // Set the list elements.
+ for ( int i = 0, n = sipCpp->size(); i < n; ++i )
+ {
+ HYDROData_Entity* t = (*sipCpp)[i]; //new HYDROData_Entity( ( sipCpp)[i] );
+
+ PyObject* pobj;
+ if ( ( pobj = sipConvertFromNewType( t, sipType_HYDROData_Entity, sipTransferObj ) ) == NULL )
+ {
+ Py_DECREF( l );
+ //delete t;
+
+ return NULL;
+ }
+
+ PyList_SET_ITEM( l, i, pobj );
+ }
+
+ 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;
+ }
+
+ std::vector<HYDROData_Entity*> *aSeq = new std::vector<HYDROData_Entity*>;
+ len = PySequence_Size(sipPy);
+ aSeq->reserve( len );
+
+ 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 aSeq;
+ return 0;
+ }
+
+ aSeq->push_back(t);
+
+ sipReleaseType(t, sipType_HYDROData_Entity, state);
+ }
+
+ *sipCppPtr = aSeq;
+
+ return sipGetState(sipTransferObj);
+%End
+};