#include "HYDROData_NaturalObject.h"
#include "HYDROData_PolylineXY.h"
#include "HYDROData_StricklerTable.h"
+#include "HYDROData_LandCoverMap.h"
#include "HYDROData_SplittedShapesGroup.h"
#include "HYDROData_Region.h"
#include "HYDROData_Tool.h"
Changed( Geom_No );
}
+Handle(HYDROData_LandCoverMap) HYDROData_CalculationCase::GetLandCoverMap() const
+{
+ // TODO
+ Handle(HYDROData_LandCoverMap) aLandCoverMap = NULL;
+ return aLandCoverMap;
+}
+
Handle(HYDROData_Region) HYDROData_CalculationCase::AddNewRegion( const Handle(HYDROData_Zone)& theZone )
{
Changed( Geom_No );
class Handle(HYDROData_SplittedShapesGroup);
class Handle(HYDROData_Document);
class Handle(HYDROData_StricklerTable);
+class Handle(HYDROData_LandCoverMap);
DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
*/
HYDRODATA_EXPORT virtual void RemoveStricklerTable();
+ /**
+ * Returns reference Land Cover Map of calculation case.
+ * \return the referenced Land Cover Map
+ */
+ HYDRODATA_EXPORT virtual Handle(HYDROData_LandCoverMap) GetLandCoverMap() const;
+
/**
* Add new one child region for calculation case.
* The new region is added into the list of reference regions.
HYDROGUI_ImportImageDlg.h
HYDROGUI_ImportImageOp.h
HYDROGUI_ImportPolylineOp.h
- HYDROGUI_ImportLandCoverOp.h
- HYDROGUI_ImportLandCoverDlg.h
HYDROGUI_ImportSinusXOp.h
HYDROGUI_ExportSinusXOp.h
HYDROGUI_ExportSinusXDlg.h
HYDROGUI_LineEditDoubleValidator.h
HYDROGUI_StricklerTableDlg.h
HYDROGUI_StricklerTableOp.h
- HYDROGUI_LandCoverDlg.h
- HYDROGUI_LandCoverOp.h
HYDROGUI_SubmersibleOp.h
HYDROGUI_Tool.h
HYDROGUI_TwoImagesDlg.h
HYDROGUI_RecognizeContoursDlg.h
HYDROGUI_RecognizeContoursOp.h
HYDROGUI_LandCoverColoringOp.h
- HYDROGUI_ShapeLandCover.h
)
QT4_WRAP_CPP(PROJECT_HEADERS_MOC ${PROJECT_HEADERS})
HYDROGUI_ImportImageOp.cxx
HYDROGUI_ImportPolylineOp.cxx
HYDROGUI_ImportSinusXOp.cxx
- HYDROGUI_ImportLandCoverOp.cxx
- HYDROGUI_ImportLandCoverDlg.cxx
HYDROGUI_ExportSinusXOp.cxx
HYDROGUI_ExportSinusXDlg.cxx
HYDROGUI_InputPanel.cxx
HYDROGUI_LineEditDoubleValidator.cxx
HYDROGUI_StricklerTableDlg.cxx
HYDROGUI_StricklerTableOp.cxx
- HYDROGUI_LandCoverDlg.cxx
- HYDROGUI_LandCoverOp.cxx
HYDROGUI_SplitPolylinesDlg.cxx
HYDROGUI_SplitPolylinesOp.cxx
HYDROGUI_SubmersibleOp.cxx
HYDROGUI_RecognizeContoursDlg.cxx
HYDROGUI_RecognizeContoursOp.cxx
HYDROGUI_LandCoverColoringOp.cxx
- HYDROGUI_ShapeLandCover.cxx
)
add_definitions(
{
addPage( createObjectsPage() );
addPage( createGroupsPage() );
- addPage( createLandCoversPage() );
+ addPage( createLandCoverMapPage() );
addPage( createZonesPage() );
- addPage( createLandCoverZonesPage() );
}
HYDROGUI_CalculationDlg::~HYDROGUI_CalculationDlg()
myObjectName->clear();
HYDROGUI_ListModel::Object2VisibleList anObject2VisibleList;
myGeomObjects->setObjects(anObject2VisibleList);
- myLandCovers->setObjects(anObject2VisibleList);
myPolylineName->clear();
myStricklerTableName->clear();
myAvailableGeomObjects->clear();
- myAvailableLandCovers->clear();
// Activate the automatic mode
setMode( HYDROData_CalculationCase::AUTOMATIC );
- setLandCoverMode( HYDROData_CalculationCase::AUTOMATIC );
// Reset the priority widget state
QList<Handle(HYDROData_Entity)> anObjects;
myPriorityWidget->setObjects( anObjects );
- myLandCoverPriorityWidget->setObjects( anObjects );
}
QWizardPage* HYDROGUI_CalculationDlg::createObjectsPage() {
return aPage;
}
-QWizardPage* HYDROGUI_CalculationDlg::createLandCoversPage() {
+QWizardPage* HYDROGUI_CalculationDlg::createLandCoverMapPage() {
QWizardPage* aPage = new QWizardPage( mainFrame() );
QFrame* aFrame = new QFrame( aPage );
- // Splitter
- myLandCoverSplitter = new QSplitter(Qt::Vertical);
-
// Top of the page
QWidget* aTopContainer = new QWidget;
-
+
+ // TODO: add combo-box to choose land cover map object
// Combo-box to choose Strickler table name
QLabel* aStricklerTableLabel = new QLabel( tr( "STRICKLER_TABLE" ), aPage );
myStricklerTableName = new QComboBox( aPage );
connect( myStricklerTableName, SIGNAL( activated( const QString & ) ),
SIGNAL( StricklerTableSelected( const QString & ) ) );
- // Mode selector (auto/manual)
- QGroupBox* aModeGroup = new QGroupBox( tr( "MODE" ) );
-
- QRadioButton* aManualRB = new QRadioButton( tr( "MANUAL" ), mainFrame() );
- QRadioButton* anAutoRB = new QRadioButton( tr( "AUTO" ), mainFrame() );
-
- myLandCoverModeButtons = new QButtonGroup( mainFrame() );
- myLandCoverModeButtons->addButton( anAutoRB, HYDROData_CalculationCase::AUTOMATIC );
- myLandCoverModeButtons->addButton( aManualRB, HYDROData_CalculationCase::MANUAL );
-
- QBoxLayout* aModeSelectorLayout = new QHBoxLayout;
- aModeSelectorLayout->setMargin( 5 );
- aModeSelectorLayout->setSpacing( 5 );
- aModeSelectorLayout->addWidget( anAutoRB );
- aModeSelectorLayout->addWidget( aManualRB );
- aModeGroup->setLayout( aModeSelectorLayout );
-
- // Available land covers
- QLabel* aLandCoversLabel = new QLabel( tr( "CALCULATION_REFERENCE_LAND_COVERS" ) );
- myAvailableLandCovers = new QListWidget( aPage );
- myAvailableLandCovers->setSelectionMode( QListWidget::ExtendedSelection );
- myAvailableLandCovers->setEditTriggers( QListWidget::NoEditTriggers );
- myAvailableLandCovers->setViewMode( QListWidget::ListMode );
- myAvailableLandCovers->setSortingEnabled( true );
-
- // Included land covers
- QLabel* anIncludedLabel = new QLabel( tr( "INCLUDED_LAND_COVERS" ) );
- myLandCovers = new HYDROGUI_OrderedListWidget( aPage, 16 );
- myLandCovers->setHiddenObjectsShown(true);
- myLandCovers->setVisibilityIconShown(false);
- myLandCovers->setContentsMargins(QMargins());
-
- // Include/Exclude buttons
- QFrame* aBtnsFrame = new QFrame;
- QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
- aBtnsLayout->setMargin( 5 );
- aBtnsLayout->setSpacing( 5 );
- aBtnsFrame->setLayout( aBtnsLayout );
- QPushButton* anAddBtn = new QPushButton( tr("INCLUDE"), aBtnsFrame );
- QPushButton* aRemoveBtn = new QPushButton( tr("EXCLUDE"), aBtnsFrame );
-
- // Fill the butons frame with two buttons
- aBtnsLayout->addWidget( anAddBtn );
- aBtnsLayout->addWidget( aRemoveBtn );
- aBtnsLayout->addStretch( 1 );
-
- // Land covers frame
- QFrame* aLandCoversFrame = new QFrame( aPage );
- aLandCoversFrame->setFrameStyle( QFrame::Panel | QFrame::Raised );
- QGridLayout* aLandCoversLayout = new QGridLayout( aLandCoversFrame );
- aLandCoversLayout->setMargin( 5 );
- aLandCoversLayout->setSpacing( 5 );
- aLandCoversFrame->setLayout( aLandCoversLayout );
-
- // Fill the land covers frame with two lists, two labels and with buttons frame
- aLandCoversLayout->addWidget( aLandCoversLabel, 0, 0, Qt::AlignHCenter );
- aLandCoversLayout->addWidget( anIncludedLabel, 0, 2, Qt::AlignHCenter );
- aLandCoversLayout->addWidget( myAvailableLandCovers, 1, 0 );
- aLandCoversLayout->addWidget( aBtnsFrame, 1, 1, Qt::AlignHCenter );
- aLandCoversLayout->addWidget( myLandCovers, 1, 2 );
-
// Fill the top layout of the page
QGridLayout* aTopLayout = new QGridLayout;
aTopLayout->setMargin( 5 );
aTopLayout->setSpacing( 5 );
aTopLayout->setVerticalSpacing( 10 );
+ // TODO: add land cover map combo-box to the layout
aTopLayout->addWidget( aStricklerTableLabel, 0, 0, Qt::AlignHCenter );
aTopLayout->addWidget( myStricklerTableName, 0, 1 );
- aTopLayout->addWidget( aModeGroup, 1, 0, 1, 2 );
- aTopLayout->addWidget( aLandCoversFrame, 2, 0, 1, 2 );
-
+
aTopContainer->setLayout( aTopLayout );
- // Add the top of the page to the splitter
- myLandCoverSplitter->insertWidget(0, aTopContainer);
- myLandCoverSplitter->setStretchFactor(0, 2);
-
- // Bottom of the page
- myLandCoverPriorityWidget = new HYDROGUI_PriorityWidget( mainFrame() );
- HYDROGUI_PriorityTableModel* aModel =
- dynamic_cast<HYDROGUI_PriorityTableModel*>( myLandCoverPriorityWidget->getTable()->model() );
- if ( aModel )
- aModel->setColumnCount( 3 );
-
- QGroupBox* aPriorityGroup = new QGroupBox( tr( "PRIORITY" ) );
- QBoxLayout* aPriorityLayout = new QHBoxLayout;
- aPriorityLayout->setMargin( 5 );
- aPriorityLayout->setSpacing( 5 );
- aPriorityLayout->addWidget( myLandCoverPriorityWidget );
- aPriorityGroup->setLayout( aPriorityLayout );
-
- // Add the bottom of the page to the splitter
- myLandCoverSplitter->insertWidget(1, aPriorityGroup);
- myLandCoverSplitter->setStretchFactor(1, 1);
-
// Page layout
QVBoxLayout* aPageLayout = new QVBoxLayout;
aPageLayout->setMargin( 5 );
aPageLayout->setSpacing( 5 );
- aPageLayout->addWidget( myLandCoverSplitter );
-
+
aPage->setLayout( aPageLayout );
- // Create selector
- if ( module() ) {
- HYDROGUI_ListSelector* aListSelector =
- new HYDROGUI_ListSelector( myLandCovers, module()->getApp()->selectionMgr() );
- aListSelector->setAutoBlock( true );
- }
-
// Connections
- connect( myLandCoverModeButtons, SIGNAL( buttonClicked( int ) ), SIGNAL( changeLandCoverMode( int ) ) );
- connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addLandCovers() ) );
- connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removeLandCovers() ) );
-
- connect( myLandCovers, SIGNAL( orderChanged() ), SLOT( onOrderLandCoverChanged() ) );
-
- connect( myLandCoverPriorityWidget, SIGNAL( ruleChanged() ), SLOT( onLandCoverRuleChanged() ) );
+ // TODO
return aPage;
}
return aPage;
}
-QWizardPage* HYDROGUI_CalculationDlg::createLandCoverZonesPage() {
- QWizardPage* aPage = new QWizardPage( mainFrame() );
- QFrame* aFrame = new QFrame( aPage );
-
- QGridLayout* aLayout = new QGridLayout( aPage );
-
- QLabel* aResultsOnLandCoversLabel = new QLabel( tr( "RESULTS_ON_LAND_COVERS" ), aFrame );
-
- myLandCoverBrowser = new HYDROGUI_DataBrowser( module(), NULL, aPage, true );
- myLandCoverBrowser->setAutoOpenLevel( 3 );
- aLayout->setMargin( 5 );
- aLayout->setSpacing( 5 );
-
- aLayout->addWidget( aResultsOnLandCoversLabel, 0, 0 );
- aLayout->addWidget( myLandCoverBrowser, 1, 0, 1, 2 );
-
- myStricklerTypeLabel = new QLabel( tr( "STRICKLER_TYPE" ), aFrame );
- myStricklerTypeChoice = new QComboBox( aFrame );
-
- myStricklerTypeLabel->setVisible( false );
- myStricklerTypeChoice->setVisible( false );
-
- aLayout->addWidget( myStricklerTypeLabel, 2, 0 );
- aLayout->addWidget( myStricklerTypeChoice, 2, 1 );
-
- aPage->setLayout( aLayout );
-
- // Connections
- connect( myLandCoverBrowser, SIGNAL( dataChanged() ), SLOT( onDataLandCoverChanged() ) );
- connect( myLandCoverBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SIGNAL( clickedInZonesBrowser( SUIT_DataObject* ) ) );
- connect( myLandCoverBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onLandCoverZoneSelected( SUIT_DataObject* ) ) );
- connect( myStricklerTypeChoice, SIGNAL( activated( int ) ), SLOT( onMergeStricklerTypeSelected( int ) ) );
- connect( myLandCoverBrowser,
- SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
- SLOT( onLandCoverZonesDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
- connect( myLandCoverBrowser, SIGNAL( newRegion() ), this, SLOT( OnNewLandCoverRegion() ) );
-
- return aPage;
-}
-
-
bool HYDROGUI_CalculationDlg::acceptCurrent() const
{
QString anErrorMsg;
HYDROGUI_Region* aRegion = dynamic_cast<HYDROGUI_Region*>(theTargetParent);
if ( aRegion )
{
- emit moveZones( theTargetParent, aZonesList, false );
+ emit moveZones( theTargetParent, aZonesList );
}
}
}
emit createRegion( myBrowser->getSelected() );
}
-void HYDROGUI_CalculationDlg::OnNewLandCoverRegion()
-{
- emit createLandCoverRegion( myLandCoverBrowser->getSelected() );
-}
-
void HYDROGUI_CalculationDlg::onMergeTypeSelected( int theIndex )
{
int aType = myBathymetryChoice->itemData( theIndex ).toInt();
myBathymetryLabel->setVisible( doShow );
}
-void HYDROGUI_CalculationDlg::onLandCoverZoneSelected( SUIT_DataObject* theObject )
-{
- bool doShow = false;
- HYDROGUI_Zone* aZone = dynamic_cast<HYDROGUI_Zone*>( theObject );
- if ( aZone )
- {
- doShow = aZone->isMergingNeed();
- }
-
- if ( doShow )
- {
- // Fill the merge type combo box
- bool prevBlock = myStricklerTypeChoice->blockSignals( true );
- myCurrentZone = aZone;
- myStricklerTypeChoice->clear();
- myStricklerTypeChoice->addItem( tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
- QStringList aList = aZone->getObjects();
- for ( int i = 0; i < aList.length(); i++ )
- {
- myStricklerTypeChoice->addItem( aList.at( i ), HYDROData_Zone::Merge_Object );
- }
- // Select the current choice if any
- int aCurIndex = 0;
- switch ( aZone->getMergeType() )
- {
- case HYDROData_Zone::Merge_Object:
- aCurIndex = 1 + aList.indexOf( aZone->text( HYDROGUI_DataObject::AltitudeObjId ) );
- break;
- default:
- aCurIndex = 0; // Select unknown by default
- }
- myStricklerTypeChoice->setCurrentIndex( aCurIndex );
- myStricklerTypeChoice->blockSignals( prevBlock );
- }
-
- myStricklerTypeChoice->setVisible( doShow );
- myStricklerTypeChoice->setEnabled( getLandCoverMode() == HYDROData_CalculationCase::MANUAL );
- myStricklerTypeLabel->setVisible( doShow );
-}
-
-void HYDROGUI_CalculationDlg::onMergeStricklerTypeSelected( int theIndex )
-{
- int aType = myStricklerTypeChoice->itemData( theIndex ).toInt();
- QString aText = myStricklerTypeChoice->itemText( theIndex );
- emit setMergeStricklerType( aType, aText );
-}
-
-void HYDROGUI_CalculationDlg::onLandCoverZonesDropped( const QList<SUIT_DataObject*>& theList,
- SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction )
-{
- QList<SUIT_DataObject*> aZonesList;
- HYDROGUI_Zone* aZone;
- // Get a list of dropped land cover zones
- for ( int i = 0; i < theList.length(); i++ )
- {
- aZone = dynamic_cast<HYDROGUI_Zone*>( theList.at( i ) );
- if ( aZone )
- {
- aZonesList.append( aZone );
- }
- }
- if ( aZonesList.length() > 0 )
- {
- // Get the target region
- HYDROGUI_NamedObject* aRegionsRoot = dynamic_cast<HYDROGUI_NamedObject*>(theTargetParent);
- if ( aRegionsRoot )
- {
- // Create a new region
- emit createLandCoverRegion( aZonesList );
- }
- else
- {
- HYDROGUI_Region* aRegion = dynamic_cast<HYDROGUI_Region*>(theTargetParent);
- if ( aRegion )
- {
- emit moveZones( theTargetParent, aZonesList, true );
- }
- }
- }
-}
-
void HYDROGUI_CalculationDlg::setObjectName( const QString& theName )
{
myObjectName->setText( theName );
}
}
-void HYDROGUI_CalculationDlg::setAllLandCovers( const QStringList& theObjects, const QStringList& theObjectsEntries )
-{
- myAvailableLandCovers->clear();
-
- for ( int i = 0, n = theObjects.length(); i < n; ++i )
- {
- QString anObjName = theObjects.at( i );
-
- QListWidgetItem* aListItem = new QListWidgetItem( anObjName, myAvailableLandCovers );
- aListItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
- aListItem->setData( Qt::UserRole, theObjectsEntries.at( i ) );
- }
-}
-
QStringList getSelected( QListWidget* theWidget )
{
QStringList aResList;
return myGeomObjects->getSelectedNames();
}
-QStringList HYDROGUI_CalculationDlg::getSelectedLandCovers() const
-{
- return myLandCovers->getSelectedNames();
-}
-
QStringList HYDROGUI_CalculationDlg::getAllGeomObjects() const
{
return myGeomObjects->getAllNames();
}
-QStringList HYDROGUI_CalculationDlg::getAllLandCovers() const
-{
- return myLandCovers->getAllNames();
-}
-
QStringList HYDROGUI_CalculationDlg::getSelectedAvailableGeomObjects() const
{
return getSelected( myAvailableGeomObjects );
}
-QStringList HYDROGUI_CalculationDlg::getSelectedAvailableLandCovers() const
-{
- return getSelected( myAvailableLandCovers );
-}
-
void HYDROGUI_CalculationDlg::setEditedObject( const Handle(HYDROData_CalculationCase) theCase )
{
myEditedObject = theCase;
myValidator->setEditedObject( theCase );
// Build the calculation case subtree
- module()->getDataModel()->buildCaseTree( myBrowser->root(), myEditedObject, false );
+ module()->getDataModel()->buildCaseTree( myBrowser->root(), myEditedObject);
myBrowser->updateTree();
myBrowser->openLevels();
myBrowser->setAutoUpdate( true );
myBrowser->setUpdateModified( true );
+ /*TODO
// Build the calculation case subtree for Land Cover regions
module()->getDataModel()->buildCaseTree( myLandCoverBrowser->root(), myEditedObject, true );
myLandCoverBrowser->adjustColumnsWidth();
myLandCoverBrowser->setAutoUpdate( true );
myLandCoverBrowser->setUpdateModified( true );
+ */
}
HYDROGUI_Zone* HYDROGUI_CalculationDlg::getCurrentZone() const
{
SUIT_DataObject* aRoot = myBrowser->root();
module()->getDataModel()->updateObjectTree( myEditedObject );
- module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, false );
+ module()->getDataModel()->buildCaseTree( aRoot, myEditedObject );
myBrowser->updateTree( aRoot );
}
void HYDROGUI_CalculationDlg::onDataChanged()
{
SUIT_DataObject* aRoot = myBrowser->root();
- module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, false );
+ module()->getDataModel()->buildCaseTree( aRoot, myEditedObject );
myBrowser->updateTree( aRoot );
}
}
}
-/**
- Get creation mode for land covers panel.
- @param theMode the mode
-*/
-int HYDROGUI_CalculationDlg::getLandCoverMode() const
-{
- return myLandCoverModeButtons->checkedId();
-}
-
-/**
- Set creation mode for land cover panel.
- @param theMode the mode
-*/
-void HYDROGUI_CalculationDlg::setLandCoverMode( int theMode )
-{
- bool isBlocked = myLandCoverModeButtons->blockSignals( true );
- myLandCoverModeButtons->button( theMode )->setChecked( true );
- myLandCoverModeButtons->blockSignals( isBlocked );
-
- bool isAuto = ( theMode == HYDROData_CalculationCase::AUTOMATIC );
-
- myLandCovers->setOrderingEnabled( isAuto );
- QWidget* aWidget = myLandCoverSplitter->widget( 1 );
- if ( aWidget ) {
- aWidget->setVisible( isAuto );
- }
-}
-
/**
Enable/disable zones drag'n'drop and renaming.
@param theIsEnabled if true - zones drag'n'drop and renaming will be enabled
myBrowser->setReadOnly( !theIsEnabled );
}
-/**
- Enable/disable land covers drag'n'drop and renaming.
- @param theIsEnabled if true - land covers drag'n'drop and renaming will be enabled
-*/
-void HYDROGUI_CalculationDlg::setEditLandCoverZonesEnabled( const bool theIsEnabled )
-{
- myLandCoverBrowser->setReadOnly( !theIsEnabled );
-}
-
/**
Get included geometry objects.
@return the list of geometry objects
}
/**
- Get included land covers.
- @return the list of land covers
+ Get chosen land cover map.
+ @return the land cover map object
*/
-QList<Handle(HYDROData_Entity)> HYDROGUI_CalculationDlg::getLandCovers()
+Handle(HYDROData_LandCoverMap) HYDROGUI_CalculationDlg::getLandCoverMap()
{
+ /* TODO
QList<Handle(HYDROData_Entity)> anEntities = myLandCovers->getObjects();
QList<Handle(HYDROData_Entity)> aLandCovers;
}
return aLandCovers;
+ */
+ Handle(HYDROData_LandCoverMap) aLandCoverMap = NULL;
+ return aLandCoverMap;
}
/**
myPriorityWidget->setRules( theRules );
}
-/**
- Get rules defined for land covers.
- @return the list of rules
- */
-HYDROData_ListOfRules HYDROGUI_CalculationDlg::getLandCoverRules() const
-{
- return myLandCoverPriorityWidget->getRules();
-}
-
-/**
- Set rules for land covers.
- @param theRules the list of rules
- */
-void HYDROGUI_CalculationDlg::setLandCoverRules( const HYDROData_ListOfRules& theRules ) const
-{
- myLandCoverPriorityWidget->setRules( theRules );
-}
-
/**
Slot called when objects order is changed.
*/
myPriorityWidget->undoLastChange();
}
+// TODO: setLandCoverMap(...)
void HYDROGUI_CalculationDlg::setStricklerTable( const QString& theStricklerTableName, bool theBlockSignals )
{
bool isBlocked;
else
emit StricklerTableSelected( theStricklerTableName );
}
-
-void HYDROGUI_CalculationDlg::includeLandCovers( const QStringList& theLandCovers, bool theReset )
-{
- if ( theReset )
- {
- HYDROGUI_ListModel::Object2VisibleList anObject2VisibleList;
- myLandCovers->setObjects(anObject2VisibleList);
- }
-
- QList<QListWidgetItem*> aFoundItems;
- foreach ( const QString& anObjName, theLandCovers ) {
- // Hide the land cover in the available land covers list
- aFoundItems = myAvailableLandCovers->findItems( anObjName, Qt::MatchExactly );
- foreach ( QListWidgetItem* anItem, aFoundItems ) {
- anItem->setHidden( true );
- }
-
- // Add the land cover to the list of included objects
- Handle(HYDROData_Entity) anObject =
- HYDROGUI_Tool::FindObjectByName( module(), anObjName );
- myLandCovers->addObject( HYDROGUI_ListModel::Object2Visible( anObject, true ) );
- }
-
- myLandCoverPriorityWidget->setObjects( getLandCovers() );
-}
-
-void HYDROGUI_CalculationDlg::excludeLandCovers( const QStringList& theLandCovers )
-{
- QList<QListWidgetItem*> aFoundItems;
- foreach ( const QString& anObjName, theLandCovers ) {
- // Set visible the land cover in the available objects list
- aFoundItems = myAvailableLandCovers->findItems( anObjName, Qt::MatchExactly );
- foreach ( QListWidgetItem* anItem, aFoundItems ) {
- anItem->setHidden( false );
- }
-
- // Remove the land cover from the list of included objects
- myLandCovers->removeObjectByName( anObjName );
- }
-
- myLandCoverPriorityWidget->setObjects( getLandCovers() );
-}
-
-void HYDROGUI_CalculationDlg::refreshLandCoverZonesBrowser()
-{
- SUIT_DataObject* aRoot = myLandCoverBrowser->root();
- module()->getDataModel()->updateObjectTree( myEditedObject );
- module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, true );
- myLandCoverBrowser->updateTree( aRoot );
-}
-
-/**
- Slot called when zones created on land covers are changed.
- */
-void HYDROGUI_CalculationDlg::onDataLandCoverChanged()
-{
- SUIT_DataObject* aRoot = myLandCoverBrowser->root();
- module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, true );
- myLandCoverBrowser->updateTree( aRoot );
-}
-
-/**
- Slot called when land covers order is changed.
- */
-void HYDROGUI_CalculationDlg::onOrderLandCoverChanged()
-{
- bool isConfirmed = true;
- emit orderLandCoverChanged( isConfirmed );
- if( isConfirmed )
- myLandCoverPriorityWidget->setObjects( getLandCovers() );
- else
- myLandCovers->undoLastMove();
-}
-
-/**
- Slot called when priority rule for land covers is changed.
- */
-void HYDROGUI_CalculationDlg::onLandCoverRuleChanged()
-{
- bool isConfirmed = true;
- emit ruleLandCoverChanged( isConfirmed );
- if( !isConfirmed )
- myLandCoverPriorityWidget->undoLastChange();
-}
#include "HYDROGUI_Wizard.h"
#include <HYDROData_CalculationCase.h>
-#include <HYDROData_LandCover.h>
+#include <HYDROData_LandCoverMap.h>
class HYDROGUI_ObjSelector;
class HYDROGUI_DataBrowser;
void reset();
int getMode() const;
- int getLandCoverMode() const;
-
+
void setObjectName( const QString& theName );
QString getObjectName() const;
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 );
+ // TODO: setLandCoverMapsNames(...)
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 setEditLandCoverZonesEnabled( 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 onOrderChanged();
void onRuleChanged();
- 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 refreshLandCoverZonesBrowser();
- void onDataLandCoverChanged();
- void onOrderLandCoverChanged();
- void onLandCoverRuleChanged();
-
+
/**
* Process items selection: hide/show bathymetry merge type selector.
*/
void onZonesDropped( const QList<SUIT_DataObject*>& theList,
SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
- /**
- * Process items selection: hide/show Strickler type merge type selector.
- */
- void onLandCoverZoneSelected( SUIT_DataObject* theObject );
- /**
- * Process merge type selection: set the selected Strickler type merge type for the currently selected zone.
- */
- void onMergeStricklerTypeSelected( int theIndex );
- /**
- * Process land cover zones moving. Create a new region with dropped zones or add to existing one.
- */
- void onLandCoverZonesDropped( const QList<SUIT_DataObject*>& theList,
- SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
-
signals:
void changeMode( int theMode );
void boundarySelected( const QString & theObjName );
void setMergeType( int theMergeType, QString& theBathymetryName );
void createRegion( const QList<SUIT_DataObject*>& theZonesList );
- void moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList, bool theLandCover );
+ void moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList );
void clickedInZonesBrowser( SUIT_DataObject* );
- void changeLandCoverMode( int theMode );
-
- void addLandCovers();
- void removeLandCovers();
- void landCoversSelected();
- void orderLandCoverChanged( bool& isConfirmed );
- void ruleLandCoverChanged( bool& isConfirmed );
+ void landCoverMapSelected();
- void createLandCoverRegion( const QList<SUIT_DataObject*>& theLandCoverZonesList );
-
void StricklerTableSelected( const QString & theObjName );
- void setMergeStricklerType( int theMergeType, QString& theStricklerTypeName );
void regenerateColors();
protected slots:
void OnNewRegion();
- void OnNewLandCoverRegion();
private:
QList<Handle(HYDROData_Entity)> getGeometryObjects();
- QList<Handle(HYDROData_Entity)> getLandCovers();
-
+
+ Handle(HYDROData_LandCoverMap) getLandCoverMap();
+
QWizardPage* createObjectsPage();
QWizardPage* createGroupsPage();
- QWizardPage* createLandCoversPage();
+ QWizardPage* createLandCoverMapPage();
QWizardPage* createZonesPage();
- QWizardPage* createLandCoverZonesPage();
-
+
QSplitter* mySplitter;
- QSplitter* myLandCoverSplitter;
-
+
QGroupBox* myObjectNameGroup;
QLineEdit* myObjectName;
HYDROGUI_NameValidator* myValidator;
QComboBox* myPolylineName;
+ // TODO: myLandCoverMapName
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_DataBrowser* myBrowser;
Handle(HYDROData_CalculationCase) myEditedObject;
QComboBox* myBathymetryChoice;
QLabel* myBathymetryLabel;
HYDROGUI_Zone* myCurrentZone;
-
- HYDROGUI_DataBrowser* myLandCoverBrowser;
- QComboBox* myStricklerTypeChoice;
- QLabel* myStricklerTypeLabel;
};
#endif
myActiveViewManager( NULL ),
myPreviewViewManager( NULL ),
myShowGeomObjects( true ),
- myShowLandCovers( false ),
- myShowZones( false ),
- myUpdateLandCoverZonesPrs( false )
+ myShowLandCoverMap( false ),
+ myShowZones( false )
{
setName( myIsEdit ? tr( "EDIT_CALCULATION" ) : tr( "CREATE_CALCULATION" ) );
}
connect( aPanel, SIGNAL( addGroups() ), SLOT( onAddGroups() ) );
connect( aPanel, SIGNAL( removeGroups() ), SLOT( onRemoveGroups() ) );
- connect( aPanel, SIGNAL( changeLandCoverMode( int ) ), SLOT( onChangeLandCoverMode( int ) ) );
- connect( aPanel, SIGNAL( addLandCovers() ), SLOT( onAddLandCovers() ) );
- connect( aPanel, SIGNAL( removeLandCovers() ), SLOT( onRemoveLandCovers() ) );
-
connect( aPanel, SIGNAL( orderChanged( bool& ) ), SLOT( onOrderChanged( bool& ) ) );
- connect( aPanel, SIGNAL( orderLandCoverChanged( bool& ) ), SLOT( onOrderLandCoverChanged( bool& ) ) );
connect( aPanel, SIGNAL( ruleChanged( bool& ) ), SLOT( onRuleChanged( bool& ) ) );
- connect( aPanel, SIGNAL( ruleLandCoverChanged( bool& ) ), SLOT( onRuleLandCoverChanged( 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( setMergeStricklerType( int, QString& ) ), SLOT( onSetMergeStricklerType( int, QString& ) ) );
connect( aPanel, SIGNAL( moveZones( SUIT_DataObject*, const QList<SUIT_DataObject*>&, bool ) ),
SLOT( onMoveZones( SUIT_DataObject*, const QList<SUIT_DataObject*>&, bool ) ) );
connect( aPanel, SIGNAL( createRegion( const QList<SUIT_DataObject*>& ) ),
{
bool anIsToUpdateViewer = false;
+ /* TODO
// Remove old presentations of land covers from the operation viewer
Handle(HYDROData_Entity) anEntity;
Handle(HYDROData_LandCover) aLandCover;
module()->update( UF_OCCViewer );
}
}
+ */
}
void HYDROGUI_CalculationOp::onObjectsSelected()
aLastShape->update( true, false );
}
-void HYDROGUI_CalculationOp::onLandCoversSelected()
+void HYDROGUI_CalculationOp::onLandCoverMapSelected()
{
HYDROGUI_CalculationDlg* aPanel =
::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
+ /* TODO: highlight the selected land cover map in the 3d viewer (synchronize slection in the dialog with a preview in the viewer)
QStringList aSelectedObjs = aPanel->getSelectedLandCovers();
QMap<QString, bool> aSelectedObjsMap;
foreach( QString aName, aSelectedObjs )
aSelectedObjsMap[aName] = true;
+ */
// Select the appropriate land cover shape in the viewer
// Unhighlight all land covers except selected
HYDROGUI_Shape* aShape = 0, *aLastShape = 0;
Handle(HYDROData_Entity) anEntity;
+ /* TODO: highlight the selected land cover map in the 3d viewer (synchronize slection in the dialog with a preview in the viewer)
HYDROData_SequenceOfObjects aSeq = myEditedObject->GetLandCovers();
HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
bool isSelected;
}
}
}
+ */
+
+ // TODO
+ //createPreview( true );
+
if( aLastShape )
aLastShape->update( true, false );
}
}
void HYDROGUI_CalculationOp::onMoveZones( SUIT_DataObject* theRegionItem,
- const QList<SUIT_DataObject*>& theZonesList,
- bool theLandCover )
+ const QList<SUIT_DataObject*>& theZonesList )
{
HYDROGUI_Region* aRegion = dynamic_cast<HYDROGUI_Region*>(theRegionItem);
if ( aRegion )
HYDROGUI_CalculationDlg* aPanel =
::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
if ( aPanel )
- {
- theLandCover ? aPanel->refreshLandCoverZonesBrowser(): aPanel->refreshZonesBrowser();
- }
- createPreview( theLandCover );
+ aPanel->refreshZonesBrowser();
+ createPreview( false );
}
}
}
void HYDROGUI_CalculationOp::onCreateRegion( const QList<SUIT_DataObject*>& theZonesList )
{
- if ( createRegion( theZonesList, false ) )
+ if ( createRegion( theZonesList ) )
{
HYDROGUI_CalculationDlg* aPanel =
::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
}
}
-void HYDROGUI_CalculationOp::onCreateLandCoverRegion( const QList<SUIT_DataObject*>& theZonesList )
-{
- if ( createRegion( theZonesList, true ) )
- {
- HYDROGUI_CalculationDlg* aPanel =
- ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
- if ( aPanel )
- {
- aPanel->refreshLandCoverZonesBrowser();
- }
- createPreview( true );
- }
-}
-
void HYDROGUI_CalculationOp::onSetMergeType( int theMergeType, QString& theMergeObjectName )
{
HYDROGUI_CalculationDlg* aPanel =
}
}
-void HYDROGUI_CalculationOp::onSetMergeStricklerType( int theMergeType, QString& theStricklerTypeName )
-{
- HYDROGUI_CalculationDlg* aPanel =
- ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
- if ( aPanel )
- {
- HYDROGUI_Zone* aZone = aPanel->getCurrentZone();
- if ( aZone )
- {
- aZone->setMergeType( theMergeType, theStricklerTypeName );
- HYDROGUI_Shape* aShape = module()->getObjectShape( HYDROGUI_Module::VMR_PreviewCaseZones, aZone->modelObject() );
- if ( aShape )
- {
- aShape->update( true, false );
- }
- }
- aPanel->refreshLandCoverZonesBrowser();
- }
-}
-
void HYDROGUI_CalculationOp::onAddObjects()
{
HYDROGUI_CalculationDlg* aPanel =
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with zones
- HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( false );
+ HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions();
if ( aSeq.Length() > 0 )
{
// If there are already defined zones then ask a user to confirm zones recalculation
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with zones
- HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( false );
+ HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions();
if ( aSeq.Length() > 0 )
{
// If there are already defined zones then ask a user to confirm zones recalculation
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with zones
- HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( false );
+ HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions();
if ( aSeq.Length() > 0 )
{
// If there are already defined zones then ask a user to confirm zones recalculation
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with zones
- HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( false );
+ HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions();
if ( aSeq.Length() > 0 )
{
// If there are already defined zones then ask a user to confirm zones recalculation
return ( anAnswer == QMessageBox::Yes );
}
-bool HYDROGUI_CalculationOp::confirmLandCoverRegionsChange() const
-{
- // Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No );
- if ( !isConfirmed )
- {
- // If not modified check if the case has already defined regions with land cover zones
- HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
- if ( aSeq.Length() > 0 )
- {
- // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
- isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
- tr( "REGIONS_CHANGED" ),
- tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_REGIONS" ),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::No ) == QMessageBox::Yes );
- }
- else
- {
- isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
- }
- }
- return isConfirmed;
-}
-
-bool HYDROGUI_CalculationOp::confirmLandCoverModeChange() const
-{
- // Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No );
- if ( !isConfirmed )
- {
- // If not modified check if the case has already defined regions with land cover zones
- HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
- if ( aSeq.Length() > 0 )
- {
- // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
- isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
- tr( "MODE_CHANGED" ),
- tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_MODE" ),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::No ) == QMessageBox::Yes );
- }
- else
- {
- isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
- }
- }
- return isConfirmed;
-}
-
-bool HYDROGUI_CalculationOp::confirmLandCoverOrderChange() const
-{
- // Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No );
- if ( !isConfirmed )
- {
- // If not modified check if the case has already defined regions with land cover zones
- HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
- if ( aSeq.Length() > 0 )
- {
- // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
- isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
- tr( "ORDER_CHANGED" ),
- tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_REGIONS" ),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::No ) == QMessageBox::Yes );
- }
- else
- {
- isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
- }
- }
- return isConfirmed;
-}
-
-bool HYDROGUI_CalculationOp::confirmLandCoverRuleChange() const
-{
- // Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No );
- if ( !isConfirmed )
- {
- // If not modified check if the case has already defined regions with land cover zones
- HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
- if ( aSeq.Length() > 0 )
- {
- // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
- isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
- tr( "RULE_CHANGED" ),
- tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_REGIONS" ),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::No ) == QMessageBox::Yes );
- }
- else
- {
- isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
- }
- }
- return isConfirmed;
-}
-
bool HYDROGUI_CalculationOp::processApply( int& theUpdateFlags,
QString& theErrorMsg,
QStringList& theBrowseObjectsEntries )
if ( aPanel->getMode() == HYDROData_CalculationCase::MANUAL ) {
myEditedObject->ClearRules( HYDROData_CalculationCase::DataTag_CustomRules, false );
}
- if ( aPanel->getLandCoverMode() == HYDROData_CalculationCase::MANUAL ) {
- myEditedObject->ClearRules( HYDROData_CalculationCase::DataTag_CustomLandCoverRules, false );
- }
theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init;
}
else if( theIndex==2 )
{
- // Land covers panel
+ // Land cover map panel
HYDROGUI_CalculationDlg* aPanel =
::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
if ( !aPanel )
return;
- setLandCoversVisible( true );
+ setLandCoverMapVisible( true );
QStringList aList;
QStringList anEntryList;
HYDROData_SequenceOfObjects aSeq;
+ /* TODO: get all land cover map objects to fill in combo-box
Handle(HYDROData_StricklerTable) aStricklerTableObj;
QString aStricklerTableName;
aPanel->setStricklerTable( aList.at( 0 ), false );
//@ASL: myEditedObject->SetToUpdate( anUpdateState );
- // Fill in list widget with all available land covers
- aSeq = HYDROGUI_Tool::GetLandCovers( module() );
- getNamesAndEntries( aSeq, aList, anEntryList );
- aPanel->setAllLandCovers( aList, anEntryList );
-
- // Set list of included land covers
- aSeq = myEditedObject->GetLandCovers();
- getNamesAndEntries( aSeq, aList, anEntryList );
- aPanel->includeLandCovers( aList, true );
-
if ( !myEditedObject.IsNull() )
{
if ( myIsEdit )
aStricklerTableName = aStricklerTableObj->GetName();
aPanel->setStricklerTable( aStricklerTableName );
}
-
- // Set mode (Auto or Manual) to defined priority of land covers
- aPanel->setLandCoverMode( myEditedObject->GetAssignmentLandCoverMode() );
-
- // Set rules defined on land covers
- setRules( HYDROData_CalculationCase::DataTag_CustomLandCoverRules );
- }
- else
- {
- myEditedObject->SetAssignmentLandCoverMode( (HYDROData_CalculationCase::AssignmentMode)aPanel->getLandCoverMode() );
}
}
+ */
closePreview( false );
createPreview( true );
QApplication::setOverrideCursor( Qt::WaitCursor );
setGeomObjectsVisible( false );
- setLandCoversVisible( false );
+ setLandCoverMapVisible( false );
QString aNewCaseName = aPanel->getObjectName();
QString anOldCaseName = myEditedObject->GetName();
}
aPanel->setEditZonesEnabled( aMode == HYDROData_CalculationCase::MANUAL );
- // Land cover zones: set parameters for automatic mode
- aMode = aPanel->getLandCoverMode();
- if ( aMode == HYDROData_CalculationCase::AUTOMATIC )
- {
- // Set objects in the specified order
- if( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) )
- {
- myEditedObject->RemoveLandCovers();
- foreach ( const QString& aName, aPanel->getAllLandCovers() )
- {
- Handle(HYDROData_LandCover) aLandCover = Handle(HYDROData_LandCover)::DownCast(
- HYDROGUI_Tool::FindObjectByName( module(), aName ) );
- if ( aLandCover.IsNull() )
- {
- continue;
- }
- myEditedObject->AddLandCover( aLandCover );
- }
-
- // Clear priority rules
- myEditedObject->ClearRules( HYDROData_CalculationCase::DataTag_CustomLandCoverRules, true );
- // Set priority rules
- foreach ( const HYDROData_CustomRule& aRule, aPanel->getLandCoverRules() ) {
- myEditedObject->AddRule( aRule.Object1, aRule.Priority,
- aRule.Object2, HYDROData_Zone::Merge_Object,
- HYDROData_CalculationCase::DataTag_CustomLandCoverRules );
- }
- }
- }
- aPanel->setEditLandCoverZonesEnabled( aMode == HYDROData_CalculationCase::MANUAL );
-
if ( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_All ) )
{
myShowZones = true;
myEditedObject->Update();
- AssignDefaultZonesColors( false );
+ AssignDefaultZonesColors();
//aPanel->setEditedObject( myEditedObject );
aPanel->refreshZonesBrowser();
createPreview( false );
anIsToUpdateOb = true;
-
- myUpdateLandCoverZonesPrs = true;
}
else
{
// Show zones
- setZonesVisible( true, false );
+ setZonesVisible( true );
if ( isNameChanged ) {
module()->getDataModel()->updateObjectTree( myEditedObject );
}
QApplication::restoreOverrideCursor();
- }
- else if( theIndex==4 )
- {
- // Partition of Land covers panel
- HYDROGUI_CalculationDlg* aPanel =
- ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- QApplication::setOverrideCursor( Qt::WaitCursor );
-
- bool anIsToUpdateOb = false;
- if ( myUpdateLandCoverZonesPrs )
- {
- myShowZones = true;
-
- AssignDefaultZonesColors( true );
-
- aPanel->refreshLandCoverZonesBrowser();
-
- anIsToUpdateOb = true;
- }
-
- closePreview( false );
- createPreview( true );
-
- if ( myUpdateLandCoverZonesPrs )
- myUpdateLandCoverZonesPrs = false;
- else
- {
- // Hide zones
- setZonesVisible( false, false );
- // Show land cover zones
- setZonesVisible( true, true );
- }
-
- if ( anIsToUpdateOb ) {
- SUIT_DataBrowser* anObjBrowser = ((LightApp_Application*)module()->application())->objectBrowser();
- if ( anObjBrowser ) {
- anObjBrowser->updateTree( module()->getDataModel()->getDataObject( myEditedObject ), false );
- }
- }
-
- QApplication::restoreOverrideCursor();
- }
+ }
}
void HYDROGUI_CalculationOp::onHideZones( const int theIndex )
}
if( theIndex==2 )
{
- setLandCoversVisible( true );
+ setLandCoverMapVisible( true );
closePreview( false );
createPreview( true );
// Hide zones
- setZonesVisible( false, false );
- // Hide land covers
- setZonesVisible( false, true );
+ setZonesVisible( false );
}
else if( theIndex==3 )
{
- AssignDefaultZonesColors( false );
+ AssignDefaultZonesColors();
closePreview( false );
createPreview( false );
- // Hide land cover zones
- setZonesVisible( false, true );
// Show zones
- setZonesVisible( true, false );
+ setZonesVisible( true );
}
}
-void HYDROGUI_CalculationOp::setZonesVisible( bool theIsVisible, const bool theLandCover )
+void HYDROGUI_CalculationOp::setZonesVisible( bool theIsVisible )
{
myShowZones = theIsVisible;
- HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions( theLandCover );
+ HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions();
HYDROData_SequenceOfObjects::Iterator aRegionsIter( aRegions );
HYDROData_SequenceOfObjects aZones;
Handle(HYDROData_Region) aRegion;
}
}
-void HYDROGUI_CalculationOp::setLandCoversVisible( bool theIsVisible )
+void HYDROGUI_CalculationOp::setLandCoverMapVisible( bool theIsVisible )
{
- myShowLandCovers = theIsVisible;
-
- HYDROData_SequenceOfObjects aSeq = myEditedObject->GetLandCovers();
-
- HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
- for ( ; anIter.More(); anIter.Next() ) {
- setObjectVisibility( anIter.Value(), theIsVisible );
- }
+ myShowLandCoverMap = theIsVisible;
+ setObjectVisibility( myEditedObject->GetLandCoverMap(), theIsVisible );
}
-void HYDROGUI_CalculationOp::AssignDefaultZonesColors( const bool theLandCover )
+void HYDROGUI_CalculationOp::AssignDefaultZonesColors()
{
- HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions( theLandCover );
+ HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions();
HYDROData_SequenceOfObjects::Iterator aRegionsIter( aRegions );
HYDROData_SequenceOfObjects aZones;
Handle(HYDROData_Region) aRegion;
}
if ( theDataTag == HYDROData_CalculationCase::DataTag_CustomRules )
- aPanel->setRules( aRules );
- else if ( theDataTag == HYDROData_CalculationCase::DataTag_CustomLandCoverRules )
- aPanel->setLandCoverRules( aRules );
+ aPanel->setRules( aRules );
}
-bool HYDROGUI_CalculationOp::createRegion( const QList<SUIT_DataObject*>& theZonesList,
- const bool theLandCover )
+bool HYDROGUI_CalculationOp::createRegion( const QList<SUIT_DataObject*>& theZonesList )
{
bool aRetValue = false;
}
if ( aZonesList.length() > 0 )
{
- module()->getDataModel()->createNewRegion( myEditedObject, aZonesList, theLandCover );
+ module()->getDataModel()->createNewRegion( myEditedObject, aZonesList );
aRetValue = true;
}
return aRetValue;
}
-void HYDROGUI_CalculationOp::createPreview( const bool theLandCover )
+void HYDROGUI_CalculationOp::createPreview( const bool theLandCoverMap )
{
LightApp_Application* anApp = module()->getApp();
HYDROData_SequenceOfObjects aSeq;
- if ( theLandCover && myShowLandCovers )
+ if ( theLandCoverMap && myShowLandCoverMap )
{
- HYDROData_SequenceOfObjects aSeqLC = myEditedObject->GetLandCovers();
- aSeq.Append( aSeqLC );
+ aSeq.Append( myEditedObject->GetLandCoverMap() );
}
- else if ( !theLandCover && myShowGeomObjects )
+ else if ( !theLandCoverMap && myShowGeomObjects )
{
HYDROData_SequenceOfObjects aSeqGO = myEditedObject->GetGeometryObjects();
aSeq.Append( aSeqGO );
if ( myShowZones )
{
// Gather zones for displaying
- HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions( theLandCover );
+ HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions();
HYDROData_SequenceOfObjects::Iterator aRegionsIter( aRegions );
HYDROData_SequenceOfObjects aZones;
Handle(HYDROData_Region) aRegion;
aPanel->excludeGroups( aSelectedList );
}
-void HYDROGUI_CalculationOp::onChangeLandCoverMode( int theMode )
-{
- HYDROGUI_CalculationDlg* aPanel =
- ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- if ( !confirmLandCoverModeChange() ) {
- aPanel->setLandCoverMode( myEditedObject->GetAssignmentLandCoverMode() );
- return;
- }
-
- myEditedObject->SetAssignmentLandCoverMode( (HYDROData_CalculationCase::AssignmentMode)theMode );
- aPanel->setLandCoverMode( theMode );
-}
-
-void HYDROGUI_CalculationOp::onAddLandCovers()
-{
- HYDROGUI_CalculationDlg* aPanel =
- ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- // Add land covers selected in the module browser to the calculation case
- QStringList aSelectedList = aPanel->getSelectedAvailableLandCovers();
- if ( aSelectedList.isEmpty() || !confirmLandCoverRegionsChange() )
- return;
-
- QStringList anAddedList;
- for (int i = 0; i < aSelectedList.length(); i++)
- {
- Handle(HYDROData_LandCover) anObject = Handle(HYDROData_LandCover)::DownCast(
- HYDROGUI_Tool::FindObjectByName( module(), aSelectedList.at( i ) ) );
- if ( anObject.IsNull() )
- continue;
-
- if ( myEditedObject->AddLandCover( anObject ) )
- anAddedList.append( anObject->GetName() );
- }
-
- if ( !anAddedList.isEmpty() )
- {
- aPanel->includeLandCovers( anAddedList, false );
- createPreview( true );
- }
-}
-
-void HYDROGUI_CalculationOp::onRemoveLandCovers()
-{
- // Remove selected objects from the calculation case
- HYDROGUI_CalculationDlg* aPanel =
- ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- QStringList aSelectedList = aPanel->getSelectedLandCovers();
- if ( aSelectedList.isEmpty() || !confirmLandCoverRegionsChange() )
- return;
-
- for (int i = 0; i < aSelectedList.length(); i++)
- {
- Handle(HYDROData_LandCover) anObject = Handle(HYDROData_LandCover)::DownCast(
- HYDROGUI_Tool::FindObjectByName( module(), aSelectedList.at(i) ) );
- if ( anObject.IsNull() )
- continue;
-
- setObjectVisibility( anObject, false );
- myEditedObject->RemoveLandCover( anObject );
- }
-
- module()->update( UF_OCCViewer );
- aPanel->excludeLandCovers( aSelectedList );
-}
-
void HYDROGUI_CalculationOp::onChangeMode( int theMode )
{
HYDROGUI_CalculationDlg* aPanel =
myEditedObject->Changed( HYDROData_Entity::Geom_2d );
}
-void HYDROGUI_CalculationOp::onOrderLandCoverChanged( bool& isConfirmed )
-{
- HYDROGUI_CalculationDlg* aPanel =
- ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- isConfirmed = confirmLandCoverOrderChange();
- if( isConfirmed )
- myEditedObject->Changed( HYDROData_Entity::Geom_No );
-}
-
void HYDROGUI_CalculationOp::onRuleChanged( bool& isConfirmed )
{
HYDROGUI_CalculationDlg* aPanel =
myEditedObject->Changed( HYDROData_Entity::Geom_2d );
}
-void HYDROGUI_CalculationOp::onRuleLandCoverChanged( bool& isConfirmed )
-{
- HYDROGUI_CalculationDlg* aPanel =
- ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- isConfirmed = confirmLandCoverRuleChange();
- if( isConfirmed )
- myEditedObject->Changed( HYDROData_Entity::Geom_No );
-}
-
void HYDROGUI_CalculationOp::onRegenerateColors()
{
// For geometry zones
- AssignDefaultZonesColors( false );
- setZonesVisible( false, false );
- setZonesVisible( true, false );
+ AssignDefaultZonesColors();
+ setZonesVisible( false );
+ setZonesVisible( true );
}
*/
void onRemoveGroups();
- /**
- * Change the creation mode related to land covers.
- * @param theMode the mode to set
- */
- void onChangeLandCoverMode( int theMode );
-
- /**
- * Add land covers selected in the module browser to the calculation case.
- */
- void onAddLandCovers();
- /**
- * Remove selected land covers from the calculation case.
- */
- void onRemoveLandCovers();
-
/**
* Set the given bathymetry/type merge type to the current zone.
*/
void onSetMergeType( int theMergeType, QString& theMergeObjectName );
- /**
- * Set the given Strickler merge type to the current zone.
- */
- void onSetMergeStricklerType( int theMergeType, QString& theStricklerTypeName );
/**
* Selected zones are moved to the existing region.
*/
void onMoveZones( SUIT_DataObject* theRegionItem,
- const QList<SUIT_DataObject*>& theZonesList,
- bool theLandCover );
+ const QList<SUIT_DataObject*>& theZonesList);
/**
* Selected zones are moved to the new region to be created.
*/
void onCreateRegion( const QList<SUIT_DataObject*>& theZonesList );
- /**
- * Selected land cover zones are moved to the new region to be created.
- */
- void onCreateLandCoverRegion( const QList<SUIT_DataObject*>& theZonesList );
/**
* Case objects must be splitted to zones if the case has been modified or new.
*/
*/
void onObjectsSelected();
/**
- * Land cover is selected in the list on the third wizard page
+ * Land cover map is selected in the list on the third wizard page
*/
- void onLandCoversSelected();
+ void onLandCoverMapSelected();
/**
* Boundary polyline is selected in the list on the first wizard page
*/
void onStricklerTableSelected( const QString & theObjName );
void onOrderChanged( bool& isConfirmed );
- void onOrderLandCoverChanged( bool& isConfirmed );
void onRuleChanged( bool& isConfirmed );
- void onRuleLandCoverChanged( bool& isConfirmed );
void onRegenerateColors();
private:
- void createPreview( const bool theLandCover);
+ void createPreview( const bool theLandCoverMap);
void closePreview( bool theRemoveViewManager = true );
void setObjectVisibility( Handle(HYDROData_Entity) theEntity, const bool theIsVisible );
- void setZonesVisible( bool theIsVisible, const bool theLandCover );
+ void setZonesVisible( bool theIsVisible );
void setGeomObjectsVisible( bool theIsVisible );
- void setLandCoversVisible( bool theIsVisible );
+ void setLandCoverMapVisible( bool theIsVisible );
void getNamesAndEntries( const HYDROData_SequenceOfObjects& theSeq,
QStringList& theNames, QStringList& theEntries ) const;
/**
* Internal method that used to assign unique default colors for zones
*/
- void AssignDefaultZonesColors( const bool theLandCover );
+ void AssignDefaultZonesColors();
/**
* Internal method that used to generate default color for zone
* @param theIndex the index of color to be generated
void setRules( HYDROData_CalculationCase::DataTag theDataTag );
- bool createRegion( const QList<SUIT_DataObject*>& theZonesList,
- const bool theLandCover );
+ bool createRegion( const QList<SUIT_DataObject*>& theZonesList );
bool confirmRegionsChange() const;
bool confirmModeChange() const;
bool confirmRuleChange() const;
bool confirmContinueWithWarning( const HYDROData_Warning& theWarning ) const;
- bool confirmLandCoverRegionsChange() const;
- bool confirmLandCoverModeChange() const;
- bool confirmLandCoverOrderChange() const;
- bool confirmLandCoverRuleChange() const;
-
private:
bool myIsEdit;
bool myShowZones;
bool myShowGeomObjects;
- bool myShowLandCovers;
- bool myUpdateLandCoverZonesPrs;
+ bool myShowLandCoverMap;
Handle(HYDROData_CalculationCase) myEditedObject;
SUIT_ViewManager* myActiveViewManager;
#include <HYDROData_Polyline3D.h>
#include <HYDROGUI_DataObject.h>
#include <HYDROData_Bathymetry.h>
-#include <HYDROData_LandCover.h>
+#include <HYDROData_LandCoverMap.h>
#include <HYDROData_Profile.h>
Handle(HYDROData_PolylineXY) aPolyXY;
Handle(HYDROData_Polyline3D) aPoly3D;
- Handle(HYDROData_LandCover) aLC;
NCollection_Sequence<Handle_HYDROData_PolylineXY> aPolyXYSeq;
NCollection_Sequence<Handle_HYDROData_Polyline3D> aPoly3DSeq;
- NCollection_Sequence<Handle_HYDROData_LandCover> aLCSeq;
+ // TODO
+ Handle_HYDROData_LandCoverMap aLCSeq;
HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( module() );
for( int anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ )
aPoly3D = Handle(HYDROData_Polyline3D)::DownCast( aSeq.Value( anIndex ));
if (!aPoly3D.IsNull())
aPoly3DSeq.Append(aPoly3D);
-
- aLC = Handle(HYDROData_LandCover)::DownCast( aSeq.Value( anIndex ));
- if (!aLC.IsNull())
- aLCSeq.Append(aLC);
}
if (!aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty())
aName = aPolyXYSeq(1)->GetName();
if (aPoly3DSeq.Size() == 1 && aPolyXYSeq.IsEmpty())
aName = aPoly3DSeq(1)->GetName();
- if (aLCSeq.Size() == 1 && aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty())
- aName = aLCSeq(1)->GetName();
QString aFileName = SUIT_FileDlg::getFileName( module()->getApp()->desktop(), aName, aFilter, tr( "EXPORT_TO_SHAPE_FILE" ), false );
if (!aFileName.isEmpty())
{
QStringList aNonExpList;
HYDROData_ShapeFile anExporter;
+ // TODO
anExporter.Export(aFileName, aPolyXYSeq, aPoly3DSeq, aLCSeq, aNonExpList);
if (!aNonExpList.empty())
{
+++ /dev/null
-// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "HYDROGUI_ImportLandCoverDlg.h"
-
-#include <QGroupBox>
-#include <QLabel>
-#include <QLineEdit>
-#include <QListWidget>
-#include <QVBoxLayout>
-#include <QToolButton>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-#include <SUIT_FileDlg.h>
-
-
-HYDROGUI_ImportLandCoverDlg::HYDROGUI_ImportLandCoverDlg( HYDROGUI_Module* theModule, const QString& theTitle )
-: HYDROGUI_InputPanel( theModule, theTitle )
-{
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-
- myFileNameGroup = new QGroupBox( tr( "IMPORT_LANDCOVER_FROM_FILE" ) );
-
- QLabel* aFileNameLabel = new QLabel( tr( "FILE_NAME" ), myFileNameGroup );
-
- myFileName = new QLineEdit( myFileNameGroup );
- myFileName->setReadOnly( true );
-
- QToolButton* aBrowseBtn = new QToolButton( myFileNameGroup );
- aBrowseBtn->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "BROWSE_ICO" ) ) );
-
- QBoxLayout* aFileNameLayout = new QHBoxLayout( myFileNameGroup );
- aFileNameLayout->setMargin( 5 );
- aFileNameLayout->setSpacing( 5 );
- aFileNameLayout->addWidget( aFileNameLabel );
- aFileNameLayout->addWidget( myFileName );
- aFileNameLayout->addWidget( aBrowseBtn );
-
- myObjectNameGroup = new QGroupBox( tr( "LANDCOVER_NAME" ) );
-
- QLabel* aLandcoverNameLabel = new QLabel( tr( "NAME" ), myObjectNameGroup );
- myObjectName = new QLineEdit( myObjectNameGroup );
-
- QBoxLayout* aLandcoverNameLayout = new QHBoxLayout( myObjectNameGroup );
- aLandcoverNameLayout->setMargin( 5 );
- aLandcoverNameLayout->setSpacing( 5 );
- aLandcoverNameLayout->addWidget( aLandcoverNameLabel );
- aLandcoverNameLayout->addWidget( myObjectName );
-
- QGroupBox* aPolygonsGroup = new QGroupBox( tr( "FOUNDED_POLYGONS" ), mainFrame() );
- myPolygons = new QListWidget( aPolygonsGroup );
- myPolygons->setSelectionMode( QListWidget::ExtendedSelection );
- myPolygons->setEditTriggers( QListWidget::NoEditTriggers );
- myPolygons->setViewMode( QListWidget::ListMode );
- myPolygons->setSortingEnabled( false );
-
- QBoxLayout* aPolygonsLayout = new QVBoxLayout;
- aPolygonsLayout->addWidget( myPolygons );
- aPolygonsGroup->setLayout( aPolygonsLayout );
-
- // Layout
- addWidget( myFileNameGroup );
- addWidget( myObjectNameGroup );
- addWidget( aPolygonsGroup );
-
- // Conections
- connect( myPolygons, SIGNAL( itemSelectionChanged() ), this, SLOT( onItemSelectionChanged() ) );
- connect( aBrowseBtn, SIGNAL( clicked() ), this, SLOT( onBrowse() ) );
-}
-
-HYDROGUI_ImportLandCoverDlg::~HYDROGUI_ImportLandCoverDlg()
-{
-}
-
-void HYDROGUI_ImportLandCoverDlg::reset()
-{
- myPolygons->clear();
-}
-
-void HYDROGUI_ImportLandCoverDlg::setPolygonNames( const QStringList& theNames )
-{
- myPolygons->clear();
- myPolygons->addItems( theNames );
-}
-
-void HYDROGUI_ImportLandCoverDlg::removePolygonNames( const QStringList& theNames )
-{
- QList<QListWidgetItem*> aFoundItems;
-
- foreach ( const QString& aName, theNames ) {
- aFoundItems = myPolygons->findItems( aName, Qt::MatchExactly );
- foreach ( QListWidgetItem* anItem, aFoundItems ) {
- anItem = myPolygons->takeItem( myPolygons->row( anItem ) );
- delete anItem;
- }
- }
-}
-
-void HYDROGUI_ImportLandCoverDlg::setSelectedPolygonNames( const QStringList& theNames )
-{
- myPolygons->clearSelection();
-
- foreach( const QString aName, theNames ) {
- QList<QListWidgetItem*> anItems = myPolygons->findItems( aName, Qt::MatchExactly );
- if ( anItems.count() == 1 ) {
- anItems.first()->setSelected( true );
- }
- }
-}
-
-void HYDROGUI_ImportLandCoverDlg::onItemSelectionChanged()
-{
- emit selectionChanged( getSelectedPolygonNames() );
-}
-
-QStringList HYDROGUI_ImportLandCoverDlg::getSelectedPolygonNames() const
-{
- QStringList aSelectedNames;
-
- QList<QListWidgetItem*> aSelectedItems = myPolygons->selectedItems();
- foreach( const QListWidgetItem* anItem, aSelectedItems ) {
- aSelectedNames << anItem->text();
- }
-
- return aSelectedNames;
-}
-
-
-void HYDROGUI_ImportLandCoverDlg::onBrowse()
-{
- QString aFilter( tr( "LANDCOVER_FILTER" ) );
- QString aFileName = SUIT_FileDlg::getFileName( this, "", aFilter, tr( "IMPORT_LANDCOVER_FROM_FILE" ), true );
-
- if( !aFileName.isEmpty() )
- {
- setFileName( aFileName );
- emit FileSelected( aFileName );
- }
-}
-
-void HYDROGUI_ImportLandCoverDlg::setObjectName( const QString& theName )
-{
- myObjectName->setText( theName );
- myObjectNameGroup->setEnabled( !theName.isEmpty() || !myFileName->text().isEmpty() );
-}
-
-QString HYDROGUI_ImportLandCoverDlg::getObjectName() const
-{
- return myObjectName->text();
-}
-
-void HYDROGUI_ImportLandCoverDlg::setFileName( const QString& theFileName )
-{
- myFileName->setText( theFileName );
-
- if ( !myObjectNameGroup->isEnabled() )
- myObjectNameGroup->setEnabled( !theFileName.isEmpty() );
-}
-
-QString HYDROGUI_ImportLandCoverDlg::getFileName() const
-{
- return myFileName->text();
-}
\ No newline at end of file
+++ /dev/null
-// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-
-#ifndef HYDROGUI_ImportLandCoverDlg_H
-#define HYDROGUI_ImportLandCoverDlg_H
-
-#include "HYDROGUI_InputPanel.h"
-
-class QListWidget;
-class QLineEdit;
-class QGroupBox;
-
-class HYDROGUI_ImportLandCoverDlg : public HYDROGUI_InputPanel
-{
- Q_OBJECT
-
-public:
- HYDROGUI_ImportLandCoverDlg( HYDROGUI_Module* theModule, const QString& theTitle );
- virtual ~HYDROGUI_ImportLandCoverDlg();
-
- void reset();
-
- void setPolygonNames( const QStringList& theNames );
- void removePolygonNames( const QStringList& theNames );
-
- void setSelectedPolygonNames( const QStringList& theNames );
-
- QStringList getSelectedPolygonNames() const;
-
- void setObjectName( const QString& theName );
- QString getObjectName() const;
-
- void setFileName( const QString& theFileName );
- QString getFileName() const;
-
-signals:
- void FileSelected( const QString& theFileName );
-
-protected slots:
- void onBrowse();
-
-signals:
- void selectionChanged( const QStringList& );
-
-public slots:
- void onItemSelectionChanged();
-
-private:
- QLineEdit* myFileName;
- QGroupBox* myFileNameGroup;
- QListWidget* myPolygons;
-
- QGroupBox* myObjectNameGroup;
- QLineEdit* myObjectName;
-
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2007-2015 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
-//
-// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "HYDROGUI_ImportLandCoverOp.h"
-
-#include "HYDROGUI_DataModel.h"
-#include "HYDROGUI_Module.h"
-#include "HYDROGUI_UpdateFlags.h"
-#include "HYDROGUI_Tool.h"
-#include "HYDROGUI_ImportLandCoverDlg.h"
-#include "HYDROGUI_Shape.h"
-#include <HYDROData_LandCover.h>
-#include <HYDROGUI_ZLayers.h>
-
-#include <HYDROGUI_DataObject.h>
-#include <HYDROData_Iterator.h>
-#include <HYDROData_ShapeFile.h>
-#include <HYDROData_Profile.h>
-
-#include <SUIT_Desktop.h>
-#include <SUIT_FileDlg.h>
-#include <LightApp_Application.h>
-
-#include <QApplication>
-#include <QFile>
-#include <QFileInfo>
-#include <SUIT_MessageBox.h>
-
-#include <OCCViewer_ViewManager.h>
-#include <OCCViewer_ViewModel.h>
-
-#include <SalomeApp_Study.h>
-
-#include <LightApp_Application.h>
-#include <LightApp_DataOwner.h>
-#include <LightApp_Displayer.h>
-#include <LightApp_SelectionMgr.h>
-
-#include <SUIT_Desktop.h>
-#include <SUIT_ViewManager.h>
-
-#include <BRep_Builder.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Wire.hxx>
-
-
-
-HYDROGUI_ImportLandCoverOp::HYDROGUI_ImportLandCoverOp( HYDROGUI_Module* theModule )
-: HYDROGUI_Operation( theModule )
-{
- setName( tr( "IMPORT_LANDCOVER" ) );
-}
-
-HYDROGUI_ImportLandCoverOp::~HYDROGUI_ImportLandCoverOp()
-{
- erasePreview();
-}
-
-void HYDROGUI_ImportLandCoverOp::startOperation()
-{
- HYDROGUI_Operation::startOperation();
-
- if ( !getPreviewManager() ) {
- setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>(
- module()->getApp()->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
- }
-
- if ( !isApplyAndClose() ) {
- return;
- }
-
- HYDROGUI_ImportLandCoverDlg* aPanel =
- ::qobject_cast<HYDROGUI_ImportLandCoverDlg*>( inputPanel() );
- if ( !aPanel ) {
- return;
- }
-
- aPanel->reset();
-}
-
-
-HYDROGUI_InputPanel* HYDROGUI_ImportLandCoverOp::createInputPanel() const
-{
- HYDROGUI_InputPanel* aPanel = new HYDROGUI_ImportLandCoverDlg( module(), getName() );
-
- connect( aPanel, SIGNAL( FileSelected( const QString& ) ), SLOT( onFileSelected() ) );
-
- connect( aPanel, SIGNAL( selectionChanged( const QStringList& ) ), this, SLOT( onSelectionChanged( const QStringList& ) ) );
-
- return aPanel;
-}
-
-bool HYDROGUI_ImportLandCoverOp::processApply( int& theUpdateFlags,
- QString& theErrorMsg,
- QStringList& theBrowseObjectsEntries )
-{
-
- HYDROGUI_ImportLandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_ImportLandCoverDlg*>( inputPanel() );
- if ( !aPanel ) {
- return false;
- }
-
- QStringList aSelectedtPolygons = aPanel->getSelectedPolygonNames();
- aPanel->removePolygonNames( aSelectedtPolygons );
-
- if (!aSelectedtPolygons.empty())
- {
- Handle(HYDROData_LandCover) aLC = Handle(HYDROData_LandCover)::DownCast( doc()->CreateObject( KIND_LAND_COVER ) );
- TopoDS_Shape aResShape;
- if (aSelectedtPolygons.size() > 1)
- {
- TopoDS_Compound cmp;
- BRep_Builder BB;
- BB.MakeCompound(cmp);
-
- foreach ( QString aName, aSelectedtPolygons ) {
- TopoDS_Shape aShape = myPolygonName2PrsShape.value( aName )->getTopoShape();
- if ( aShape.IsNull() )
- continue;
- BB.Add(cmp, aShape);
- HYDROGUI_Shape* aShapeToDelete = myPolygonName2PrsShape.take( aName );
- delete aShapeToDelete;
- }
- aResShape = cmp;
- }
- else
- {
- TopoDS_Shape aShape = myPolygonName2PrsShape.value( aSelectedtPolygons.first() )->getTopoShape();
- if ( !aShape.IsNull() )
- {
- HYDROGUI_Shape* aShapeToDelete = myPolygonName2PrsShape.take( aSelectedtPolygons.first() );
- delete aShapeToDelete;
- aResShape = aShape;
- }
- }
- if( !aLC.IsNull() )
- {
- QString aLCName = aPanel->getObjectName() + "_polygon";
- int i = 0;
- for( ;HYDROGUI_Tool::FindObjectByName(module(), aLCName); i++)
- aLCName = aPanel->getObjectName() + "_polygon_" + QString::number(i);
- aLC->SetName( aLCName );
- aLC->SetFillingColor( aLC->DefaultFillingColor() );
- aLC->SetBorderColor( aLC->DefaultBorderColor() );
-
- aLC->SetShape(aResShape);
- aLC->Show();
-
- //erasePreview();
-
- module()->setIsToUpdate( aLC );
-
- }
- }
-
- module()->update( UF_Model | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init );
-
- if ( isApplyAndClose() )
- erasePreview();
-
- return true;
-}
-
-
-void HYDROGUI_ImportLandCoverOp::onFileSelected()
-{
- HYDROGUI_ImportLandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_ImportLandCoverDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- QString anObjectName = aPanel->getObjectName().simplified();
- anObjectName = aPanel->getFileName();
- if ( !anObjectName.isEmpty() )
- anObjectName = QFileInfo( anObjectName ).baseName();
-
- if ( anObjectName.isEmpty() )
- anObjectName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_LANDCOVER_NAME" ) );
- aPanel->setObjectName( anObjectName );
-
- QString aFileName = aPanel->getFileName();
- if ( aFileName.isEmpty() )
- {
- abort();
- return;
- }
-
- QString anExt = aFileName.split('.', QString::SkipEmptyParts).back();
-
- if (anExt == "shp")
- {
- startDocOperation();
- QApplication::setOverrideCursor(Qt::WaitCursor);
-
- QStringList aPolygonsList;
- TopTools_SequenceOfShape aFaces;
- HYDROData_ShapeFile anImporter;
-
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( module()->getApp()->activeStudy() );
- if ( !aStudy )
- return;
-
- erasePreview();
-
- Handle(AIS_InteractiveContext) aCtx = NULL;
- int aShapeTypeOfFile = -1;
- int aStat = anImporter.ImportLandCovers(aFileName, aPolygonsList, aFaces, aShapeTypeOfFile);
- if (aStat == 1)
- {
- aPanel->setPolygonNames(aPolygonsList);
-
- LightApp_Application* anApp = module()->getApp();
- if ( !getPreviewManager() )
- setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>( anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
- OCCViewer_ViewManager* aViewManager = getPreviewManager();
-
- if ( aViewManager )
- {
- if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() )
- {
- aCtx = aViewer->getAISContext();
- connect( aViewer, SIGNAL( selectionChanged() ), this, SLOT( onViewerSelectionChanged() ) );
- }
- }
-
- Handle(HYDROData_LandCover) aLC = Handle(HYDROData_LandCover)::DownCast( doc()->CreateObject( KIND_LAND_COVER ) );
- for ( int i = 1; i <= aFaces.Length(); i++ )
- {
- TopoDS_Face aFace = TopoDS::Face(aFaces.Value( i ));
-
- aLC->SetShape( aFace );
-
- if ( aViewManager && !aCtx.IsNull() )
- {
- HYDROGUI_Shape* aShape = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
-
- aShape->setFillingColor( aLC->DefaultFillingColor(), false, false );
- aShape->setBorderColor( aLC->DefaultBorderColor(), false, false );
- if( !aFace.IsNull() )
- aShape->setShape( aLC->GetShape() );
- myPolygonName2PrsShape.insert( "polygon_" + QString::number(i), aShape);
- }
- }
- aLC->Remove();
-
- if ( !aCtx.IsNull() )
- {
- UpdateZLayersOfHilightPresentationsOfDisplayedObjects( aCtx, Graphic3d_ZLayerId_TopOSD );
- aCtx->UpdateCurrentViewer();
- }
-
- QApplication::restoreOverrideCursor();
- commitDocOperation();
- }
- else
- {
- erasePreview();
- aPanel->setPolygonNames(QStringList());
- aPanel->setObjectName("");
- QApplication::restoreOverrideCursor();
- QString aMess = "Cannot import land cover;\n";
- if (aStat == -1)
- aMess += "Cannot open SHP file";
- else if (aStat == -2)
- aMess += "Cannot open SHX file";
- else
- aMess += "The shape type of file is " + anImporter.GetShapeTypeName(aShapeTypeOfFile);
- SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "IMPORT_LANDCOVER" ), aMess);
- commitDocOperation();
- //abort();
- }
- anImporter.Free();
-
- }
-
-}
-
-void HYDROGUI_ImportLandCoverOp::onSelectionChanged( const QStringList& theSelectedNames )
-{
- Handle(AIS_InteractiveContext) aCtx = NULL;
-
- OCCViewer_ViewManager* aViewManager = getPreviewManager();
- if ( aViewManager ) {
- if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
- aCtx = aViewer->getAISContext();
- }
- }
-
- if ( !aCtx.IsNull() ) {
- foreach ( QString aName, myPolygonName2PrsShape.keys() ) {
- Handle(AIS_InteractiveObject) anObject =
- myPolygonName2PrsShape.value(aName)->getAISObject();
-
- bool isSelected = theSelectedNames.contains( aName );
- if ( ( isSelected && !aCtx->IsSelected( anObject) ) ||
- ( !isSelected && aCtx->IsSelected( anObject) ) ) {
- aCtx->AddOrRemoveSelected( anObject, Standard_False );
- }
- }
- aCtx->UpdateCurrentViewer();
- }
-}
-
-
-void HYDROGUI_ImportLandCoverOp::onViewerSelectionChanged()
-{
- // Get panel
- HYDROGUI_ImportLandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_ImportLandCoverDlg*>( inputPanel() );
- if ( !aPanel ) {
- return;
- }
-
- OCCViewer_ViewManager* aViewManager = getPreviewManager();
- Handle(AIS_InteractiveContext) aCtx = NULL;
- if ( aViewManager ) {
- if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
- aCtx = aViewer->getAISContext();
- }
- }
-
- if ( !aCtx.IsNull() )
- {
- QStringList aSelectedNames;
- foreach ( QString aName, myPolygonName2PrsShape.keys() ) {
- bool isSelected = aCtx->IsSelected( myPolygonName2PrsShape.value(aName)->getAISObject() );
- if ( isSelected ) {
- aSelectedNames << aName;
- }
- }
- aPanel->setSelectedPolygonNames( aSelectedNames );
- }
-}
-
-
-void HYDROGUI_ImportLandCoverOp::erasePreview()
-{
- foreach ( HYDROGUI_Shape* aShape, myPolygonName2PrsShape ) {
- delete aShape;
- }
-
- myPolygonName2PrsShape.clear();
-}
-
-
-void HYDROGUI_ImportLandCoverOp::abortOperation()
-{
- LightApp_Application* anApp = module()->getApp();
- if ( anApp ) {
- anApp->disconnect( this );
- }
-
- erasePreview();
-
- HYDROGUI_Operation::abortOperation();
-}
-
-
+++ /dev/null
-// Copyright (C) 2007-2015 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
-//
-// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef HYDROGUI_IMPORTLANDCOVER_H
-#define HYDROGUI_IMPORTLANDCOVER_H
-
-#include "HYDROGUI_Operation.h"
-#include <vector>
-#include <QMap>
-
-class SUIT_FileDlg;
-class HYDROGUI_Shape;
-class TopoDS_Face;
-
-
-class HYDROGUI_ImportLandCoverOp : public HYDROGUI_Operation
-{
- Q_OBJECT
-
-public:
- HYDROGUI_ImportLandCoverOp( HYDROGUI_Module* theModule );
- virtual ~HYDROGUI_ImportLandCoverOp();
-
-protected:
- virtual void startOperation();
- virtual void abortOperation();
-
- virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg, QStringList& theBrowseObjectsEntries );
- HYDROGUI_InputPanel* createInputPanel() const;
-
- void erasePreview();
-
-protected slots:
- void onFileSelected();
- void onSelectionChanged( const QStringList& theSelectedNames );
- void onViewerSelectionChanged ();
-
-private:
- QMap<QString, HYDROGUI_Shape*> myPolygonName2PrsShape;
-};
-
-#endif
+++ /dev/null
-// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "HYDROGUI_LandCoverDlg.h"
-
-#include "HYDROGUI_Module.h"
-#include "HYDROGUI_OrderedListWidget.h"
-#include "HYDROGUI_ListSelector.h"
-
-#include <LightApp_Application.h>
-#include <LightApp_SelectionMgr.h>
-
-#include <QGroupBox>
-#include <QLabel>
-#include <QLayout>
-#include <QListWidget>
-#include <QPushButton>
-
-HYDROGUI_LandCoverDlg::HYDROGUI_LandCoverDlg( HYDROGUI_Module* theModule, const QString& theTitle )
-: HYDROGUI_BasicZoneDlg( theModule, theTitle,
- tr( "LAND_COVER_NAME" ), tr( "NAME" ),
- tr( "LAND_COVER_PARAMETERS" ), tr( "LAND_COVER_STRICKLER_TYPE" ) )
-{
- myPolylines = new HYDROGUI_OrderedListWidget( myPolylineFrame, 16 );
- myPolylines->setHiddenObjectsShown(true);
- myPolylines->setVisibilityIconShown(false);
- myPolylines->setContentsMargins(QMargins());
- myPolylines->setOrderingEnabled( true );
-
- // Include/Exclude buttons
- QFrame* aBtnsFrame = new QFrame( myPolylineFrame );
- QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
- aBtnsLayout->setMargin( 0 );
- aBtnsLayout->setSpacing( 5 );
- aBtnsFrame->setLayout( aBtnsLayout );
- QPushButton* anAddBtn = new QPushButton( tr("INCLUDE"), aBtnsFrame );
- QPushButton* aRemoveBtn = new QPushButton( tr("EXCLUDE"), aBtnsFrame );
-
- // Fill the butons frame with two buttons
- aBtnsLayout->addWidget( anAddBtn );
- aBtnsLayout->addWidget( aRemoveBtn );
- aBtnsLayout->addStretch( 1 );
-
- QGridLayout* aPolyLayout = new QGridLayout( myPolylineFrame );
- aPolyLayout->setMargin( 0 );
- aPolyLayout->setSpacing( 10 );
- aPolyLayout->addWidget( new QLabel( tr( "LAND_COVER_POLYLINES" ), myPolylineFrame ), 0, 0, 1, 2 );
- aPolyLayout->addWidget( aBtnsFrame, 1, 0, 1, 1 );
- aPolyLayout->addWidget( myPolylines, 1, 1, 1, 1 );
-
- QBoxLayout* aParamLayout = new QVBoxLayout( myParamGroup );
- aParamLayout->setMargin( 5 );
- aParamLayout->setSpacing( 5 );
- aParamLayout->addWidget( myPolylineFrame );
-
- // Create selector
- if ( module() ) {
- HYDROGUI_ListSelector* aListSelector =
- new HYDROGUI_ListSelector( myPolylines, module()->getApp()->selectionMgr() );
- aListSelector->setAutoBlock( true );
- }
-
- // Connect signals and slots
- connect( myPolylines, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onZoneDefChanged() ) );
- connect( myPolylines, SIGNAL( orderPolylinesChanged() ), SLOT( onOrderPolylinesChanged() ) );
- connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addPolylines() ) );
- connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removePolylines() ) );
-}
-
-HYDROGUI_LandCoverDlg::~HYDROGUI_LandCoverDlg()
-{
-}
-
-void HYDROGUI_LandCoverDlg::reset()
-{
- bool isBlocked = blockSignals( true );
-
- HYDROGUI_BasicZoneDlg::reset();
-
- HYDROGUI_ListModel::Object2VisibleList anObject2VisibleList;
- myPolylines->setObjects(anObject2VisibleList);
- myPolylines->setOrderingEnabled( false );
-
- blockSignals( isBlocked );
-
- onZoneDefChanged();
-}
-
-bool HYDROGUI_LandCoverDlg::includePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines )
-{
- QStringList anIncludedPolylinesNames = myPolylines->getAllNames();
-
- bool aSetOfPolylinesChanged = false;
- foreach ( const HYDROGUI_ListModel::Object2Visible& aSelectedPolyline, theSelectedPolylines )
- {
- if ( !anIncludedPolylinesNames.contains( aSelectedPolyline.first->GetName() ) )
- {
- myPolylines->addObject( aSelectedPolyline );
- aSetOfPolylinesChanged = true;
- }
- }
- myPolylines->setOrderingEnabled( myPolylines->getObjects().count() > 1 );
-
- return aSetOfPolylinesChanged;
-}
-
-bool HYDROGUI_LandCoverDlg::excludePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines )
-{
- bool aSetOfPolylinesChanged = !theSelectedPolylines.isEmpty();
-
- foreach ( const HYDROGUI_ListModel::Object2Visible& aSelectedPolyline, theSelectedPolylines )
- myPolylines->removeObjectByName( aSelectedPolyline.first->GetName() );
- myPolylines->setOrderingEnabled( myPolylines->getObjects().count() > 1 );
-
- return aSetOfPolylinesChanged;
-}
-
-QStringList HYDROGUI_LandCoverDlg::getPolylineNames() const
-{
- return myPolylines->getAllNames();
-}
-
-QStringList HYDROGUI_LandCoverDlg::getSelectedPolylineNames() const
-{
- return myPolylines->getSelectedNames();
-}
-
-void HYDROGUI_LandCoverDlg::onZoneDefChanged()
-{
- if ( signalsBlocked() )
- return;
-
- QStringList aPolylineNames = getPolylineNames();
- emit CreatePreview( aPolylineNames );
-}
-
-void HYDROGUI_LandCoverDlg::onOrderPolylinesChanged()
-{
- // TODO: implement this method
-}
+++ /dev/null
-// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef HYDROGUI_LANDCOVERDLG_H
-#define HYDROGUI_LANDCOVERDLG_H
-
-#include "HYDROGUI_BasicZoneDlg.h"
-
-#include "HYDROGUI_ListModel.h"
-
-class HYDROGUI_OrderedListWidget;
-
-class QListWidget;
-
-class HYDROGUI_LandCoverDlg : public HYDROGUI_BasicZoneDlg
-{
- Q_OBJECT
-
-public:
- HYDROGUI_LandCoverDlg( HYDROGUI_Module* theModule, const QString& theTitle );
- virtual ~HYDROGUI_LandCoverDlg();
-
- virtual void reset();
-
- bool includePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines );
- bool excludePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines );
- QStringList getPolylineNames() const;
- QStringList getSelectedPolylineNames() const;
-
-signals:
- void CreatePreview( const QStringList& thePolylineNames );
- void orderPolylinesChanged();
- void addPolylines();
- void removePolylines();
-
-private slots:
- void onZoneDefChanged();
- void onOrderPolylinesChanged();
-
-private:
- HYDROGUI_OrderedListWidget* myPolylines;
-};
-
-#endif
+++ /dev/null
-// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "HYDROGUI_LandCoverOp.h"
-
-#include "HYDROGUI_LandCoverDlg.h"
-#include "HYDROGUI_Module.h"
-#include "HYDROGUI_OCCDisplayer.h"
-#include "HYDROGUI_Shape.h"
-#include "HYDROGUI_Tool.h"
-#include "HYDROGUI_UpdateFlags.h"
-#include "HYDROGUI_DataObject.h"
-
-#include <HYDROData_PolylineXY.h>
-#include <HYDROData_Document.h>
-#include <HYDROData_Iterator.h>
-#include <HYDROData_StricklerTable.h>
-
-#include <OCCViewer_ViewManager.h>
-#include <OCCViewer_ViewModel.h>
-
-#include <LightApp_Application.h>
-
-#include <SUIT_MessageBox.h>
-#include <SUIT_Desktop.h>
-
-#include <TopoDS.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Wire.hxx>
-
-#include <QApplication>
-
-HYDROGUI_LandCoverOp::HYDROGUI_LandCoverOp( HYDROGUI_Module* theModule,
- const bool theIsEdit )
-: HYDROGUI_Operation( theModule ),
- myIsEdit( theIsEdit ),
- myPreviewPrs( 0 )
-{
- setName( theIsEdit ? tr( "EDIT_LAND_COVER" ) : tr( "CREATE_LAND_COVER" ) );
-}
-
-HYDROGUI_LandCoverOp::~HYDROGUI_LandCoverOp()
-{
- closePreview();
-}
-
-void HYDROGUI_LandCoverOp::startOperation()
-{
- HYDROGUI_Operation::startOperation();
-
- HYDROGUI_LandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- aPanel->blockSignals( true );
-
- aPanel->reset();
-
- QString anObjectName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_LAND_COVER_NAME" ) );
-
- HYDROGUI_ListModel::Object2VisibleList aSelectedPolylines;
- QString aSelectedStricklerType;
-
- if ( myIsEdit )
- {
- if ( isApplyAndClose() )
- myEditedObject = Handle(HYDROData_LandCover)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
- if ( !myEditedObject.IsNull() )
- {
- anObjectName = myEditedObject->GetName();
-
- HYDROData_SequenceOfObjects aRefPolylines = myEditedObject->GetPolylines();
- for ( int i = aRefPolylines.Lower(); i <= aRefPolylines.Upper(); i++ ) {
- Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast( aRefPolylines.Value( i ) );
- if ( !aPolyline.IsNull() ) {
- aSelectedPolylines.append( HYDROGUI_ListModel::Object2Visible( aPolyline, true ) );
- }
- }
- }
-
- aSelectedStricklerType = myEditedObject->GetStricklerType();
- }
-
- aPanel->setObjectName( anObjectName );
- // Construct a list of unique names of all Strickler types defined within the data model
- QStringList aStricklerTypes;
- HYDROData_Iterator anIterator( doc(), KIND_STRICKLER_TABLE );
- for( ; anIterator.More(); anIterator.Next() )
- {
- Handle(HYDROData_StricklerTable) aStricklerTableObj =
- Handle(HYDROData_StricklerTable)::DownCast( anIterator.Current() );
- if ( !aStricklerTableObj.IsNull() )
- {
- // Get Strickler table data from the data model
- QStringList aTypes = aStricklerTableObj->GetTypes();
- for ( QStringList::iterator it = aTypes.begin(); it != aTypes.end(); ++it )
- {
- QString aType = *it;
- if ( !aType.isEmpty() && !aStricklerTypes.contains( aType ) )
- aStricklerTypes.append( aType );
- }
- }
- }
-
- aStricklerTypes.sort();
- aPanel->setAdditionalParams( aStricklerTypes );
-
- aPanel->blockSignals( false );
-
- aPanel->includePolylines( aSelectedPolylines );
- aPanel->setSelectedAdditionalParamName( aSelectedStricklerType );
-}
-
-void HYDROGUI_LandCoverOp::abortOperation()
-{
- closePreview();
-
- HYDROGUI_Operation::abortOperation();
-}
-
-void HYDROGUI_LandCoverOp::commitOperation()
-{
- closePreview();
-
- HYDROGUI_Operation::commitOperation();
-}
-
-HYDROGUI_InputPanel* HYDROGUI_LandCoverOp::createInputPanel() const
-{
- HYDROGUI_LandCoverDlg* aPanel = new HYDROGUI_LandCoverDlg( module(), getName() );
- connect( aPanel, SIGNAL( CreatePreview( const QStringList& ) ),
- this, SLOT( onCreatePreview( const QStringList& ) ) );
- connect( aPanel, SIGNAL( addPolylines() ), SLOT( onAddPolylines() ) );
- connect( aPanel, SIGNAL( removePolylines() ), SLOT( onRemovePolylines() ) );
- return aPanel;
-}
-
-bool HYDROGUI_LandCoverOp::processApply( int& theUpdateFlags,
- QString& theErrorMsg,
- QStringList& theBrowseObjectsEntries )
-{
- HYDROGUI_LandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverDlg*>( inputPanel() );
- if ( !aPanel )
- return false;
-
- QString anObjectName = aPanel->getObjectName().simplified();
- if ( anObjectName.isEmpty() )
- {
- theErrorMsg = tr( "INCORRECT_OBJECT_NAME" );
- return false;
- }
-
- if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anObjectName ) )
- {
- // check that there are no other objects with the same name in the document
- Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( module(), anObjectName );
- if( !anObject.IsNull() )
- {
- theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( anObjectName );
- return false;
- }
- }
-
- HYDROData_SequenceOfObjects aZonePolylines;
- QString aStricklerType;
-
- QStringList aSelectedPolylineNames = aPanel->getPolylineNames();
- QStringList::const_iterator anIt = aSelectedPolylineNames.begin(), aLast = aSelectedPolylineNames.end();
- for( ; anIt!=aLast; anIt++ )
- {
- QString aPolylineName = *anIt;
- if ( !aPolylineName.isEmpty() )
- {
- aZonePolylines.Append( Handle(HYDROData_PolylineXY)::DownCast(
- HYDROGUI_Tool::FindObjectByName( module(), aPolylineName, KIND_POLYLINEXY ) ) );
- }
- }
-
- if ( aZonePolylines.IsEmpty() )
- {
- theErrorMsg = tr( "POLYLINES_NOT_DEFINED" );
- return false;
- }
-
- QString aSelectedStricklerType = aPanel->getSelectedAdditionalParamName();
-
- TCollection_AsciiString anError;
- if ( HYDROData_LandCover::buildShape( aZonePolylines, anError ).IsNull() )
- {
- if ( !anError.IsEmpty() ) {
- theErrorMsg = HYDROGUI_Tool::ToQString( anError );
- } else {
- theErrorMsg = tr( "LAND_COVER_OBJECT_CANNOT_BE_CREATED" );
- }
- return false;
- }
-
- Handle(HYDROData_LandCover) aZoneObj = myIsEdit ? myEditedObject :
- Handle(HYDROData_LandCover)::DownCast( doc()->CreateObject( KIND_LAND_COVER ) );
-
- aZoneObj->SetName( anObjectName );
-
- if ( !myIsEdit )
- {
- aZoneObj->SetFillingColor( aZoneObj->DefaultFillingColor() );
- aZoneObj->SetBorderColor( aZoneObj->DefaultBorderColor() );
- }
-
- aZoneObj->SetPolylines( aZonePolylines );
- aZoneObj->SetStricklerType( aSelectedStricklerType );
- aZoneObj->Update();
-
- closePreview();
-
- if( !myIsEdit )
- {
- module()->setObjectVisible( HYDROGUI_Tool::GetActiveOCCViewId( module() ), aZoneObj, true );
- QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aZoneObj );
- theBrowseObjectsEntries.append( anEntry );
- }
-
- module()->setIsToUpdate( aZoneObj );
- module()->getOCCDisplayer()->SetToUpdateColorScale();
-
- theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
-
- return true;
-}
-
-void HYDROGUI_LandCoverOp::onCreatePreview( const QStringList& thePolylineNames )
-{
- HYDROGUI_LandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- QApplication::setOverrideCursor( Qt::WaitCursor );
-
- HYDROData_SequenceOfObjects aZonePolylines;
- QStringList::const_iterator anIt = thePolylineNames.begin(), aLast = thePolylineNames.end();
- for( ; anIt!=aLast; anIt++ )
- {
- QString aPolylineName = *anIt;
- Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast(
- HYDROGUI_Tool::FindObjectByName( module(), aPolylineName, KIND_POLYLINEXY ) );
- if ( !aPolyline.IsNull() )
- aZonePolylines.Append( aPolyline );
- }
-
- TCollection_AsciiString anError;
- TopoDS_Shape aZoneShape = HYDROData_LandCover::buildShape( aZonePolylines, anError );
-
- LightApp_Application* anApp = module()->getApp();
- if ( !getPreviewManager() )
- setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>(
- anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
- OCCViewer_ViewManager* aViewManager = getPreviewManager();
- if ( aViewManager && !myPreviewPrs )
- {
- if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() )
- {
- Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
- if ( !aCtx.IsNull() )
- myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
- }
- }
-
- if ( aViewManager && myPreviewPrs )
- {
- QColor aFillingColor = Qt::magenta;
- QColor aBorderColor = Qt::transparent;
- if ( !myEditedObject.IsNull() ) {
- aFillingColor = myEditedObject->GetFillingColor();
- aBorderColor = myEditedObject->GetBorderColor();
- }
-
- myPreviewPrs->setFillingColor( aFillingColor, false, false );
- myPreviewPrs->setBorderColor( aBorderColor, false, false );
-
- if( !aZoneShape.IsNull() )
- myPreviewPrs->setShape( aZoneShape );
- }
-
- QApplication::restoreOverrideCursor();
-}
-
-void HYDROGUI_LandCoverOp::onAddPolylines()
-{
- HYDROGUI_LandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- // Add polylines selected in the module browser
- Handle(HYDROData_PolylineXY) aPolyXY;
- HYDROGUI_ListModel::Object2VisibleList aSelectedPolylines;
- HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( module() );
-
- if ( aSeq.IsEmpty() || !confirmPolylinesChange() )
- return;
-
- for( int anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ )
- {
- aPolyXY = Handle(HYDROData_PolylineXY)::DownCast( aSeq.Value( anIndex ));
- if (!aPolyXY.IsNull())
- aSelectedPolylines.append( HYDROGUI_ListModel::Object2Visible( aPolyXY, true ) );
- }
-
- if ( aPanel->includePolylines( aSelectedPolylines ) )
- {
- closePreview();
- onCreatePreview( aPanel->getPolylineNames() );
- }
-}
-
-void HYDROGUI_LandCoverOp::onRemovePolylines()
-{
- // Remove selected polylines from the calculation case
- HYDROGUI_LandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverDlg*>( inputPanel() );
- if ( !aPanel )
- return;
-
- QStringList aSelectedList = aPanel->getSelectedPolylineNames();
- if ( aSelectedList.isEmpty() || !confirmPolylinesChange() )
- return;
-
- HYDROGUI_ListModel::Object2VisibleList aSelectedPolylines;
- for (int i = 0; i < aSelectedList.length(); i++)
- {
- Handle(HYDROData_PolylineXY) anObject = Handle(HYDROData_PolylineXY)::DownCast(
- HYDROGUI_Tool::FindObjectByName( module(), aSelectedList.at(i) ) );
- if ( anObject.IsNull() )
- continue;
-
- aSelectedPolylines.append( HYDROGUI_ListModel::Object2Visible( anObject, true ) );
- }
-
- module()->update( UF_OCCViewer );
-
- if ( aPanel->excludePolylines( aSelectedPolylines ) )
- {
- closePreview();
- onCreatePreview( aPanel->getPolylineNames() );
- }
-}
-
-void HYDROGUI_LandCoverOp::closePreview()
-{
- if( myPreviewPrs )
- {
- delete myPreviewPrs;
- myPreviewPrs = 0;
- }
-}
-
-bool HYDROGUI_LandCoverOp::confirmPolylinesChange() const
-{
- if ( myEditedObject.IsNull() )
- return true;
-
- // Check if the land cover object is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d );
- if ( !isConfirmed )
- {
- // If not modified check if the land cover has already defined polylines
- HYDROData_SequenceOfObjects aSeq = myEditedObject->GetPolylines();
- if ( aSeq.Length() > 0 )
- {
- // If there are already defined polylines then ask a user to confirm land cover recalculation
- isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
- tr( "POLYLINES_CHANGED" ),
- tr( "CONFIRM_LAND_COVER_RECALCULATION" ),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::No ) == QMessageBox::Yes );
- }
- else
- {
- isConfirmed = true; // No polylines - nothing to recalculate
- }
- }
- return isConfirmed;
-}
+++ /dev/null
-// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef HYDROGUI_LANDCOVEROP_H
-#define HYDROGUI_LANDCOVEROP_H
-
-#include "HYDROGUI_Operation.h"
-
-#include <HYDROData_LandCover.h>
-
-class HYDROGUI_Shape;
-
-class HYDROGUI_LandCoverOp : public HYDROGUI_Operation
-{
- Q_OBJECT
-
-public:
- HYDROGUI_LandCoverOp( HYDROGUI_Module* theModule, const bool theIsEdit );
- virtual ~HYDROGUI_LandCoverOp();
-
-protected:
- virtual void startOperation();
- virtual void abortOperation();
- virtual void commitOperation();
-
- virtual HYDROGUI_InputPanel* createInputPanel() const;
-
- virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
- QStringList& theBrowseObjectsEntries );
-
- virtual HYDROGUI_Shape* getPreviewShape() const { return myPreviewPrs; };
-
-protected slots:
- void onCreatePreview( const QStringList& thePolylineNames );
- void onAddPolylines();
- void onRemovePolylines();
-
-private:
- void closePreview();
- bool confirmPolylinesChange() const;
-
-private:
- bool myIsEdit;
- Handle(HYDROData_LandCover) myEditedObject;
-
- HYDROGUI_Shape* myPreviewPrs;
-};
-
-#endif
bool anIsZone = false;
bool anIsObstacle = false;
bool anIsStricklerTable = false;
- bool anIsLandCover = false;
+ bool anIsLandCoverMap = false;
bool anIsStream = false;
bool anIsChannel = false;
bool anIsDigue = false;
anIsObstacle = true;
else if( anObjectKind == KIND_STRICKLER_TABLE )
anIsStricklerTable = true;
- else if( anObjectKind == KIND_LAND_COVER )
- anIsLandCover = true;
+ else if( anObjectKind == KIND_LAND_COVER_MAP )
+ anIsLandCoverMap = true;
else if( anObjectKind == KIND_STREAM )
{
anIsStream = true;
case KIND_STRICKLER_TABLE:
theMenu->addAction( action( ImportStricklerTableFromFileId ) );
break;
- case KIND_LAND_COVER:
- theMenu->addAction( action( CreateLandCoverId ) );
- theMenu->addAction( action( ImportLandCoverId ) );
+ case KIND_LAND_COVER_MAP:
+ theMenu->addAction( action( CreateLandCoverMapId ) );
+ theMenu->addAction( action( ImportLandCoverMapId ) );
break;
case KIND_CALCULATION:
theMenu->addAction( action( CreateCalculationId ) );
HYDROGUI_DataObject::dataObjectEntry( getLandCoverColoringTable( anActiveViewId ) );
bool isUsed = aCurrentTable == HYDROGUI_DataObject::dataObjectEntry( aTable );
- if ( !isUsed && !getObjectShapes( anActiveViewId, KIND_LAND_COVER ).isEmpty() ) {
+ if ( !isUsed && !getObjectShapes( anActiveViewId, KIND_LAND_COVER_MAP ).isEmpty() ) {
theMenu->addAction( action( LandCoverScalarMapModeOnId ) );
theMenu->addSeparator();
}
}
- else if( anIsLandCover )
+ else if( anIsLandCoverMap )
{
- theMenu->addAction( action( EditLandCoverId ) );
+ theMenu->addAction( action( AddLandCoverId ) );
+ theMenu->addAction( action( RemoveLandCoverId ) );
+ theMenu->addSeparator();
+ theMenu->addAction( action( SplitLandCoverId ) );
+ theMenu->addAction( action( MergeLandCoverId ) );
theMenu->addSeparator();
}
else if( anIsVisualState && anIsObjectBrowser )
}
bool anIsPoly = anIsPolyline || anIsPolyline3D;
- if ((anIsPoly && !anIsLandCover) || (!anIsPoly && anIsLandCover))
+ if ((anIsPoly && !anIsLandCoverMap) || (!anIsPoly && anIsLandCoverMap))
theMenu->addAction( action( ExportToShapeFileID ) );
// Add copy action
anIsImmersibleZone || anIsZone || anIsRegion ||
anIsBathymetry || anIsObstacle || anIsStream ||
anIsChannel || anIsDigue || anIsDummyObject3D ||
- anIsValidProfile || anIsGroup || anIsLandCover )
+ anIsValidProfile || anIsGroup || anIsLandCoverMap )
{
if( anIsHiddenInSelection )
theMenu->addAction( action( ShowId ) );
if ( theObject->GetKind() == KIND_BATHYMETRY && theState ) {
setLandCoversScalarMapModeOff( theViewId );
- } else if ( theObject->GetKind() == KIND_LAND_COVER && theState ) {
+ } else if ( theObject->GetKind() == KIND_LAND_COVER_MAP && theState ) {
getOCCDisplayer()->SetToUpdateColorScale();
}
}
#include "HYDROGUI_Tool.h"
#include <HYDROGUI_ShapeImage.h>
#include <HYDROGUI_ShapeBathymetry.h>
-#include <HYDROGUI_ShapeLandCover.h>
+// TODO
+//#include <HYDROGUI_ShapeLandCoverMap.h>
#include "HYDROGUI_Operation.h"
#include "HYDROGUI_DataObject.h"
#include "HYDROGUI_ZLayers.h"
#include <HYDROData_Bathymetry.h>
-#include <HYDROData_LandCover.h>
+#include <HYDROData_LandCoverMap.h>
#include <HYDROData_StricklerTable.h>
#include <AIS_InteractiveContext.hxx>
aResShape = new HYDROGUI_ShapeImage( theContext, Handle_HYDROData_Image::DownCast( theObject ) );
else if( theObject->IsKind( STANDARD_TYPE( HYDROData_Bathymetry ) ) )
aResShape = new HYDROGUI_ShapeBathymetry( this, theContext, Handle_HYDROData_Bathymetry::DownCast( theObject ) );
- else if( theObject->IsKind( STANDARD_TYPE( HYDROData_LandCover ) ) ) {
+ else if( theObject->IsKind( STANDARD_TYPE( HYDROData_LandCoverMap ) ) ) {
bool isScalarMode = module()->isLandCoversScalarMapModeOn( theViewerId );
- aResShape = new HYDROGUI_ShapeLandCover( this, theContext, Handle_HYDROData_LandCover::DownCast( theObject ), -1, isScalarMode );
+ /* TODO
+ aResShape = new HYDROGUI_ShapeLandCover( this, theContext, Handle_HYDROData_LandCoverMap::DownCast( theObject ), -1, isScalarMode );
+ */
}
else
aResShape = new HYDROGUI_Shape( theContext, theObject );
int aViewerId = (size_t)theViewer;//TODO: check if viewer id is correct
bool isLandCoverColoringOn = module()->isLandCoversScalarMapModeOn( aViewerId );
- QList<HYDROGUI_Shape*> aLandCoverShapes = module()->getObjectShapes( aViewerId, KIND_LAND_COVER );
+ QList<HYDROGUI_Shape*> aLandCoverShapes = module()->getObjectShapes( aViewerId, KIND_LAND_COVER_MAP );
QList<HYDROGUI_Shape*> aBathShapes = module()->getObjectShapes( aViewerId, KIND_BATHYMETRY );
bool isDisplayColorScale = !aBathShapes.empty() || isLandCoverColoringOn;
aView->ColorScaleErase();
}
+ /* TODO
foreach( HYDROGUI_Shape* aShape, aLandCoverShapes ) {
HYDROGUI_ShapeLandCover* aLandCoverShape =
dynamic_cast<HYDROGUI_ShapeLandCover*>( aShape );
continue;
}
+ QColor aColor;
Handle(HYDROData_LandCover) aLandCover =
Handle(HYDROData_LandCover)::DownCast( aLandCoverShape->getObject() );
aShapeColor.Blue() * 255 );
}
}
- }
+ }
aLandCoverShape->setFillingColor( aColor, true, true );
aLandCoverShape->setScalarMapModeEnabled( isLandCoverColoringOn );
theViewer->getAISContext()->Redisplay( aLandCoverShape->getAISObject() );
}
+ */
myToUpdateColorScale = false;
}
#include "HYDROGUI_SubmersibleOp.h"
#include "HYDROGUI_StricklerTableOp.h"
#include "HYDROGUI_DuplicateOp.h"
-#include "HYDROGUI_LandCoverOp.h"
+// TODO
+//#include "HYDROGUI_LandCoverMapOp.h"
#include "HYDROGUI_PolylineExtractionOp.h"
#include "HYDROGUI_ExportSinusXOp.h"
#include "HYDROGUI_MergePolylinesOp.h"
#include "HYDROGUI_SplitPolylinesOp.h"
#include "HYDROGUI_LandCoverColoringOp.h"
-#include "HYDROGUI_ImportLandCoverOp.h"
+// TODO
+//#include "HYDROGUI_ImportLandCoverMapOp.h"
#include <HYDROData_Document.h>
#include <HYDROData_Obstacle.h>
createAction( ImportPolylineId, "IMPORT_POLYLINE", "IMPORT_POLYLINE_ICO" );
createAction( ImportSinusXId, "IMPORT_SINUSX", "IMPORT_SINUSX_ICO" );
createAction( ExportSinusXId, "EXPORT_SINUSX", "EXPORT_SINUSX_ICO" );
- createAction( ImportLandCoverId, "IMPORT_LANDCOVER", "IMPORT_LANDCOVER_ICO" );
+ createAction( ImportLandCoverMapId, "IMPORT_LANDCOVER_MAP", "IMPORT_LANDCOVER_MAP_ICO" );
createAction( CreatePolylineId, "CREATE_POLYLINE", "CREATE_POLYLINE_ICO" );
createAction( EditPolylineId, "EDIT_POLYLINE", "EDIT_POLYLINE_ICO" );
createAction( EditStricklerTableId, "EDIT_STRICKLER_TABLE", "EDIT_STRICKLER_TABLE_ICO" );
createAction( DuplicateStricklerTableId, "DUPLICATE_STRICKLER_TABLE", "DUPLICATE_STRICKLER_TABLE_ICO" );
- createAction( CreateLandCoverId, "CREATE_LAND_COVER", "CREATE_LAND_COVER_ICO" );
- createAction( EditLandCoverId, "EDIT_LAND_COVER", "EDIT_LAND_COVER_ICO" );
+ createAction( CreateLandCoverMapId, "CREATE_LAND_COVER_MAP", "CREATE_LAND_COVER_MAP_ICO" );
+
+ createAction( AddLandCoverId, "ADD_LAND_COVER", "ADD_LAND_COVER_ICO" );
+ createAction( RemoveLandCoverId, "REMOVE_LAND_COVER", "REMOVE_LAND_COVER_ICO" );
+ createAction( SplitLandCoverId, "SPLIT_LAND_COVER", "SPLIT_LAND_COVER_ICO" );
+ createAction( MergeLandCoverId, "MERGE_LAND_COVER", "MERGE_LAND_COVER_ICO" );
createAction( ImportObstacleFromFileId, "IMPORT_OBSTACLE_FROM_FILE", "IMPORT_OBSTACLE_FROM_FILE_ICO" );
createAction( ImportGeomObjectAsObstacleId, "IMPORT_GEOM_OBJECT_AS_OBSTACLE", "IMPORT_GEOM_OBJECT_ICO" );
int aHydroId = createMenu( tr( "MEN_DESK_HYDRO" ), -1, -1, aHydroMenu );
createMenu( ImportSinusXId, aHydroId, -1, -1 );
createMenu( ExportSinusXId, aHydroId, -1, -1 );
- createMenu( ImportLandCoverId, aHydroId, -1, -1 );
+ createMenu( ImportLandCoverMapId, aHydroId, -1, -1 );
createMenu( ImportBathymetryId, aHydroId, -1, -1 );
createMenu( ImportStricklerTableFromFileId, aHydroId, -1, -1 );
createMenu( CreateImmersibleZoneId, aHydroId, -1, -1 );
createMenu( CreateChannelId, aHydroId, -1, -1 );
createMenu( CreateDigueId, aHydroId, -1, -1 );
- createMenu( CreateLandCoverId, aHydroId, -1, -1 );
+ createMenu( CreateLandCoverMapId, aHydroId, -1, -1 );
int aNewImageId = createMenu( tr( "MEN_DESK_IMAGE" ), aHydroId, -1 );
createMenu( ImportImageId, aNewImageId, -1, -1 );
createTool( ImportPolylineId, aToolBar );
createTool( ImportSinusXId, aToolBar );
createTool( ExportSinusXId, aToolBar );
- createTool( ImportLandCoverId, aToolBar );
+ createTool( ImportLandCoverMapId, aToolBar );
createTool( ImportBathymetryId, aToolBar );
createTool( CreatePolylineId, aToolBar );
createTool( ImportStricklerTableFromFileId, aToolBar );
createTool( separator(), aToolBar );
- createTool( CreateLandCoverId, aToolBar );
+ createTool( CreateLandCoverMapId, aToolBar );
createTool( separator(), aToolBar );
createTool( CreateCalculationId, aToolBar );
case ExportToShapeFileID:
anOp = new HYDROGUI_ExportFileOp( aModule );
break;
- case ImportLandCoverId:
- anOp = new HYDROGUI_ImportLandCoverOp( aModule );
+ case ImportLandCoverMapId:
+ // TODO
+ //anOp = new HYDROGUI_ImportLandCoverMapOp( aModule );
break;
case RemoveImageRefsId:
anOp = new HYDROGUI_RemoveImageRefsOp( aModule );
case EditStricklerTableId:
anOp = new HYDROGUI_StricklerTableOp( aModule, theId );
break;
- case CreateLandCoverId:
- case EditLandCoverId:
- anOp = new HYDROGUI_LandCoverOp( aModule, theId == EditLandCoverId );
+ case CreateLandCoverMapId:
+ // TODO
+ //anOp = new HYDROGUI_LandCoverMapOp( aModule, theId == EditLandCoverMapId );
+ break;
+ case AddLandCoverId:
+ // TODO
+ break;
+ case RemoveLandCoverId:
+ // TODO
+ break;
+ case SplitLandCoverId:
+ // TODO
+ break;
+ case MergeLandCoverId:
+ // TODO
break;
case DuplicateStricklerTableId:
anOp = new HYDROGUI_DuplicateOp( aModule );
ExportSinusXId,
ExportToShapeFileID,
- ImportLandCoverId,
+ ImportLandCoverMapId,
ImportStricklerTableFromFileId,
ExportStricklerTableFromFileId,
EditStricklerTableId,
DuplicateStricklerTableId,
- CreateLandCoverId,
- EditLandCoverId,
+ CreateLandCoverMapId,
+
+ AddLandCoverId,
+ RemoveLandCoverId,
+ SplitLandCoverId,
+ MergeLandCoverId,
PolylineExtractionId,
SplitPolylinesId,
#include "HYDROGUI_PriorityTableModel.h"
-#include <HYDROData_LandCover.h>
#include <HYDROGUI_DataObject.h>
/**
break;
case 3:
{
- if ( getObjectsKind() != KIND_LAND_COVER )
+ if ( getObjectsKind() != KIND_LAND_COVER_MAP )
aData = tr( "BATHYMETRY" );
}
break;
#include <HYDROData_Object.h>
#include <HYDROData_IPolyline.h>
-#include <HYDROData_LandCover.h>
+#include <HYDROData_LandCoverMap.h>
#include <LightApp_Application.h>
#include <LightApp_UpdateFlags.h>
return false;
bool isCanBeColored = false;
- if ( theObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) ) ) {
+ if ( theObject->IsKind( STANDARD_TYPE(HYDROData_LandCoverMap) ) ) {
size_t anActiveViewId = HYDROGUI_Tool::GetActiveOCCViewId( theModule );
isCanBeColored = !theModule->isLandCoversScalarMapModeOn( anActiveViewId );
}
anIsOneColor = true;
}
- else if ( myEditedObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) ) )
+ else if ( myEditedObject->IsKind( STANDARD_TYPE(HYDROData_LandCoverMap) ) )
{
- Handle(HYDROData_LandCover) aLandCover =
- Handle(HYDROData_LandCover)::DownCast( myEditedObject );
+ Handle(HYDROData_LandCoverMap) aLandCoverMap =
+ Handle(HYDROData_LandCoverMap)::DownCast( myEditedObject );
- aFirstColor = aLandCover->GetFillingColor();
- aSecondColor = aLandCover->GetBorderColor();
+ /* TODO
+ aFirstColor = aLandCoverMap->GetFillingColor();
+ aSecondColor = aLandCoverMap->GetBorderColor();
+ */
}
// Create color dialog
aPolyObject->SetWireColor( aFirstColor );
}
- else if ( myEditedObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) ) )
+ else if ( myEditedObject->IsKind( STANDARD_TYPE(HYDROData_LandCoverMap) ) )
{
- Handle(HYDROData_LandCover) aLandCover =
- Handle(HYDROData_LandCover)::DownCast( myEditedObject );
+ Handle(HYDROData_LandCoverMap) aLandCoverMap =
+ Handle(HYDROData_LandCoverMap)::DownCast( myEditedObject );
- aLandCover->SetFillingColor( aFirstColor );
- aLandCover->SetBorderColor( aSecondColor );
+ /* TODO
+ aLandCoverMap->SetFillingColor( aFirstColor );
+ aLandCoverMap->SetBorderColor( aSecondColor );
+ */
}
module()->setIsToUpdate( myEditedObject );
#include <HYDROData_ShapesGroup.h>
#include <HYDROData_Stream.h>
#include <HYDROData_Zone.h>
-#include <HYDROData_LandCover.h>
#include <AIS_Shape.hxx>
#include <BRep_Builder.hxx>
+++ /dev/null
-// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "HYDROGUI_ShapeLandCover.h"
-#include "HYDROGUI_OCCDisplayer.h"
-
-#include <HYDROData_LandCover.h>
-
-#include <AIS_InteractiveContext.hxx>
-
-HYDROGUI_ShapeLandCover::HYDROGUI_ShapeLandCover( HYDROGUI_OCCDisplayer* theDisplayer,
- const Handle(AIS_InteractiveContext)& theContext,
- const Handle_HYDROData_LandCover& theLandCover,
- const int theZLayer,
- const bool theIsScalarMode )
-: HYDROGUI_Shape( theContext, theLandCover, theZLayer ),
- myDisplayer( theDisplayer ),
- myIsScalarMapMode( theIsScalarMode )
-{
-}
-
-HYDROGUI_ShapeLandCover::~HYDROGUI_ShapeLandCover()
-{
-}
-
-void HYDROGUI_ShapeLandCover::update( bool theIsUpdateViewer, bool isDeactivateSelection )
-{
- setIsToUpdate( false );
-
- Handle(HYDROData_LandCover) aLandCoverObj =
- Handle(HYDROData_LandCover)::DownCast( getObject() );
-
- TopoDS_Shape aLandCoverShape = aLandCoverObj->GetShape();
- if ( !aLandCoverShape.IsNull() ) {
- setShape( aLandCoverShape, false, false );
- }
-
- if ( !myIsScalarMapMode ) {
- QColor aFillingColor = aLandCoverObj->GetFillingColor();
- QColor aBorderColor = aLandCoverObj->GetBorderColor();
-
- setFillingColor( aFillingColor, false, false );
- setBorderColor( aBorderColor, false, false );
- } else {
- updateShape( false, false );
- }
-
- HYDROGUI_Shape::update( theIsUpdateViewer, isDeactivateSelection );
-}
-
-void HYDROGUI_ShapeLandCover::setScalarMapModeEnabled( const bool theIsToEnable )
-{
- myIsScalarMapMode = theIsToEnable;
-}
-
-void HYDROGUI_ShapeLandCover::setVisible( const bool theState,
- const bool theIsUpdateViewer )
-{
- HYDROGUI_Shape::setVisible( theState, theIsUpdateViewer );
- myDisplayer->SetToUpdateColorScale();
-}
-
-void HYDROGUI_ShapeLandCover::displayShape( const bool theIsUpdateViewer )
-{
- HYDROGUI_Shape::displayShape( theIsUpdateViewer );
- myDisplayer->SetToUpdateColorScale();
-}
-
-void HYDROGUI_ShapeLandCover::display( const bool theIsUpdateViewer )
-{
- HYDROGUI_Shape::display( theIsUpdateViewer );
- myDisplayer->SetToUpdateColorScale();
-}
-
-void HYDROGUI_ShapeLandCover::erase( const bool theIsUpdateViewer )
-{
- HYDROGUI_Shape::erase( theIsUpdateViewer );
- myDisplayer->SetToUpdateColorScale();
-}
+++ /dev/null
-// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef HYDROGUI_SHAPE_LANDCOVER_H
-#define HYDROGUI_SHAPE_LANDCOVER_H
-
-#include <HYDROGUI_Shape.h>
-
-class HYDROGUI_OCCDisplayer;
-
-class HYDROGUI_ShapeLandCover : public HYDROGUI_Shape
-{
-public:
- HYDROGUI_ShapeLandCover( HYDROGUI_OCCDisplayer* theDisplayer,
- const Handle(AIS_InteractiveContext)& theContext,
- const Handle_HYDROData_LandCover& theLandCover,
- const int theZLayer = -1,
- const bool theIsScalarMode = false );
- virtual ~HYDROGUI_ShapeLandCover();
-
- virtual void update( bool isUpdateViewer,
- bool isDeactivateSelection );
-
- virtual void display( const bool theIsUpdateViewer = true );
- virtual void erase( const bool theIsUpdateViewer = true );
-
- virtual void setVisible( const bool theState,
- const bool theIsUpdateViewer = true );
-
- /**
- * Enable/disable scalar map coloring mode.
- * @param theIsToEnable if true - scalar map coloring mode willbe enbaled, if false - disabled
- */
- virtual void setScalarMapModeEnabled( const bool theIsToEnable );
-
-protected:
- virtual void displayShape( const bool theIsUpdateViewer );
-
-private:
- HYDROGUI_OCCDisplayer* myDisplayer;
- bool myIsScalarMapMode;
-};
-
-#endif
#include <HYDROData_Zone.h>
#include <HYDROData_Object.h>
#include <HYDROData_IAltitudeObject.h>
-#include <HYDROData_LandCover.h>
#include <SUIT_DataObject.h>
#include <QSet>
}
}
}
- else
- {
- Handle(HYDROData_LandCover) aRefLandCoverObj =
- Handle(HYDROData_LandCover)::DownCast( anIter.Value() );
- if ( !aRefLandCoverObj.IsNull() )
- {
- // Get name of land cover object
- aName = aRefLandCoverObj->GetName();
- if ( !isMergingNeed )
- {
- // Get the first land cover object's altitude name and go out
- aRes = aName;
- break;
- }
- }
- }
if ( !aName.isEmpty() && !aNamesSet.contains( aName ) )
{
{
// Get altitude object
aMergeObject = aRefGeomObj->GetAltitudeObject();
- } else {
- aMergeObject = Handle(HYDROData_LandCover)::DownCast( anIter.Value() );
}
if ( !aMergeObject.IsNull() && theMergeObjectName == aMergeObject->GetName() )
</message>
<message>
- <source>CREATE_LAND_COVER_ICO</source>
+ <source>CREATE_LAND_COVER_MAP_ICO</source>
<translation>icon_create_land_cover.png</translation>
</message>
<message>
- <source>EDIT_LAND_COVER_ICO</source>
+ <source>ADD_LAND_COVER_ICO</source>
<translation>icon_edit_land_cover.png</translation>
</message>
+ <message>
+ <source>REMOVE_LAND_COVER_ICO</source>
+ <translation>icon_remove_land_cover.png</translation>
+ </message>
+ <message>
+ <source>SPLIT_LAND_COVER_ICO</source>
+ <translation>icon_split_land_cover.png</translation>
+ </message>
+ <message>
+ <source>MERGE_LAND_COVER_ICO</source>
+ <translation>icon_merge_land_cover.png</translation>
+ </message>
<message>
<source>IMPORT_OBSTACLE_FROM_FILE_ICO</source>
</message>
<message>
- <source>IMPORT_LANDCOVER_ICO</source>
+ <source>IMPORT_LANDCOVER_MAP_ICO</source>
<translation>icon_import_polygon.png</translation>
</message>
<translation>Duplicate Strickler table</translation>
</message>
<message>
- <source>DSK_CREATE_LAND_COVER</source>
- <translation>Create land cover</translation>
+ <source>DSK_CREATE_LAND_COVER_MAP</source>
+ <translation>Create land cover map</translation>
</message>
<message>
- <source>DSK_EDIT_LAND_COVER</source>
- <translation>Edit land cover</translation>
+ <source>DSK_ADD_LAND_COVER</source>
+ <translation>Add land cover</translation>
+ </message>
+ <message>
+ <source>DSK_REMOVE_LAND_COVER</source>
+ <translation>Remove land cover</translation>
+ </message>
+ <message>
+ <source>DSK_SPLIT_LAND_COVER</source>
+ <translation>Split land cover(s)</translation>
+ </message>
+ <message>
+ <source>DSK_MERGE_LAND_COVER</source>
+ <translation>Merge land covers</translation>
</message>
<message>
<source>DSK_COPY</source>
<translation>Import polyline from file(s)</translation>
</message>
<message>
- <source>DSK_IMPORT_LANDCOVER</source>
- <translation>Import land cover from file(s)</translation>
+ <source>DSK_IMPORT_LANDCOVER_MAP</source>
+ <translation>Import land cover map from file(s)</translation>
</message>
<message>
<source>DSK_IMPORT_SINUSX</source>
<translation>Duplicate Strickler table</translation>
</message>
<message>
- <source>MEN_CREATE_LAND_COVER</source>
- <translation>Create land cover</translation>
+ <source>MEN_CREATE_LAND_COVER_MAP</source>
+ <translation>Create land cover map</translation>
</message>
<message>
- <source>MEN_EDIT_LAND_COVER</source>
- <translation>Edit land cover</translation>
+ <source>MEN_ADD_LAND_COVER</source>
+ <translation>Add land cover</translation>
+ </message>
+ <message>
+ <source>MEN_REMOVE_LAND_COVER</source>
+ <translation>Remove land cover</translation>
+ </message>
+ <message>
+ <source>MEN_SPLIT_LAND_COVER</source>
+ <translation>Split land cover(s)</translation>
+ </message>
+ <message>
+ <source>MEN_MERGE_LAND_COVER</source>
+ <translation>Merge land covers</translation>
</message>
<message>
<source>MEN_CUT_IMAGES</source>
<translation>Import polyline</translation>
</message>
<message>
- <source>MEN_IMPORT_LANDCOVER</source>
- <translation>Import land cover from file(s)</translation>
+ <source>MEN_IMPORT_LANDCOVER_MAP</source>
+ <translation>Import land cover map from file(s)</translation>
</message>
<message>
<source>MEN_IMPORT_SINUSX</source>
<translation>Duplicate Strickler table</translation>
</message>
<message>
- <source>STB_CREATE_LAND_COVER</source>
- <translation>Create land cover</translation>
+ <source>STB_CREATE_LAND_COVER_MAP</source>
+ <translation>Create land cover map</translation>
</message>
<message>
- <source>STB_EDIT_LAND_COVER</source>
- <translation>Edit land cover</translation>
+ <source>STB_ADD_LAND_COVER</source>
+ <translation>Add land cover</translation>
+ </message>
+ <message>
+ <source>STB_REMOVE_LAND_COVER</source>
+ <translation>Remove land cover</translation>
+ </message>
+ <message>
+ <source>STB_SPLIT_LAND_COVER</source>
+ <translation>Split land cover(s)</translation>
+ </message>
+ <message>
+ <source>STB_MERGE_LAND_COVER</source>
+ <translation>Merge land covers</translation>
</message>
<message>
<source>STB_COPY</source>
<translation>Import polyline</translation>
</message>
<message>
- <source>STB_IMPORT_LANDCOVER</source>
- <translation>Import land cover from file(s)</translation>
+ <source>STB_IMPORT_LANDCOVER_MAP</source>
+ <translation>Import land cover map from file(s)</translation>
</message>
<message>
<source>STB_IMPORT_SINUSX</source>