Salome HOME
Merge from V5_1_main branch 24/11/2010
[modules/multipr.git] / src / MULTIPRGUI / MULTIPR_GUI.h
index bab9f4a18e021f54a355e3599bf9bed027009e06..5aec810f9f58c3bf6e404f2425b0dcccf097262e 100644 (file)
@@ -1,6 +1,24 @@
-// Project MULTIPR, IOLS WP1.2.1 - EDF/CS
-// Partitioning/decimation module for the SALOME v3.2 platform
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D
+//
+//  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
+// Partitioning/decimation module for the SALOME v3.2 platform
+//
 /**
  * \file    MULTIPR_GUI.h
  *
@@ -21,7 +39,8 @@
 
 #include <SalomeApp_Module.h>
 #include <LightApp_DataObject.h>
-#include <LightApp_DataModel.h>
+//#include <LightApp_DataModel.h>
+#include <SalomeApp_DataModel.h>
 
 #include <SALOMEconfig.h>
 #include CORBA_CLIENT_HEADER(MULTIPR)
@@ -36,6 +55,8 @@
 class SalomeApp_Application;
 class CAM_Module;
 
+class SUIT_Desktop;
+
 class QVBoxLayout;
 class QHBoxLayout;
 class QGridLayout;
@@ -47,6 +68,9 @@ class QLineEdit;
 class QSpinBox;
 class QPushButton;
 
+class QTimer;
+//class MULTIPR_GUI_ProgressCallbackDlg;
+class QProgressDialog;
 
 //*****************************************************************************
 // Class MULTIPR_GUI
@@ -70,6 +94,7 @@ public:
     void windows(QMap<int, int>&) const;
     
     MULTIPR_ORB::MULTIPR_Obj_ptr getMULTIPRObj();
+    void setMULTIPRObj (MULTIPR_ORB::MULTIPR_Obj_ptr theObj);
     
     SalomeApp_Application* getAppli() const;
     
@@ -77,6 +102,8 @@ public:
     
     const QStringList& getSelectedParts() const { return mSelectedParts; }
 
+    static SUIT_Desktop* desktop();
+
 public slots:
 
     bool deactivateModule(SUIT_Study*);
@@ -90,11 +117,13 @@ protected slots:
     void OnDecimate();
     void OnRemove();
     void OnSave();
-    
+
+    void timerDone(); // update saving progress dialog
+
 protected:
 
     virtual CAM_DataModel* createDataModel();
-    
+
     void retrieveSelectedParts();
     bool isPartExist(const char* partName);
     bool removeLowerResolution();
@@ -114,8 +143,13 @@ private:
 
     QString                      mMEDFileName;
     QStringList                  mSelectedParts;
-    MULTIPR_ORB::MULTIPR_Obj_ptr mMULTIPRObj;
-  
+    //MULTIPR_ORB::MULTIPR_Obj_ptr mMULTIPRObj;
+    MULTIPR_ORB::MULTIPR_Obj_var mMULTIPRObj;
+
+    QProgressDialog*             mProgress;
+    //MULTIPR_GUI_ProgressCallbackDlg* mProgress;
+    QTimer*                      mTimer;
+
 }; // class MULTIPR_GUI
 
 
@@ -146,7 +180,8 @@ protected:
 // Class MULTIPR_GUI_DataObject_Module
 //*****************************************************************************
 
-class MULTIPR_GUI_DataObject_Module : public MULTIPR_GUI_DataObject, public LightApp_ModuleObject
+
+class MULTIPR_GUI_DataObject_Module : public MULTIPR_GUI_DataObject
 {
 public:
 
@@ -157,8 +192,13 @@ public:
     virtual QString name()    const;
     virtual QPixmap icon()    const;
     virtual QString toolTip() const;
-};
 
+private:
+
+    CAM_DataModel* mDm;
+    SUIT_DataObject* mParent;
+
+};
 
 //*****************************************************************************
 // Class MULTIPR_GUI_DataObject_Mesh
@@ -223,17 +263,22 @@ public:
 // Class MULTIPR_GUI_DataModel
 //*****************************************************************************
 
-class MULTIPR_GUI_DataModel : public LightApp_DataModel
+//class MULTIPR_GUI_DataModel : public LightApp_DataModel
+class MULTIPR_GUI_DataModel : public SalomeApp_DataModel
 {
+
 public:
 
     MULTIPR_GUI_DataModel(CAM_Module*);
     virtual ~MULTIPR_GUI_DataModel();
 
+    virtual void update (LightApp_DataObject* = 0, LightApp_Study* = 0);
+
 protected:
 
     virtual void build();
-    
+    void buildAll (LightApp_Study* = 0);
+
 private:
 
     MULTIPR_GUI* mMULTIPR_GUI;
@@ -244,4 +289,3 @@ private:
 
 
 // EOF
-