From a2af64b36f5dc0ef10aea5a727f4504a204a52c4 Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 21 Jul 2005 11:49:44 +0000 Subject: [PATCH] IPAL9285,9292,9314 --- src/VISUGUI/VISU_msg_en.po | 73 +++++----- src/VISUGUI/VisuGUI.cxx | 164 +++-------------------- src/VISUGUI/VisuGUI.h | 6 +- src/VISUGUI/VisuGUI_ActionsDef.h | 7 +- src/VISUGUI/VisuGUI_CutLinesDlg.cxx | 18 +-- src/VISUGUI/VisuGUI_CutLinesDlg.h | 3 +- src/VISUGUI/VisuGUI_CutPlanesDlg.cxx | 11 +- src/VISUGUI/VisuGUI_CutPlanesDlg.h | 9 +- src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx | 12 +- src/VISUGUI/VisuGUI_DeformedShapeDlg.h | 52 +++---- src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx | 7 +- src/VISUGUI/VisuGUI_IsoSurfacesDlg.h | 50 +++---- src/VISUGUI/VisuGUI_Plot3DDlg.cxx | 11 +- src/VISUGUI/VisuGUI_Plot3DDlg.h | 4 +- src/VISUGUI/VisuGUI_ScalarBarDlg.cxx | 6 +- src/VISUGUI/VisuGUI_ScalarBarDlg.h | 4 +- src/VISUGUI/VisuGUI_Selection.cxx | 11 +- src/VISUGUI/VisuGUI_StreamLinesDlg.cxx | 71 +++++----- src/VISUGUI/VisuGUI_StreamLinesDlg.h | 10 +- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 13 +- src/VISUGUI/VisuGUI_TimeAnimation.h | 3 +- src/VISUGUI/VisuGUI_Tools.cxx | 22 ++- src/VISUGUI/VisuGUI_VectorsDlg.cxx | 14 +- src/VISUGUI/VisuGUI_VectorsDlg.h | 45 ++++--- 24 files changed, 269 insertions(+), 357 deletions(-) diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index a5519dac..824bffb0 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -9,6 +9,15 @@ msgstr "" msgid "BUT_OK" msgstr "OK" +msgid "BUT_APPLY" +msgstr "Apply" + +msgid "BUT_CLOSE" +msgstr "Close" + +msgid "BUT_CANCEL" +msgstr "Cancel" + msgid "WRN_VISU" msgstr "Post-Pro Warning" @@ -18,12 +27,17 @@ msgstr " done" msgid "WRN_STUDY_LOCKED" msgstr "Current Study is locked" +msgid "WRN_NO_AVAILABLE_DATA" +msgstr "No Available data in selection" + msgid "ERR_CANT_FIND_VISU_COMPONENT" msgstr "Failed to activate VISU engine!" msgid "ERR_CANT_FIND_MED_COMPONENT" msgstr "Failed to activate MED engine!" +msgid "ERR_CANT_BUILD_PRESENTATION" +msgstr "The object can't be built" #: VisuGUI.cxx @@ -36,18 +50,6 @@ msgstr "Explore MED File" msgid "VisuGUI::MEN_IMPORT_TABLE" msgstr "Import table from File" -msgid "VisuGUI::ERR_ERROR_IN_THE_FILE" -msgstr "Error in the file" - -msgid "VisuGUI::FLT_ALL_FILES" -msgstr "All Files (*.*)" - -msgid "VisuGUI::FLT_MED_FILES" -msgstr "MED Files (*.med)" - -msgid "VisuGUI::FLT_TABLE_FILES" -msgstr "Tables (*.xls *.txt *.tab)" - msgid "VisuGUI::MEN_SCALAR_MAP" msgstr "Scalar Map" @@ -183,32 +185,6 @@ msgstr "Vectors" msgid "VisuGUI::MEN_WIREFRAME" msgstr "Wireframe" - -### jfa added - -#: Common - -msgid "BUT_CLOSE" -msgstr "Close" - -msgid "BUT_CANCEL" -msgstr "Cancel" - -msgid "BUT_APPLY" -msgstr "Apply" - -msgid "WRN_NO_AVAILABLE_DATA" -msgstr "No Available data in selection" - - -#: VisuGUI.cxx - -msgid "ERR_CANT_BUILD_PRESENTATION" -msgstr "The object can't be built" - -msgid "VisuGUI::ERR_CANT_CREATE_ACTOR" -msgstr "Can't create actor for this presentation" - msgid "VisuGUI::MEN_DELETE_VIEWPARAMS" msgstr "Delete view parameters" @@ -272,6 +248,27 @@ msgstr "Use Field Range" msgid "VisuGUI::MEN_ARRANGE_ACTORS" msgstr "Arrange Actors" + +msgid "VisuGUI::ERR_ERROR_IN_THE_FILE" +msgstr "Error in the file" + +msgid "VisuGUI::ERR_CANT_CREATE_ACTOR" +msgstr "Can't create actor for this presentation" + +msgid "VisuGUI::ERR_ACTIVATE_VIEW3D" +msgstr "Please activate 3D view before" + + +msgid "VisuGUI::FLT_ALL_FILES" +msgstr "All Files (*.*)" + +msgid "VisuGUI::FLT_MED_FILES" +msgstr "MED Files (*.med)" + +msgid "VisuGUI::FLT_TABLE_FILES" +msgstr "Tables (*.xls *.txt *.tab)" + + msgid "VisuGUI::DLG_OPACITY_TITLE" msgstr "Opacity" diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 39ae6385..ced02edf 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -425,7 +425,7 @@ CreatePrs3d(SalomeApp_Module* theModule, SUIT_ResourceMgr* aResourceMgr = GetResourceMgr(); int aValue = aResourceMgr->integerValue("Visu:BuildDefaultPrs3d",0); if(!aValue){ - if(TDlg* aDlg = new TDlg(GetDesktop(theModule))){ // dialog box in creation mode + if(TDlg* aDlg = new TDlg(theModule)){ // dialog box in creation mode aDlg->initFromPrsObject(aPrs3d); if(IsDlgModal) if(aDlg->exec() && (aDlg->storeToPrsObject(aPrs3d))) { @@ -678,7 +678,7 @@ EditPrs3d (SalomeApp_Module* theModule, VISU::Prs3d_i* thePrs3d) TPrs3d_i* aPrsObject = dynamic_cast(thePrs3d); if (aPrsObject) { //TDlg* aDlg = new TDlg (GetDesktop(theModule), false, true); - TDlg* aDlg = new TDlg (GetDesktop(theModule)); + TDlg* aDlg = new TDlg (theModule); aDlg->initFromPrsObject(aPrsObject); if (aDlg->exec()) { if (!(aDlg->storeToPrsObject(aPrsObject))) { @@ -775,40 +775,6 @@ OnEditPrs() vw->highlight(anIO, 1); } -void -VisuGUI:: -OnDeletePrs() -{ - _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); - if (CheckLock(aCStudy)) - return; - SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy); - - Handle(SALOME_InteractiveObject) anIO; - CORBA::Object_var anObject = GetSelectedObj(this, &anIO); - if (anIO.IsNull()) - return; - - // There is a transaction - SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); - aStudyBuilder->NewCommand(); - - // is it Prs3d object ? - VISU::Prs3d_i* aPrsObject = dynamic_cast(VISU::GetServant(anObject).in()); - if (aPrsObject) { - DeletePrs3d(this, aPrsObject, anIO); - } - - // is it Curve object ? - VISU::Curve_i* aCurveObject = dynamic_cast(VISU::GetServant(anObject).in()); - if (aCurveObject) { - //jfa tmp:DeleteCurve(this, aCurveObject, anIO); - } - - aStudyBuilder->CommitCommand(); -} - - void VisuGUI:: OnEraseAll() @@ -1111,75 +1077,6 @@ OnCreateTable() } } -void -VisuGUI:: -OnDeleteObject() -{ - _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); - if (CheckLock(aCStudy)) - return; - SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy); - - Handle(SALOME_InteractiveObject) anIO; - CORBA::Object_var anObject = GetSelectedObj(this, &anIO); - if (anIO.IsNull() || !anIO->hasEntry()) - return; - - SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry()); - if (!aSObject->_is_nil()) { - SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject); - for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) { - SALOMEDS::SObject_var aChildSObject = aChildIter->Value(); - CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject); - ErasePrs(this, aChildObj); - } - SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); - // There is a transaction - aStudyBuilder->NewCommand(); - CORBA::Object_var anObj = VISU::SObjectToObject(aSObject); - if (!CORBA::is_nil(anObj)) { - VISU::Base_var aBase = VISU::Base::_narrow(anObj); - if (!CORBA::is_nil(aBase)) { - VISU::VISUType aType = aBase->GetType(); - switch (aType) { - case VISU::TRESULT: - { - SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject); - for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) { - SALOMEDS::SObject_var aChildSObject = aChildIter->Value(); - CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject); - if (CORBA::is_nil(aChildObj)) continue; - VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aChildObj); - if (CORBA::is_nil(aPrs3d)) continue; - VISU::Prs3d_i* pPrs3d = dynamic_cast(VISU::GetServant(aPrs3d).in()); - DeletePrs3d(this, pPrs3d, NULL); - } - break; - } - case VISU::TTABLE: - { - SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject); - for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) { - SALOMEDS::SObject_var aChildSObject = aChildIter->Value(); - CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject); - if (CORBA::is_nil(aChildObj)) continue; - CORBA::Object_ptr aCurve = VISU::Curve::_narrow(aChildObj); - if (CORBA::is_nil(aCurve)) continue; - //VISU::Curve_i* pCurve = dynamic_cast(VISU::GetServant(aCurve).in()); - //jfa tmp:DeleteCurve(this, pCurve, NULL); - } - break; - } - } - } - } - aStudyBuilder->RemoveObjectWithChildren(aSObject); - aStudyBuilder->CommitCommand(); - //jfa tmp:GetActiveStudy()->unHighlightAll(); - updateObjBrowser(true); - } -} - void VisuGUI:: OnDeleteObjects() @@ -1519,38 +1416,6 @@ OnRestoreViewParams() VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp } -void -VisuGUI:: -OnDeleteViewParams() -{ - _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); - if (CheckLock(aCStudy)) - return; - SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy); - - Handle(SALOME_InteractiveObject) anIO; - CORBA::Object_var anObject = GetSelectedObj(this, &anIO); - _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry()); - if (!aSObject) return; - - VISU::VISUType aType = (VISU::VISUType)getValue(aSObject, "myType").toInt(); - if (aType == VISU::TVIEW3D) { - SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); - SALOME_ListIO aListIO, aNewListIO; - aSelectionMgr->selectedObjects(aListIO); - for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) { - if (it.Value()->getEntry() != anIO->getEntry()) { - aNewListIO.Append(it.Value()); - } - } - aSelectionMgr->setSelectedObjects(aNewListIO); - - aCStudy->NewBuilder()->RemoveObject(aSObject); - - updateObjBrowser(); - } -} - void VisuGUI:: OnRename() @@ -1860,7 +1725,13 @@ void VisuGUI:: OnSelectionInfo() { - (new VisuGUI_SelectionDlg(GetDesktop(this)))->show(); + if (GetViewWindow()) + (new VisuGUI_SelectionDlg(GetDesktop(this)))->show(); + else + SUIT_MessageBox::warn1(GetDesktop(this), + tr("WRN_VISU"), + tr("ERR_ACTIVATE_VIEW3D"), + tr("BUT_OK") ); } void @@ -2188,20 +2059,22 @@ createActions() createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIconSet(), tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false, this, SLOT(OnClearContainer())); - //aPixmap = aResourceMgr->loadPixmap("VISU",tr("")); createAction( VISU_SAVE_VIEW_PARAMS, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(), tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false, this, SLOT(OnSaveViewParams())); + createAction( VISU_SAVE_VIEW_PARAMS_1, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(), + tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false, + this, SLOT(OnSaveViewParams())); //aPixmap = aResourceMgr->loadPixmap("VISU",tr("")); createAction( VISU_RESTORE_VIEW_PARAMS, tr("MEN_RESTORE_VIEWPARAMS"), QIconSet(), tr("MEN_RESTORE_VIEWPARAMS"), "", 0, aParent, false, this, SLOT(OnRestoreViewParams())); - //aPixmap = aResourceMgr->loadPixmap("VISU",tr("")); createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIconSet(), tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false, - this, SLOT(OnDeleteViewParams())); + //this, SLOT(OnDeleteViewParams())); + this, SLOT(OnDeleteObjects())); createAction( VISU_ARRANGE_ACTORS, tr("MEN_ARRANGE_ACTORS"), QIconSet(), tr("MEN_ARRANGE_ACTORS"), "", 0, aParent, false, @@ -2462,6 +2335,7 @@ createPopupMenus() // view parameters commands mgr->insert( action( VISU_SAVE_VIEW_PARAMS ), -1, -1, -1 ); // save view params + mgr->insert( action( VISU_SAVE_VIEW_PARAMS_1 ), -1, -1, -1 ); // save view params mgr->insert( action( VISU_RESTORE_VIEW_PARAMS ), -1, -1, -1 ); // restore view params mgr->insert( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params @@ -2522,9 +2396,9 @@ createPopupMenus() mgr->setRule( action( VISU_FREE_SCALAR_BARS ), aRule, true ); // View parameters - //jfa tmp:aRule = "(client='VTKViewer' and selcount=0) or (selcount=1 and type='VISU::TVIEW3D')"; - //jfa tmp:mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), aRule, true ); - mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), "client='VTKViewer' and selcount=0", true ); //jfa tmp + aRule = "selcount=1 and type='VISU::TVIEW3D'"; + mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule, true ); + mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), "client='VTKViewer' and selcount=0", true ); mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true ); mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true ); @@ -2594,7 +2468,7 @@ createPopupMenus() mgr->setRule( action( VISU_SWEEP ), aRule, true ); // Selection info popup item - aRule = "client='ObjectBrowser' and selcount=1" + aInsideType; + aRule = "client='VTKViewer' and selcount=1" + aInsideType; mgr->setRule( action( VISU_SELECTION_INFO ), aRule, true ); aRule = "client='ObjectBrowser' and selcount>0 and $type in {'VISU::TFIELD'} and nbTimeStamps>1"; diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index 7c9f3fbd..10a62f2f 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -88,7 +88,7 @@ protected slots: void OnCreatePlot2dView(); void OnEditPrs(); - void OnDeletePrs(); + //void OnDeletePrs(); void OnDisplayPrs(); void OnDisplayOnlyPrs(); @@ -109,7 +109,7 @@ protected slots: void OnShowTable(); void OnCreateTable(); - void OnDeleteObject(); + //void OnDeleteObject(); void OnDeleteObjects(); void OnPlotData(); void OnCurveProperties(); @@ -121,7 +121,7 @@ protected slots: void OnSaveViewParams(); void OnRestoreViewParams(); - void OnDeleteViewParams(); + //void OnDeleteViewParams(); void OnRename(); void OnClippingPlanes(); diff --git a/src/VISUGUI/VisuGUI_ActionsDef.h b/src/VISUGUI/VisuGUI_ActionsDef.h index 94e1ed64..c78ac716 100644 --- a/src/VISUGUI/VisuGUI_ActionsDef.h +++ b/src/VISUGUI/VisuGUI_ActionsDef.h @@ -22,7 +22,7 @@ #define VISU_PLOT2D 4018 #define VISU_PLOT_3D 4019 -#define VISU_DELETE 4021 +//#define VISU_DELETE 4021 #define VISU_DELETE_OBJS 4022 #define VISU_SHOW_TABLE 4023 @@ -34,14 +34,15 @@ #define VISU_ERASE 4030 #define VISU_DISPLAY 4031 #define VISU_DISPLAY_ONLY 4032 -#define VISU_DELETE_PRS 4033 +//#define VISU_DELETE_PRS 4033 #define VISU_COPY_PRS 4037 #define VISU_CURVE_PROPS 4040 #define VISU_RENAME 4041 #define VISU_EDIT_CONTAINER 4042 -#define VISU_CLEAR_CONTAINER 4044 +#define VISU_CLEAR_CONTAINER 4043 +#define VISU_SAVE_VIEW_PARAMS_1 4045 #define VISU_SAVE_VIEW_PARAMS 4046 #define VISU_RESTORE_VIEW_PARAMS 4047 #define VISU_DELETE_VIEW_PARAMS 4048 diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx index 55f1dcf3..8bb166b6 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx @@ -40,25 +40,15 @@ using namespace std; -//extern VisuGUI *visuGUI; - -//#define GET_VTK_VIEWWINDOW(aMgr) dynamic_cast(aMgr->getActiveView()) - bool VisuGUI_CutLinesDlg::MYGenerateTable = true; bool VisuGUI_CutLinesDlg::MYGenerateCurve = true; -//SalomeApp_Study* study() -//{ -// return dynamic_cast(VisuGUI::application()->activeStudy()); -//} - -VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (QWidget* parent, bool theIsCreation, bool theIsModal) - : QDialog(parent, "VisuGUI_CutLinesDlg", theIsModal, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), +VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule, + bool theIsCreation, bool theIsModal) + : QDialog(VISU::GetDesktop(theModule), "VisuGUI_CutLinesDlg", theIsModal, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), myPreviewActor(0) - //,myMgr(VisuGUI::application()->activeViewManager()) { - //myStudyWnd = myMgr->getActiveView(); if (!theIsModal) { setWFlags(getWFlags() | WDestructiveClose); } diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.h b/src/VISUGUI/VisuGUI_CutLinesDlg.h index c33b1566..5d9d103a 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.h +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.h @@ -17,6 +17,7 @@ #include class SUIT_ViewManager; +class SalomeApp_Module; namespace VISU{ class CutLines_i; @@ -27,7 +28,7 @@ class VisuGUI_CutLinesDlg: public QDialog Q_OBJECT public: - VisuGUI_CutLinesDlg (QWidget* parent, bool theIsCreation = true, bool theIsModal = true); + VisuGUI_CutLinesDlg (SalomeApp_Module* theModule, bool theIsCreation = true, bool theIsModal = true); ~VisuGUI_CutLinesDlg(); void initFromPrsObject (VISU::CutLines_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index 5eb5e1e7..845a9a86 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -62,8 +62,8 @@ using namespace std; //extern VisuGUI *visuGUI; -VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent/*, SUIT_ViewManager* theMgr*/) - : QFrame(theParent), myPreviewActor(0)//, myMgr(theMgr) +VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent) + : QFrame(theParent), myPreviewActor(0) { QGridLayout* TopLayout = new QGridLayout( this ); TopLayout->setSpacing( 6 ); @@ -458,12 +458,11 @@ void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview) /*! Constructor */ -VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (QWidget* parent, bool theIsCreation, bool theIsModal) - : QDialog(parent, "VisuGUI_CutPlanesDlg", theIsModal, WStyle_Customize | +VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule, + bool theIsCreation, bool theIsModal) + : QDialog(VISU::GetDesktop(theModule), "VisuGUI_CutPlanesDlg", theIsModal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) - //,myMgr(VisuGUI::application()->activeViewManager()) { - //myStudyWnd = myMgr->getActiveView(); if (!theIsModal) { setWFlags(getWFlags() | WDestructiveClose); } diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.h b/src/VISUGUI/VisuGUI_CutPlanesDlg.h index 19d10b82..227830fa 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.h +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.h @@ -43,6 +43,7 @@ class QtxDblSpinBox; class SUIT_ViewWindow; class SUIT_ViewManager; +class SalomeApp_Module; class VisuGUI_CutPlanesPane : public QFrame @@ -50,7 +51,7 @@ class VisuGUI_CutPlanesPane : public QFrame Q_OBJECT public: - VisuGUI_CutPlanesPane(QWidget* theParent/*, SUIT_ViewManager * theStudy*/); + VisuGUI_CutPlanesPane (QWidget* parent); ~VisuGUI_CutPlanesPane(); void setNbPlanes( const int nbp ) {nbPlan->setValue( nbp );} @@ -85,9 +86,7 @@ private: double Y1, Y2; double Z1, Z2; bool hasInit; - //SUIT_ViewManager *myMgr; - //vector myPreviewActors; SALOME_Actor* myPreviewActor; private slots: @@ -106,8 +105,8 @@ class VisuGUI_CutPlanesDlg : public QDialog Q_OBJECT public: - //VisuGUI_CutPlanesDlg(QWidget* parent, bool theIsCreation = true, bool theIsModal = false); - VisuGUI_CutPlanesDlg (QWidget* parent, bool theIsCreation = true, bool theIsModal = true); + VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule, + bool theIsCreation = true, bool theIsModal = true); ~VisuGUI_CutPlanesDlg() {}; void initFromPrsObject (VISU::CutPlanes_i* thePrs); diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index 7e63126a..1dcf9e63 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -27,8 +27,14 @@ // $Header$ #include "VisuGUI_DeformedShapeDlg.h" + +#include "VisuGUI_Tools.h" + #include "VISU_DeformedShape_i.hh" +#include "SalomeApp_Module.h" +#include "SUIT_Desktop.h" + #include #include @@ -37,9 +43,9 @@ using namespace std; /*! * Constructor */ -VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg(QWidget* parent) - : QDialog(parent, "VisuGUI_DeformedShapeDlg", true, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) + : QDialog(VISU::GetDesktop(theModule), "VisuGUI_DeformedShapeDlg", true, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { setCaption(tr("DLG_TITLE")); setSizeGripEnabled(TRUE); diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h index f8677b62..bd735a5a 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h @@ -1,28 +1,28 @@ // VISU VISUGUI : GUI of VISU component // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org // // // // File : VisuGUI_MagnitudeDlg.h -// Author : Laurent CORNABE & Hubert ROLLAND +// Author : Laurent CORNABE & Hubert ROLLAND // Module : VISU // $Header$ @@ -31,29 +31,31 @@ #include "VisuGUI_ScalarBarDlg.h" +#include "QtxDblSpinBox.h" + #include #include #include #include #include -#include "QtxDblSpinBox.h" +class SalomeApp_Module; namespace VISU{ class DeformedShape_i; } class VisuGUI_DeformedShapeDlg : public QDialog -{ +{ Q_OBJECT public: - VisuGUI_DeformedShapeDlg(QWidget* parent); + VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule); ~VisuGUI_DeformedShapeDlg() {}; - - double getFactor() + + double getFactor() { return ScalFact->value(); } - void setFactor(double theFactor) + void setFactor(double theFactor) { ScalFact->setValue(theFactor); } bool isColored() @@ -64,7 +66,7 @@ public: protected slots: void accept(); - + private: QtxDblSpinBox* ScalFact; QCheckBox* UseMagn; diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx index 21503938..344e30a2 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx @@ -27,8 +27,9 @@ // $Header$ #include "VisuGUI_IsoSurfacesDlg.h" + #include "VisuGUI.h" -//#include "VisuGUI_Selection.h" +#include "VisuGUI_Tools.h" #include "SalomeApp_Application.h" @@ -160,8 +161,8 @@ bool VisuGUI_IsoSurfPane::check() /*! Constructor */ -VisuGUI_IsoSurfacesDlg::VisuGUI_IsoSurfacesDlg (QWidget* parent) - : QDialog(parent, "VisuGUI_IsoSurfacesDlg", true, +VisuGUI_IsoSurfacesDlg::VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule) + : QDialog(VISU::GetDesktop(theModule), "VisuGUI_IsoSurfacesDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { setCaption(tr("DEFINE_ISOSURFACES")); diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h index 9f470176..f3ad7c0b 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h @@ -40,55 +40,55 @@ #include #include +class SalomeApp_Module; + class VisuGUI_IsoSurfPane : public QVBox { - Q_OBJECT + Q_OBJECT; -public: - VisuGUI_IsoSurfPane(QWidget* parent); - ~VisuGUI_IsoSurfPane() {}; + public: + VisuGUI_IsoSurfPane (QWidget* parent); + ~VisuGUI_IsoSurfPane() {}; - void initFromPrsObject(VISU::IsoSurfaces_i* thePrs); - int storeToPrsObject(VISU::IsoSurfaces_i* thePrs); + void initFromPrsObject(VISU::IsoSurfaces_i* thePrs); + int storeToPrsObject(VISU::IsoSurfaces_i* thePrs); - void setScalarBarPane(VisuGUI_ScalarBarPane* theScalarPane) {myScalarPane = theScalarPane;} - VisuGUI_ScalarBarPane* getScalarBarPane() {return myScalarPane;} + void setScalarBarPane(VisuGUI_ScalarBarPane* theScalarPane) {myScalarPane = theScalarPane;} + VisuGUI_ScalarBarPane* getScalarBarPane() {return myScalarPane;} - bool check(); + bool check(); -protected slots: + protected slots: void onCBUpdate(); -private: + private: QLineEdit* MinIso; QLineEdit* MaxIso; QSpinBox* NbrIso; - //QCheckBox* CBUpdate; VisuGUI_ScalarBarPane* myScalarPane; - // QCheckBox* CBLog; }; class VisuGUI_IsoSurfacesDlg : public QDialog { - Q_OBJECT + Q_OBJECT; -public: - VisuGUI_IsoSurfacesDlg(QWidget* parent); - ~VisuGUI_IsoSurfacesDlg() {}; + public: + VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule); + ~VisuGUI_IsoSurfacesDlg() {}; - void initFromPrsObject(VISU::IsoSurfaces_i* thePrs) - {myScalarPane->initFromPrsObject(thePrs); myIsoPane->initFromPrsObject(thePrs);} + void initFromPrsObject(VISU::IsoSurfaces_i* thePrs) + {myScalarPane->initFromPrsObject(thePrs); myIsoPane->initFromPrsObject(thePrs);} - int storeToPrsObject(VISU::IsoSurfaces_i* thePrs) - {return myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs);} + int storeToPrsObject(VISU::IsoSurfaces_i* thePrs) + {return myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs);} -protected slots: + protected slots: void accept(); -private: - VisuGUI_IsoSurfPane* myIsoPane; - VisuGUI_ScalarBarPane* myScalarPane; + private: + VisuGUI_IsoSurfPane* myIsoPane; + VisuGUI_ScalarBarPane* myScalarPane; }; #endif // VISUGUI_ISOSURFACESDLG_H diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index 19ff935d..54aa2650 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -36,6 +36,7 @@ #include "SALOME_Actor.h" #include "SVTK_ViewWindow.h" +#include "SUIT_Desktop.h" #include #include @@ -60,10 +61,8 @@ using namespace std; static void renderViewFrame (SVTK_ViewWindow* vw) { if (vw) { -//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) { - vw->getRenderer()->ResetCameraClippingRange(); - vw->Repaint(); -//} + vw->getRenderer()->ResetCameraClippingRange(); + vw->Repaint(); } } @@ -498,8 +497,8 @@ bool VisuGUI_Plot3DPane::check() //function : Constructor //purpose : //======================================================================= -VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg(QWidget* parent) - : QDialog(parent, "VisuGUI_Plot3DDlg", false, WStyle_Customize | +VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg (SalomeApp_Module* theModule) + : QDialog(VISU::GetDesktop(theModule), "VisuGUI_Plot3DDlg", false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { setCaption(tr("TITLE")); diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.h b/src/VISUGUI/VisuGUI_Plot3DDlg.h index 8194f1d7..a1e59f90 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.h +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.h @@ -35,6 +35,8 @@ #include +class SalomeApp_Module; + namespace VISU { class Plot3D_i; }; @@ -96,7 +98,7 @@ class VisuGUI_Plot3DDlg : public QDialog Q_OBJECT public: - VisuGUI_Plot3DDlg (QWidget* parent); + VisuGUI_Plot3DDlg (SalomeApp_Module* theModule); ~VisuGUI_Plot3DDlg() {}; void initFromPrsObject (VISU::Plot3D_i* thePrs) diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index bee38dc5..5ad002e1 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -29,6 +29,7 @@ #include "VisuGUI_ScalarBarDlg.h" #include "VisuGUI.h" +#include "VisuGUI_Tools.h" #include "VisuGUI_FontWg.h" #include "VISUConfig.hh" @@ -833,8 +834,9 @@ void VisuGUI_ScalarBarPane::onTextPref() /*! Constructor */ -VisuGUI_ScalarBarDlg::VisuGUI_ScalarBarDlg (QWidget* parent, bool SetPref) - : QDialog(parent, 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +VisuGUI_ScalarBarDlg::VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule, bool SetPref) + : QDialog(VISU::GetDesktop(theModule), 0, true, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { setName("VisuGUI_ScalarBarDlg"); setCaption(SetPref ? tr("DLG_PREF_TITLE") : tr("DLG_PROP_TITLE")); diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.h b/src/VISUGUI/VisuGUI_ScalarBarDlg.h index ad8f4f18..c8ddc6ab 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.h @@ -59,7 +59,7 @@ class QVBox; class QToolButton; class QtxDblSpinBox; - +class SalomeApp_Module; class VisuGUI_FontWg; class VisuGUI_TextPrefDlg: public QDialog @@ -163,7 +163,7 @@ class VisuGUI_ScalarBarDlg : public QDialog Q_OBJECT; public: - VisuGUI_ScalarBarDlg( QWidget* parent = 0, bool SetPref = FALSE ); + VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule, bool SetPref = FALSE); ~VisuGUI_ScalarBarDlg() {}; bool isToSave() {return myScalarPane->isToSave();} diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index 1f814946..5bd77a64 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -258,12 +258,11 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (QWidget* parent) myFl = false; - //onSelectionChange(0); SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow(); // Activate Points pane myWidgetStack->raiseWidget(myPointsPane); - aSVTKVW->SetSelectionMode(NodeSelection); - //onPointIdEdit(myIDValLbl->text()); + if (aSVTKVW) + aSVTKVW->SetSelectionMode(NodeSelection); onSelectionEvent(); mySelectionDlg = this; @@ -276,6 +275,7 @@ VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg() void VisuGUI_SelectionDlg::onSelectionChange (int theId) { SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow(); + if (!aSVTKVW) return; switch (theId) { case 0: // Points @@ -301,7 +301,8 @@ void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent) SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow(); mySelectionDlg = NULL; - aSVTKVW->SetSelectionMode(ActorSelection); + if (aSVTKVW) + aSVTKVW->SetSelectionMode(ActorSelection); disconnect(mySelectionMgr,0,0,0); QDialog::closeEvent(theEvent); } @@ -335,6 +336,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { (SUIT_Session::session()->activeApplication()); SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow(); + if (!aSVTKVW) return; SVTK_Selector* aSelector = aSVTKVW->GetSelector(); VISU::Prs3d_i* aPrs3d = NULL; @@ -516,6 +518,7 @@ bool onIdEdit (const QString& theText, SalomeApp_Application* anApp = dynamic_cast (SUIT_Session::session()->activeApplication()); SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow(); + if (!aSVTKVW) return false; SVTK_Selector* aSelector = aSVTKVW->GetSelector(); VISU::Prs3d_i* aPrs3d = NULL; diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx index cd368f93..9f554b33 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx @@ -11,6 +11,7 @@ #include "VisuGUI_StreamLinesDlg.h" #include "VisuGUI.h" +#include "VisuGUI_Tools.h" #include "VISU_Mesh_i.hh" #include "VISU_Gen_i.hh" @@ -21,13 +22,16 @@ #include "SalomeApp_Application.h" #include "SalomeApp_SelectionMgr.h" +#include "SVTK_ViewWindow.h" + #include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" #include "SUIT_MessageBox.h" #include "SALOME_ListIO.hxx" -#include "SVTK_ViewWindow.h" +#include +#include #include #include @@ -35,14 +39,12 @@ #include #include -#include -#include - using namespace std; -VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (QWidget* parent) - : QDialog(parent, "VisuGUI_StreamLinesDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) + : QDialog(VISU::GetDesktop(theModule), "VisuGUI_StreamLinesDlg", false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), + myVisuGUI(theModule) { myPrs = NULL; setCaption(tr("DLG_TITLE")); @@ -82,38 +84,39 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (QWidget* parent) connect(myUseSrcCombo, SIGNAL(activated(int)), this, SLOT(onSourceTypeChange(int))); // Find All prs obj -/* - SUIT_Study* aActiveStudy = VisuGUI::GetActiveStudy(); - SalomeApp_SelectionMgr* aSel = VisuGUI::application()->selectionMgr(); - SALOME_ListIO selected; aSel->selectedObjects( selected ); - if( selected.Extent() > 0 ) { + //SUIT_Study* aActiveStudy = VISU::(myVisuGUI); + _PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI)); + SalomeApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI); + SALOME_ListIO selected; + aSel->selectedObjects(selected); + if (selected.Extent() > 0) { Handle(SALOME_InteractiveObject) aIO = selected.First(); - if (aIO->hasEntry()){ - SALOMEDSClient_SObject* aSObject = VisuGUI::GetStudyDocument()->FindObjectID(aIO->getEntry()); + if (aIO->hasEntry()) { + _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry()); aSObject = aSObject->GetFather(); aSObject = aSObject->GetFather(); aSObject = aSObject->GetFather(); aSObject = aSObject->GetFather(); mySelectionObj = aSObject; - CORBA::Object_var anObject = VISU::ClientSObjectToObject( mySelectionObj ); + CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj); VISU::Result_var aResult; if (CORBA::is_nil(anObject)) { mySelectionObj = mySelectionObj->GetFather(); } - SALOMEDSClient_ChildIterator* aIter = VisuGUI::GetStudyDocument()->NewChildIterator( mySelectionObj ); + _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj); - for (aIter->InitEx(true); aIter->More(); aIter->Next() ) { - SALOMEDSClient_SObject* aChildSObj = aIter->Value(); - CORBA::Object_var aChildObject = VISU::ClientSObjectToObject( aChildSObj ); + for (aIter->InitEx(true); aIter->More(); aIter->Next()) { + _PTR(SObject) aChildSObj = aIter->Value(); + CORBA::Object_var aChildObject = VISU::ClientSObjectToObject(aChildSObj); - if(!CORBA::is_nil( aChildObject ) ) { - VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow( aChildObject ); - if( !CORBA::is_nil( aPrsObj ) ) { // if this is a Prs object + if (!CORBA::is_nil(aChildObject)) { + VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject); + if (!CORBA::is_nil(aPrsObj)) { // if this is a Prs object if ((aPrsObj->GetType() != VISU::TSTREAMLINES) && (aPrsObj->GetType() != VISU::TMESH)) { - SALOMEDSClient_GenericAttribute* anAttr; - if ( aChildSObj->FindAttribute(anAttr, "AttributeName") ) { - SALOMEDSClient_AttributeName* aName = dynamic_cast( anAttr ); + _PTR(GenericAttribute) anAttr; + if (aChildSObj->FindAttribute(anAttr, "AttributeName")) { + _PTR(AttributeName) aName (anAttr); myPrsLst += QString(aName->Value()); myPrsList.append(aPrsObj); continue; @@ -122,22 +125,22 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (QWidget* parent) } } // else { // This is not a Prs object - SALOMEDSClient_GenericAttribute* anAttr; + _PTR(GenericAttribute) anAttr; if (aChildSObj->FindAttribute(anAttr, "AttributeComment")) { - SALOMEDSClient_AttributeComment* aComment = dynamic_cast( anAttr ); + _PTR(AttributeComment) aComment (anAttr); string aComm = aComment->Value(); - QString strIn(aComm.c_str()); + QString strIn (aComm.c_str()); VISU::Storable::TRestoringMap aMap; VISU::Storable::StrToMap(strIn,aMap); bool isExist; VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt(); if (isExist) { if ((aType == VISU::TFAMILY) || (aType == VISU::TGROUP) || (aType == VISU::TENTITY)) { - SALOMEDSClient_GenericAttribute* aNameAttr; - if ( aChildSObj->FindAttribute(aNameAttr, "AttributeName") ) { - SALOMEDSClient_AttributeName* aName = dynamic_cast( aNameAttr ); - VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow( aChildObject ); - switch(aType) { + _PTR(GenericAttribute) aNameAttr; + if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) { + _PTR(AttributeName) aName (aNameAttr); + VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject); + switch (aType) { case VISU::TFAMILY: myFamilisLst += QString(aName->Value()); myFamilyList.append(aPrsObj); @@ -158,7 +161,7 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (QWidget* parent) } } } -*/ + // connect(myUseSrcChk, SIGNAL(toggled(bool)), mySrcCombo, SLOT(setEnabled(bool))); aSrcLayout->addMultiCellWidget(mySrcCombo, 1, 1, 0, 1); diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.h b/src/VISUGUI/VisuGUI_StreamLinesDlg.h index f38b9d3c..59fae6ca 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.h +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.h @@ -21,6 +21,7 @@ #include "SALOMEconfig.h" #include CORBA_CLIENT_HEADER(VISU_Gen) +class SalomeApp_Module; class QtxDblSpinBox; class SALOMEDSClient_SObject; @@ -32,7 +33,7 @@ class VisuGUI_StreamLinesDlg: public QDialog { Q_OBJECT public: - VisuGUI_StreamLinesDlg(QWidget* parent); + VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule); ~VisuGUI_StreamLinesDlg() {}; void initFromPrsObject(VISU::StreamLines_i* thePrs); @@ -64,6 +65,9 @@ private: QComboBox* myUseSrcCombo; QtxDblSpinBox* myPntPercent; QComboBox* mySrcCombo; + + VisuGUI_ScalarBarPane* myScalarPane; + QValueList myPrsList; QValueList myEntityList; QValueList myFamilyList; @@ -72,10 +76,10 @@ private: QStringList myFamilisLst; QStringList myGroupsLst; QStringList myPrsLst; - SALOMEDSClient_SObject* mySelectionObj; - VisuGUI_ScalarBarPane* myScalarPane; + _PTR(SObject) mySelectionObj; VISU::StreamLines_i* myPrs; + SalomeApp_Module* myVisuGUI; private slots: void setVColor(); diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index cfb7e796..1bae73cc 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -372,9 +372,10 @@ void ArrangeDlg::acceptViewWindow() //***************************************************************************************************** //***************************************************************************************************** //***************************************************************************************************** -SetupDlg::SetupDlg (QWidget* theParent, VISU_TimeAnimation* theAnimator) - : QDialog(theParent, "SetupDlg", true, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +SetupDlg::SetupDlg (VisuGUI* theModule, VISU_TimeAnimation* theAnimator) + : QDialog(VISU::GetDesktop(theModule), "SetupDlg", true, WStyle_Customize | + WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), + myModule(theModule) { setCaption("Setup Animation"); setSizeGripEnabled( TRUE ); @@ -613,7 +614,7 @@ void SetupDlg::onPreferencesDlg() #define EDITPRS(TYPE, DLG) {\ - DLG* aDlg = new DLG(this);\ + DLG* aDlg = new DLG (myModule);\ aDlg->initFromPrsObject(dynamic_cast(aData.myPrs[0]));\ if (aDlg->exec())\ { \ @@ -829,8 +830,6 @@ static const char * pauseIco[] = { static QPixmap MYpausePixmap(pauseIco); -//VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (QWidget* parent, _PTR(Study) theStudy) -// : QDialog(parent, "VisuGUI_TimeAnimationDlg", false, WStyle_Customize | VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Study) theStudy) : QDialog(VISU::GetDesktop(theModule), "VisuGUI_TimeAnimationDlg", false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose) @@ -1157,7 +1156,7 @@ void VisuGUI_TimeAnimationDlg::onExecution (long theNewFrame, double theTime) void VisuGUI_TimeAnimationDlg::onSetupDlg() { if (myAnimator->getNbFrames() > 0) myAnimator->firstFrame(); - SetupDlg* aDlg = new SetupDlg(this, myAnimator); + SetupDlg* aDlg = new SetupDlg (myModule, myAnimator); aDlg->exec(); myPlayFrame->setEnabled(false); delete aDlg; diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.h b/src/VISUGUI/VisuGUI_TimeAnimation.h index 709d341a..f9fd9743 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.h +++ b/src/VISUGUI/VisuGUI_TimeAnimation.h @@ -90,7 +90,7 @@ class SetupDlg: public QDialog { Q_OBJECT public: - SetupDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator); + SetupDlg(VisuGUI* theModule, VISU_TimeAnimation* theAnimator); ~SetupDlg() {}; private slots: @@ -104,6 +104,7 @@ class SetupDlg: public QDialog { void onArrangeDlg(); private: + VisuGUI* myModule; VISU_TimeAnimation* myAnimator; QListBox* myFieldLst; QComboBox* myTypeCombo; diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index c53d8af9..23b90dc2 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -271,6 +271,12 @@ namespace VISU theSelectionMgr->setSelectedObjects(aNewListIO); } + /*! + * \brief Check, if "Delete" popup-menu can be put on current selection + * + * \param theModule - is used to access SelectionManager, Study and VISU_Gen + * \retval bool - returns TRUE if all currently selected objects are removable + */ bool IsRemovableSelected (const SalomeApp_Module* theModule) { @@ -281,11 +287,25 @@ namespace VISU if (aListIO.Extent() < 1) return false; + _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule)); + if (!aStudy) return false; + + // In some cases single selection can have its own popup-menu item for deletion + if (aListIO.Extent() == 1) { + Handle(SALOME_InteractiveObject) anIO = aListIO.First(); + _PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry()); + if (aSObject) { + VISU::VISUType aType = (VISU::VISUType)getValue(aSObject, "myType").toInt(); + if (aType == VISU::TVIEW3D) { + return false; // special case + } + } + } + SALOME_ListIteratorOfListIO anIter (aListIO); for (; anIter.More(); anIter.Next()) { Handle(SALOME_InteractiveObject) anIO = anIter.Value(); if (anIO->hasEntry()) { - _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule)); _PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry()); VISU::Storable::TRestoringMap pMap; if (aSObject) { diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.cxx b/src/VISUGUI/VisuGUI_VectorsDlg.cxx index 1a150753..86a10e9c 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.cxx +++ b/src/VISUGUI/VisuGUI_VectorsDlg.cxx @@ -27,9 +27,15 @@ // $Header$ #include "VisuGUI_VectorsDlg.h" -#include "VISU_Vectors_i.hh" + #include "VisuGUI.h" -#include "VisuGUI_Selection.h" +//#include "VisuGUI_Selection.h" +#include "VisuGUI_Tools.h" + +#include "VISU_Vectors_i.hh" + +#include "SalomeApp_Module.h" +#include "SUIT_Desktop.h" #include #include @@ -40,8 +46,8 @@ using namespace std; /*! Constructor */ -VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (QWidget* parent) - : QDialog(parent, "VisuGUI_VectorsDlg", true, +VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) + : QDialog(VISU::GetDesktop(theModule), "VisuGUI_VectorsDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) { setCaption(tr("DLG_TITLE")); diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.h b/src/VISUGUI/VisuGUI_VectorsDlg.h index d187a71e..70d99b7c 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.h +++ b/src/VISUGUI/VisuGUI_VectorsDlg.h @@ -1,28 +1,28 @@ // VISU VISUGUI : GUI of VISU component // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org // // // // File : VisuGUI_VectorsDlg.h -// Author : Laurent CORNABE & Hubert ROLLAND +// Author : Laurent CORNABE & Hubert ROLLAND // Module : VISU // $Header$ @@ -43,16 +43,19 @@ #include "SALOMEconfig.h" #include CORBA_CLIENT_HEADER(VISU_Gen) + +class SalomeApp_Module; + namespace VISU{ class Vectors_i; } class VisuGUI_VectorsDlg : public QDialog -{ +{ Q_OBJECT public: - VisuGUI_VectorsDlg(QWidget* parent); + VisuGUI_VectorsDlg (SalomeApp_Module* theModule); ~VisuGUI_VectorsDlg() {}; void setScaleFactor( double sf ); @@ -78,7 +81,7 @@ public: protected slots: void accept(); - + private: QGroupBox* TopGroup; QCheckBox* UseMagn; -- 2.39.2