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"
21 #include "HYDROData_ArtificialObject.h"
22 #include "HYDROData_IAltitudeObject.h"
23 #include "HYDROData_Document.h"
24 #include "HYDROData_ShapesGroup.h"
25 #include "HYDROData_Iterator.h"
26 #include "HYDROData_NaturalObject.h"
27 #include "HYDROData_PolylineXY.h"
28 #include "HYDROData_SplittedShapesGroup.h"
29 #include "HYDROData_Region.h"
30 #include "HYDROData_Tool.h"
31 #include "HYDROData_GeomTool.h"
38 #include <TopoDS_Shell.hxx>
39 #include <TopoDS_Edge.hxx>
41 #include <BRep_Builder.hxx>
42 #include <BRepBuilderAPI_Sewing.hxx>
43 #include <BRepTopAdaptor_FClass2d.hxx>
45 #include <BRepTools.hxx>
48 #include <TopExp_Explorer.hxx>
50 #include <TopTools_ListOfShape.hxx>
51 #include <TopTools_ListIteratorOfListOfShape.hxx>
52 #include <TDataStd_Integer.hxx>
54 //#define DEB_CALCULATION 1
55 #ifdef DEB_CALCULATION
56 #include <BRepTools.hxx>
57 #include <TopLoc_Location.hxx>
59 #define CALCULATION_REGIONS_PREF GetName() + "_Reg"
60 #define CALCULATION_ZONES_PREF GetName() + "_Zone"
61 #define CALCULATION_GROUPS_PREF GetName() + "_"
62 //#define DEB_CLASS2D 1
64 #include <BRepBuilderAPI_MakeVertex.hxx>
67 #define EXPORT_NAME "HYDRO_" + GetName()
69 #include <SALOME_NamingService.hxx>
70 #include <SALOME_LifeCycleCORBA.hxx>
73 #include "HYDRO_trace.hxx"
75 IMPLEMENT_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
76 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity)
78 HYDROData_CalculationCase::HYDROData_CalculationCase()
83 HYDROData_CalculationCase::~HYDROData_CalculationCase()
87 void HYDROData_CalculationCase::SetName( const QString& theName )
89 QString anOldCaseName = GetName();
90 if ( anOldCaseName != theName )
92 HYDROData_SequenceOfObjects aRegions = GetRegions();
94 HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
95 for ( ; anIter.More(); anIter.Next() )
97 Handle(HYDROData_Region) aRegion =
98 Handle(HYDROData_Region)::DownCast( anIter.Value() );
99 if ( aRegion.IsNull() )
102 HYDROData_Tool::UpdateChildObjectName( anOldCaseName, theName, aRegion );
104 HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
105 HYDROData_SequenceOfObjects::Iterator anIter( aZones );
106 for ( ; anIter.More(); anIter.Next() )
108 Handle(HYDROData_Zone) aRegZone =
109 Handle(HYDROData_Zone)::DownCast( anIter.Value() );
110 if ( aRegZone.IsNull() )
113 HYDROData_Tool::UpdateChildObjectName( anOldCaseName, theName, aRegZone );
117 HYDROData_SequenceOfObjects aGroups = GetSplittedGroups();
119 anIter.Init( aGroups );
120 for ( ; anIter.More(); anIter.Next() )
122 Handle(HYDROData_SplittedShapesGroup) aGroup =
123 Handle(HYDROData_SplittedShapesGroup)::DownCast( anIter.Value() );
124 if ( aGroup.IsNull() )
127 HYDROData_Tool::UpdateChildObjectName( anOldCaseName, theName, aGroup );
131 HYDROData_Entity::SetName( theName );
134 QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
136 QStringList aResList = dumpObjectCreation( theTreatedObjects );
137 aResList.prepend( "# Calculation case" );
139 QString aCalculName = GetObjPyName();
141 AssignmentMode aMode = GetAssignmentMode();
142 QString aModeStr = aMode==MANUAL ? "HYDROData_CalculationCase.MANUAL" : "HYDROData_CalculationCase.AUTOMATIC";
143 aResList << QString( "%0.SetAssignmentMode( %1 )" ).arg( aCalculName ).arg( aModeStr );
145 HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
146 HYDROData_SequenceOfObjects::Iterator anIter( aGeomObjects );
147 for ( ; anIter.More(); anIter.Next() )
149 Handle(HYDROData_Object) aRefGeomObj =
150 Handle(HYDROData_Object)::DownCast( anIter.Value() );
151 setPythonReferenceObject( theTreatedObjects, aResList, aRefGeomObj, "AddGeometryObject" );
153 aResList << QString( "" );
155 QString aGroupName = HYDROData_Tool::GenerateNameForPython( theTreatedObjects, "case_geom_group" );
157 HYDROData_SequenceOfObjects aGeomGroups = GetGeometryGroups();
158 anIter.Init( aGeomGroups );
159 for ( ; anIter.More(); anIter.Next() )
161 Handle(HYDROData_ShapesGroup) aGeomGroup =
162 Handle(HYDROData_ShapesGroup)::DownCast( anIter.Value() );
163 if ( aGeomGroup.IsNull() )
166 Handle(HYDROData_Object) aFatherGeom =
167 Handle(HYDROData_Object)::DownCast( aGeomGroup->GetFatherObject() );
168 if ( aFatherGeom.IsNull() )
171 int aGroupId = aFatherGeom->GetGroupId( aGeomGroup );
172 aResList << QString( "%1 = %2.GetGroup( %3 );" )
173 .arg( aGroupName ).arg( aFatherGeom->GetObjPyName() ).arg( aGroupId );
175 aResList << QString( "%1.AddGeometryGroup( %2 );" ).arg( aCalculName ).arg( aGroupName );
178 Handle(HYDROData_PolylineXY) aBoundaryPolyline = GetBoundaryPolyline();
179 setPythonReferenceObject( theTreatedObjects, aResList, aBoundaryPolyline, "SetBoundaryPolyline" );
181 if( aMode==AUTOMATIC )
182 DumpRulesToPython( aCalculName, aResList );
184 aResList << QString( "" );
185 aResList << "# Start the algorithm of the partition and assignment";
186 aResList << QString( "%1.Update();" ).arg( aCalculName );
190 // Now we restore the regions and zones order
191 HYDROData_SequenceOfObjects aRegions = GetRegions();
192 anIter.Init( aRegions );
193 for ( ; anIter.More(); anIter.Next() )
195 Handle(HYDROData_Region) aRegion =
196 Handle(HYDROData_Region)::DownCast( anIter.Value() );
197 if ( aRegion.IsNull() )
200 theTreatedObjects.insert( aRegion->GetName(), aRegion );
201 QStringList aRegDump = aRegion->DumpToPython( theTreatedObjects );
202 aResList << aRegDump;
206 // Export calculation case
207 aResList << QString( "" );
208 aResList << "# Export of the calculation case";
209 QString aStudyName = "theStudy";
210 QString anEntryVar = aCalculName + "_entry";
211 aResList << QString( "%1 = %2.Export( %3._get_StudyId() )" ).arg( anEntryVar ).arg( aCalculName ).arg( aStudyName );
213 // Get geometry object and print debug information
215 aResList << "# Get geometry shape and print debug information";
216 aResList << "import GEOM";
217 aResList << QString( "print \"Entry:\", %1" ).arg( anEntryVar );
218 QString aGeomShapeName = aCalculName + "_geom";
219 aResList << QString( "%1 = salome.IDToObject( str( %2 ) )" ).arg( aGeomShapeName ).arg( anEntryVar );
220 aResList << QString( "print \"Geom shape:\", %1" ).arg( aGeomShapeName );
221 aResList << QString( "print \"Geom shape name:\", %1.GetName()" ).arg( aGeomShapeName );
223 DumpSampleMeshing( aResList, aStudyName, aGeomShapeName, aCalculName+"_mesh" );
225 aResList << QString( "" );
229 void HYDROData_CalculationCase::DumpSampleMeshing( QStringList& theResList,
230 const QString& theStudyName,
231 const QString& theGeomShapeName,
232 const QString& theMeshName ) const
235 theResList << "# Meshing";
236 theResList << "import SMESH, SALOMEDS";
237 theResList << "from salome.smesh import smeshBuilder";
238 theResList << "from salome.geom import geomBuilder";
240 theResList << QString( "smesh = smeshBuilder.New( %1 )" ).arg( theStudyName );
241 theResList << QString( "%1 = smesh.Mesh( %2 )" ).arg( theMeshName ).arg( theGeomShapeName );
242 theResList << QString( "MEFISTO_2D = %1.Triangle( algo=smeshBuilder.MEFISTO )" ).arg( theMeshName );
243 theResList << "Max_Element_Area_1 = MEFISTO_2D.MaxElementArea( 10 )";
244 theResList << QString( "Regular_1D = %1.Segment()" ).arg( theMeshName );
245 theResList << "Max_Size_1 = Regular_1D.MaxSize(10)";
246 theResList << QString( "isDone = %1.Compute()" ).arg( theMeshName );
249 theResList << "# Set names of Mesh objects";
250 theResList << "smesh.SetName( MEFISTO_2D.GetAlgorithm(), 'MEFISTO_2D' )";
251 theResList << "smesh.SetName( Regular_1D.GetAlgorithm(), 'Regular_1D' )";
252 theResList << "smesh.SetName( Max_Size_1, 'Max Size_1' )";
253 theResList << "smesh.SetName( Max_Element_Area_1, 'Max. Element Area_1' )";
254 theResList << QString( "smesh.SetName( %1.GetMesh(), '%1' )" ).arg( theMeshName );
257 theResList << "# Greate SMESH groups";
258 theResList << QString( "geompy = geomBuilder.New( %1 )" ).arg( theStudyName );
259 theResList << QString( "geom_groups = geompy.GetGroups( %1 )" ).arg( theGeomShapeName );
260 theResList << QString( "for group in geom_groups:" );
261 theResList << QString( " smesh_group = %1.GroupOnGeom(group, group.GetName(), SMESH.EDGE)" )
263 theResList << QString( " smesh.SetName(smesh_group, group.GetName())" );
264 theResList << QString( " print \"SMESH group '%s': %s\" % (smesh_group.GetName(), smesh_group)" );
267 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetAllReferenceObjects() const
269 HYDROData_SequenceOfObjects aResSeq = HYDROData_Entity::GetAllReferenceObjects();
271 Handle(HYDROData_PolylineXY) aBoundaryPolyline = GetBoundaryPolyline();
272 if ( !aBoundaryPolyline.IsNull() )
273 aResSeq.Append( aBoundaryPolyline );
275 HYDROData_SequenceOfObjects aSeqOfRegions = GetRegions();
276 aResSeq.Append( aSeqOfRegions );
281 void HYDROData_CalculationCase::Update()
283 HYDROData_Entity::Update();
286 // At first we remove previously created objects
288 RemoveSplittedGroups();
290 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
291 if ( aDocument.IsNull() )
294 Handle(HYDROData_PolylineXY) aBoundaryPolyline = GetBoundaryPolyline();
295 HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
296 if ( aGeomObjects.IsEmpty() )
299 HYDROData_SequenceOfObjects aGeomGroups = GetGeometryGroups();
301 HYDROData_SplitToZonesTool::SplitDataList aSplitObjects =
302 HYDROData_SplitToZonesTool::Split( aGeomObjects, aGeomGroups, aBoundaryPolyline );
303 if ( aSplitObjects.isEmpty() )
306 HYDROData_SplitToZonesTool::SplitDataList aZonesList, anEdgesList;
308 HYDROData_SplitToZonesTool::SplitDataListIterator anIter( aSplitObjects );
309 while( anIter.hasNext() )
311 const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
312 if ( aSplitData.Type == HYDROData_SplitToZonesTool::SplitData::Data_Zone )
313 aZonesList.append( aSplitData );
314 else if ( aSplitData.Type == HYDROData_SplitToZonesTool::SplitData::Data_Edge )
315 anEdgesList.append( aSplitData );
318 switch( GetAssignmentMode() )
321 CreateRegionsDef( aDocument, aZonesList );
324 CreateRegionsAuto( aDocument, aZonesList );
327 CreateEdgeGroupsDef( aDocument, anEdgesList );
330 void HYDROData_CalculationCase::CreateRegionsDef( const Handle(HYDROData_Document)& theDoc,
331 const HYDROData_SplitToZonesTool::SplitDataList& theZones )
333 // Create result regions for case, by default one zone for one region
334 QString aRegsPref = CALCULATION_REGIONS_PREF;
335 QString aZonesPref = CALCULATION_ZONES_PREF;
337 HYDROData_SplitToZonesTool::SplitDataListIterator anIter( theZones );
338 while( anIter.hasNext() )
340 const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
342 Handle(HYDROData_Region) aRegion = addNewRegion( theDoc, aRegsPref );
344 // Add the zone for region
345 Handle(HYDROData_Zone) aRegionZone = aRegion->addNewZone( theDoc, aZonesPref, aSplitData.Face(), aSplitData.ObjectNames );
349 void HYDROData_CalculationCase::CreateRegionsAuto( const Handle(HYDROData_Document)& theDoc,
350 const HYDROData_SplitToZonesTool::SplitDataList& theZones )
352 QMap<QString, Handle(HYDROData_Region)> aRegionsMap; //object name to region
353 QMap<QString, QString> aRegionNameToObjNameMap;
354 QString aZonesPref = CALCULATION_ZONES_PREF;
355 HYDROData_PriorityQueue aPr( this );
357 // 1. First we create a default region for each object included into the calculation case
358 HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
359 for( int i=aGeomObjects.Lower(), n=aGeomObjects.Upper(); i<=n; i++ )
361 Handle(HYDROData_Object) anObj = Handle(HYDROData_Object)::DownCast( aGeomObjects.Value( i ) );
364 QString anObjName = anObj->GetName();
365 QString aRegName = anObjName + "_reg";
366 Handle(HYDROData_Region) aRegion = addNewRegion( theDoc, aRegName, false );
367 aRegionsMap.insert( anObjName, aRegion );
368 aRegionNameToObjNameMap.insert( aRegName, anObjName );
371 // 2. Now for each zone it is necessary to determine the most priority object
372 // and assign to zone to corresponding region
373 HYDROData_SplitToZonesTool::SplitDataListIterator anIter( theZones );
374 while( anIter.hasNext() )
376 const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
377 HYDROData_Zone::MergeAltitudesType aMergeType;
378 Handle(HYDROData_Object) aRegObj = aPr.GetMostPriorityObject( aSplitData.ObjectNames, aMergeType );
379 if( aRegObj.IsNull() )
381 Handle(HYDROData_Region) aRegion = aRegionsMap[aRegObj->GetName()];
382 if( aRegion.IsNull() )
384 Handle(HYDROData_Zone) aRegionZone = aRegion->addNewZone( theDoc, aZonesPref, aSplitData.Face(), aSplitData.ObjectNames );
386 if( aSplitData.ObjectNames.count() > 1 && aMergeType==HYDROData_Zone::Merge_UNKNOWN )
388 qDebug( "Error in algorithm: unresolved conflicts" );
393 case HYDROData_Zone::Merge_ZMIN:
394 case HYDROData_Zone::Merge_ZMAX:
395 aRegionZone->SetMergeType( aMergeType );
397 case HYDROData_Zone::Merge_Object:
398 aRegionZone->SetMergeType( aMergeType );
399 aRegionZone->RemoveMergeAltitude();
400 aRegionZone->SetMergeAltitude( aRegObj->GetAltitudeObject() );
405 QStringList anObjectsWithEmptyRegions;
406 QMap<QString, Handle(HYDROData_Region)>::const_iterator
407 anIt = aRegionsMap.begin(), aLast = aRegionsMap.end();
408 for( ; anIt!=aLast; anIt++ )
410 Handle(HYDROData_Region) aRegion = anIt.value();
411 if( aRegion->GetZones().IsEmpty() )
413 QString aRegName = aRegion->GetName();
414 QString anObjName = aRegionNameToObjNameMap[aRegName];
415 anObjectsWithEmptyRegions.append( anObjName );
419 if( !anObjectsWithEmptyRegions.empty() )
421 QString aData = anObjectsWithEmptyRegions.join( ", " );
422 SetWarning( WARN_EMPTY_REGIONS, aData );
426 void HYDROData_CalculationCase::CreateEdgeGroupsDef( const Handle(HYDROData_Document)& theDoc,
427 const HYDROData_SplitToZonesTool::SplitDataList& theEdges )
429 QMap<QString,Handle(HYDROData_SplittedShapesGroup)> aSplittedEdgesGroupsMap;
431 HYDROData_SplitToZonesTool::SplitDataListIterator anIter( theEdges );
432 while( anIter.hasNext() )
434 const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
435 // Create new edges group
436 if ( aSplitData.ObjectNames.isEmpty() || aSplitData.Shape.IsNull() )
439 QString anObjName = aSplitData.ObjectNames.first();
440 if ( anObjName.isEmpty() )
442 #ifdef DEB_CALCULATION
443 QString aStr = aSplitData.ObjectNames.join(" ");
444 cout << " CCase: Names = "<<aStr.toStdString() << " size = " <<aSplitData.ObjectNames.size() <<endl;
446 Handle(HYDROData_SplittedShapesGroup) aSplittedGroup;
447 if ( !aSplittedEdgesGroupsMap.contains( anObjName ) )
449 aSplittedGroup = addNewSplittedGroup( CALCULATION_GROUPS_PREF + anObjName );
450 aSplittedEdgesGroupsMap.insert( anObjName, aSplittedGroup );
454 aSplittedGroup = aSplittedEdgesGroupsMap[ anObjName ];
456 if ( aSplittedGroup.IsNull() )
459 aSplittedGroup->AddShape( aSplitData.Shape );
463 bool HYDROData_CalculationCase::AddGeometryObject( const Handle(HYDROData_Object)& theObject )
465 if ( !HYDROData_Tool::IsGeometryObject( theObject ) )
466 return false; // Wrong type of object
468 if ( HasReference( theObject, DataTag_GeometryObject ) )
469 return false; // Object is already in reference list
471 AddReferenceObject( theObject, DataTag_GeometryObject );
473 // Indicate model of the need to update splitting
479 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryObjects() const
481 return GetReferenceObjects( DataTag_GeometryObject );
484 void HYDROData_CalculationCase::RemoveGeometryObject( const Handle(HYDROData_Object)& theObject )
486 if ( theObject.IsNull() )
489 RemoveReferenceObject( theObject->Label(), DataTag_GeometryObject );
491 // Indicate model of the need to update splitting
495 void HYDROData_CalculationCase::RemoveGeometryObjects()
497 ClearReferenceObjects( DataTag_GeometryObject );
499 // Indicate model of the need to update splitting
503 bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup )
505 if ( theGroup.IsNull() )
508 if ( HasReference( theGroup, DataTag_GeometryGroup ) )
509 return false; // Object is already in reference list
511 AddReferenceObject( theGroup, DataTag_GeometryGroup );
513 // Indicate model of the need to update splitting
519 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetGeometryGroups() const
521 return GetReferenceObjects( DataTag_GeometryGroup );
524 void HYDROData_CalculationCase::RemoveGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup )
526 if ( theGroup.IsNull() )
529 RemoveReferenceObject( theGroup->Label(), DataTag_GeometryGroup );
531 // Indicate model of the need to update splitting
535 void HYDROData_CalculationCase::RemoveGeometryGroups()
537 ClearReferenceObjects( DataTag_GeometryGroup );
539 // Indicate model of the need to update splitting
543 void HYDROData_CalculationCase::SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline )
545 Handle(HYDROData_PolylineXY) aPrevPolyline = GetBoundaryPolyline();
547 SetReferenceObject( thePolyline, DataTag_Polyline );
549 // Indicate model of the need to update zones splitting
550 SetToUpdate( !IsEqual( aPrevPolyline, thePolyline ) || IsMustBeUpdated() );
553 Handle(HYDROData_PolylineXY) HYDROData_CalculationCase::GetBoundaryPolyline() const
555 return Handle(HYDROData_PolylineXY)::DownCast(
556 GetReferenceObject( DataTag_Polyline ) );
559 void HYDROData_CalculationCase::RemoveBoundaryPolyline()
561 Handle(HYDROData_PolylineXY) aPrevPolyline = GetBoundaryPolyline();
563 ClearReferenceObjects( DataTag_Polyline );
565 // Indicate model of the need to update zones splitting
566 SetToUpdate( !aPrevPolyline.IsNull() || IsMustBeUpdated() );
569 Handle(HYDROData_Region) HYDROData_CalculationCase::AddNewRegion( const Handle(HYDROData_Zone)& theZone )
571 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
572 Handle(HYDROData_Region) aNewRegion = addNewRegion( aDocument, CALCULATION_REGIONS_PREF );
573 if ( aNewRegion.IsNull() )
576 aNewRegion->AddZone( theZone );
581 bool HYDROData_CalculationCase::AddRegion( const Handle(HYDROData_Region)& theRegion )
583 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
585 if ( theRegion.IsNull() )
588 if ( HasReference( theRegion, DataTag_Region ) )
589 return false; // Object is already in reference list
591 // Move the region from other calculation
592 Handle(HYDROData_CalculationCase) aFatherCalc =
593 Handle(HYDROData_CalculationCase)::DownCast( theRegion->GetFatherObject() );
594 if ( !aFatherCalc.IsNull() && aFatherCalc->Label() != myLab )
596 Handle(HYDROData_Region) aNewRegion = addNewRegion( aDocument, CALCULATION_REGIONS_PREF );
597 theRegion->CopyTo( aNewRegion );
599 aFatherCalc->RemoveRegion( theRegion );
601 theRegion->SetLabel( aNewRegion->Label() );
605 AddReferenceObject( theRegion, DataTag_Region );
611 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetRegions() const
613 return GetReferenceObjects( DataTag_Region );
616 void HYDROData_CalculationCase::UpdateRegionsOrder()
618 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
619 if ( aDocument.IsNull() )
622 HYDROData_SequenceOfObjects aRegions = GetRegions();
624 HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
625 for ( ; anIter.More(); anIter.Next() )
627 Handle(HYDROData_Region) aRegion =
628 Handle(HYDROData_Region)::DownCast( anIter.Value() );
629 if ( aRegion.IsNull() )
632 aRegion->SetName( "" );
635 QString aRegsPref = CALCULATION_REGIONS_PREF;
637 anIter.Init( aRegions );
638 for ( ; anIter.More(); anIter.Next() )
640 Handle(HYDROData_Region) aRegion =
641 Handle(HYDROData_Region)::DownCast( anIter.Value() );
642 if ( aRegion.IsNull() )
645 QString aRegionName = HYDROData_Tool::GenerateObjectName( aDocument, aRegsPref );
646 aRegion->SetName( aRegionName );
650 void HYDROData_CalculationCase::RemoveRegion( const Handle(HYDROData_Region)& theRegion )
652 if ( theRegion.IsNull() )
655 RemoveReferenceObject( theRegion->Label(), DataTag_Region );
657 // Remove region from data model
658 Handle(HYDROData_CalculationCase) aFatherCalc =
659 Handle(HYDROData_CalculationCase)::DownCast( theRegion->GetFatherObject() );
660 if ( !aFatherCalc.IsNull() && aFatherCalc->Label() == myLab )
664 void HYDROData_CalculationCase::RemoveRegions()
666 myLab.FindChild( DataTag_ChildRegion ).ForgetAllAttributes();
669 HYDROData_SequenceOfObjects HYDROData_CalculationCase::GetSplittedGroups() const
671 return GetReferenceObjects( DataTag_SplittedGroups );
674 void HYDROData_CalculationCase::RemoveSplittedGroups()
676 myLab.FindChild( DataTag_SplittedGroups ).ForgetAllAttributes();
679 double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint ) const
681 Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint );
682 return GetAltitudeForPoint( thePoint, aZone );
685 double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint,
686 const Handle(HYDROData_Region)& theRegion ) const
688 double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude();
690 Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint );
691 if ( !aZone.IsNull() )
693 //DEBTRACE("GetAltitudeForPoint Region " << theRegion->GetName().toStdString() << " Zone " << aZone->GetName().toStdString());
694 Handle(HYDROData_Region) aRefRegion = Handle(HYDROData_Region)::DownCast( aZone->GetFatherObject() );
695 if ( IsEqual( aRefRegion, theRegion ) )
696 aResAltitude = GetAltitudeForPoint( thePoint, aZone );
699 DEBTRACE("GetAltitudeForPoint Region " << aRefRegion->GetName().toStdString() << " Zone " << aZone->GetName().toStdString() << " ---------------------------");
700 aResAltitude = GetAltitudeForPoint( thePoint, aZone );
705 DEBTRACE(" --- GetAltitudeForPoint No Zone ---");
711 double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint,
712 const Handle(HYDROData_Zone)& theZone ) const
714 //DEBTRACE("GetAltitudeForPoint Zone " << theZone->GetName().toStdString());
715 double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude();
716 if ( theZone.IsNull() )
719 HYDROData_Zone::MergeAltitudesType aZoneMergeType = theZone->GetMergeType();
720 if ( !theZone->IsMergingNeed() )
722 aZoneMergeType = HYDROData_Zone::Merge_UNKNOWN;
724 else if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
729 HYDROData_IInterpolator* aZoneInterpolator = theZone->GetInterpolator();
730 if ( aZoneMergeType == HYDROData_Zone::Merge_Object )
732 Handle(HYDROData_IAltitudeObject) aMergeAltitude = theZone->GetMergeAltitude();
733 if ( !aMergeAltitude.IsNull() )
735 if ( aZoneInterpolator != NULL )
737 aZoneInterpolator->SetAltitudeObject( aMergeAltitude );
738 aResAltitude = aZoneInterpolator->GetAltitudeForPoint( thePoint );
741 aResAltitude = aMergeAltitude->GetAltitudeForPoint( thePoint );
746 HYDROData_SequenceOfObjects aZoneObjects = theZone->GetGeometryObjects();
747 HYDROData_SequenceOfObjects::Iterator anIter( aZoneObjects );
748 for ( ; anIter.More(); anIter.Next() )
750 Handle(HYDROData_Object) aZoneObj =
751 Handle(HYDROData_Object)::DownCast( anIter.Value() );
752 if ( aZoneObj.IsNull() )
755 Handle(HYDROData_IAltitudeObject) anObjAltitude = aZoneObj->GetAltitudeObject();
756 if ( anObjAltitude.IsNull() )
759 double aPointAltitude = 0.0;
760 if ( aZoneInterpolator != NULL )
762 aZoneInterpolator->SetAltitudeObject( anObjAltitude );
763 aPointAltitude = aZoneInterpolator->GetAltitudeForPoint( thePoint );
766 aPointAltitude = anObjAltitude->GetAltitudeForPoint( thePoint );
768 if ( ValuesEquals( aPointAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) )
771 if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
773 aResAltitude = aPointAltitude;
776 else if ( aZoneMergeType == HYDROData_Zone::Merge_ZMIN )
778 if ( ValuesEquals( aResAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) ||
779 aResAltitude > aPointAltitude )
781 aResAltitude = aPointAltitude;
784 else if ( aZoneMergeType == HYDROData_Zone::Merge_ZMAX )
786 if ( ValuesEquals( aResAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) ||
787 aResAltitude < aPointAltitude )
789 aResAltitude = aPointAltitude;
798 NCollection_Sequence<double> HYDROData_CalculationCase::GetAltitudesForPoints(
799 const NCollection_Sequence<gp_XY>& thePoints,
800 const Handle(HYDROData_Region)& theRegion ) const
802 //DEBTRACE("HYDROData_CalculationCase::GetAltitudesForPoints " << theRegion->GetName().toStdString());
803 NCollection_Sequence<double> aResSeq;
805 for ( int i = 1, n = thePoints.Length(); i <= n; ++i )
807 const gp_XY& thePnt = thePoints.Value( i );
809 double anAltitude = GetAltitudeForPoint( thePnt, theRegion );
810 aResSeq.Append( anAltitude );
816 NCollection_Sequence<double> HYDROData_CalculationCase::GetAltitudesForPoints(
817 const NCollection_Sequence<gp_XY>& thePoints,
818 const Handle(HYDROData_Zone)& theZone ) const
820 NCollection_Sequence<double> aResSeq;
822 for ( int i = 1, n = thePoints.Length(); i <= n; ++i )
824 const gp_XY& thePnt = thePoints.Value( i );
826 double anAltitude = GetAltitudeForPoint( thePnt, theZone );
827 aResSeq.Append( anAltitude );
833 Handle(HYDROData_Region) HYDROData_CalculationCase::GetRegionFromPoint( const gp_XY& thePoint ) const
835 Handle(HYDROData_Region) aResRegion;
837 Handle(HYDROData_Zone) aZone = GetZoneFromPoint( thePoint );
838 if ( !aZone.IsNull() )
839 aResRegion = Handle(HYDROData_Region)::DownCast( aZone->GetFatherObject() );
844 Handle(HYDROData_Zone) HYDROData_CalculationCase::GetZoneFromPoint( const gp_XY& thePoint ) const
846 Handle(HYDROData_Zone) aResZone;
848 HYDROData_SequenceOfObjects aRegions = GetRegions();
850 HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
851 for ( ; anIter.More() && aResZone.IsNull(); anIter.Next() )
853 Handle(HYDROData_Region) aRegion =
854 Handle(HYDROData_Region)::DownCast( anIter.Value() );
855 if ( aRegion.IsNull() )
858 HYDROData_SequenceOfObjects aZones = aRegion->GetZones();
859 HYDROData_SequenceOfObjects::Iterator aZonesIter( aZones );
860 for ( ; aZonesIter.More() && aResZone.IsNull(); aZonesIter.Next() )
862 Handle(HYDROData_Zone) aRegZone =
863 Handle(HYDROData_Zone)::DownCast( aZonesIter.Value() );
864 if ( aRegZone.IsNull() )
867 PointClassification aPointRelation = GetPointClassification( thePoint, aRegZone );
868 if ( aPointRelation != POINT_OUT )
869 aResZone = aRegZone; // We found the desired zone
876 HYDROData_CalculationCase::PointClassification HYDROData_CalculationCase::GetPointClassification(
877 const gp_XY& thePoint,
878 const Handle(HYDROData_Zone)& theZone ) const
880 PointClassification aRes = POINT_OUT;
881 if ( theZone.IsNull() )
884 TopoDS_Face aZoneFace = TopoDS::Face( theZone->GetShape() );
885 if ( aZoneFace.IsNull() )
888 TopoDS_Compound aCmp;
890 aBB.MakeCompound(aCmp);
891 aBB.Add(aCmp, aZoneFace);
892 gp_Pnt aPnt (thePoint.X(), thePoint.Y(), 0.);
893 BRepBuilderAPI_MakeVertex aMk(aPnt);
894 aBB.Add(aCmp, aMk.Vertex());
895 BRepTools::Write(aCmp, "FCL2d.brep");
897 TopAbs_State State = HYDROData_Tool::ComputePointState(thePoint, aZoneFace);
898 if (State == TopAbs_OUT)
900 else if(State == TopAbs_IN)
902 else if(State == TopAbs_ON)
907 Handle(HYDROData_Region) HYDROData_CalculationCase::addNewRegion( const Handle(HYDROData_Document)& theDoc,
908 const QString& thePrefixOrName,
911 TDF_Label aNewLab = myLab.FindChild( DataTag_ChildRegion ).NewChild();
912 int aTag = aNewLab.Tag();
914 Handle(HYDROData_Region) aNewRegion =
915 Handle(HYDROData_Region)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_REGION ) );
916 AddRegion( aNewRegion );
918 QString aRegionName = isPrefix ? HYDROData_Tool::GenerateObjectName( theDoc, thePrefixOrName ) : thePrefixOrName;
919 aNewRegion->SetName( aRegionName );
924 Handle(HYDROData_SplittedShapesGroup) HYDROData_CalculationCase::addNewSplittedGroup( const QString& theName )
926 TDF_Label aNewLab = myLab.FindChild( DataTag_SplittedGroups ).NewChild();
928 Handle(HYDROData_SplittedShapesGroup) aNewGroup =
929 Handle(HYDROData_SplittedShapesGroup)::DownCast(
930 HYDROData_Iterator::CreateObject( aNewLab, KIND_SPLITTED_GROUP ) );
931 AddReferenceObject( aNewGroup, DataTag_SplittedGroups );
933 aNewGroup->SetName( theName );
938 QString HYDROData_CalculationCase::Export( int theStudyId ) const
940 GEOM::GEOM_Gen_var aGEOMEngine = HYDROData_GeomTool::GetGeomGen();
941 SALOMEDS::Study_var aDSStudy = HYDROData_GeomTool::GetStudyByID( theStudyId );
943 QString aGeomObjEntry;
944 bool isOK = Export( aGEOMEngine, aDSStudy, aGeomObjEntry );
945 return isOK ? aGeomObjEntry : QString();
948 bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
949 SALOMEDS::Study_ptr theStudy,
950 QString& theGeomObjEntry ) const
952 HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroupsDefs;
954 // Get groups definitions
955 HYDROData_SequenceOfObjects aSplittedGroups = GetSplittedGroups();
957 HYDROData_SequenceOfObjects::Iterator anIter( aSplittedGroups );
958 for ( ; anIter.More(); anIter.Next() )
961 Handle(HYDROData_ShapesGroup) aGroup =
962 Handle(HYDROData_ShapesGroup)::DownCast( anIter.Value() );
963 if ( aGroup.IsNull() )
966 HYDROData_ShapesGroup::GroupDefinition aGroupDef;
968 aGroupDef.Name = aGroup->GetName().toLatin1().constData();
969 aGroup->GetShapes( aGroupDef.Shapes );
971 aSeqOfGroupsDefs.Append( aGroupDef );
975 TopTools_ListOfShape aFaces;
976 HYDROData_SequenceOfObjects aCaseRegions = GetRegions();
977 HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions );
978 for ( ; aRegionIter.More(); aRegionIter.Next() )
980 Handle(HYDROData_Region) aRegion =
981 Handle(HYDROData_Region)::DownCast( aRegionIter.Value() );
982 if( aRegion.IsNull() )
985 TopoDS_Shape aRegionShape = aRegion->GetShape( &aSeqOfGroupsDefs );
986 aFaces.Append( aRegionShape );
989 return Export( theGeomEngine, theStudy, aFaces, aSeqOfGroupsDefs, theGeomObjEntry );
992 bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
993 SALOMEDS::Study_ptr theStudy,
994 const TopTools_ListOfShape& theFaces,
995 const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs,
996 QString& theGeomObjEntry ) const
999 BRepBuilderAPI_Sewing aSewing( Precision::Confusion() * 10.0 );
1000 aSewing.SetNonManifoldMode( Standard_False );
1001 #ifdef DEB_CALCULATION
1002 TCollection_AsciiString aNam("Sh_");
1005 TopTools_ListIteratorOfListOfShape aFaceIter( theFaces );
1006 for ( ; aFaceIter.More(); aFaceIter.Next() )
1008 TopoDS_Shape aShape = aFaceIter.Value();
1009 if ( aShape.IsNull() )
1012 if ( aShape.ShapeType() == TopAbs_FACE )
1014 aSewing.Add( aShape );
1015 #ifdef DEB_CALCULATION
1016 TCollection_AsciiString aName = aNam + ++i + ".brep";
1017 BRepTools::Write(aShape ,aName.ToCString());
1022 #ifdef DEB_CALCULATION
1025 TopExp_Explorer anExp( aShape, TopAbs_FACE );
1026 for (; anExp.More(); anExp.Next() ) {
1027 aSewing.Add( anExp.Current() );
1028 #ifdef DEB_CALCULATION
1030 TCollection_AsciiString aName = aNam + i + "_" + ++j + ".brep";
1031 BRepTools::Write(anExp.Current() ,aName.ToCString());
1038 TopoDS_Shape aSewedShape = aSewing.SewedShape();
1040 // If the sewed shape is empty - return false
1041 if ( aSewedShape.IsNull() || !TopoDS_Iterator( aSewedShape ).More() )
1044 #ifdef DEB_CALCULATION
1045 BRepTools::Write(aSewedShape ,"Sew.brep");
1047 // Publish the sewed shape
1048 QString aName = EXPORT_NAME;
1049 GEOM::GEOM_Object_ptr aMainShape =
1050 publishShapeInGEOM( theGeomEngine, theStudy, aSewedShape, aName, theGeomObjEntry );
1052 if ( aMainShape->_is_nil() )
1055 if ( theGroupsDefs.IsEmpty() )
1059 TopTools_IndexedMapOfShape aMapOfSubShapes;
1060 TopExp::MapShapes( aSewedShape, aMapOfSubShapes );
1062 NCollection_DataMap< TCollection_AsciiString, NCollection_Sequence<int> > aGroupsData;
1064 for ( int aGrId = 1, nbGroups = theGroupsDefs.Length(); aGrId <= nbGroups; ++aGrId )
1066 const HYDROData_ShapesGroup::GroupDefinition& aGroupDef = theGroupsDefs.Value( aGrId );
1068 NCollection_Sequence<int> aGroupIndexes;
1069 for( int i = 1, n = aGroupDef.Shapes.Length(); i <= n; i++ )
1071 const TopoDS_Shape& aShape = aGroupDef.Shapes.Value( i );
1072 #ifdef DEB_CALCULATION
1073 cout << "\nOld shape(" << i << ") = " << aShape.TShape() <<endl;
1076 TopoDS_Shape aModifiedShape = aShape;
1077 if ( aSewing.IsModified( aShape ) )
1078 aModifiedShape = aSewing.Modified( aShape );
1079 else if ( aSewing.IsModifiedSubShape( aShape ) )
1080 aModifiedShape = aSewing.ModifiedSubShape( aShape );
1082 #ifdef DEB_CALCULATION
1083 const TopLoc_Location& aL1 = aShape.Location();
1084 const TopLoc_Location& aL2 = aModifiedShape.Location();
1085 cout << "\nNew shape(" << i << ") = " << aModifiedShape.TShape() << " Location is Equal = " << aL1.IsEqual(aL2)<<endl;
1088 int anIndex = aMapOfSubShapes.FindIndex(aModifiedShape);
1089 if ( anIndex > 0 ) {
1090 aGroupIndexes.Append( anIndex );
1092 #ifdef DEB_CALCULATION
1093 TCollection_AsciiString aNam("Lost_");
1094 if(!aMapOfSubShapes.Contains(aModifiedShape)) {
1095 for ( int anIndex = 1; anIndex <= aMapOfSubShapes.Extent(); anIndex++ )
1097 const TopoDS_Shape& aS = aMapOfSubShapes.FindKey( anIndex );
1098 if ( aModifiedShape.IsPartner( aS ) )
1100 cout <<"\nIndex in Map = " << anIndex << "TShape = " << aS.TShape() <<endl;
1101 TCollection_AsciiString aName = aNam + i + "_" + anIndex + ".brep";
1102 BRepTools::Write(aS ,aName.ToCString());
1110 if ( !aGroupIndexes.IsEmpty() )
1111 aGroupsData.Bind( aGroupDef.Name, aGroupIndexes );
1114 if ( !aGroupsData.IsEmpty() )
1116 GEOM::GEOM_IGroupOperations_var aGroupOp =
1117 theGeomEngine->GetIGroupOperations( theStudy->StudyId() );
1119 NCollection_DataMap< TCollection_AsciiString, NCollection_Sequence<int> >::Iterator aMapIt( aGroupsData );
1120 for ( ; aMapIt.More(); aMapIt.Next() )
1122 const TCollection_AsciiString& aGroupName = aMapIt.Key();
1123 const NCollection_Sequence<int>& aGroupIndexes = aMapIt.Value();
1125 GEOM::GEOM_Object_var aGeomGroup = aGroupOp->CreateGroup( aMainShape, TopAbs_EDGE );
1126 if ( CORBA::is_nil( aGeomGroup ) || !aGroupOp->IsDone() )
1129 GEOM::ListOfLong_var aGeomIndexes = new GEOM::ListOfLong;
1130 aGeomIndexes->length( aGroupIndexes.Length() );
1132 for( int i = 1, n = aGroupIndexes.Length(); i <= n; i++ )
1133 aGeomIndexes[ i - 1 ] = aGroupIndexes.Value( i );
1135 aGroupOp->UnionIDs( aGeomGroup, aGeomIndexes );
1136 if ( aGroupOp->IsDone() )
1138 SALOMEDS::SObject_var aGroupSO =
1139 theGeomEngine->AddInStudy( theStudy, aGeomGroup, aGroupName.ToCString(), aMainShape );
1147 GEOM::GEOM_Object_ptr HYDROData_CalculationCase::publishShapeInGEOM(
1148 GEOM::GEOM_Gen_var theGeomEngine, SALOMEDS::Study_ptr theStudy,
1149 const TopoDS_Shape& theShape, const QString& theName,
1150 QString& theGeomObjEntry ) const
1152 theGeomObjEntry = "";
1153 GEOM::GEOM_Object_var aGeomObj;
1155 if ( theGeomEngine->_is_nil() || theStudy->_is_nil() ||
1156 theShape.IsNull() ) {
1157 return aGeomObj._retn();
1160 std::ostringstream aStreamShape;
1161 // Write TopoDS_Shape in ASCII format to the stream
1162 BRepTools::Write( theShape, aStreamShape );
1163 // Returns the number of bytes that have been stored in the stream's buffer.
1164 int aSize = aStreamShape.str().size();
1165 // Allocate octect buffer of required size
1166 CORBA::Octet* anOctetBuf = SALOMEDS::TMPFile::allocbuf( aSize );
1167 // Copy ostrstream content to the octect buffer
1168 memcpy( anOctetBuf, aStreamShape.str().c_str(), aSize );
1170 SALOMEDS::TMPFile_var aSeqFile = new SALOMEDS::TMPFile( aSize, aSize, anOctetBuf, 1 );
1172 // Restore shape from the stream and get the GEOM object
1173 GEOM::GEOM_IInsertOperations_var anInsOp = theGeomEngine->GetIInsertOperations( theStudy->StudyId() );
1174 aGeomObj = anInsOp->RestoreShape( aSeqFile );
1176 // Puplish the GEOM object
1177 if ( !aGeomObj->_is_nil() ) {
1178 QString aName = HYDROData_GeomTool::GetFreeName( theStudy, theName );
1180 SALOMEDS::SObject_var aResultSO =
1181 theGeomEngine->PublishInStudy( theStudy, SALOMEDS::SObject::_nil(),
1182 aGeomObj, qPrintable( aName ) );
1183 if ( aResultSO->_is_nil() ) {
1184 aGeomObj = GEOM::GEOM_Object::_nil();
1187 theGeomObjEntry = aResultSO->GetID();
1190 return aGeomObj._retn();
1193 void HYDROData_CalculationCase::ClearRules( const bool theIsSetToUpdate )
1195 TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
1196 HYDROData_PriorityQueue::ClearRules( aRulesLab );
1198 // Indicate model of the need to update splitting
1199 if ( theIsSetToUpdate ) {
1200 SetToUpdate( true );
1204 void HYDROData_CalculationCase::AddRule( const Handle(HYDROData_Object)& theObject1,
1205 HYDROData_PriorityType thePriority,
1206 const Handle(HYDROData_Object)& theObject2,
1207 HYDROData_Zone::MergeAltitudesType theMergeType )
1209 TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
1210 HYDROData_PriorityQueue::AddRule( aRulesLab, theObject1, thePriority, theObject2, theMergeType );
1212 // Indicate model of the need to update splitting
1213 SetToUpdate( true );
1216 QString HYDROData_CalculationCase::DumpRules() const
1218 TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
1219 return HYDROData_PriorityQueue::DumpRules( aRulesLab );
1222 void HYDROData_CalculationCase::SetAssignmentMode( AssignmentMode theMode )
1224 TDF_Label aModeLab = myLab.FindChild( DataTag_AssignmentMode );
1225 TDataStd_Integer::Set( aModeLab, ( int ) theMode );
1227 // Indicate model of the need to update splitting
1228 SetToUpdate( true );
1231 HYDROData_CalculationCase::AssignmentMode HYDROData_CalculationCase::GetAssignmentMode() const
1233 Handle(TDataStd_Integer) aModeAttr;
1234 bool isOK = myLab.FindChild( DataTag_AssignmentMode ).FindAttribute( TDataStd_Integer::GetID(), aModeAttr );
1236 return ( AssignmentMode ) aModeAttr->Get();
1241 void HYDROData_CalculationCase::DumpRulesToPython( const QString& theCalcCaseName,
1242 QStringList& theScript ) const
1244 TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
1245 HYDROData_PriorityQueue::DumpRulesToPython( aRulesLab, theCalcCaseName, theScript );
1248 HYDROData_Warning HYDROData_CalculationCase::GetLastWarning() const
1250 return myLastWarning;
1253 void HYDROData_CalculationCase::SetWarning( HYDROData_WarningType theType, const QString& theData )
1255 myLastWarning.Type = theType;
1256 myLastWarning.Data = theData;
1259 bool HYDROData_CalculationCase::GetRule( int theIndex,
1260 Handle(HYDROData_Object)& theObject1,
1261 HYDROData_PriorityType& thePriority,
1262 Handle(HYDROData_Object)& theObject2,
1263 HYDROData_Zone::MergeAltitudesType& theMergeType ) const
1265 TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
1266 return HYDROData_PriorityQueue::GetRule( aRulesLab, theIndex,
1267 theObject1, thePriority, theObject2, theMergeType );