Salome HOME
IPAL9285,9292,9314
authorjfa <jfa@opencascade.com>
Thu, 21 Jul 2005 11:49:44 +0000 (11:49 +0000)
committerjfa <jfa@opencascade.com>
Thu, 21 Jul 2005 11:49:44 +0000 (11:49 +0000)
24 files changed:
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_ActionsDef.h
src/VISUGUI/VisuGUI_CutLinesDlg.cxx
src/VISUGUI/VisuGUI_CutLinesDlg.h
src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.h
src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_DeformedShapeDlg.h
src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx
src/VISUGUI/VisuGUI_IsoSurfacesDlg.h
src/VISUGUI/VisuGUI_Plot3DDlg.cxx
src/VISUGUI/VisuGUI_Plot3DDlg.h
src/VISUGUI/VisuGUI_ScalarBarDlg.cxx
src/VISUGUI/VisuGUI_ScalarBarDlg.h
src/VISUGUI/VisuGUI_Selection.cxx
src/VISUGUI/VisuGUI_StreamLinesDlg.cxx
src/VISUGUI/VisuGUI_StreamLinesDlg.h
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISUGUI/VisuGUI_TimeAnimation.h
src/VISUGUI/VisuGUI_Tools.cxx
src/VISUGUI/VisuGUI_VectorsDlg.cxx
src/VISUGUI/VisuGUI_VectorsDlg.h

index a5519dac31ad2234adb40ad8fc4235b44682b0d5..824bffb0948511eb1802002435201536ee3029a2 100644 (file)
@@ -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"
 
index 39ae63851a971090ed6eb29e361a0957261c6a96..ced02edf286d7ad476290cd8de1e3e8be76be6a1 100644 (file)
@@ -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<TPrs3d_i*>(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::Prs3d_i*>(VISU::GetServant(anObject).in());
-  if (aPrsObject) {
-    DeletePrs3d(this, aPrsObject, anIO);
-  }
-
-  // is it Curve object ?
-  VISU::Curve_i* aCurveObject = dynamic_cast<VISU::Curve_i*>(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::Prs3d_i*>(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::Curve_i*>(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";
index 7c9f3fbdd1c8e1f6a700bbd5f76b7f981aa860e8..10a62f2f037c73da6dddd98b64e0c1b42a283d6b 100644 (file)
@@ -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();
index 94e1ed64a7d8248bba2a95229861e04e5f775e4e..c78ac716ba8d44765fd754f50a011548fc75f55b 100644 (file)
@@ -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
 #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
index 55f1dcf38a6e3c6003e294d4ad1c21b219456d7c..8bb166b64b0cfc33261c4613644355d3465bbe13 100644 (file)
 
 using namespace std;
 
-//extern VisuGUI *visuGUI;
-
-//#define GET_VTK_VIEWWINDOW(aMgr) dynamic_cast<VTKViewer_ViewWindow*>(aMgr->getActiveView())
-
 bool VisuGUI_CutLinesDlg::MYGenerateTable = true;
 bool VisuGUI_CutLinesDlg::MYGenerateCurve = true;
 
-//SalomeApp_Study* study()
-//{
-//  return dynamic_cast<SalomeApp_Study*>(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);
   }
index c33b15669dec0241fb601b5657ec135529b2f25a..5d9d103ad78cbc38981e17f678f8042d041ad97c 100644 (file)
@@ -17,6 +17,7 @@
 #include <qvalidator.h>
 
 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);
index 5eb5e1e7e53fd355f8463c7b7aa7a8e3bcd3cdd4..845a9a869dd53a8769f24174c131da4f1f9e6748 100644 (file)
@@ -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);
   }
index 19d10b82716ef4fca86e529d5a28428cf205158f..227830fa28c3456141fba234a51e463c797a3510 100644 (file)
@@ -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<SALOME_Actor*> 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);
index 7e63126ad6d255cca1a232447ca2cd4e42366371..1dcf9e6327eebeb8b972836453b273646b09f6a7 100644 (file)
 //  $Header$
 
 #include "VisuGUI_DeformedShapeDlg.h"
+
+#include "VisuGUI_Tools.h"
+
 #include "VISU_DeformedShape_i.hh"
 
+#include "SalomeApp_Module.h"
+#include "SUIT_Desktop.h"
+
 #include <qlayout.h>
 #include <qtabwidget.h>
 
