Salome HOME
Fix for Bug IPAL8945
[modules/visu.git] / src / VISUGUI / VisuGUI_CutPlanesDlg.h
index 1696878250295e74e16027bbdf29f81890816bbc..e5ccea9ff9236f6552a37ce07eb502ec0b976382 100644 (file)
-//  File      : VisuGUI_CutPlanesDlg.h
-//  Created   : Wed Aug 01 10:23:06 2001
-//  Author    : Laurent CORNABE & Hubert ROLLAND 
-//  Project   : SALOME
-//  Module    : VISUGUI
-//  Copyright : PRINCIPIA
+//  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
+//
+//
+//
+//  File   : VisuGUI_CutPlanesDlg.h
+//  Author : Laurent CORNABE & Hubert ROLLAND
+//  Module : VISU
 //  $Header$
 
 #ifndef VISUGUI_CUTPLANESDLG_H
 #define VISUGUI_CUTPLANESDLG_H
 
-#include <qdialog.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qspinbox.h>
-#include "QAD_SpinBoxDbl.h"
-#include "VISU_PrsObject_i.hh"
 #include "VisuGUI_ScalarBarDlg.h"
+#include "VISU_CutPlanes_i.hh"
 
+#include <SALOME_Actor.h>
 
-class VisuGUI_CutPlanesDlg : public QDialog
-{ 
+#include <qradiobutton.h>
+#include <qtable.h>
+
+#include "SALOMEconfig.h"
+#include CORBA_CLIENT_HEADER(VISU_Gen)
+
+class QtxDblSpinBox;
+class SUIT_ViewWindow;
+class SUIT_ViewManager;
+class SalomeApp_Module;
+
+
+class VisuGUI_CutPlanesPane : public QFrame
+{
     Q_OBJECT
 
 public:
-    VisuGUI_CutPlanesDlg();
-    ~VisuGUI_CutPlanesDlg();
-
-    void setBounds( const double x1, const double x2, 
-                   const double y1, const double y2, 
-                   const double z1, const double z2 );
-    void   setNbPlanes( const int nbp );
-    int    getNbPlanes();
+    VisuGUI_CutPlanesPane (QWidget* parent);
+    ~VisuGUI_CutPlanesPane();
+
+    void   setNbPlanes( const int nbp ) {nbPlan->setValue( nbp );}
+    int    getNbPlanes() {return nbPlan->value();}
     void   setPlanePos( const VISU::CutPlanes::Orientation orient/*, const double pos1, const double pos2 */);
-    //void   setPlanePosFrac( const int orient, const double frac1, const double frac2 );
     VISU::CutPlanes::Orientation  getOrientaion();
-    //double getPlanePos1();
-    //double getPlanePos2();
     void   setRotation( const double r1, const double r2 );
-    double getRotation1();
-    double getRotation2();
+    double getRotation1() {return Rot1->value();}
+    double getRotation2() {return Rot2->value();}
 
     void initFromPrsObject(VISU::CutPlanes_i* thePrs);
-    void storeToPrsObject(VISU::CutPlanes_i* thePrs);
+    int storeToPrsObject(VISU::CutPlanes_i* thePrs);
 
-protected slots:
+private:
+    void createPlanes();
+    void deletePlanes();
 
 
-private:
-    //QLabel* Comment2_1;
-    //QLabel* Comment2_2;
     QLabel* LabelRot1;
     QLabel* LabelRot2;
     QSpinBox* nbPlan;
-    //QAD_SpinBoxDbl* PosPlan1;
-    //QAD_SpinBoxDbl* PosFrac1;
-    //QAD_SpinBoxDbl* PosPlan2;
-    //QAD_SpinBoxDbl* PosFrac2;
-    QAD_SpinBoxDbl* Rot1;
-    QAD_SpinBoxDbl* Rot2;
+    QtxDblSpinBox* Rot1;
+    QtxDblSpinBox* Rot2;
     QRadioButton* RBzx;
     QRadioButton* RByz;
     QRadioButton* RBxy;
-    //QGroupBox* GBplan1;
-    //QGroupBox* GBplan2;
-
+    QtxDblSpinBox* myPosSpn;
+    QTable* myPosTable;
+    VISU::CutPlanes_i* myCutPlanes;
+    QCheckBox* myPreviewCheck;
     double          X1, X2;
     double          Y1, Y2;
     double          Z1, Z2;
-    //int             nbPold;
-    
+    bool hasInit;
+
+    SALOME_Actor* myPreviewActor;
 
 private slots:
     void editScalarBar();
     void orientationChanged( int );
-    //void nbPlanChanged( int );
-    //void fracChanged( double );
-    //void posChanged( double );
+    void DrawTable();
+    void setDefault( int all = -1);
+    void onValueChanged(int theRow, int theCol);
+    void onRotation(double theValue);
+    void onPreviewCheck(bool thePreview);
 };
 
-#endif // VISUGUI_CUTPLANESDLG_H
 
+class VisuGUI_CutPlanesDlg : public QDialog
+{
+    Q_OBJECT
+
+public:
+    VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule);
+    ~VisuGUI_CutPlanesDlg() {};
+
+    void initFromPrsObject (VISU::CutPlanes_i* thePrs);
+    int  storeToPrsObject  (VISU::CutPlanes_i* thePrs);
 
+protected slots:
+    void accept();
+    void reject();
+    void onWindowActivated (SUIT_ViewWindow*);
 
+private:
+    VisuGUI_CutPlanesPane* myCutPane;
+    VisuGUI_ScalarBarPane* myScalarPane;
+    VISU::CutPlanes_i*     myPrs;
+};
 
 
+class VisuGUI_NumEditItem: public QTableItem
+{
+public:
+    VisuGUI_NumEditItem(QTable* table, EditType et, const QString& text ):
+      QTableItem(table, et, text) {};
+    ~VisuGUI_NumEditItem() {};
 
+    QWidget* createEditor() const;
+};
 
+#endif // VISUGUI_CUTPLANESDLG_H