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
19 #include "HYDROData_CalculationCase.h"
20 #include "HYDROData_ArtificialObject.h"
21 #include "HYDROData_IAltitudeObject.h"
22 #include "HYDROData_Document.h"
23 #include "HYDROData_ShapesGroup.h"
24 #include "HYDROData_Iterator.h"
25 #include "HYDROData_NaturalObject.h"
26 #include "HYDROData_PolylineXY.h"
27 #include "HYDROData_StricklerTable.h"
28 #include "HYDROData_LandCoverMap.h"
29 #include "HYDROData_SplittedShapesGroup.h"
30 #include "HYDROData_Region.h"
31 #include "HYDROData_Tool.h"
32 #include "HYDROData_GeomTool.h"
35 #pragma warning ( disable: 4251 )
43 #pragma warning ( default: 4251 )
49 #include <TopoDS_Shell.hxx>
50 #include <TopoDS_Edge.hxx>
52 #include <BRep_Builder.hxx>
53 #include <BRepBuilderAPI_Sewing.hxx>
54 #include <BRepTopAdaptor_FClass2d.hxx>
56 #include <BRepTools.hxx>
59 #include <TopExp_Explorer.hxx>
61 #include <TopTools_ListOfShape.hxx>
62 #include <TopTools_ListIteratorOfListOfShape.hxx>
63 #include <TDataStd_Integer.hxx>
65 //#define DEB_CALCULATION 1
66 #ifdef DEB_CALCULATION
67 #include <BRepTools.hxx>
68 #include <TopLoc_Location.hxx>
70 #define CALCULATION_REGIONS_PREF GetName() + "_Reg"
71 #define CALCULATION_ZONES_PREF GetName() + "_Zone"
72 #define CALCULATION_GROUPS_PREF GetName() + "_"
73 //#define DEB_CLASS2D 1
75 #include <BRepBuilderAPI_MakeVertex.hxx>
78 #define EXPORT_NAME "HYDRO_" + GetName()
80 IMPLEMENT_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
81 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity)
83 HYDROData_CalculationCase::HYDROData_CalculationCase()
84 : HYDROData_Entity( Geom_2d_and_groups )
88 HYDROData_CalculationCase::~HYDROData_CalculationCase()
92 void HYDROData_CalculationCase::SetName( const QString& theName )
94 QString anOldCaseName = GetName();
95 if ( anOldCaseName != theName )
97 // Update names of regions and its zones
98 UpdateRegionsNames( GetRegions(), anOldCaseName, theName );
100 HYDROData_SequenceOfObjects aGroups = GetSplittedGroups();
102 HYDROData_SequenceOfObjects::Iterator anIter;
103 anIter.Init( aGroups );
104 for ( ; anIter.More(); anIter.Next() )
106 Handle(HYDROData_SplittedShapesGroup) aGroup =
107 Handle(HYDROData_SplittedShapesGroup)::DownCast( anIter.Value() );
108 if ( aGroup.IsNull() )
111 HYDROData_Tool::UpdateChildObjectName( anOldCaseName, theName, aGroup );
115 HYDROData_Entity::SetName( theName );
118 QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
120 QStringList aResList = dumpObjectCreation( theTreatedObjects );
121 aResList.prepend( "# Calculation case" );
123 QString aCalculName = GetObjPyName();
125 AssignmentMode aMode = GetAssignmentMode();
126 QString aModeStr = aMode==MANUAL ? "HYDROData_CalculationCase.MANUAL" : "HYDROData_CalculationCase.AUTOMATIC";
127 aResList << QString( "%0.SetAssignmentMode( %1 )" ).arg( aCalculName ).arg( aModeStr );
129 HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
130 HYDROData_SequenceOfObjects::Iterator anIter( aGeomObjects );
131 for ( ; anIter.More(); anIter.Next() )
133 Handle(HYDROData_Object) aRefGeomObj =
134 Handle(HYDROData_Object)::DownCast( anIter.Value() );
135 setPythonReferenceObject( theTreatedObjects, aResList, aRefGeomObj, "AddGeometryObject" );
137 aResList << QString( "" );
139 QString aGroupName = HYDROData_Tool::GenerateNameForPython( theTreatedObjects, "case_geom_group" );
141 HYDROData_SequenceOfObjects aGeomGroups = GetGeometryGroups();
142 anIter.Init( aGeomGroups );
143 for ( ; anIter.More(); anIter.Next() )
145 Handle(HYDROData_ShapesGroup) aGeomGroup =
146 Handle(HYDROData_ShapesGroup)::DownCast( anIter.Value() );
147 if ( aGeomGroup.IsNull() )
150 Handle(HYDROData_Object) aFatherGeom =
151 Handle(HYDROData_Object)::DownCast( aGeomGroup->GetFatherObject() );
152 if ( aFatherGeom.IsNull() )
155 int aGroupId = aFatherGeom->GetGroupId( aGeomGroup );
156 aResList << QString( "%1 = %2.GetGroup( %3 );" )
157 .arg( aGroupName ).arg( aFatherGeom->GetObjPyName() ).arg( aGroupId );
159 aResList << QString( "%1.AddGeometryGroup( %2 );" ).arg( aCalculName ).arg( aGroupName );
162 Handle(HYDROData_PolylineXY) aBoundaryPolyline = GetBoundaryPolyline();
163 setPythonReferenceObject( theTreatedObjects, aResList, aBoundaryPolyline, "SetBoundaryPolyline" );
165 if( aMode==AUTOMATIC )
166 DumpRulesToPython( aCalculName, aResList );
168 aResList << QString( "" );
169 aResList << "# Start the algorithm of the partition and assignment";
170 aResList << QString( "%1.Update();" ).arg( aCalculName );
174 // Now we restore the
175 // - regions and zones order
176 DumpRegionsToPython( aResList, theTreatedObjects, GetRegions() );
179 // Export calculation case
180 aResList << QString( "" );
181 aResList << "# Export of the calculation case";
182 QString aStudyName = "theStudy";
183 QString anEntryVar = aCalculName + "_entry";
184 aResList << QString( "%1 = %2.Export( %3._get_StudyId() )" ).arg( anEntryVar ).arg( aCalculName ).arg( aStudyName );
186 // Get geometry object and print debug information
188 aResList << "# Get geometry shape and print debug information";
189 aResList << "import GEOM";
190 aResList << QString( "print \"Entry:\", %1" ).arg( anEntryVar );
191 QString aGeomShapeName = aCalculName + "_geom";
192 aResList << QString( "%1 = salome.IDToObject( str( %2 ) )" ).arg( aGeomShapeName ).arg( anEntryVar );
193 aResList << QString( "print \"Geom shape:\", %1" ).arg( aGeomShapeName );
194 aResList << QString( "print \"Geom shape name:\", %1.GetName()" ).arg( aGeomShapeName );
196 DumpSampleMeshing( aResList, aStudyName, aGeomShapeName, aCalculName+"_mesh" );
198 aResList << QString( "" );
202 void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
203 const QString& theStudyName,
204 const QString& theGeomShapeName,
205 const QString& theMeshName ) const
208 theResList << "# Meshing";
209 theResList << "import SMESH, SALOMEDS";
210 theResList << "from salome.smesh import smeshBuilder";
211 theResList << "from salome.geom import geomBuilder";
213 theResList << QString( "smesh = smeshBuilder.New( %1 )" ).arg( theStudyName );
214 theResList << QString( "%1 = smesh.Mesh( %2 )" ).arg( theMeshName ).arg( theGeomShapeName );
215 theResList << QString( "MEFISTO_2D = %1.Triangle( algo=smeshBuilder.MEFISTO )" ).arg( theMeshName );
216 theResList << "Max_Element_Area_1 = MEFISTO_2D.MaxElementArea( 10 )";
217 theResList << QString( "Regular_1D = %1.Segment()" ).arg( theMeshName );
218 theResList << "Max_Size_1 = Regular_1D.MaxSize(10)";
219 theResList << QString( "isDone = %1.Compute()" ).arg( theMeshName );
222 theResList << "# Set names of Mesh objects";
223 theResList << "smesh.SetName( MEFISTO_2D.GetAlgorithm(), 'MEFISTO_2D' )";
224 theResList << "smesh.SetName( Regular_1D.GetAlgorithm(), 'Regular_1D' )";
225 theResList << "smesh.SetName( Max_Size_1, 'Max Size_1' )";
226 theResList << "smesh.SetName( Max_Element_Area_1, 'Max. Element Area_1' )";
227 theResList << QString( "smesh.SetName( %1.GetMesh(), '%1' )" ).arg( theMeshName );
230 theResList << "# Greate SMESH groups";
231 theResList << QString( "geompy = geomBuilder.New( %1 )" ).arg( theStudyName );
232 theResList << QString( "geom_groups = geompy.GetGroups( %1 )" ).arg( theGeomShapeName );
233 theResList << QString( "for group in geom_groups:" );
234 theResList << QString( " smesh_group = %1.GroupOnGeom(group, group.GetName(), SMESH.EDGE)" )
236 theResList << QString( " smesh.SetName(smesh_group, group.GetName())" );
237 theResList << QString( " print \"SMESH group '%s': %s\" % (smesh_group.GetName(), smesh_group)" );
240 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetAllReferenceObjects() const
242 HYDROData_SequenceOfObjects aResSeq = HYDROData_Entity::GetAllReferenceObjects();
244 Handle(HYDROData_PolylineXY) aBoundaryPolyline = GetBoundaryPolyline();
245 if ( !aBoundaryPolyline.IsNull() )
246 aResSeq.Append( aBoundaryPolyline );
248 HYDROData_SequenceOfObjects aSeqOfGeomObjs = GetGeometryObjects();
249 aResSeq.Append( aSeqOfGeomObjs );
252 HYDROData_SequenceOfObjects aSeqOfRegions = GetRegions();
253 aResSeq.Append( aSeqOfRegions );
258 void HYDROData_CalculationCase::Update()
260 HYDROData_Entity::Update();
263 // At first we remove previously created objects
265 RemoveSplittedGroups();
267 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
268 if ( aDocument.IsNull() )
272 HYDROData_SplitToZonesTool::SplitDataList aZonesList, anEdgesList;
274 Handle(HYDROData_PolylineXY) aBoundaryPolyline = GetBoundaryPolyline();
275 HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
276 if ( !aGeomObjects.IsEmpty() ) {
277 HYDROData_SequenceOfObjects aGeomGroups = GetGeometryGroups();
279 HYDROData_SplitToZonesTool::SplitDataList aSplitObjects =
280 HYDROData_SplitToZonesTool::Split( aGeomObjects, aGeomGroups, aBoundaryPolyline );
281 if ( !aSplitObjects.isEmpty() ) {
282 HYDROData_SplitToZonesTool::SplitDataListIterator anIter( aSplitObjects );
283 while( anIter.hasNext() ) {
284 const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
285 if ( aSplitData.Type == HYDROData_SplitToZonesTool::SplitData::Data_Zone )
286 aZonesList.append( aSplitData );
287 else if ( aSplitData.Type == HYDROData_SplitToZonesTool::SplitData::Data_Edge )
288 anEdgesList.append( aSplitData );
293 switch( GetAssignmentMode() )
296 CreateRegionsDef( aDocument, aZonesList );
299 CreateRegionsAuto( aDocument, aZonesList );
303 CreateEdgeGroupsDef( aDocument, anEdgesList );
306 void HYDROData_CalculationCase::CreateRegionsDef( const Handle(HYDROData_Document)& theDoc,
307 const HYDROData_SplitToZonesTool::SplitDataList& theZones )
309 // Create result regions for case, by default one zone for one region
310 QString aRegsPref = CALCULATION_REGIONS_PREF;
311 QString aZonesPref = CALCULATION_ZONES_PREF;
313 HYDROData_SplitToZonesTool::SplitDataListIterator anIter( theZones );
314 while( anIter.hasNext() )
316 const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
318 Handle(HYDROData_Region) aRegion = addNewRegion( theDoc, aRegsPref );
320 // Add the zone for region
321 Handle(HYDROData_Zone) aRegionZone = aRegion->addNewZone( theDoc, aZonesPref, aSplitData.Face(), aSplitData.ObjectNames );
325 void HYDROData_CalculationCase::CreateRegionsAuto( const Handle(HYDROData_Document)& theDoc,
326 const HYDROData_SplitToZonesTool::SplitDataList& theZones )
328 QMap<QString, Handle(HYDROData_Region)> aRegionsMap; //object name to region
329 QMap<QString, QString> aRegionNameToObjNameMap;
330 QString aZonesPref = CALCULATION_ZONES_PREF;
331 HYDROData_PriorityQueue aPr( this, DataTag_CustomRules );
333 // 1. First we create a default region for each object included into the calculation case
334 HYDROData_SequenceOfObjects anObjects = GetGeometryObjects();
335 for( int i = anObjects.Lower(), n = anObjects.Upper(); i<=n; i++ )
337 Handle(HYDROData_Entity) anObj = anObjects.Value( i );
340 QString anObjName = anObj->GetName();
341 QString aRegName = anObjName + "_reg";
342 Handle(HYDROData_Region) aRegion = addNewRegion( theDoc, aRegName, false );
343 aRegionsMap.insert( anObjName, aRegion );
344 aRegionNameToObjNameMap.insert( aRegName, anObjName );
347 // 2. Now for each zone it is necessary to determine the most priority object
348 // and assign to zone to corresponding region
349 HYDROData_SplitToZonesTool::SplitDataListIterator anIter( theZones );
350 while( anIter.hasNext() )
352 const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
353 HYDROData_Zone::MergeType aMergeType;
354 Handle(HYDROData_Entity) aRegObj = aPr.GetMostPriorityObject( aSplitData.ObjectNames, aMergeType );
355 if( aRegObj.IsNull() )
357 Handle(HYDROData_Region) aRegion = aRegionsMap[aRegObj->GetName()];
358 if( aRegion.IsNull() )
360 Handle(HYDROData_Zone) aRegionZone = aRegion->addNewZone( theDoc, aZonesPref, aSplitData.Face(), aSplitData.ObjectNames );
362 if( aSplitData.ObjectNames.count() > 1 && aMergeType==HYDROData_Zone::Merge_UNKNOWN )
364 qDebug( "Error in algorithm: unresolved conflicts" );
367 Handle(HYDROData_Entity) aMergeEntity = aRegObj;
368 Handle(HYDROData_Object) aMergeObject = Handle(HYDROData_Object)::DownCast( aMergeEntity );
369 if ( !aMergeObject.IsNull() ) {
370 aMergeEntity = aMergeObject->GetAltitudeObject();
375 case HYDROData_Zone::Merge_ZMIN:
376 case HYDROData_Zone::Merge_ZMAX:
377 aRegionZone->SetMergeType( aMergeType );
379 case HYDROData_Zone::Merge_Object:
380 aRegionZone->SetMergeType( aMergeType );
381 aRegionZone->RemoveMergeObject();
382 aRegionZone->SetMergeObject( aMergeEntity );
387 QStringList anObjectsWithEmptyRegions;
388 QMap<QString, Handle(HYDROData_Region)>::const_iterator
389 anIt = aRegionsMap.begin(), aLast = aRegionsMap.end();
390 for( ; anIt!=aLast; anIt++ )
392 Handle(HYDROData_Region) aRegion = anIt.value();
393 if( aRegion->GetZones().IsEmpty() )
395 QString aRegName = aRegion->GetName();
396 QString anObjName = aRegionNameToObjNameMap[aRegName];
397 anObjectsWithEmptyRegions.append( anObjName );
401 if( !anObjectsWithEmptyRegions.empty() )
403 QString aData = anObjectsWithEmptyRegions.join( ", " );
404 SetWarning( WARN_EMPTY_REGIONS, aData );
408 void HYDROData_CalculationCase::CreateEdgeGroupsDef( const Handle(HYDROData_Document)& theDoc,
409 const HYDROData_SplitToZonesTool::SplitDataList& theEdges )
411 QMap<QString,Handle(HYDROData_SplittedShapesGroup)> aSplittedEdgesGroupsMap;
413 HYDROData_SplitToZonesTool::SplitDataListIterator anIter( theEdges );
414 while( anIter.hasNext() )
416 const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
417 // Create new edges group
418 if ( aSplitData.ObjectNames.isEmpty() || aSplitData.Shape.IsNull() )
421 QString anObjName = aSplitData.ObjectNames.first();
422 if ( anObjName.isEmpty() )
424 #ifdef DEB_CALCULATION
425 QString aStr = aSplitData.ObjectNames.join(" ");
426 cout << " CCase: Names = "<<aStr.toStdString() << " size = " <<aSplitData.ObjectNames.size() <<endl;
428 Handle(HYDROData_SplittedShapesGroup) aSplittedGroup;
429 if ( !aSplittedEdgesGroupsMap.contains( anObjName ) )
431 aSplittedGroup = addNewSplittedGroup( CALCULATION_GROUPS_PREF + anObjName );
432 aSplittedEdgesGroupsMap.insert( anObjName, aSplittedGroup );
436 aSplittedGroup = aSplittedEdgesGroupsMap[ anObjName ];
438 if ( aSplittedGroup.IsNull() )
441 aSplittedGroup->AddShape( aSplitData.Shape );
445 bool HYDROData_CalculationCase::AddGeometryObject( const Handle(HYDROData_Object)& theObject )
447 if ( !HYDROData_Tool::IsGeometryObject( theObject ) )
448 return false; // Wrong type of object
450 if ( HasReference( theObject, DataTag_GeometryObject ) )
451 return false; // Object is already in reference list
453 AddReferenceObject( theObject, DataTag_GeometryObject );
455 // Indicate model of the need to update splitting
461 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryObjects() const
463 return GetReferenceObjects( DataTag_GeometryObject );
466 void HYDROData_CalculationCase::RemoveGeometryObject( const Handle(HYDROData_Object)& theObject )
468 if ( theObject.IsNull() )
471 RemoveReferenceObject( theObject->Label(), DataTag_GeometryObject );
473 // Indicate model of the need to update splitting
477 void HYDROData_CalculationCase::RemoveGeometryObjects()
479 ClearReferenceObjects( DataTag_GeometryObject );
481 // Indicate model of the need to update splitting
485 bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup )
487 if ( theGroup.IsNull() )
490 if ( HasReference( theGroup, DataTag_GeometryGroup ) )
491 return false; // Object is already in reference list
493 AddReferenceObject( theGroup, DataTag_GeometryGroup );
495 // Indicate model of the need to update splitting
496 Changed( Geom_Groups );
501 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryGroups() const
503 return GetReferenceObjects( DataTag_GeometryGroup );
506 void HYDROData_CalculationCase::RemoveGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup )
508 if ( theGroup.IsNull() )
511 RemoveReferenceObject( theGroup->Label(), DataTag_GeometryGroup );
513 // Indicate model of the need to update splitting
514 Changed( Geom_Groups );
517 void HYDROData_CalculationCase::RemoveGeometryGroups()
519 ClearReferenceObjects( DataTag_GeometryGroup );
521 // Indicate model of the need to update splitting
522 Changed( Geom_Groups );
525 void HYDROData_CalculationCase::SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline )
527 Handle(HYDROData_PolylineXY) aPrevPolyline = GetBoundaryPolyline();
529 SetReferenceObject( thePolyline, DataTag_Polyline );
531 // Indicate model of the need to update zones splitting
532 if( !IsEqual( aPrevPolyline, thePolyline ) )
536 Handle(HYDROData_PolylineXY) HYDROData_CalculationCase::GetBoundaryPolyline() const
538 return Handle(HYDROData_PolylineXY)::DownCast(
539 GetReferenceObject( DataTag_Polyline ) );
542 void HYDROData_CalculationCase::RemoveBoundaryPolyline()
544 Handle(HYDROData_PolylineXY) aPrevPolyline = GetBoundaryPolyline();
546 ClearReferenceObjects( DataTag_Polyline );
548 // Indicate model of the need to update zones splitting
552 void HYDROData_CalculationCase::SetStricklerTable( const Handle(HYDROData_StricklerTable)& theStricklerTable )
554 Handle(HYDROData_StricklerTable) aPrevStricklerTable = GetStricklerTable();
556 SetReferenceObject( theStricklerTable, DataTag_StricklerTable );
558 // Indicate model of the need to update land covers partition
559 if( !IsEqual( aPrevStricklerTable, theStricklerTable ) )
563 Handle(HYDROData_StricklerTable) HYDROData_CalculationCase::GetStricklerTable() const
565 return Handle(HYDROData_StricklerTable)::DownCast(
566 GetReferenceObject( DataTag_StricklerTable ) );
569 void HYDROData_CalculationCase::RemoveStricklerTable()
571 Handle(HYDROData_StricklerTable) aPrevStricklerTable = GetStricklerTable();
573 ClearReferenceObjects( DataTag_StricklerTable );
575 // Indicate model of the need to update land covers partition
579 Handle(HYDROData_LandCoverMap) HYDROData_CalculationCase::GetLandCoverMap() const
582 Handle(HYDROData_LandCoverMap) aLandCoverMap = NULL;
583 return aLandCoverMap;
586 Handle(HYDROData_Region) HYDROData_CalculationCase::AddNewRegion( const Handle(HYDROData_Zone)& theZone )
591 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
592 Handle(HYDROData_Region) aNewRegion = addNewRegion( aDocument, CALCULATION_REGIONS_PREF );
593 if ( aNewRegion.IsNull() )
596 aNewRegion->AddZone( theZone );
601 bool HYDROData_CalculationCase::AddRegion( const Handle(HYDROData_Region)& theRegion )
603 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
605 if ( theRegion.IsNull() )
608 HYDROData_CalculationCase::DataTag aDataTag = DataTag_Region;
610 if ( HasReference( theRegion, aDataTag ) )
611 return false; // Object is already in reference list
613 // Move the region from other calculation
614 Handle(HYDROData_CalculationCase) aFatherCalc =
615 Handle(HYDROData_CalculationCase)::DownCast( theRegion->GetFatherObject() );
616 if ( !aFatherCalc.IsNull() && aFatherCalc->Label() != myLab )
618 Handle(HYDROData_Region) aNewRegion = addNewRegion( aDocument, CALCULATION_REGIONS_PREF );
619 theRegion->CopyTo( aNewRegion, true );
621 aFatherCalc->RemoveRegion( theRegion );
623 theRegion->SetLabel( aNewRegion->Label() );
627 AddReferenceObject( theRegion, aDataTag );
633 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetRegions() const
635 return GetReferenceObjects( DataTag_Region );
638 void HYDROData_CalculationCase::UpdateRegionsOrder()
640 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
641 if ( aDocument.IsNull() )
644 HYDROData_SequenceOfObjects aRegions = GetRegions();
645 HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
646 for ( ; anIter.More(); anIter.Next() )
648 Handle(HYDROData_Region) aRegion =
649 Handle(HYDROData_Region)::DownCast( anIter.Value() );
650 if ( aRegion.IsNull() )
653 aRegion->SetName( "" );
656 QString aRegsPref = CALCULATION_REGIONS_PREF;
658 anIter.Init( aRegions );
659 for ( ; anIter.More(); anIter.Next() )
661 Handle(HYDROData_Region) aRegion =
662 Handle(HYDROData_Region)::DownCast( anIter.Value() );
663 if ( aRegion.IsNull() )
666 QString aRegionName = HYDROData_Tool::GenerateObjectName( aDocument, aRegsPref );
667 aRegion->SetName( aRegionName );
671 void HYDROData_CalculationCase::RemoveRegion( const Handle(HYDROData_Region)& theRegion )
673 if ( theRegion.IsNull() )
676 HYDROData_CalculationCase::DataTag aDataTag = DataTag_Region;
677 RemoveReferenceObject( theRegion->Label(), aDataTag );
679 // Remove region from data model
680 Handle(HYDROData_CalculationCase) aFatherCalc =
681 Handle(HYDROData_CalculationCase)::DownCast( theRegion->GetFatherObject() );
682 if ( !aFatherCalc.IsNull() && aFatherCalc->Label() == myLab )
686 void HYDROData_CalculationCase::RemoveRegions()
688 myLab.FindChild( DataTag_ChildRegion ).ForgetAllAttributes();
691 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetSplittedGroups() const
693 return GetReferenceObjects( DataTag_SplittedGroups );
696 void HYDROData_CalculationCase::RemoveSplittedGroups()
698 myLab.FindChild( DataTag_SplittedGroups ).ForgetAllAttributes();
701 double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint ) const
703 Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint );
704 return GetAltitudeForPoint( thePoint, aZone );
707 double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint,
708 const Handle(HYDROData_Region)& theRegion ) const
710 double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude();
712 Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint );
713 if ( !aZone.IsNull() )
715 Handle(HYDROData_Region) aRefRegion = Handle(HYDROData_Region)::DownCast( aZone->GetFatherObject() );
716 if ( IsEqual( aRefRegion, theRegion ) )
717 aResAltitude = GetAltitudeForPoint( thePoint, aZone );
723 double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint,
724 const Handle(HYDROData_Zone)& theZone ) const
726 double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude();
727 if ( theZone.IsNull() )
730 HYDROData_Zone::MergeType aZoneMergeType = theZone->GetMergeType();
731 if ( !theZone->IsMergingNeed() )
733 aZoneMergeType = HYDROData_Zone::Merge_UNKNOWN;
735 else if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
740 HYDROData_IInterpolator* aZoneInterpolator = theZone->GetInterpolator();
741 if ( aZoneMergeType == HYDROData_Zone::Merge_Object )
743 Handle(HYDROData_IAltitudeObject) aMergeAltitude =
744 Handle(HYDROData_IAltitudeObject)::DownCast( theZone->GetMergeObject() );
745 if ( !aMergeAltitude.IsNull() )
747 if ( aZoneInterpolator != NULL )
749 aZoneInterpolator->SetAltitudeObject( aMergeAltitude );
750 aResAltitude = aZoneInterpolator->GetAltitudeForPoint( thePoint );
753 aResAltitude = aMergeAltitude->GetAltitudeForPoint( thePoint );
758 HYDROData_SequenceOfObjects aZoneObjects = theZone->GetObjects();
759 HYDROData_SequenceOfObjects::Iterator anIter( aZoneObjects );
760 for ( ; anIter.More(); anIter.Next() )
762 Handle(HYDROData_Object) aZoneObj =
763 Handle(HYDROData_Object)::DownCast( anIter.Value() );
764 if ( aZoneObj.IsNull() )
767 Handle(HYDROData_IAltitudeObject) anObjAltitude = aZoneObj->GetAltitudeObject();
768 if ( anObjAltitude.IsNull() )
771 double aPointAltitude = 0.0;
772 if ( aZoneInterpolator != NULL )
774 aZoneInterpolator->SetAltitudeObject( anObjAltitude );
775 aPointAltitude = aZoneInterpolator->GetAltitudeForPoint( thePoint );
778 aPointAltitude = anObjAltitude->GetAltitudeForPoint( thePoint );
780 if ( ValuesEquals( aPointAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) )
783 if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
785 aResAltitude = aPointAltitude;
788 else if ( aZoneMergeType == HYDROData_Zone::Merge_ZMIN )
790 if ( ValuesEquals( aResAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) ||
791 aResAltitude > aPointAltitude )
793 aResAltitude = aPointAltitude;
796 else if ( aZoneMergeType == HYDROData_Zone::Merge_ZMAX )
798 if ( ValuesEquals( aResAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) ||
799 aResAltitude < aPointAltitude )
801 aResAltitude = aPointAltitude;
810 NCollection_Sequence<double> HYDROData_CalculationCase::GetAltitudesForPoints(
811 const NCollection_Sequence<gp_XY>& thePoints,
812 const Handle(HYDROData_Region)& theRegion ) const
814 NCollection_Sequence<double> aResSeq;
816 for ( int i = 1, n = thePoints.Length(); i <= n; ++i )
818 const gp_XY& thePnt = thePoints.Value( i );
820 double anAltitude = GetAltitudeForPoint( thePnt, theRegion );
821 aResSeq.Append( anAltitude );
827 NCollection_Sequence<double> HYDROData_CalculationCase::GetAltitudesForPoints(
828 const NCollection_Sequence<gp_XY>& thePoints,
829 const Handle(HYDROData_Zone)& theZone ) const
831 NCollection_Sequence<double> aResSeq;
833 for ( int i = 1, n = thePoints.Length(); i <= n; ++i )
835 const gp_XY& thePnt = thePoints.Value( i );
837 double anAltitude = GetAltitudeForPoint( thePnt, theZone );
838 aResSeq.Append( anAltitude );
844 double HYDROData_CalculationCase::GetStricklerCoefficientForPoint( const gp_XY& thePoint ) const
850 Handle(HYDROData_Region) HYDROData_CalculationCase::GetRegionFromPoint( const gp_XY& thePoint ) const
852 Handle(HYDROData_Region) aResRegion;
854 Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint );
855 if ( !aZone.IsNull() )
856 aResRegion = Handle(HYDROData_Region)::DownCast( aZone->GetFatherObject() );
861 Handle(HYDROData_Zone) HYDROData_CalculationCase::GetZoneFromPoint( const gp_XY& thePoint ) const
863 Handle(HYDROData_Zone) aResZone;
865 HYDROData_SequenceOfObjects aRegions = GetRegions();
867 HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
868 for ( ; anIter.More() && aResZone.IsNull(); anIter.Next() )
870 Handle(HYDROData_Region) aRegion =
871 Handle(HYDROData_Region)::DownCast( anIter.Value() );
872 if ( aRegion.IsNull() )
875 HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
876 HYDROData_SequenceOfObjects::Iterator aZonesIter( aZones );
877 for ( ; aZonesIter.More() && aResZone.IsNull(); aZonesIter.Next() )
879 Handle(HYDROData_Zone) aRegZone =
880 Handle(HYDROData_Zone)::DownCast( aZonesIter.Value() );
881 if ( aRegZone.IsNull() )
884 PointClassification aPointRelation = GetPointClassification( thePoint, aRegZone );
885 if ( aPointRelation != POINT_OUT )
886 aResZone = aRegZone; // We found the desired zone
893 HYDROData_CalculationCase::PointClassification HYDROData_CalculationCase::GetPointClassification(
894 const gp_XY& thePoint,
895 const Handle(HYDROData_Zone)& theZone ) const
897 PointClassification aRes = POINT_OUT;
898 if ( theZone.IsNull() )
901 TopoDS_Face aZoneFace = TopoDS::Face( theZone->GetShape() );
902 if ( aZoneFace.IsNull() )
905 TopoDS_Compound aCmp;
907 aBB.MakeCompound(aCmp);
908 aBB.Add(aCmp, aZoneFace);
909 gp_Pnt aPnt (thePoint.X(), thePoint.Y(), 0.);
910 BRepBuilderAPI_MakeVertex aMk(aPnt);
911 aBB.Add(aCmp, aMk.Vertex());
912 BRepTools::Write(aCmp, "FCL2d.brep");
914 TopAbs_State State = HYDROData_Tool::ComputePointState(thePoint, aZoneFace);
915 if (State == TopAbs_OUT)
917 else if(State == TopAbs_IN)
919 else if(State == TopAbs_ON)
924 Handle(HYDROData_Region) HYDROData_CalculationCase::addNewRegion( const Handle(HYDROData_Document)& theDoc,
925 const QString& thePrefixOrName,
928 TDF_Label aNewLab = myLab.FindChild( DataTag_ChildRegion ).NewChild();
929 int aTag = aNewLab.Tag();
931 Handle(HYDROData_Region) aNewRegion =
932 Handle(HYDROData_Region)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_REGION ) );
933 AddRegion( aNewRegion );
935 QString aRegionName = isPrefix ? HYDROData_Tool::GenerateObjectName( theDoc, thePrefixOrName ) : thePrefixOrName;
936 aNewRegion->SetName( aRegionName );
941 Handle(HYDROData_SplittedShapesGroup) HYDROData_CalculationCase::addNewSplittedGroup( const QString& theName )
943 TDF_Label aNewLab = myLab.FindChild( DataTag_SplittedGroups ).NewChild();
945 Handle(HYDROData_SplittedShapesGroup) aNewGroup =
946 Handle(HYDROData_SplittedShapesGroup)::DownCast(
947 HYDROData_Iterator::CreateObject( aNewLab, KIND_SPLITTED_GROUP ) );
948 AddReferenceObject( aNewGroup, DataTag_SplittedGroups );
950 aNewGroup->SetName( theName );
955 QString HYDROData_CalculationCase::Export( int theStudyId ) const
960 GEOM::GEOM_Gen_var aGEOMEngine = HYDROData_GeomTool::GetGeomGen();
961 SALOMEDS::Study_var aDSStudy = HYDROData_GeomTool::GetStudyByID( theStudyId );
963 QString aGeomObjEntry, anErrorMsg;
964 bool isOK = Export( aGEOMEngine, aDSStudy, aGeomObjEntry, anErrorMsg );
965 return isOK ? aGeomObjEntry : QString();
970 bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
971 SALOMEDS::Study_ptr theStudy,
972 QString& theGeomObjEntry,
973 QString& theErrorMsg ) const
975 HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroupsDefs;
977 // Get groups definitions
978 HYDROData_SequenceOfObjects aSplittedGroups = GetSplittedGroups();
980 HYDROData_SequenceOfObjects::Iterator anIter( aSplittedGroups );
981 for ( ; anIter.More(); anIter.Next() )
984 Handle(HYDROData_ShapesGroup) aGroup =
985 Handle(HYDROData_ShapesGroup)::DownCast( anIter.Value() );
986 if ( aGroup.IsNull() )
989 HYDROData_ShapesGroup::GroupDefinition aGroupDef;
991 aGroupDef.Name = aGroup->GetName().toLatin1().constData();
992 aGroup->GetShapes( aGroupDef.Shapes );
994 aSeqOfGroupsDefs.Append( aGroupDef );
998 bool isAllNotSubmersible = true;
999 TopTools_ListOfShape aFaces;
1000 HYDROData_SequenceOfObjects aCaseRegions = GetRegions();
1001 HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions );
1002 for ( ; aRegionIter.More(); aRegionIter.Next() )
1004 Handle(HYDROData_Region) aRegion =
1005 Handle(HYDROData_Region)::DownCast( aRegionIter.Value() );
1006 if( aRegion.IsNull() || !aRegion->IsSubmersible() )
1009 if ( isAllNotSubmersible )
1010 isAllNotSubmersible = false;
1012 TopoDS_Shape aRegionShape = aRegion->GetShape( &aSeqOfGroupsDefs );
1013 aFaces.Append( aRegionShape );
1018 if ( aCaseRegions.IsEmpty() ) {
1019 theErrorMsg = QString("the list of regions is empty.");
1020 } else if ( isAllNotSubmersible ) {
1021 theErrorMsg = QString("there are no submersible regions.");
1023 aRes = Export( theGeomEngine, theStudy, aFaces, aSeqOfGroupsDefs, theGeomObjEntry );;
1029 bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
1030 SALOMEDS::Study_ptr theStudy,
1031 const TopTools_ListOfShape& theFaces,
1032 const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs,
1033 QString& theGeomObjEntry ) const
1036 BRepBuilderAPI_Sewing aSewing( Precision::Confusion() * 10.0 );
1037 aSewing.SetNonManifoldMode( Standard_False );
1038 #ifdef DEB_CALCULATION
1039 TCollection_AsciiString aNam("Sh_");
1042 TopTools_ListIteratorOfListOfShape aFaceIter( theFaces );
1043 for ( ; aFaceIter.More(); aFaceIter.Next() )
1045 TopoDS_Shape aShape = aFaceIter.Value();
1046 if ( aShape.IsNull() )
1049 if ( aShape.ShapeType() == TopAbs_FACE )
1051 aSewing.Add( aShape );
1052 #ifdef DEB_CALCULATION
1053 TCollection_AsciiString aName = aNam + ++i + ".brep";
1054 BRepTools::Write(aShape ,aName.ToCString());
1059 #ifdef DEB_CALCULATION
1062 TopExp_Explorer anExp( aShape, TopAbs_FACE );
1063 for (; anExp.More(); anExp.Next() ) {
1064 aSewing.Add( anExp.Current() );
1065 #ifdef DEB_CALCULATION
1067 TCollection_AsciiString aName = aNam + i + "_" + ++j + ".brep";
1068 BRepTools::Write(anExp.Current() ,aName.ToCString());
1075 TopoDS_Shape aSewedShape = aSewing.SewedShape();
1077 // If the sewed shape is empty - return false
1078 if ( aSewedShape.IsNull() || !TopoDS_Iterator( aSewedShape ).More() )
1081 #ifdef DEB_CALCULATION
1082 BRepTools::Write(aSewedShape ,"Sew.brep");
1084 // Publish the sewed shape
1085 QString aName = EXPORT_NAME;
1086 GEOM::GEOM_Object_ptr aMainShape =
1087 HYDROData_GeomTool::publishShapeInGEOM( theGeomEngine, theStudy, aSewedShape, aName, theGeomObjEntry );
1089 if ( aMainShape->_is_nil() )
1092 if ( theGroupsDefs.IsEmpty() )
1096 TopTools_IndexedMapOfShape aMapOfSubShapes;
1097 TopExp::MapShapes( aSewedShape, aMapOfSubShapes );
1099 NCollection_DataMap< TCollection_AsciiString, NCollection_Sequence<int> > aGroupsData;
1101 for ( int aGrId = 1, nbGroups = theGroupsDefs.Length(); aGrId <= nbGroups; ++aGrId )
1103 const HYDROData_ShapesGroup::GroupDefinition& aGroupDef = theGroupsDefs.Value( aGrId );
1105 NCollection_Sequence<int> aGroupIndexes;
1106 for( int i = 1, n = aGroupDef.Shapes.Length(); i <= n; i++ )
1108 const TopoDS_Shape& aShape = aGroupDef.Shapes.Value( i );
1109 #ifdef DEB_CALCULATION
1110 cout << "\nOld shape(" << i << ") = " << aShape.TShape() <<endl;
1113 TopoDS_Shape aModifiedShape = aShape;
1114 if ( aSewing.IsModified( aShape ) )
1115 aModifiedShape = aSewing.Modified( aShape );
1116 else if ( aSewing.IsModifiedSubShape( aShape ) )
1117 aModifiedShape = aSewing.ModifiedSubShape( aShape );
1119 #ifdef DEB_CALCULATION
1120 const TopLoc_Location& aL1 = aShape.Location();
1121 const TopLoc_Location& aL2 = aModifiedShape.Location();
1122 cout << "\nNew shape(" << i << ") = " << aModifiedShape.TShape() << " Location is Equal = " << aL1.IsEqual(aL2)<<endl;
1125 int anIndex = aMapOfSubShapes.FindIndex(aModifiedShape);
1126 if ( anIndex > 0 ) {
1127 aGroupIndexes.Append( anIndex );
1129 #ifdef DEB_CALCULATION
1130 TCollection_AsciiString aNam("Lost_");
1131 if(!aMapOfSubShapes.Contains(aModifiedShape)) {
1132 for ( int anIndex = 1; anIndex <= aMapOfSubShapes.Extent(); anIndex++ )
1134 const TopoDS_Shape& aS = aMapOfSubShapes.FindKey( anIndex );
1135 if ( aModifiedShape.IsPartner( aS ) )
1137 cout <<"\nIndex in Map = " << anIndex << "TShape = " << aS.TShape() <<endl;
1138 TCollection_AsciiString aName = aNam + i + "_" + anIndex + ".brep";
1139 BRepTools::Write(aS ,aName.ToCString());
1147 if ( !aGroupIndexes.IsEmpty() )
1148 aGroupsData.Bind( aGroupDef.Name, aGroupIndexes );
1151 if ( !aGroupsData.IsEmpty() )
1153 GEOM::GEOM_IGroupOperations_var aGroupOp =
1154 theGeomEngine->GetIGroupOperations( theStudy->StudyId() );
1156 NCollection_DataMap< TCollection_AsciiString, NCollection_Sequence<int> >::Iterator aMapIt( aGroupsData );
1157 for ( ; aMapIt.More(); aMapIt.Next() )
1159 const TCollection_AsciiString& aGroupName = aMapIt.Key();
1160 const NCollection_Sequence<int>& aGroupIndexes = aMapIt.Value();
1162 GEOM::GEOM_Object_var aGeomGroup = aGroupOp->CreateGroup( aMainShape, TopAbs_EDGE );
1163 if ( CORBA::is_nil( aGeomGroup ) || !aGroupOp->IsDone() )
1166 GEOM::ListOfLong_var aGeomIndexes = new GEOM::ListOfLong;
1167 aGeomIndexes->length( aGroupIndexes.Length() );
1169 for( int i = 1, n = aGroupIndexes.Length(); i <= n; i++ )
1170 aGeomIndexes[ i - 1 ] = aGroupIndexes.Value( i );
1172 aGroupOp->UnionIDs( aGeomGroup, aGeomIndexes );
1173 if ( aGroupOp->IsDone() )
1175 SALOMEDS::SObject_var aGroupSO =
1176 theGeomEngine->AddInStudy( theStudy, aGeomGroup, aGroupName.ToCString(), aMainShape );
1185 void HYDROData_CalculationCase::ClearRules( HYDROData_CalculationCase::DataTag theDataTag,
1186 const bool theIsSetToUpdate )
1188 TDF_Label aRulesLab = myLab.FindChild( theDataTag );
1189 HYDROData_PriorityQueue::ClearRules( aRulesLab );
1191 // Indicate model of the need to update splitting
1192 if ( theIsSetToUpdate ) {
1197 void HYDROData_CalculationCase::AddRule( const Handle(HYDROData_Entity)& theObject1,
1198 HYDROData_PriorityType thePriority,
1199 const Handle(HYDROData_Entity)& theObject2,
1200 HYDROData_Zone::MergeType theMergeType,
1201 HYDROData_CalculationCase::DataTag theDataTag )
1203 TDF_Label aRulesLab = myLab.FindChild( theDataTag );
1204 HYDROData_PriorityQueue::AddRule( aRulesLab, theObject1, thePriority, theObject2, theMergeType );
1206 // Indicate model of the need to update splitting
1210 QString HYDROData_CalculationCase::DumpRules() const
1212 TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
1213 return HYDROData_PriorityQueue::DumpRules( aRulesLab );
1216 void HYDROData_CalculationCase::SetAssignmentMode( AssignmentMode theMode )
1218 TDF_Label aModeLab = myLab.FindChild( DataTag_AssignmentMode );
1219 TDataStd_Integer::Set( aModeLab, ( int ) theMode );
1221 // Indicate model of the need to update splitting
1225 HYDROData_CalculationCase::AssignmentMode HYDROData_CalculationCase::GetAssignmentMode() const
1227 Handle(TDataStd_Integer) aModeAttr;
1228 bool isOK = myLab.FindChild( DataTag_AssignmentMode ).FindAttribute( TDataStd_Integer::GetID(), aModeAttr );
1230 return ( AssignmentMode ) aModeAttr->Get();
1235 void HYDROData_CalculationCase::DumpRulesToPython( const QString& theCalcCaseName,
1236 QStringList& theScript ) const
1238 TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
1239 HYDROData_PriorityQueue::DumpRulesToPython( aRulesLab, theCalcCaseName, theScript );
1242 HYDROData_Warning HYDROData_CalculationCase::GetLastWarning() const
1244 return myLastWarning;
1247 void HYDROData_CalculationCase::SetWarning( HYDROData_WarningType theType, const QString& theData )
1249 myLastWarning.Type = theType;
1250 myLastWarning.Data = theData;
1253 void HYDROData_CalculationCase::UpdateRegionsNames( const HYDROData_SequenceOfObjects& theRegions,
1254 const QString& theOldCaseName,
1255 const QString& theName )
1257 HYDROData_SequenceOfObjects::Iterator anIter( theRegions );
1258 for ( ; anIter.More(); anIter.Next() )
1260 Handle(HYDROData_Region) aRegion =
1261 Handle(HYDROData_Region)::DownCast( anIter.Value() );
1262 if ( aRegion.IsNull() )
1265 HYDROData_Tool::UpdateChildObjectName( theOldCaseName, theName, aRegion );
1267 HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
1268 HYDROData_SequenceOfObjects::Iterator anIter( aZones );
1269 for ( ; anIter.More(); anIter.Next() )
1271 Handle(HYDROData_Zone) aRegZone =
1272 Handle(HYDROData_Zone)::DownCast( anIter.Value() );
1273 if ( aRegZone.IsNull() )
1276 HYDROData_Tool::UpdateChildObjectName( theOldCaseName, theName, aRegZone );
1281 void HYDROData_CalculationCase::DumpRegionsToPython( QStringList& theResList,
1282 MapOfTreatedObjects& theTreatedObjects,
1283 const HYDROData_SequenceOfObjects& theRegions ) const
1285 HYDROData_SequenceOfObjects::Iterator anIter;
1286 anIter.Init( theRegions );
1287 for ( ; anIter.More(); anIter.Next() )
1289 Handle(HYDROData_Region) aRegion =
1290 Handle(HYDROData_Region)::DownCast( anIter.Value() );
1291 if ( aRegion.IsNull() )
1294 theTreatedObjects.insert( aRegion->GetName(), aRegion );
1295 QStringList aRegDump = aRegion->DumpToPython( theTreatedObjects );
1296 theResList << aRegDump;
1300 bool HYDROData_CalculationCase::GetRule( int theIndex,
1301 Handle(HYDROData_Entity)& theObject1,
1302 HYDROData_PriorityType& thePriority,
1303 Handle(HYDROData_Entity)& theObject2,
1304 HYDROData_Zone::MergeType& theMergeType,
1305 HYDROData_CalculationCase::DataTag& theDataTag) const
1307 TDF_Label aRulesLab = myLab.FindChild( theDataTag );
1308 return HYDROData_PriorityQueue::GetRule( aRulesLab, theIndex,
1309 theObject1, thePriority, theObject2, theMergeType );