Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/visu.git] / src / VISUGUI / VisuGUI_ClippingDlg.h
index b7f7fc5c3a3b001010f3b3c578f0089e7ce70330..bf1f1fd3d115468d8707abaaac3b0fec1f26a742 100644 (file)
@@ -1,14 +1,34 @@
-
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  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
+//  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
+//
 #ifndef DIALOGBOX_CLIPPING_H
 #define DIALOGBOX_CLIPPING_H
 
 #include "SALOME_InteractiveObject.hxx"
 
-#include "QtxDblSpinBox.h"
+#include "QtxDoubleSpinBox.h"
 
 // QT Includes
-#include <qdialog.h>
-#include <qtable.h>
+#include <QDialog>
+#include <QPointer>
 
 // VTK Includes
 #include <vtkSmartPointer.h>
 
 class QLabel;
 class QPushButton;
-class QTable;
 class QCheckBox;
+class QGroupBox;
 class QComboBox;
-class QHButtonGroup;
+class QButtonGroup;
 class QSpinBox;
 class QTabWidget;
+class QListWidget;
 
-class QtxDblSpinBox;
+class SALOME_Actor;
 
-class SalomeApp_SelectionMgr;
+class QtxDoubleSpinBox;
 
-class VisuGUI;
+class SVTK_ViewWindow;
 
+class LightApp_SelectionMgr;
+
+class VisuGUI;
+class vtkPlaneSource;
+class vtkDataSetMapper;
 class OrientedPlane;
+class VISU_Actor;
+class PreviewPlane;
 
 namespace VISU {
   class Prs3d_i;
@@ -42,6 +70,47 @@ namespace VISU {
   enum Orientation {XY, YZ, ZX};
 };
 
+//=================================================================================
+//class    : OrientedPlane
+//purpose  :
+//=================================================================================
+class OrientedPlane: public vtkPlane
+{
+  QPointer<SVTK_ViewWindow> myViewWindow;
+  vtkDataSetMapper* myMapper;
+
+public:
+  static OrientedPlane* New();
+  static OrientedPlane* New (SVTK_ViewWindow* vw);
+
+  vtkTypeMacro(OrientedPlane, vtkPlane);
+
+  VISU::Orientation myOrientation;
+  float myDistance;
+  double myAngle[2];
+
+  vtkPlaneSource* myPlaneSource;
+  SALOME_Actor* myActor;
+
+  void SetOrientation(VISU::Orientation theOrientation);
+  VISU::Orientation GetOrientation();
+
+  void SetDistance(float theDistance);
+  float GetDistance();
+
+  void ShallowCopy(OrientedPlane* theOrientedPlane);
+
+protected:
+  OrientedPlane();
+  OrientedPlane(SVTK_ViewWindow* vw);
+  ~OrientedPlane();
+
+  void Init();
+
+private:
+  OrientedPlane(const OrientedPlane&);
+  void operator=(const OrientedPlane&);
+};
 
 //=================================================================================
 // class    : VisuGUI_ClippingDlg
@@ -53,9 +122,7 @@ class VisuGUI_ClippingDlg : public QDialog
 
 public:
     VisuGUI_ClippingDlg( VisuGUI* theModule,
-                        const char* name = 0,
-                        bool modal = false,
-                        WFlags fl = 0 );
+                        bool modal = false );
 
     float  getDistance()  { return (float)SpinBoxDistance->value(); }
     void   setDistance(const float theDistance) { SpinBoxDistance->setValue(theDistance); }
@@ -67,8 +134,19 @@ public:
     ~VisuGUI_ClippingDlg();
 
 private:
+    void keyPressEvent( QKeyEvent* e );
+  
+    void SetPrs3d(VISU::Prs3d_i* thePrs);
+  
+    VISU_Actor* getSelectedActor();
 
-    SalomeApp_SelectionMgr* mySelectionMgr;
+    void applyLocalPlanes();
+
+    void removeAllClippingPlanes(VISU::Prs3d_i* thePrs);
+
+private:
+
+    LightApp_SelectionMgr* mySelectionMgr;
     Handle(SALOME_InteractiveObject) myIO;
 
     VisuGUI       * myVisuGUI;
@@ -87,12 +165,13 @@ private:
     QTabWidget*       TabPane;
 
     QComboBox*        ComboBoxOrientation;
-    QtxDblSpinBox*    SpinBoxDistance;
-    QtxDblSpinBox*    SpinBoxRot1;
-    QtxDblSpinBox*    SpinBoxRot2;
+    QtxDoubleSpinBox*    SpinBoxDistance;
+    QtxDoubleSpinBox*    SpinBoxRot1;
+    QtxDoubleSpinBox*    SpinBoxRot2;
 
     QWidget*          WidgetIJKTab;
-    QHButtonGroup*    ButtonGroupIJKAxis;
+    QButtonGroup*     ButtonGroupIJKAxis;
+    QGroupBox*        GroupBoxIJKAxis;
     QLabel*           TextLabelIJKIndex;
     QSpinBox*         SpinBoxIJKIndex;
     QCheckBox*        CheckBoxIJKPlaneReverse;
@@ -103,9 +182,13 @@ private:
     QPushButton*      buttonOk;
     QPushButton*      buttonCancel;
     QPushButton*      buttonApply;
+    QPushButton*      buttonHelp;
 
     bool myIsSelectPlane;
 
+    VISU_Actor* myDSActor;
+    QList<PreviewPlane*> myPreviewList;
+
 protected:
     QWidget* createParamsTab();
     QWidget* createIJKParamsTab();
@@ -127,6 +210,9 @@ public slots:
     void ClickOnOk();
     void ClickOnCancel();
     void ClickOnApply();
+    void ClickOnHelp();
 };
 
 #endif // DIALOGBOX_TRANSPARENCYDLG_H
+
+