#include <HYDROData_Object.h>
#include <HYDROData_PolylineXY.h>
+#include <OCCViewer_ViewManager.h>
+
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_DataOwner.h>
+
+#include <SUIT_DataObject.h>
+
#include <QLineEdit>
#include <QComboBox>
#include <QGroupBox>
aParamLayout->addWidget( myStricklerTypesLabel, 1, 0, 1, 1 );
aParamLayout->addWidget( myStricklerTypes, 1, 1, 1, 1 );
+ // Label indicated the number of selected land covers
+ QString aDefaultLabel( "0" );
+ mySelectedLandCoversLabel = new QLabel( tr( "LAND_COVER_MAP_SELECTED_FACES" ) + aDefaultLabel, myParamGroup );
+ mySelectedLandCoversLabel->setStyleSheet("QLabel { font: italic; color : red; }");
+
// Common
addWidget( myObjectNameGroup );
addWidget( myParamGroup );
+ addWidget( mySelectedLandCoversLabel );
addStretch();
// Connect signals and slots
connect( myObjectNameEdit, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onLandCoverMapChanged() ) );
- connect( myPolylinesFaces, SIGNAL( objectSelected( const QString& ) ), this, SLOT( onPolylineFaceChanged( const QString& ) ) );
+ connect( myPolylinesFaces, SIGNAL( objectSelected( const QString& ) ), this, SLOT( onPolylineFaceChanged() ) );
updateState( true );
myObjectNameCreate->setText( theName );
else
myObjectNameEdit->setCurrentIndex( myObjectNameEdit->findText( theName ) );
+
+ updateState();
}
QString HYDROGUI_LandCoverMapDlg::getObjectName() const
return myStricklerTypes->getSelectedStricklerTypeName();
}
+void HYDROGUI_LandCoverMapDlg::updateSelectedLandCoversLabel( int theNbSelected )
+{
+ QString aLabel;
+ aLabel.setNum( theNbSelected );
+ if ( theNbSelected == 0 )
+ mySelectedLandCoversLabel->setStyleSheet("QLabel { font: italic; color : red; }");
+ else
+ mySelectedLandCoversLabel->setStyleSheet("QLabel { font: italic; color : black; }");
+ mySelectedLandCoversLabel->setText( tr( "LAND_COVER_MAP_SELECTED_FACES" ) + aLabel );
+}
+
void HYDROGUI_LandCoverMapDlg::onLandCoverMapChanged()
{
if ( signalsBlocked() )
emit landCoverMapChanged( getObjectName() );
}
-void HYDROGUI_LandCoverMapDlg::onPolylineFaceChanged( const QString& )
+void HYDROGUI_LandCoverMapDlg::onPolylineFaceChanged()
{
updateState();
- // TODO: select chosen polyline/face in the 3D viewer, if it is not selected yet (i.e. object was chosen not in the viewer, but in combo-box)
+
+ emit polylineFaceChanged();
}
void HYDROGUI_LandCoverMapDlg::updateState( bool theInitialConfigure )
myOperationId == ChangeLandCoverTypeId );
myStricklerTypesLabel->setVisible( aShowStricklerTypesCtrls );
myStricklerTypes->setVisible( aShowStricklerTypesCtrls );
+
+ bool aShowSelectedLandCoversLabel = ( myOperationId == RemoveLandCoverId ||
+ myOperationId == MergeLandCoverId ||
+ myOperationId == ChangeLandCoverTypeId );
+ mySelectedLandCoversLabel->setVisible( aShowSelectedLandCoversLabel );
}
else
{