Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / VISUGUI / VisuGUI_CutPlanesDlg.h
index e5ccea9ff9236f6552a37ce07eb502ec0b976382..5c8f019e4d5df4cfc5e1c58910acfc763a72f88a 100644 (file)
@@ -1,6 +1,6 @@
-//  VISU VISUGUI : GUI of VISU component
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2003-2007  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
 //  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
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
+//  VISU VISUGUI : GUI of VISU component
 //  File   : VisuGUI_CutPlanesDlg.h
 //  Author : Laurent CORNABE & Hubert ROLLAND
 //  Module : VISU
 //  $Header$
-
+//
 #ifndef VISUGUI_CUTPLANESDLG_H
 #define VISUGUI_CUTPLANESDLG_H
 
-#include "VisuGUI_ScalarBarDlg.h"
-#include "VISU_CutPlanes_i.hh"
+#include "VisuGUI_Prs3dDlg.h"
 
 #include <SALOME_Actor.h>
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
 
-#include <qradiobutton.h>
-#include <qtable.h>
+#include <QFrame>
+
+class QRadioButton;
+class QTabWidget;
+class QTableWidget;
+class QCheckBox;
+class QComboBox;
 
 #include "SALOMEconfig.h"
 #include CORBA_CLIENT_HEADER(VISU_Gen)
 
-class QtxDblSpinBox;
+#include <map>
+#include <vector>
+
+namespace VISU 
+{
+  class CutPlanes_i;
+  class Result_i;
+};
+
 class SUIT_ViewWindow;
 class SUIT_ViewManager;
 class SalomeApp_Module;
-
+class VisuGUI_InputPane;
 
 class VisuGUI_CutPlanesPane : public QFrame
 {
@@ -62,26 +76,40 @@ public:
     double getRotation1() {return Rot1->value();}
     double getRotation2() {return Rot2->value();}
 
-    void initFromPrsObject(VISU::CutPlanes_i* thePrs);
-    int storeToPrsObject(VISU::CutPlanes_i* thePrs);
+    double getScaleFactor();
+    void   setScaleFactor(double factor);
+
+    void   initFromPrsObject(VISU::CutPlanes_i* thePrs);
+    int    storeToPrsObject(VISU::CutPlanes_i* thePrs);
 
 private:
+    typedef std::vector<QString> TVectorialFieldsList;
+    typedef std::map<VISU::Entity, TVectorialFieldsList> TEntity2VectorialFields;
+    typedef std::pair<VISU::Entity,TVectorialFieldsList> TEntVectPair;
+    TEntity2VectorialFields myEntity2VectorialFields;
+
     void createPlanes();
     void deletePlanes();
 
+    void InitEntity2VectorialFieldsMap(VISU::ColoredPrs3d_i* thePrs);
+    void InsertAllVectorialFields();
+    void InitVectorialField();
 
     QLabel* LabelRot1;
     QLabel* LabelRot2;
-    QSpinBox* nbPlan;
-    QtxDblSpinBox* Rot1;
-    QtxDblSpinBox* Rot2;
+    QGroupBox* GDeformation;
+    SalomeApp_IntSpinBox* nbPlan;
+    SalomeApp_DoubleSpinBox* Rot1;
+    SalomeApp_DoubleSpinBox* Rot2;
     QRadioButton* RBzx;
     QRadioButton* RByz;
     QRadioButton* RBxy;
-    QtxDblSpinBox* myPosSpn;
-    QTable* myPosTable;
-    VISU::CutPlanes_i* myCutPlanes;
+    SalomeApp_DoubleSpinBox* myPosSpn;
+    QTableWidget* myPosTable;
+    SALOME::GenericObjPtr<VISU::CutPlanes_i> myCutPlanes;
     QCheckBox* myPreviewCheck;
+    QComboBox* myVectorialFieldCombo;
+    SalomeApp_DoubleSpinBox* myScaleSpn;
     double          X1, X2;
     double          Y1, Y2;
     double          Z1, Z2;
@@ -90,47 +118,54 @@ private:
     SALOME_Actor* myPreviewActor;
 
 private slots:
-    void editScalarBar();
     void orientationChanged( int );
     void DrawTable();
     void setDefault( int all = -1);
     void onValueChanged(int theRow, int theCol);
     void onRotation(double theValue);
     void onPreviewCheck(bool thePreview);
+    void onScaleFactorChanged(double);
+    void onDeformationCheck(bool);
+    void onVectorialFieldChanged(int);
 };
 
 
-class VisuGUI_CutPlanesDlg : public QDialog
+class VisuGUI_CutPlanesDlg : public VisuGUI_ScalarBarBaseDlg
 {
     Q_OBJECT
 
 public:
     VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule);
-    ~VisuGUI_CutPlanesDlg() {};
+    ~VisuGUI_CutPlanesDlg();
+
+    virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+                                    bool theInit );
 
-    void initFromPrsObject (VISU::CutPlanes_i* thePrs);
-    int  storeToPrsObject  (VISU::CutPlanes_i* thePrs);
+    virtual int  storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
+
+protected:
+    virtual QString        GetContextHelpFilePath();
 
 protected slots:
     void accept();
     void reject();
-    void onWindowActivated (SUIT_ViewWindow*);
 
 private:
+    QTabWidget*            myTabBox;
     VisuGUI_CutPlanesPane* myCutPane;
-    VisuGUI_ScalarBarPane* myScalarPane;
-    VISU::CutPlanes_i*     myPrs;
+    VisuGUI_InputPane*     myInputPane;
+    SALOME::GenericObjPtr<VISU::CutPlanes_i> myPrsCopy;
 };
 
 
-class VisuGUI_NumEditItem: public QTableItem
+/*class VisuGUI_NumEditItem: public QTableItem
 {
 public:
-    VisuGUI_NumEditItem(QTable* table, EditType et, const QString& text ):
+    VisuGUI_NumEditItem(QTableWidget* table, const QString& text ):
       QTableItem(table, et, text) {};
     ~VisuGUI_NumEditItem() {};
 
     QWidget* createEditor() const;
-};
+};*/
 
 #endif // VISUGUI_CUTPLANESDLG_H