]> SALOME platform Git repositories - modules/visu.git/blob - src/VISUGUI/VisuGUI_OffsetDlg.h
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/visu.git] / src / VISUGUI / VisuGUI_OffsetDlg.h
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20
21 #ifndef DIALOGBOX_OFFSET_H
22 #define DIALOGBOX_OFFSET_H
23
24 #include "VTKViewer.h"
25 #include "VISU_Prs3d_i.hh"
26
27 // QT Includes
28 #include <qdialog.h>
29 #include <qptrlist.h>
30
31 class QCheckBox;
32 class QtxDblSpinBox;
33 class VisuGUI;
34
35 struct OffsetStruct
36 {
37   vtkFloatingPointType myOffset[3];
38
39   OffsetStruct()
40   {
41     myOffset[0] = myOffset[1] = myOffset[2] = 0;
42   }
43
44   OffsetStruct(vtkFloatingPointType theX,
45                vtkFloatingPointType theY,
46                vtkFloatingPointType theZ)
47   {
48     myOffset[0] = theX;
49     myOffset[1] = theY;
50     myOffset[2] = theZ;
51   }
52 };
53
54 class VisuGUI_OffsetDlg: public QDialog
55 {
56   Q_OBJECT
57  public:
58   VisuGUI_OffsetDlg (VisuGUI* theModule);
59   ~VisuGUI_OffsetDlg() {};
60
61   void addPresentation (VISU::Prs3d_i* thePrs);
62   int getPrsCount() const { return myPrsList.count(); }
63
64   void setOffset (const vtkFloatingPointType* theOffset);
65   void getOffset (vtkFloatingPointType* theOffset) const;
66   bool isToSave() const;
67
68  private:
69   void keyPressEvent( QKeyEvent* e );
70
71  public slots:
72   void onReset();
73
74  protected slots:
75   virtual void accept();
76   virtual void reject();
77   void onApply();
78   void onHelp();
79
80  private:
81   void updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset);
82
83   VisuGUI * myModule;
84
85   QtxDblSpinBox * myDxEdt;
86   QtxDblSpinBox * myDyEdt;
87   QtxDblSpinBox * myDzEdt;
88   QCheckBox     * mySaveChk;
89
90   QPtrList<VISU::Prs3d_i>  myPrsList;
91   QValueList<OffsetStruct> myOldOffsets;
92 };
93
94 #endif // DIALOGBOX_OFFSET_H