@@ -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);
index f8677b62ba3c90c1728e73a45780484b62d20efd..bd735a5ac24558df7ecbe9450f563914660851ad 100644 (file)
@@ -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$
 
 
 #include "VisuGUI_ScalarBarDlg.h"
 
+#include "QtxDblSpinBox.h"
+
 #include <qdialog.h>
 #include <qgroupbox.h>
 #include <qcheckbox.h>
 #include <qlabel.h>
 #include <qpushbutton.h>
 
-#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;
index 215039381179c189102755bc65f82daa60331051..344e30a26d15924640c999113a832e68bb4c6665 100644 (file)
@@ -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"));
index 9f4701760145f71c997a252ba362704d2c4346dd..f3ad7c0bee28f9955a310a3fc3f5b8327f02d1f6 100644 (file)
 #include <qcheckbox.h>
 #include <qlineedit.h>
 
+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
index 19ff935dcfdd4ec3c9a3f1686a5a0563533db56e..54aa2650ad48ea295e44cee7c23bf6a71e796e4f 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "SALOME_Actor.h"
 #include "SVTK_ViewWindow.h"
+#include "SUIT_Desktop.h"
 
 #include <qlayout.h>
 #include <qvalidator.h>
@@ -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"));
index 8194f1d7276640ab385a247f563f7d9a3d301fe0..a1e59f90c2fb1f1229fb33097c688871c910b35b 100644 (file)
@@ -35,6 +35,8 @@
 
 #include <qhbuttongroup.h>
 
+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)
index bee38dc53c2528da084670d7e66d08b6d205d57c..5ad002e1e7ac89f1af0e203c7a39a83946c3bd6a 100644 (file)
@@ -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"));
index ad8f4f18f9fb4883c6180620ba8df64dc30064b4..c8ddc6ab4116933e582de69a094c7639d8c06925 100644 (file)
@@ -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();}
index 1f81494608d9183c142cefe6a47a3925e5d27f07..5bd77a643e0332245813d36afbbf918719c31989 100644 (file)
@@ -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<SalomeApp_Application*>
     (SUIT_Session::session()->activeApplication());
   SVTK_ViewWindow* aSVTKVW = VISU::GetViewWindow();
+  if (!aSVTKVW) return false;
   SVTK_Selector* aSelector = aSVTKVW->GetSelector();
 
   VISU::Prs3d_i* aPrs3d = NULL;
index cd368f93666aa9694ec741f7c1e4454f6f9a802a..9f554b33098244fffa231514c6d565486206eae3 100644 (file)
@@ -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"
 #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 <SALOMEDSClient_SObject.hxx>
+#include <SALOMEDS_SObject.hxx>
 
 #include <limits.h>
 #include <qlayout.h>
 #include <qcolordialog.h>
 #include <qtabwidget.h>
 
-#include <SALOMEDSClient_SObject.hxx>
-#include <SALOMEDS_SObject.hxx>
-
 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<SALOMEDSClient_AttributeName*>( 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<SALOMEDSClient_AttributeComment*>( 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<SALOMEDSClient_AttributeName*>( 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);
 
index f38b9d3cf4752f9e32eedffcbc1fd2bf4256ccd3..59fae6ca0f7442a3ae615ed26fd545b676acaeed 100644 (file)
@@ -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<VISU::Prs3d_var> myPrsList;
     QValueList<VISU::Prs3d_var> myEntityList;
     QValueList<VISU::Prs3d_var> 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();
index cfb7e796bf4edbbb1f6b5089cb44fbfbcda66b5f..1bae73cc5b17319169c07763503abd578a1870f3 100644 (file)
@@ -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<TYPE*>(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;
index 709d341ab4fad839d925a435b30b80ccbf9d77c9..f9fd9743058340b6a5788d1e88b0101301d74786 100644 (file)
@@ -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;
index c53d8af9b1ab5cb1ba6d096a54b3c50f7b14221b..23b90dc2d03f5509b0e9bc5884f8fc958ad7d6b4 100644 (file)
@@ -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) {
index 1a150753279fa128e364ddb8e3bd5f5957974f98..86a10e9c7fc38ea1e605e76b52bb0d6305ab2d4d 100644 (file)
 //  $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 <qlayout.h>
 #include <qcolordialog.h>
@@ -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"));
index d187a71e9d6e0ef6292e035436b1d5d6ba5e725d..70d99b7c5379c902c7c8353b09066defed321ca1 100644 (file)
@@ -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$
 
 
 #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;