1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include <HYDROData_CompleteCalcCase.h>
21 #include <HYDROData_Document.h>
24 class HYDROData_CompleteCalcCase
29 #include "HYDRO_trace.hxx"
30 #include <HYDROData_CompleteCalcCase.h>
31 #include <HYDROData_Document.h>
37 * Add new geometry object for calculation case.
39 static SIP_PYTUPLE AddObjects( HYDROData_Document doc,
40 HYDROData_CalculationCase theCalcCase,
41 std::vector<HYDROData_Entity*> theNewObjects,
42 bool IsUseOrigNamingOfNewRegions)
43 [ bool ( const opencascade::handle<HYDROData_Document>&,
44 opencascade::handle<HYDROData_CalculationCase>&,
45 NCollection_Sequence<opencascade::handle<HYDROData_Entity> >,
48 NCollection_Sequence< opencascade::handle<HYDROData_Region> >& )];
50 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document();
51 Handle(HYDROData_CalculationCase) aCase = Handle(HYDROData_CalculationCase)::DownCast( createHandle( a1 ) );
52 NCollection_Sequence<Handle(HYDROData_Entity)> objs;
53 for (size_t i = 0; i != a2->size(); i++)
55 DEBTRACE("item " << i);
56 Handle(HYDROData_Entity) anEnt = createHandle( (*a2)[i] );
60 bool isIntersectionOfNewObj = false;
61 NCollection_Sequence<Handle(HYDROData_Region)> theNewRegions;
63 if ( !aDoc.IsNull() && !aCase.IsNull() )
65 DEBTRACE("before HYDROData_CompleteCalcCase::AddObjects");
66 Py_BEGIN_ALLOW_THREADS
67 res = HYDROData_CompleteCalcCase::AddObjects( aDoc, aCase, objs, a3, isIntersectionOfNewObj, theNewRegions );
70 DEBTRACE("res " << res);
71 DEBTRACE("isIntersectionOfNewObj " << isIntersectionOfNewObj);
72 DEBTRACE("theNewRegions size " << theNewRegions.Size());
75 if (res && isIntersectionOfNewObj)
78 t = Py_BuildValue("(iiO)", res, isIntersectionOfNewObj, theNewRegions);
84 t = Py_BuildValue("(ii)", res, isIntersectionOfNewObj);
94 * Creates new object in the internal data structure. Use higher level objects
95 * to create objects with real content.
97 HYDROData_CompleteCalcCase();
100 * Destructs properties of the object and object itself, removes it from the document.
102 ~HYDROData_CompleteCalcCase();