+void HYDROGUI_CalculationOp::getNamesAndEntries( const HYDROData_SequenceOfObjects& theSeq,
+ QStringList& theNames, QStringList& theEntries ) const
+{
+
+ theNames.clear();
+ theEntries.clear();
+ HYDROData_SequenceOfObjects::Iterator anIter( theSeq );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Entity) anEntity = anIter.Value();
+ //if ( !HYDROData_Tool::IsGeometryObject( anEntity ) )
+ // continue;
+
+ theNames.append( anEntity->GetName() );
+ theEntries.append( HYDROGUI_DataObject::dataObjectEntry( anEntity ) );
+ }
+}
+
+void HYDROGUI_CalculationOp::abortOperation()
+{
+ closePreview();
+ // Abort transaction
+ abortDocOperation();
+ HYDROGUI_Operation::abortOperation();
+ module()->getApp()->updateObjectBrowser();
+}
+
+void HYDROGUI_CalculationOp::commitOperation()
+{
+ closePreview();
+ // Commit transaction
+ commitDocOperation();
+ HYDROGUI_Operation::commitOperation();
+}
+
+HYDROGUI_InputPanel* HYDROGUI_CalculationOp::createInputPanel() const
+{
+ HYDROGUI_CalculationDlg* aPanel = new HYDROGUI_CalculationDlg( module(), getName() );
+
+ // Connect signals and slots
+ connect( aPanel, SIGNAL( changeMode( int ) ), SLOT( onChangeMode( int ) ) );
+ connect( aPanel, SIGNAL( addObjects() ), SLOT( onAddObjects() ) );
+ connect( aPanel, SIGNAL( removeObjects() ), SLOT( onRemoveObjects() ) );
+ connect( aPanel, SIGNAL( addGroups() ), SLOT( onAddGroups() ) );
+ connect( aPanel, SIGNAL( removeGroups() ), SLOT( onRemoveGroups() ) );
+
+ connect( aPanel, SIGNAL( orderChanged( bool& ) ), SLOT( onOrderChanged( bool& ) ) );
+
+ connect( aPanel, SIGNAL( ruleChanged( bool& ) ), SLOT( onRuleChanged( bool& ) ) );
+
+ connect( aPanel, SIGNAL( Next( const int ) ), SLOT( onNext( const int ) ) );
+ connect( aPanel, SIGNAL( Back( const int ) ), SLOT( onHideZones( const int ) ) );
+ //connect( aPanel, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onSelected( SUIT_DataObject* ) ) );
+ connect( aPanel, SIGNAL( setMergeType( int, QString& ) ), SLOT( onSetMergeType( int, QString& ) ) );
+ connect( aPanel, SIGNAL( moveZones( SUIT_DataObject*, const QList<SUIT_DataObject*>& ) ),
+ SLOT( onMoveZones( SUIT_DataObject*, const QList<SUIT_DataObject*>& ) ) );
+ connect( aPanel, SIGNAL( createRegion( const QList<SUIT_DataObject*>& ) ),
+ SLOT( onCreateRegion( const QList<SUIT_DataObject*>& ) ) );
+ connect( aPanel, SIGNAL( clickedInZonesBrowser( SUIT_DataObject* ) ),
+ SLOT( onClickedInZonesBrowser( SUIT_DataObject* ) ) );
+ connect( aPanel, SIGNAL( objectsSelected() ),
+ SLOT( onObjectsSelected() ) );
+ connect( aPanel, SIGNAL( landCoverMapSelected( const QString & ) ),
+ SLOT( onLandCoverMapSelected( const QString & ) ) );
+ connect( aPanel, SIGNAL( boundarySelected( const QString & ) ),
+ SLOT( onBoundarySelected( const QString & ) ) );
+ connect( aPanel, SIGNAL( StricklerTableSelected( const QString & ) ),
+ SLOT( onStricklerTableSelected( const QString & ) ) );
+
+ connect( aPanel, SIGNAL( regenerateColors() ), this,
+ SLOT( onRegenerateColors() ) );
+
+ return aPanel;
+}
+
+void HYDROGUI_CalculationOp::onBoundarySelected ( const QString & theObjName )
+{
+ bool anIsToUpdateViewer = false;
+
+ // Remove the old boundary from the operation viewer
+ Handle(HYDROData_PolylineXY) aPrevPolyline =
+ myEditedObject->GetBoundaryPolyline();
+ if ( !aPrevPolyline.IsNull() )
+ {
+ setObjectVisibility( aPrevPolyline, false );
+ anIsToUpdateViewer = true;
+ }
+
+ // Set the selected boundary polyline to the calculation case
+ Handle(HYDROData_PolylineXY) aNewPolyline = Handle(HYDROData_PolylineXY)::DownCast(
+ HYDROGUI_Tool::FindObjectByName( module(), theObjName, KIND_POLYLINEXY ) );
+ myEditedObject->SetBoundaryPolyline( aNewPolyline );
+
+ if ( myPreviewViewManager )
+ {
+ OCCViewer_Viewer* aViewer = myPreviewViewManager->getOCCViewer();
+ if ( aViewer )
+ {
+ if ( !aNewPolyline.IsNull() )