2 #ifndef HYDROData_PriorityQueue_HeaderFile
3 #define HYDROData_PriorityQueue_HeaderFile
6 #include <HYDROData_Object.h>
7 #include <HYDROData_Zone.h>
9 class HYDROData_CalculationCase;
11 enum HYDROData_PriorityType
17 struct HYDROData_CustomRule
19 Handle(HYDROData_Object) Object1;
20 HYDROData_PriorityType Priority;
21 Handle(HYDROData_Object) Object2;
22 HYDROData_Zone::MergeAltitudesType MergeType;
25 typedef QList<HYDROData_CustomRule> HYDROData_ListOfRules;
27 class HYDROData_PriorityQueue
30 HYDROData_PriorityQueue( HYDROData_CalculationCase* );
31 ~HYDROData_PriorityQueue();
33 Handle_HYDROData_Object GetMostPriorityObject( const QStringList& theZoneObjects,
34 HYDROData_Zone::MergeAltitudesType& theMergeType ) const;
36 bool IsMorePriority( const Handle(HYDROData_Object)& theObj1,
37 const Handle(HYDROData_Object)& theObj2,
38 HYDROData_Zone::MergeAltitudesType& theMergeType ) const;
40 static void ClearRules( TDF_Label& theRulesLabel );
41 static void AddRule( TDF_Label& theRulesLabel,
42 const Handle(HYDROData_Object)& theObject1,
43 HYDROData_PriorityType thePriority,
44 const Handle(HYDROData_Object)& theObject2,
45 HYDROData_Zone::MergeAltitudesType theMergeType );
46 static HYDROData_ListOfRules GetRules( const TDF_Label& theRulesLabel );
47 static QString DumpRules( const TDF_Label& theRulesLab );
48 static void DumpRulesToPython( const TDF_Label& theRulesLab,
49 const QString& theCalcCaseName,
50 QStringList& theScript );
51 static int GetRulesCount( const TDF_Label& theRulesLab );
52 static bool GetRule( const TDF_Label& theRulesLab,
54 Handle(HYDROData_Object)& theObject1,
55 HYDROData_PriorityType& thePriority,
56 Handle(HYDROData_Object)& theObject2,
57 HYDROData_Zone::MergeAltitudesType& theMergeType );
59 typedef QMap<QString, Handle(HYDROData_Object)> MapNameToObject;
61 HYDROData_SequenceOfObjects myGeomObjects; ///< the ordered list of objects (default priority)
62 MapNameToObject myNames; ///< the map of name to object
63 HYDROData_ListOfRules myRules; ///< the list of rules