X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_CalculationDlg.h;h=f4ee385fd047cbee7db7f1c5bf57e309f9554612;hb=d6e19029f8b41f295db878e9aecf451c2edda4af;hp=742bbca9ca5817184b8cbd73aa0646ddd45bc218;hpb=bd1a4992da8d54929ec556df6db4e7e0ebbfbbd7;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_CalculationDlg.h b/src/HYDROGUI/HYDROGUI_CalculationDlg.h index 742bbca9..f4ee385f 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationDlg.h +++ b/src/HYDROGUI/HYDROGUI_CalculationDlg.h @@ -1,12 +1,8 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// Copyright (C) 2014-2015 EDF-R&D // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,17 +16,34 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #ifndef HYDROGUI_CALCULATIONDLG_H #define HYDROGUI_CALCULATIONDLG_H -#include "HYDROGUI_InputPanel.h" +#include "HYDROGUI_Wizard.h" +#include +#include class HYDROGUI_ObjSelector; +class HYDROGUI_DataBrowser; +class HYDROGUI_NameValidator; +class HYDROGUI_Zone; +class HYDROGUI_OrderedListWidget; +class HYDROGUI_PriorityWidget; + +class SUIT_DataObject; + +class QButtonGroup; class QGroupBox; class QLineEdit; class QListWidget; +class QComboBox; +class QLabel; +class QSplitter; +class QStringList; + -class HYDROGUI_CalculationDlg : public HYDROGUI_InputPanel +class HYDROGUI_CalculationDlg : public HYDROGUI_Wizard { Q_OBJECT @@ -40,34 +53,148 @@ public: void reset(); + int getMode() const; + int getLandCoverMode() const; + void setObjectName( const QString& theName ); QString getObjectName() const; - void setPolylineName( const QString& theName ); - QString getPolylineName() const; + void setEditedObject( const Handle(HYDROData_CalculationCase) theCase ); + + void setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries ); + QStringList getAllGeomObjects() const; + void setAllLandCovers( const QStringList& theObjects, const QStringList& theObjectsEntries ); + QStringList getAllLandCovers() const; + void setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries ); + void setStricklerTableNames( const QStringList& theObjects, const QStringList& theObjectsEntries ); + QStringList getSelectedGeomObjects() const; + QStringList getSelectedLandCovers() const; + QStringList getSelectedAvailableGeomObjects() const; + QStringList getSelectedAvailableLandCovers() const; + QStringList getSelectedGroups() const; + QStringList getSelectedAvailableGroups() const; + HYDROGUI_Zone* getCurrentZone() const; + + void setAvailableGroups( const QStringList& ); + + void setEditZonesEnabled( const bool theIsEnabled ); + void setEditLandCoversEnabled( const bool theIsEnabled ); + + HYDROData_ListOfRules getRules() const; + void setRules( const HYDROData_ListOfRules& theRules ) const; + + HYDROData_ListOfRules getLandCoverRules() const; + void setLandCoverRules( const HYDROData_ListOfRules& theRules ) const; + +public slots: + void setMode( int theMode ); + void setBoundary( const QString& theObjName ); + void includeGeomObjects( const QStringList& theObjects ); + void excludeGeomObjects( const QStringList& theObjects ); + void includeGroups( const QStringList& theObjects ); + void excludeGroups( const QStringList& theObjects ); + void onEmptyName(); + void onAlreadyExists( QString theName ); + void refreshZonesBrowser(); + void onDataChanged(); + void onOrderChanged(); + + void setLandCoverMode( int theMode ); + void setStricklerTable( const QString& theStricklerTableName, bool theBlockSignals = true ); + void includeLandCovers( const QStringList& theLandCovers, bool theReset ); + void excludeLandCovers( const QStringList& theLandCovers ); + void onOrderLandCoverChanged(); + + /** + * Process items selection: hide/show bathymetry merge type selector. + */ + void onSelected( SUIT_DataObject* theObject ); + /** + * Process merge type selection: set the selected bathymetry merge type for the currently selected zone. + */ + void onMergeTypeSelected( int theIndex ); + /** + * Process zones moving. Create a new region with dropped zones or add to existing one. + */ + void onZonesDropped( const QList& theList, + SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction ); - void setZones( const QStringList& theZones ); - void setSelectedZones( const QStringList& theZones ); - QStringList getSelectedZones() const; +signals: + void changeMode( int theMode ); - void setSplittedZones( const QStringList& theZones ); - QStringList getSplittedZones() const; + void addObjects(); + void removeObjects(); + void objectsSelected(); + void orderChanged( bool& isConfirmed ); - void setSplitZonesPrefix( const QString& theName ); - QString getSplitZonesPrefix() const; + void addGroups(); + void removeGroups(); + void groupsSelected(); -signals: - void SplitZones(); + void boundarySelected( const QString & theObjName ); + void setMergeType( int theMergeType, QString& theBathymetryName ); + void createRegion( const QList& theZonesList ); + void moveZones( SUIT_DataObject* theRegion, const QList& theZonesList ); + void clickedInZonesBrowser( SUIT_DataObject* ); + + void changeLandCoverMode( int theMode ); + + void addLandCovers(); + void removeLandCovers(); + void landCoversSelected(); + void orderLandCoverChanged( bool& isConfirmed ); + + void StricklerTableSelected( const QString & theObjName ); + +protected: + + virtual bool acceptCurrent() const; + +protected slots: + void OnNewRegion(); private: + QList getGeometryObjects(); + QList getLandCovers(); + + QWizardPage* createObjectsPage(); + QWizardPage* createGroupsPage(); + QWizardPage* createLandCoversPage(); + QWizardPage* createZonesPage(); + QWizardPage* createLandCoversPartitionPage(); + + QSplitter* mySplitter; + QSplitter* myLandCoverSplitter; + QGroupBox* myObjectNameGroup; QLineEdit* myObjectName; + HYDROGUI_NameValidator* myValidator; + + QComboBox* myPolylineName; + QComboBox* myStricklerTableName; + + QButtonGroup* myModeButtons; + QButtonGroup* myLandCoverModeButtons; + + QListWidget* myAvailableGeomObjects; + HYDROGUI_OrderedListWidget* myGeomObjects; + + HYDROGUI_PriorityWidget* myPriorityWidget; + HYDROGUI_PriorityWidget* myLandCoverPriorityWidget; + + QListWidget* myAvailableGroups; + QListWidget* myGroups; + + QListWidget* myAvailableLandCovers; + HYDROGUI_OrderedListWidget* myLandCovers; - HYDROGUI_ObjSelector* myBndPolyline; + HYDROGUI_DataBrowser* myBrowser; + Handle(HYDROData_CalculationCase) myEditedObject; + QComboBox* myBathymetryChoice; + QLabel* myBathymetryLabel; + HYDROGUI_Zone* myCurrentZone; - QListWidget* myZones; - QListWidget* mySplittedZones; - QLineEdit* mySplittedZonesPrefix; + HYDROGUI_DataBrowser* myLandCoverBrowser; }; #endif