HYDROData_Stream.h
HYDROData_StreamAltitude.h
HYDROData_StricklerTable.h
+ HYDROData_LandCover.h
HYDROData_Tool.h
HYDROData_Transform.h
HYDROData_VisualState.h
HYDROData_Stream.cxx
HYDROData_StreamAltitude.cxx
HYDROData_StricklerTable.cxx
+ HYDROData_LandCover.cxx
HYDROData_Tool.cxx
HYDROData_Transform.cxx
HYDROData_VisualState.cxx
case KIND_SPLITTED_GROUP: return "KIND_SPLITTED_GROUP";
case KIND_STREAM_ALTITUDE: return "KIND_STREAM_ALTITUDE";
case KIND_OBSTACLE_ALTITUDE: return "KIND_OBSTACLE_ALTITUDE";
- case KIND_STRICKLER_TABLE: return "KIND_STRICKLER_TABLE";
+ case KIND_STRICKLER_TABLE: return "KIND_STRICKLER_TABLE";
+ case KIND_LAND_COVER: return "KIND_LAND_COVER";
default: return "KIND_UNKNOWN"; ///! Unrecognized object
}
}
const ObjectKind KIND_STREAM_ALTITUDE = 24;
const ObjectKind KIND_OBSTACLE_ALTITUDE = 25;
const ObjectKind KIND_STRICKLER_TABLE = 26;
-const ObjectKind KIND_LAST = KIND_STRICKLER_TABLE;
+const ObjectKind KIND_LAND_COVER = 27;
+const ObjectKind KIND_LAST = KIND_LAND_COVER;
DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared)
#include "HYDROData_StreamAltitude.h"
#include "HYDROData_Zone.h"
#include "HYDROData_StricklerTable.h"
+#include "HYDROData_LandCover.h"
#include <TDataStd_Name.hxx>
#include <TDataStd_NamedData.hxx>
case KIND_SPLITTED_GROUP: aResult = new HYDROData_SplittedShapesGroup(); break;
case KIND_STREAM_ALTITUDE: aResult = new HYDROData_StreamAltitude(); break;
case KIND_OBSTACLE_ALTITUDE: aResult = new HYDROData_ObstacleAltitude(); break;
- case KIND_STRICKLER_TABLE: aResult = new HYDROData_StricklerTable(); break;
+ case KIND_STRICKLER_TABLE: aResult = new HYDROData_StricklerTable(); break;
+ case KIND_LAND_COVER: aResult = new HYDROData_LandCover(); break;
default: break;
}
--- /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 "HYDROData_LandCover.h"
+
+IMPLEMENT_STANDARD_HANDLE( HYDROData_LandCover, HYDROData_Entity )
+IMPLEMENT_STANDARD_RTTIEXT( HYDROData_LandCover, HYDROData_Entity )
+
+HYDROData_LandCover::HYDROData_LandCover()
+{
+}
+
+
+HYDROData_LandCover::~HYDROData_LandCover()
+{
+}
+
+const ObjectKind HYDROData_LandCover::GetKind() const
+{
+ return KIND_LAND_COVER;
+}
--- /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 HYDROData_LANDCOVER_HeaderFile
+#define HYDROData_LANDCOVER_HeaderFile
+
+#include <HYDROData_Entity.h>
+
+DEFINE_STANDARD_HANDLE( HYDROData_LandCover, HYDROData_Entity )
+
+class HYDROData_LandCover : public HYDROData_Entity
+{
+protected:
+ friend class HYDROData_Iterator;
+
+ enum DataTag
+ {
+ DataTag_Table = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
+ };
+
+ HYDRODATA_EXPORT HYDROData_LandCover();
+ HYDRODATA_EXPORT ~HYDROData_LandCover();
+
+public:
+ DEFINE_STANDARD_RTTI( HYDROData_LandCover );
+
+ HYDRODATA_EXPORT virtual const ObjectKind GetKind() const;
+};
+
+#endif
HYDROGUI_ExportImageOp.h
HYDROGUI_GVSelector.h
HYDROGUI_ImagePrs.h
+ HYDROGUI_BasicZoneDlg.h
HYDROGUI_ImmersibleZoneDlg.h
HYDROGUI_ImmersibleZoneOp.h
HYDROGUI_ImportBathymetryDlg.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_ExportImageOp.cxx
HYDROGUI_GVSelector.cxx
HYDROGUI_ImagePrs.cxx
+ HYDROGUI_BasicZoneDlg.cxx
HYDROGUI_ImmersibleZoneDlg.cxx
HYDROGUI_ImmersibleZoneOp.cxx
HYDROGUI_ImportBathymetryDlg.cxx
HYDROGUI_LineEditDoubleValidator.cxx
HYDROGUI_StricklerTableDlg.cxx
HYDROGUI_StricklerTableOp.cxx
+ HYDROGUI_LandCoverDlg.cxx
+ HYDROGUI_LandCoverOp.cxx
HYDROGUI_SubmersibleOp.cxx
HYDROGUI_Tool.cxx
HYDROGUI_TwoImagesDlg.cxx
--- /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_BasicZoneDlg.h"
+
+#include <QComboBox>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLayout>
+#include <QLineEdit>
+
+HYDROGUI_BasicZoneDlg::HYDROGUI_BasicZoneDlg( HYDROGUI_Module* theModule, const QString& theTitle,
+ const QString& theLabel1, const QString& theLabel2,
+ const QString& theLabel3, const QString& theLabel4 )
+: HYDROGUI_InputPanel( theModule, theTitle )
+{
+ // Zone name
+ myObjectNameGroup = new QGroupBox( theLabel1, mainFrame() );
+
+ myObjectName = new QLineEdit( myObjectNameGroup );
+
+ QBoxLayout* aNameLayout = new QHBoxLayout( myObjectNameGroup );
+ aNameLayout->setMargin( 5 );
+ aNameLayout->setSpacing( 5 );
+ aNameLayout->addWidget( new QLabel( theLabel2, myObjectNameGroup ) );
+ aNameLayout->addWidget( myObjectName );
+
+ // Main parameters: group-box and frame
+ myParamGroup = new QGroupBox( theLabel3, mainFrame() );
+
+ myPolylineFrame = new QFrame( myParamGroup );
+
+ // Additional parameter defined with help of combo-box control
+ myAdditionalParamsGroup = new QGroupBox( theLabel4, mainFrame() );
+
+ myAdditionalParams = new QComboBox( myPolylineFrame );
+ myAdditionalParams->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ QBoxLayout* aBathLayout = new QHBoxLayout( myAdditionalParamsGroup );
+ aBathLayout->setMargin( 5 );
+ aBathLayout->setSpacing( 5 );
+ aBathLayout->addWidget( myAdditionalParams );
+
+ // Common
+ addWidget( myObjectNameGroup );
+ addWidget( myParamGroup );
+ addWidget( myAdditionalParamsGroup );
+
+ addStretch();
+}
+
+HYDROGUI_BasicZoneDlg::~HYDROGUI_BasicZoneDlg()
+{
+}
+
+void HYDROGUI_BasicZoneDlg::reset()
+{
+ myObjectName->clear();
+ myAdditionalParams->clear();
+}
+
+void HYDROGUI_BasicZoneDlg::setObjectName( const QString& theName )
+{
+ myObjectName->setText( theName );
+}
+
+QString HYDROGUI_BasicZoneDlg::getObjectName() const
+{
+ return myObjectName->text();
+}
+
+void HYDROGUI_BasicZoneDlg::setAdditionalParams( const QStringList& thePrams )
+{
+ bool isBlocked = blockSignals( true );
+
+ myAdditionalParams->clear();
+ myAdditionalParams->addItems( thePrams );
+
+ blockSignals( isBlocked );
+}
+
+void HYDROGUI_BasicZoneDlg::setSelectedAdditionalParamName( const QString& theParam )
+{
+ int aNewIdx = myAdditionalParams->findText( theParam );
+ myAdditionalParams->setCurrentIndex( aNewIdx );
+}
+
+QString HYDROGUI_BasicZoneDlg::getSelectedAdditionalParamName() const
+{
+ return myAdditionalParams->currentText();
+}
--- /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_BASICZONEDLG_H
+#define HYDROGUI_BASICZONEDLG_H
+
+#include "HYDROGUI_InputPanel.h"
+
+class QComboBox;
+class QGroupBox;
+class QLineEdit;
+class QFrame;
+
+class HYDROGUI_BasicZoneDlg : public HYDROGUI_InputPanel
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_BasicZoneDlg( HYDROGUI_Module* theModule, const QString& theTitle,
+ const QString& theLabel1, const QString& theLabel2,
+ const QString& theLabel3, const QString& theLabel4 );
+ virtual ~HYDROGUI_BasicZoneDlg();
+
+ virtual void reset();
+
+ void setObjectName( const QString& theName );
+ QString getObjectName() const;
+
+ void setAdditionalParams( const QStringList& thePrams );
+ void setSelectedAdditionalParamName( const QString& theParam );
+ QString getSelectedAdditionalParamName() const;
+
+protected:
+ QGroupBox* myObjectNameGroup;
+ QLineEdit* myObjectName;
+
+ QGroupBox* myParamGroup;
+ QFrame* myPolylineFrame;
+
+ QGroupBox* myAdditionalParamsGroup;
+ QComboBox* myAdditionalParams; // bathymetries or strickler types
+};
+
+#endif
#include <HYDROData_River.h>
#include <HYDROData_Stream.h>
#include <HYDROData_StricklerTable.h>
+#include <HYDROData_LandCover.h>
#include <CAM_Module.h>
#include <CAM_Study.h>
// STRICKLER TABLES
LightApp_DataObject* aStricklerTablesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_STRICKLER_TABLE ).toAscii() ) );
+ // LAND COVERS
+ LightApp_DataObject* aLandCoversRootObj = createObject( aNewRootObj, tr( partitionName( KIND_LAND_COVER ).toAscii() ) );
+
// CALCULATION CASES
LightApp_DataObject* aCalculRootObj = createObject( aNewRootObj, tr( partitionName( KIND_CALCULATION ).toAscii() ) );
break;
}
- case KIND_STRICKLER_TABLE:
+ case KIND_STRICKLER_TABLE:
{
- Handle(HYDROData_StricklerTable) anStricklerTableObj =
+ Handle(HYDROData_StricklerTable) aStricklerTableObj =
Handle(HYDROData_StricklerTable)::DownCast( anObj );
- if( !anStricklerTableObj.IsNull() ) {
- obj = createObject( aStricklerTablesRootObj, anStricklerTableObj );
+ if( !aStricklerTableObj.IsNull() ) {
+ obj = createObject( aStricklerTablesRootObj, aStricklerTableObj );
+ }
+ aNoStricklerTableObj++;
+
+ break;
+ }
+ case KIND_LAND_COVER:
+ {
+ Handle(HYDROData_LandCover) aLandCoverObj =
+ Handle(HYDROData_LandCover)::DownCast( anObj );
+ if( !aLandCoverObj.IsNull() ) {
+ obj = createObject( aLandCoversRootObj, aLandCoverObj );
}
- aNoStricklerTableObj++;
break;
}
case KIND_ARTIFICIAL_OBJECT: return "ARTIFICIAL_OBJECTS";
case KIND_NATURAL_OBJECT: return "NATURAL_OBJECTS";
case KIND_STRICKLER_TABLE: return "STRICKLER_TABLES";
+ case KIND_LAND_COVER: return "LAND_COVERS";
default: break;
}
return QString();
LightApp_DataObject* theParent )
{
// Create default Strickler table object
- Handle(HYDROData_StricklerTable) anStricklerTableObj =
+ Handle(HYDROData_StricklerTable) aStricklerTableObj =
Handle(HYDROData_StricklerTable)::DownCast( theDocument->CreateObject(KIND_STRICKLER_TABLE) );
- if ( !anStricklerTableObj.IsNull() )
+ if ( !aStricklerTableObj.IsNull() )
{
- anStricklerTableObj->Import( HYDROGUI_Tool::ToAsciiString( tr( "DEFAULT_STRICKLER_TABLE_FILE" ) ) );
- // Set name
+ aStricklerTableObj->Import( HYDROGUI_Tool::ToAsciiString( tr( "DEFAULT_STRICKLER_TABLE_FILE" ) ) );
+ // Set name
QString aStricklerTableName;
- if ( anStricklerTableObj->GetName().isEmpty() )
+ if ( aStricklerTableObj->GetName().isEmpty() )
{
HYDROGUI_Module* aModule = dynamic_cast<HYDROGUI_Module*>( module() );
if ( aModule )
aStricklerTableName = HYDROGUI_Tool::GenerateObjectName( aModule, tr( "DEFAULT_STRICKLER_TABLE_NAME" ) );
}
- if ( anStricklerTableObj->GetName() != aStricklerTableName )
- anStricklerTableObj->SetName( aStricklerTableName );
+ if ( aStricklerTableObj->GetName() != aStricklerTableName )
+ aStricklerTableObj->SetName( aStricklerTableName );
- anStricklerTableObj->Update();
+ aStricklerTableObj->Update();
- LightApp_DataObject* obj = createObject( theParent, anStricklerTableObj );
+ LightApp_DataObject* obj = createObject( theParent, aStricklerTableObj );
}
}
#include <QGroupBox>
#include <QLabel>
#include <QLayout>
-#include <QLineEdit>
HYDROGUI_ImmersibleZoneDlg::HYDROGUI_ImmersibleZoneDlg( HYDROGUI_Module* theModule, const QString& theTitle )
-: HYDROGUI_InputPanel( theModule, theTitle )
+: HYDROGUI_BasicZoneDlg( theModule, theTitle,
+ tr( "ZONE_NAME" ), tr( "NAME" ),
+ tr( "ZONE_PARAMETERS" ), tr( "ZONE_BATHYMETRY" ) )
{
- // Zone name
- myObjectNameGroup = new QGroupBox( tr( "ZONE_NAME" ), mainFrame() );
-
- myObjectName = new QLineEdit( myObjectNameGroup );
-
- QBoxLayout* aNameLayout = new QHBoxLayout( myObjectNameGroup );
- aNameLayout->setMargin( 5 );
- aNameLayout->setSpacing( 5 );
- aNameLayout->addWidget( new QLabel( tr( "NAME" ), myObjectNameGroup ) );
- aNameLayout->addWidget( myObjectName );
-
-
- QGroupBox* aParamGroup = new QGroupBox( tr( "ZONE_PARAMETERS" ), mainFrame() );
-
- QFrame* aPolylineFrame = new QFrame( aParamGroup );
-
- myPolylines = new QComboBox( aPolylineFrame );
+ myPolylines = new QComboBox( myPolylineFrame );
myPolylines->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- QBoxLayout* aPolyLayout = new QHBoxLayout( aPolylineFrame );
+ QBoxLayout* aPolyLayout = new QHBoxLayout( myPolylineFrame );
aPolyLayout->setMargin( 0 );
aPolyLayout->setSpacing( 5 );
- aPolyLayout->addWidget( new QLabel( tr( "ZONE_POLYLINE" ), aPolylineFrame ) );
+ aPolyLayout->addWidget( new QLabel( tr( "ZONE_POLYLINE" ), myPolylineFrame ) );
aPolyLayout->addWidget( myPolylines );
- QBoxLayout* aParamLayout = new QVBoxLayout( aParamGroup );
+ QBoxLayout* aParamLayout = new QVBoxLayout( myParamGroup );
aParamLayout->setMargin( 5 );
aParamLayout->setSpacing( 5 );
- aParamLayout->addWidget( aPolylineFrame );
-
- QGroupBox* aBathGroup = new QGroupBox( tr( "ZONE_BATHYMETRY" ), mainFrame() );
-
- myBathymetries = new QComboBox( aPolylineFrame );
- myBathymetries->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- QBoxLayout* aBathLayout = new QHBoxLayout( aBathGroup );
- aBathLayout->setMargin( 5 );
- aBathLayout->setSpacing( 5 );
- aBathLayout->addWidget( myBathymetries );
-
-
- // Common
- addWidget( myObjectNameGroup );
- addWidget( aParamGroup );
- addWidget( aBathGroup );
-
- addStretch();
-
+ aParamLayout->addWidget( myPolylineFrame );
// Connect signals and slots
connect( myPolylines, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onZoneDefChanged() ) );
{
bool isBlocked = blockSignals( true );
- myObjectName->clear();
+ HYDROGUI_BasicZoneDlg::reset();
myPolylines->clear();
- myBathymetries->clear();
-
+
blockSignals( isBlocked );
onZoneDefChanged();
}
-void HYDROGUI_ImmersibleZoneDlg::setObjectName( const QString& theName )
-{
- myObjectName->setText( theName );
-}
-
-QString HYDROGUI_ImmersibleZoneDlg::getObjectName() const
-{
- return myObjectName->text();
-}
-
void HYDROGUI_ImmersibleZoneDlg::setPolylineNames( const QStringList& thePolylines )
{
bool isBlocked = blockSignals( true );
return myPolylines->currentText();
}
-void HYDROGUI_ImmersibleZoneDlg::setBathymetryNames( const QStringList& theBathymetries )
-{
- bool isBlocked = blockSignals( true );
-
- myBathymetries->clear();
- myBathymetries->addItems( theBathymetries );
-
- blockSignals( isBlocked );
-}
-
-void HYDROGUI_ImmersibleZoneDlg::setBathymetryName( const QString& theName )
-{
- int aNewIdx = myBathymetries->findText( theName );
- myBathymetries->setCurrentIndex( aNewIdx );
-}
-
-QString HYDROGUI_ImmersibleZoneDlg::getBathymetryName() const
-{
- return myBathymetries->currentText();
-}
-
void HYDROGUI_ImmersibleZoneDlg::onZoneDefChanged()
{
if ( signalsBlocked() )
#ifndef HYDROGUI_ImmersibleZoneDlg_H
#define HYDROGUI_ImmersibleZoneDlg_H
-#include "HYDROGUI_InputPanel.h"
+#include "HYDROGUI_BasicZoneDlg.h"
class QComboBox;
-class QGroupBox;
-class QLineEdit;
-class HYDROGUI_ImmersibleZoneDlg : public HYDROGUI_InputPanel
+class HYDROGUI_ImmersibleZoneDlg : public HYDROGUI_BasicZoneDlg
{
Q_OBJECT
HYDROGUI_ImmersibleZoneDlg( HYDROGUI_Module* theModule, const QString& theTitle );
virtual ~HYDROGUI_ImmersibleZoneDlg();
- void reset();
-
- void setObjectName( const QString& theName );
- QString getObjectName() const;
+ virtual void reset();
void setPolylineNames( const QStringList& thePolylines );
void setPolylineName( const QString& thePolyline );
QString getPolylineName() const;
- void setBathymetryNames( const QStringList& theBathymetries );
- void setBathymetryName( const QString& theBathymetry );
- QString getBathymetryName() const;
-
signals:
void CreatePreview( const QString& thePolylineName );
void onZoneDefChanged();
private:
-
- QGroupBox* myObjectNameGroup;
- QLineEdit* myObjectName;
-
QComboBox* myPolylines;
- QComboBox* myBathymetries;
};
#endif
aPanel->setObjectName( anObjectName );
aPanel->setPolylineNames( HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_POLYLINEXY ) );
- aPanel->setBathymetryNames( HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_BATHYMETRY ) );
+ aPanel->setAdditionalParams( HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_BATHYMETRY ) );
aPanel->blockSignals( false );
aPanel->setPolylineName( aSelectedPolyline );
- aPanel->setBathymetryName( aSelectedBathymetry );
+ aPanel->setSelectedAdditionalParamName( aSelectedBathymetry );
}
void HYDROGUI_ImmersibleZoneOp::abortOperation()
HYDROGUI_Tool::FindObjectByName( module(), aPolylineName, KIND_POLYLINEXY ) );
}
- QString aBathymetryName = aPanel->getBathymetryName();
+ QString aBathymetryName = aPanel->getSelectedAdditionalParamName();
if ( !aBathymetryName.isEmpty() )
{
aZoneBathymetry = Handle(HYDROData_Bathymetry)::DownCast(
--- /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 <QGroupBox>
+#include <QLabel>
+#include <QLayout>
+#include <QListWidget>
+
+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 QListWidget( myPolylineFrame );
+ myPolylines->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+ myPolylines->setSelectionMode( QAbstractItemView::ExtendedSelection );
+
+ QBoxLayout* aPolyLayout = new QVBoxLayout( myPolylineFrame );
+ aPolyLayout->setMargin( 0 );
+ aPolyLayout->setSpacing( 5 );
+ aPolyLayout->addWidget( new QLabel( tr( "LAND_COVER_POLYLINES" ), myPolylineFrame ) );
+ aPolyLayout->addWidget( myPolylines );
+
+ QBoxLayout* aParamLayout = new QVBoxLayout( myParamGroup );
+ aParamLayout->setMargin( 5 );
+ aParamLayout->setSpacing( 5 );
+ aParamLayout->addWidget( myPolylineFrame );
+
+ // Connect signals and slots
+ connect( myPolylines, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onZoneDefChanged() ) );
+}
+
+HYDROGUI_LandCoverDlg::~HYDROGUI_LandCoverDlg()
+{
+}
+
+void HYDROGUI_LandCoverDlg::reset()
+{
+ bool isBlocked = blockSignals( true );
+
+ HYDROGUI_BasicZoneDlg::reset();
+
+ myPolylines->clear();
+
+ blockSignals( isBlocked );
+
+ onZoneDefChanged();
+}
+
+void HYDROGUI_LandCoverDlg::setPolylineNames( const QStringList& thePolylines )
+{
+ bool isBlocked = blockSignals( true );
+
+ myPolylines->clear();
+ myPolylines->addItems( thePolylines );
+
+ blockSignals( isBlocked );
+}
+
+void HYDROGUI_LandCoverDlg::setSelectedPolylineNames( const QStringList& theSelectedPolylines )
+{
+ bool anUpdateNeeded = false;
+ for (int i =0; i< myPolylines->count(); i++)
+ {
+ QListWidgetItem* anItem = myPolylines->item( i );
+ if ( anItem )
+ {
+ bool aIsSelected = anItem->isSelected();
+ if ( theSelectedPolylines.contains( anItem->text() ) )
+ {
+ if ( !aIsSelected )
+ {
+ anUpdateNeeded = true;
+ anItem->setSelected( true );
+ }
+ }
+ else if ( aIsSelected )
+ {
+ anUpdateNeeded = true;
+ anItem->setSelected( false );
+ }
+ }
+ }
+
+ if ( anUpdateNeeded )
+ onZoneDefChanged();
+}
+
+QStringList HYDROGUI_LandCoverDlg::getSelectedPolylineNames() const
+{
+ QStringList aSelectedPolylines;
+
+ QList<QListWidgetItem*> aSelectedItems = myPolylines->selectedItems();
+ QList<QListWidgetItem*>::const_iterator anIt = aSelectedItems.begin(), aLast = aSelectedItems.end();
+ for( ; anIt!=aLast; anIt++ )
+ aSelectedPolylines.append( (*anIt)->text() );
+
+ return aSelectedPolylines;
+}
+
+void HYDROGUI_LandCoverDlg::onZoneDefChanged()
+{
+ if ( signalsBlocked() )
+ return;
+
+ QStringList aPolylineNames = getSelectedPolylineNames();
+ emit CreatePreview( aPolylineNames );
+}
--- /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"
+
+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();
+
+ void setPolylineNames( const QStringList& thePolylines );
+ void setSelectedPolylineNames( const QStringList& theSelectedPolylines );
+ QStringList getSelectedPolylineNames() const;
+
+signals:
+ void CreatePreview( const QStringList& thePolylineNames );
+
+private slots:
+ void onZoneDefChanged();
+
+private:
+ QListWidget* 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_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 <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" ) );
+
+ QStringList aSelectedPolylines;
+ QString aSelectedStricklerType;
+
+ if ( myIsEdit )
+ {
+ if ( isApplyAndClose() )
+ myEditedObject = Handle(HYDROData_LandCover)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
+ if ( !myEditedObject.IsNull() )
+ {
+ anObjectName = myEditedObject->GetName();
+
+ // TODO: Temporary commented until getPolylinesCount, GetPolyline and GetStricklerType data model methods will be implemented
+ /*
+ int nNoPolylines = myEditedObject->getPolylinesCount();
+ for (int i=0; i<nNoPolylines; i++)
+ {
+ Handle(HYDROData_PolylineXY) aRefPolyline = myEditedObject->GetPolyline(i);
+ if ( !aRefPolyline.IsNull() )
+ aSelectedPolylines.append( aRefPolyline->GetName() );
+ }
+
+ aSelectedStricklerType = myEditedObject->GetStricklerType();
+ */
+
+ // The code below is a sample of data filling Land cover object
+ aSelectedPolylines.append( "Lake_1" );
+ aSelectedPolylines.append( "Polyline_1" );
+ aSelectedStricklerType = "Canaux naturels";
+ }
+ }
+
+ aPanel->setObjectName( anObjectName );
+ aPanel->setPolylineNames( HYDROGUI_Tool::FindExistingObjectsNames( doc(), KIND_POLYLINEXY ) );
+ // 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() )
+ {
+ // TODO: implement GetTypes method in data model
+ //QStringList aTypes = aStricklerTableObj->GetTypes();
+ // The code below is a sample of data filling list of Strickler types
+ QStringList aTypes;
+ aTypes.append("Zones de champs, prairies, sans cultures");
+ aTypes.append("Canaux naturels");
+ aTypes.append("Zones à faible urbanization (bourg)");
+ QStringList::const_iterator anIt = aTypes.begin(), aLast = aTypes.end();
+ for( ; anIt!=aLast; anIt++ )
+ {
+ QString aType = *anIt;
+ if ( !aType.isEmpty() && !aStricklerTypes.contains( aType ))
+ aStricklerTypes.append( aType );
+ }
+ }
+ }
+ aStricklerTypes.sort();
+ aPanel->setAdditionalParams( aStricklerTypes );
+
+ aPanel->blockSignals( false );
+
+ aPanel->setSelectedPolylineNames( 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& ) ) );
+ 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;
+ }
+ }
+
+ QList<Handle(HYDROData_PolylineXY)> aZonePolylines;
+ QString aStricklerType;
+
+ QStringList aSelectedPolylineNames = aPanel->getSelectedPolylineNames();
+ 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 ) ) );
+ }
+ }
+
+ QString aSelectedStricklerType = aPanel->getSelectedAdditionalParamName();
+
+ // TODO: Generate TopoDS_Shape based on the set of polylines, implement generateTopShape data model method
+ /*
+ if ( HYDROData_LandCover::generateTopShape( aZonePolylines ).IsNull() )
+ {
+ theErrorMsg = tr( "ZONE_OBJECT_CANNOT_BE_CREATED" );
+ return false;
+ }
+ */
+
+ Handle(HYDROData_LandCover) aZoneObj = myIsEdit ? myEditedObject :
+ Handle(HYDROData_LandCover)::DownCast( doc()->CreateObject( KIND_LAND_COVER ) );
+
+ aZoneObj->SetName( anObjectName );
+
+ // TODO: Temporary commented until SetFillingColor, DefaultFillingColor,
+ // SetBorderColor and DefaultBorderColor data model methods will be implemented
+ /*
+ if ( !myIsEdit )
+ {
+ aZoneObj->SetFillingColor( HYDROData_LandCover::DefaultFillingColor() );
+ aZoneObj->SetBorderColor( HYDROData_LandCover::DefaultBorderColor() );
+ }
+ */
+
+ // TODO: Temporary commented until SetPolylines and SetStricklerType data model methods will be implemented
+ //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 );
+
+ 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 );
+
+ QList<Handle(HYDROData_PolylineXY)> 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 );
+ }
+
+ // TODO: Generate TopoDS_Shape based on the set of polylines, implement generateTopShape data model method
+ TopoDS_Shape aZoneShape;/* = HYDROData_LandCover::generateTopShape( aZonePolylines );
+ if( aZoneShape.IsNull() )
+ printErrorMessage( tr( "ZONE_OBJECT_CANNOT_BE_CREATED" ) );
+ */
+
+ 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 )
+ {
+ // TODO: Temporary commented until GetFillingColor, DefaultFillingColor,
+ // GetBorderColor and DefaultBorderColor data model methods will be implemented
+ /*
+ QColor aFillingColor = HYDROData_LandCover::DefaultFillingColor();
+ QColor aBorderColor = HYDROData_LandCover::DefaultBorderColor();
+ if ( !myEditedObject.IsNull() ) {
+ aFillingColor = myEditedObject->GetFillingColor();
+ aBorderColor = myEditedObject->GetBorderColor();
+ }
+
+ myPreviewPrs->setFillingColor( aFillingColor, false, false );
+ myPreviewPrs->setBorderColor( aBorderColor, false, false );
+ */
+
+ TopoDS_Face aFace;
+ if( !aZoneShape.IsNull() )
+ aFace = TopoDS::Face( aZoneShape );
+ myPreviewPrs->setFace( aFace, true, true, "" );
+ }
+
+ QApplication::restoreOverrideCursor();
+}
+
+void HYDROGUI_LandCoverOp::closePreview()
+{
+ if( myPreviewPrs )
+ {
+ delete myPreviewPrs;
+ myPreviewPrs = 0;
+ }
+}
--- /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 );
+
+private:
+ void closePreview();
+
+private:
+ bool myIsEdit;
+ Handle(HYDROData_LandCover) myEditedObject;
+
+ HYDROGUI_Shape* myPreviewPrs;
+};
+
+#endif
bool anIsZone = false;
bool anIsObstacle = false;
bool anIsStricklerTable = false;
+ bool anIsLandCover = 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_STREAM )
{
anIsStream = true;
case KIND_STRICKLER_TABLE:
theMenu->addAction( action( ImportStricklerTableFromFileId ) );
break;
+ case KIND_LAND_COVER:
+ theMenu->addAction( action( CreateLandCoverId ) );
+ break;
case KIND_CALCULATION:
theMenu->addAction( action( CreateCalculationId ) );
break;
theMenu->addAction( action( DuplicateStricklerTableId ) );
theMenu->addSeparator();
}
+ else if( anIsLandCover )
+ {
+ theMenu->addAction( action( EditLandCoverId ) );
+ theMenu->addSeparator();
+ }
else if( anIsVisualState && anIsObjectBrowser )
{
theMenu->addAction( action( SaveVisualStateId ) );
#include "HYDROGUI_SubmersibleOp.h"
#include "HYDROGUI_StricklerTableOp.h"
#include "HYDROGUI_DuplicateOp.h"
+#include "HYDROGUI_LandCoverOp.h"
#include <HYDROData_Document.h>
#include <HYDROData_Obstacle.h>
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( ImportObstacleFromFileId, "IMPORT_OBSTACLE_FROM_FILE", "IMPORT_OBSTACLE_FROM_FILE_ICO" );
createAction( ImportGeomObjectAsObstacleId, "IMPORT_GEOM_OBJECT_AS_OBSTACLE", "IMPORT_GEOM_OBJECT_ICO" );
createAction( ImportGeomObjectAsPolylineId, "IMPORT_GEOM_OBJECT_AS_POLYLINE", "IMPORT_GEOM_OBJECT_ICO" );
createMenu( CreateImmersibleZoneId, aHydroId, -1, -1 );
createMenu( CreateChannelId, aHydroId, -1, -1 );
createMenu( CreateDigueId, aHydroId, -1, -1 );
+ createMenu( CreateLandCoverId, aHydroId, -1, -1 );
int aNewProfileId = createMenu( tr( "MEN_DESK_PROFILE" ), aHydroId, -1 );
createMenu( CreateProfileId, aNewProfileId, -1, -1 );
createTool( CreateCylinderId, aToolBar );
createTool( separator(), aToolBar );
- createTool( ImportStricklerTableFromFileId, aToolBar );
+ createTool( ImportStricklerTableFromFileId, aToolBar );
+
+ createTool( separator(), aToolBar );
+ createTool( CreateLandCoverId, aToolBar );
createTool( separator(), aToolBar );
createTool( CreateCalculationId, aToolBar );
case EditStricklerTableId:
anOp = new HYDROGUI_StricklerTableOp( aModule, theId == EditStricklerTableId );
break;
+ case CreateLandCoverId:
+ case EditLandCoverId:
+ anOp = new HYDROGUI_LandCoverOp( aModule, theId == EditLandCoverId );
+ break;
case DuplicateStricklerTableId:
anOp = new HYDROGUI_DuplicateOp( aModule );
break;
ImportStricklerTableFromFileId,
ExportStricklerTableFromFileId,
EditStricklerTableId,
- DuplicateStricklerTableId
+ DuplicateStricklerTableId,
+ CreateLandCoverId,
+ EditLandCoverId
};
#endif
<source>HYDRO_TYPE26_ICO</source>
<translation>icon_strickler_table.png</translation>
</message>
+ <message>
+ <source>HYDRO_TYPE27_ICO</source>
+ <translation>icon_land_cover.png</translation>
+ </message>
<!-- Icons for need to update objects -->
<message>
<translation>icon_edit_strickler_table.png</translation>
</message>
+ <message>
+ <source>CREATE_LAND_COVER_ICO</source>
+ <translation>icon_create_land_cover.png</translation>
+ </message>
+ <message>
+ <source>EDIT_LAND_COVER_ICO</source>
+ <translation>icon_edit_land_cover.png</translation>
+ </message>
+
<message>
<source>IMPORT_OBSTACLE_FROM_FILE_ICO</source>
<translation>icon_import_obstacle.png</translation>
<source>DEFAULT_STRICKLER_TABLE_NAME</source>
<translation>Strickler table</translation>
</message>
+ <message>
+ <source>DEFAULT_LAND_COVER_NAME</source>
+ <translation>Land cover</translation>
+ </message>
<message>
<source>IMAGES</source>
<translation>IMAGES</translation>
<source>STRICKLER_TABLES</source>
<translation>STRICKLER TABLES</translation>
</message>
+ <message>
+ <source>LAND_COVERS</source>
+ <translation>LAND COVERS</translation>
+ </message>
<message>
<source>ARTIFICIAL_OBJECTS</source>
<translation>ARTIFICIAL OBJECTS</translation>
<source>DSK_DUPLICATE_STRICKLER_TABLE</source>
<translation>Duplicate Strickler table</translation>
</message>
+ <message>
+ <source>DSK_CREATE_LAND_COVER</source>
+ <translation>Create land cover</translation>
+ </message>
+ <message>
+ <source>DSK_EDIT_LAND_COVER</source>
+ <translation>Edit land cover</translation>
+ </message>
<message>
<source>DSK_COPY</source>
<translation>Copy</translation>
<source>MEN_DUPLICATE_STRICKLER_TABLE</source>
<translation>Duplicate Strickler table</translation>
</message>
+ <message>
+ <source>MEN_CREATE_LAND_COVER</source>
+ <translation>Create land cover</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_LAND_COVER</source>
+ <translation>Edit land cover</translation>
+ </message>
<message>
<source>MEN_CUT_IMAGES</source>
<translation>Cut images</translation>
<source>STB_DUPLICATE_STRICKLER_TABLE</source>
<translation>Duplicate Strickler table</translation>
</message>
+ <message>
+ <source>STB_CREATE_LAND_COVER</source>
+ <translation>Create land cover</translation>
+ </message>
+ <message>
+ <source>STB_EDIT_LAND_COVER</source>
+ <translation>Edit land cover</translation>
+ </message>
<message>
<source>STB_COPY</source>
<translation>Copy</translation>
</message>
</context>
+ <context>
+ <name>HYDROGUI_LandCoverDlg</name>
+ <message>
+ <source>DEFAULT_LAND_COVER_NAME</source>
+ <translation>Land cover</translation>
+ </message>
+ <message>
+ <source>LAND_COVER_NAME</source>
+ <translation>Land cover name</translation>
+ </message>
+ <message>
+ <source>NAME</source>
+ <translation>Name</translation>
+ </message>
+ <message>
+ <source>LAND_COVER_PARAMETERS</source>
+ <translation>Parameters</translation>
+ </message>
+ <message>
+ <source>LAND_COVER_POLYLINES</source>
+ <translation>Polylines</translation>
+ </message>
+ <message>
+ <source>LAND_COVER_STRICKLER_TYPE</source>
+ <translation>Strickler type</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>HYDROGUI_LandCoverOp</name>
+ <message>
+ <source>CREATE_LAND_COVER</source>
+ <translation>Create land cover</translation>
+ </message>
+ <message>
+ <source>EDIT_LAND_COVER</source>
+ <translation>Edit land cover</translation>
+ </message>
+ <message>
+ <source>SELECT_STRICKLER_TABLE_FILE</source>
+ <translation>The Strickler table file is not chosen</translation>
+ </message>
+ </context>
+
<context>
<name>HYDROGUI_TranslateObstacleDlg</name>
<message>