#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>
const QString& theTitle,
const int theOperationId )
: HYDROGUI_InputPanel( theModule, theTitle ),
- HYDROGUI_ObjComboBoxFilter(),
- myOperationId( theOperationId )
+ myOperationId( theOperationId ),
+ myFilter( theOperationId )
{
// Land Cover Map name
myObjectNameGroup = new QGroupBox( tr( "LAND_COVER_MAP_NAME" ), mainFrame() );
myPolylinesFacesLabel = new QLabel( tr( "LAND_COVER_MAP_POLYLINE_FACE" ) );
aParamLayout->addWidget( myPolylinesFacesLabel, 0, 0, 1, 1 );
aParamLayout->addWidget( myPolylinesFaces = new HYDROGUI_ObjComboBox( theModule, "", KIND_UNKNOWN, myParamGroup ), 0, 1, 1, 1 );
- myPolylinesFaces->setObjectFilter( this );
+ myPolylinesFaces->setObjectFilter( &myFilter );
// Strickler type name
myStricklerTypesLabel = new QLabel( tr( "LAND_COVER_MAP_STRICKLER_TYPE" ), myParamGroup );
// 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
mySelectedLandCoversLabel->setText( tr( "LAND_COVER_MAP_SELECTED_FACES" ) + aLabel );
}
-bool HYDROGUI_LandCoverMapDlg::isOk( const Handle(HYDROData_Entity)& theEntity ) const
-{
- Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast(theEntity);
- Handle(HYDROData_Object) anObject2d3dPrs = Handle(HYDROData_Object)::DownCast(theEntity);
- return ( !anObject2d3dPrs.IsNull() ||
- ( !aPolylineXY.IsNull() && ( ( myOperationId == CreateLandCoverMapId || myOperationId == AddLandCoverId ) && aPolylineXY->IsClosed() ||
- myOperationId == SplitLandCoverId ) ) );
-}
-
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 )