- case 5021: // TRANSLATION
- {
- aDlg = new TransformationGUI_TranslationDlg( getGeometryGUI(), parent, "" );
- break;
- }
- case 5022: // ROTATION
- {
- aDlg = new TransformationGUI_RotationDlg( parent, "" );
- break;
- }
- case 5023: // POSITION
- {
- aDlg = new TransformationGUI_PositionDlg( parent, "" );
- break;
- }
- case 5024: // MIRROR
- {
- aDlg = new TransformationGUI_MirrorDlg( parent, "" );
- break;
- }
- case 5025: // SCALE
- {
- aDlg = new TransformationGUI_ScaleDlg( getGeometryGUI(), parent, "" );
- break;
- }
- case 5026: // OFFSET
- {
- aDlg = new TransformationGUI_OffsetDlg( parent, "" );
- break;
- }
- case 5027: // MULTI TRANSLATION
- {
- aDlg = new TransformationGUI_MultiTranslationDlg( getGeometryGUI(), parent, "" );
- break;
- }
- case 5028: // MULTI ROTATION
- {
- aDlg = new TransformationGUI_MultiRotationDlg( getGeometryGUI(), parent, "" );
- break;
- }
- default:
- {
- SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
- break;
- }
+ SalomeApp_Study* anAppStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
+
+ GEOM::GEOM_ITransformOperations_var anOp =
+ GeometryGUI::GetGeomGen()->GetITransformOperations(anAppStudy->id());
+ if (anOp->_is_nil()) return false;
+
+ GEOM_Displayer aDisp (anAppStudy);
+ SUIT_Desktop* desk = app->desktop();
+ QList<SUIT_ViewWindow*> wnds = desk->windows();
+
+ LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ SALOME_ListIteratorOfListIO aSelIt (aSelList);
+ for (; aSelIt.More(); aSelIt.Next()) {
+ Handle(SALOME_InteractiveObject) io = aSelIt.Value();
+ Standard_Boolean testResult = Standard_False;
+ GEOM::GEOM_Object_var aGeomObj = GEOMBase::ConvertIOinGEOMObject(io, testResult);
+ if (testResult) {
+ anOp->RecomputeObject(aGeomObj);
+
+ SUIT_ViewWindow* wnd;
+ QListIterator<SUIT_ViewWindow*> it (wnds);
+ while (it.hasNext() && (wnd = it.next()))
+ {
+ if (SUIT_ViewManager* vman = wnd->getViewManager()) {
+ if (SUIT_ViewModel* vmodel = vman->getViewModel()) {
+ if (SALOME_View* view = dynamic_cast<SALOME_View*>(vmodel)) {
+ if (view->isVisible(io)) {
+ aDisp.Erase(io, false, false, view);
+ aDisp.Display(io, true, view);
+ }
+ // ? Redisplay subshapes ?
+ }
+ }
+ }
+ }
+ }
+ } // for (; aSelIt.More(); aSelIt.Next())