From ba274e7ad1f0eb13130e5086f55191e8e165a220 Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 2 Oct 2008 13:54:43 +0000 Subject: [PATCH] IMP 0019918: Re-open popup for imported shapes. --- .../gui/GEOM/images/geomimport_reopen.png | Bin 0 -> 11051 bytes doc/salome/gui/GEOM/input/import_export.doc | 8 +++ idl/GEOM_Gen.idl | 7 ++ src/GEOMGUI/GEOM_msg_en.po | 6 ++ src/GEOMGUI/GeometryGUI.cxx | 25 +++++-- src/GEOM_I/GEOM_ITransformOperations_i.cc | 36 ++++++++++ src/GEOM_I/GEOM_ITransformOperations_i.hh | 1 + src/TransformationGUI/TransformationGUI.cxx | 68 ++++++++++++++++-- 8 files changed, 141 insertions(+), 10 deletions(-) create mode 100644 doc/salome/gui/GEOM/images/geomimport_reopen.png diff --git a/doc/salome/gui/GEOM/images/geomimport_reopen.png b/doc/salome/gui/GEOM/images/geomimport_reopen.png new file mode 100644 index 0000000000000000000000000000000000000000..9d6745db48f54ababcfaed951226c1ff89ce0e0b GIT binary patch literal 11051 zcmcI~WmsELmo-qF;@096cL`RsSaB)t6bl~Qt$2YVg(AV-3GP-X(iDf{?heH@FzL)Q zGv71syfgFX`?HhhJjp%h+_Ue#YpuPa)K%rMG089y5D>5xkjExaBz@yt2ntq6PnDSfn8$EfZ#aeUIekQr zo$1-07ranDl8F4NwThfZ!CDGcmzVyv5j4TlnL#?SC;4TWN2pr)`)*7C@C@S=YvH%i{9KCn!;Bp zrs;G31XiZ_s{AZo(0aJ(PlPZAq5@~DP9|7tXlTg4_5yGLb!hEo4wDB=sUNWkBT5p+ zo!GsCS~42dM$FFlv`{Z8N0y&i-xYyjrh8ItF8xIcGWv+@?uuY3>r>FL;L^%UBFt(H`4U z==gYY64`Y3xDOR`r-V|aC>uXs)Aa?cCS$1V^=6%=$&)v!A6;lylM=E4*(KgQN|7cT zo)AVwVfBqs(S{w6L|zz65lf-x#r)!kk8W63i+a&`=z*`>86bb_Zmi{KOoJ+eg9l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S@SzZ(g|Zrfz7fskdi3+WCW~qZX$tgcQA5 zC3Zt!kX(J+EYaN{Idt7`lfL}N)A>&e#J~PRAE?EP3=eHIKY0t_2#V)_bN2kJtmmi; zY$zVy&MzHJ-zQb84Hqam!zsiz7;_+wS;ex_09uTmM* zHVD%yQW-mUY%l{)2#+nh`cw!O1WXD&L8~6`w*xzFtr$~18iO@{-mr=H6(Ifkpwm$o z67032x{9jpP(IX}Z8rt4GvDrC#ar=dlwXoEn=M>Rhqrb2z(;=rl9^6(pndpIY{kHP zoUR^~{eahL!VzrLPZ5bgHYp`03<_YsrU>|PQo3hcszzrn)+;I3(c+|`)nN#Wgu$Ua z^YAYBD%8-piU;1+_&rg7mz!&H-|_FHtPU1hTN!lu`q~$fKRzC0Dzh$jI0vrHPL*?D zJQd~qXy6=mu)1#Aj)39&yOXjG!62SSAsH8_DM_k3-_@PEIz zC^~F(I-gj=BvDhKWqAwEvz^lWh95qK8HT&FQZXVbB+lUNx?^{Eot^%F(2=t)ldC!1 y-L>V!4%-Q5ENupWgt=?L;eL*%BMI0 literal 0 HcmV?d00001 diff --git a/doc/salome/gui/GEOM/input/import_export.doc b/doc/salome/gui/GEOM/input/import_export.doc index 8a5219ebe..25eb1ae67 100644 --- a/doc/salome/gui/GEOM/input/import_export.doc +++ b/doc/salome/gui/GEOM/input/import_export.doc @@ -22,6 +22,14 @@ Select the required file and click \b Open. Your file will be imported in the module and its contents (geometrical object) will be displayed in the Object Browser. +\note You can re-open ones imported shape from the initial file, if +the file has been changed on disk. Use for that item +Reload From Disk from context menu of imported +shape. Reloaded shape will have the same representation parameters +like before this operation. + +\image html geomimport_reopen.png + \n To export geometrical objects into a BREP, IGES, STEP file: diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index c130973fb..38f10ca6e 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -792,6 +792,13 @@ module GEOM GEOM_Object PositionShapeCopy (in GEOM_Object theObject, in GEOM_Object theStartLCS, in GEOM_Object theEndLCS); + + /*! + * Recompute the shape from its arguments. + * \param theObject The object to be recomputed. + * \return theObject. + */ + GEOM_Object RecomputeObject (in GEOM_Object theObject); }; /*! diff --git a/src/GEOMGUI/GEOM_msg_en.po b/src/GEOMGUI/GEOM_msg_en.po index 20cd3b673..43c6e908a 100644 --- a/src/GEOMGUI/GEOM_msg_en.po +++ b/src/GEOMGUI/GEOM_msg_en.po @@ -2482,6 +2482,12 @@ msgstr "Edit" msgid "STB_GROUP_EDIT" msgstr "Edit a group" +msgid "MEN_RELOAD_IMPORTED" +msgstr "Reload From Disk" + +msgid "STB_RELOAD_IMPORTED" +msgstr "Reload imported shape from its original place on disk" + msgid "MEN_BLOCKS" msgstr "Blocks" diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 2b95749ba..d1ffd70c2 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -71,6 +71,7 @@ #include #include +#include "GEOMImpl_Types.hxx" extern "C" { Standard_EXPORT CAM_Module* createModule() { @@ -488,7 +489,8 @@ void GeometryGUI::OnGUIEvent( int id ) id == 5025 || // MENU TRANSFORMATION - SCALE id == 5026 || // MENU TRANSFORMATION - OFFSET id == 5027 || // MENU TRANSFORMATION - MULTI-TRANSLATION - id == 5028 ) { // MENU TRANSFORMATION - MULTI-ROTATION + id == 5028 || // MENU TRANSFORMATION - MULTI-ROTATION + id == 5029 ) { // CONTEXT(POPUP) MENU - RELOAD_IMPORTED #ifndef WNT library = getLibrary( "libTransformationGUI.so" ); #else @@ -825,6 +827,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( 5026, "OFFSET" ); createGeomAction( 5027, "MUL_TRANSLATION" ); createGeomAction( 5028, "MUL_ROTATION" ); + createGeomAction( 5029, "RELOAD_IMPORTED" ); createGeomAction( 503, "PARTITION" ); createGeomAction( 504, "ARCHIMEDE" ); @@ -1722,13 +1725,23 @@ void GeometryGUI::contextMenuPopup( const QString& client, QPopupMenu* menu, QSt SalomeApp_Module::contextMenuPopup( client, menu, title ); SALOME_ListIO lst; getApp()->selectionMgr()->selectedObjects( lst ); - if ( ( client == "OCCViewer" || client == "VTKViewer" ) && lst.Extent() == 1 ) { + + if (lst.Extent() == 1) { Handle(SALOME_InteractiveObject) io = lst.First(); - SalomeApp_Study* appStudy = dynamic_cast( application()->activeStudy() ); + SalomeApp_Study* appStudy = dynamic_cast(application()->activeStudy()); _PTR(Study) study = appStudy->studyDS(); - _PTR(SObject) obj = study->FindObjectID( io->getEntry() ); - if ( obj ) - title = QString( obj->GetName().c_str() ); + _PTR(SObject) aSObj = study->FindObjectID(io->getEntry()); + if (aSObj) { + // Set context menu title + if (client == "OCCViewer" || client == "VTKViewer") + title = QString(aSObj->GetName().c_str()); + + // Reload imported shape + CORBA::Object_var anObj = GeometryGUI::ClientSObjectToObject(aSObj); + GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(anObj); + if (!CORBA::is_nil(aGeomObj) && aGeomObj->GetType() == GEOM_IMPORT) + action(5029)->addTo(menu); + } } } diff --git a/src/GEOM_I/GEOM_ITransformOperations_i.cc b/src/GEOM_I/GEOM_ITransformOperations_i.cc index 1dff38932..338e901eb 100644 --- a/src/GEOM_I/GEOM_ITransformOperations_i.cc +++ b/src/GEOM_I/GEOM_ITransformOperations_i.cc @@ -1252,3 +1252,39 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePointsCopy return GetObject(anObject); } + +//============================================================================= +/*! + * RecomputeObject + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RecomputeObject + (GEOM::GEOM_Object_ptr theObject) +{ + //Set a not done flag + GetOperations()->SetNotDone(); + GEOM::GEOM_Object_var aGEOMObject; + + if (theObject == NULL) return aGEOMObject._retn(); + + //check if the object is a subshape + //if (!theObject->IsMainShape()) { + // GetOperations()->SetErrorCode(SUBSHAPE_ERROR); + // return aGEOMObject._retn(); + //} + + aGEOMObject = GEOM::GEOM_Object::_duplicate(theObject); + + //Get the object itself + CORBA::String_var anEntry = theObject->GetEntry(); + Handle(GEOM_Object) anObject = + GetOperations()->GetEngine()->GetObject(theObject->GetStudyID(), anEntry); + if (anObject.IsNull()) return aGEOMObject._retn(); + + //Perform the recomputation + Handle(GEOM_Function) aLastFunction = anObject->GetLastFunction(); + if (aLastFunction.IsNull()) return aGEOMObject._retn(); + GetOperations()->GetSolver()->ComputeFunction(aLastFunction); + + return aGEOMObject._retn(); +} diff --git a/src/GEOM_I/GEOM_ITransformOperations_i.hh b/src/GEOM_I/GEOM_ITransformOperations_i.hh index 848e5077b..ccfdc50e1 100644 --- a/src/GEOM_I/GEOM_ITransformOperations_i.hh +++ b/src/GEOM_I/GEOM_ITransformOperations_i.hh @@ -151,6 +151,7 @@ class GEOM_I_EXPORT GEOM_ITransformOperations_i : GEOM::GEOM_Object_ptr thePoint1, GEOM::GEOM_Object_ptr thePoint2); + GEOM::GEOM_Object_ptr RecomputeObject (GEOM::GEOM_Object_ptr theObject); ::GEOMImpl_ITransformOperations* GetOperations() { return (::GEOMImpl_ITransformOperations*)GetImpl(); } }; diff --git a/src/TransformationGUI/TransformationGUI.cxx b/src/TransformationGUI/TransformationGUI.cxx index eb69c9037..1c5cfe1c8 100644 --- a/src/TransformationGUI/TransformationGUI.cxx +++ b/src/TransformationGUI/TransformationGUI.cxx @@ -27,12 +27,18 @@ // $Header$ #include "TransformationGUI.h" -#include "GeometryGUI.h" -#include "SUIT_Session.h" -#include "SUIT_Desktop.h" +#include +#include "GeometryGUI.h" -#include "SalomeApp_Application.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "TransformationGUI_MultiTranslationDlg.h" // Method MULTI TRANSLATION #include "TransformationGUI_MultiRotationDlg.h" // Method MULTI ROTATION @@ -100,6 +106,60 @@ bool TransformationGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) case 5028: // MULTI ROTATION aDlg = new TransformationGUI_MultiRotationDlg( getGeometryGUI(), parent, "" ); break; + case 5029: // RELOAD IMPORTED SHAPE + { + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); + SALOME_ListIO aSelList; + aSelMgr->selectedObjects(aSelList); + if (aSelList.Extent() == 1) { + Standard_Boolean testResult = Standard_False; + GEOM::GEOM_Object_var aGeomObj = + GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + if (testResult) { + SalomeApp_Study* anAppStudy = dynamic_cast(app->activeStudy()); + GEOM::GEOM_ITransformOperations_var anOp = + GeometryGUI::GetGeomGen()->GetITransformOperations(anAppStudy->id()); + if (!anOp->_is_nil()) { + anOp->RecomputeObject(aGeomObj); + GEOM_Displayer aDisp (anAppStudy); + //aDisp.Redisplay(aSelList.First()); + //aDisp.Display(aSelList.First()); + Handle(SALOME_InteractiveObject) theIO = aSelList.First(); + SUIT_Desktop* desk = app->desktop(); + QPtrList wnds = desk->windows(); + SUIT_ViewWindow* wnd; + for ( wnd = wnds.first(); wnd; wnd = wnds.next() ) + { + SUIT_ViewManager* vman = wnd->getViewManager(); + if ( vman ) + { + SUIT_ViewModel* vmodel = vman->getViewModel(); + if ( vmodel ) + { + SALOME_View* view = dynamic_cast(vmodel); + if ( view ) + { + //if (view->isVisible(theIO) || view == GetActiveView()) + if (view->isVisible(theIO)) + { + //SALOME_Prs* prs = view->CreatePrs( theIO->getEntry() ); + //if ( prs ) { + // prs->Update(&aDisp); + // view->Repaint(); + //} + aDisp.Erase(theIO, false, false, view); + aDisp.Display(theIO, true, view); + } + } + } + } + } + // ? Redisplay subshapes ? + } + } + } + } + break; default: app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; -- 2.39.2