+
+ HYDROGUI_LandCoverMapDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverMapDlg*>( inputPanel() );
+ if ( !aPanel )
+ return;
+
+ if ( myOperationId == RemoveLandCoverId || myOperationId == MergeLandCoverId || myOperationId == ChangeLandCoverTypeId )
+ aPanel->setApplyEnabled( false );
+}
+
+Handle(AIS_InteractiveContext) HYDROGUI_LandCoverMapOp::getInteractiveContext()
+{
+ OCCViewer_ViewManager* aViewManager = getPreviewManager();
+ Handle(AIS_InteractiveContext) aCtx = NULL;
+ if ( aViewManager ) {
+ if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
+ aCtx = aViewer->getAISContext();
+ }
+ }
+ return aCtx;
+}
+
+void HYDROGUI_LandCoverMapOp::getSelectedShapes( TopTools_ListOfShape& theSelectedShapes,
+ Handle(AIS_InteractiveContext)& theCtx )
+{
+ if ( theCtx.IsNull() )
+ theCtx = getInteractiveContext();
+
+ if ( !theCtx.IsNull() && theCtx->NbSelected() > 0 )
+ {
+ for ( theCtx->InitSelected(); theCtx->MoreSelected(); theCtx->NextSelected() )
+ {
+ TopoDS_Shape aSelectedShape = theCtx->SelectedShape();
+ if ( aSelectedShape.IsNull() )
+ continue;
+
+ theSelectedShapes.Append( aSelectedShape );
+ }
+ }