Salome HOME
Copyrights update
[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/
19 //
20
21 #ifndef DIALOGBOX_OFFSET_H
22 #define DIALOGBOX_OFFSET_H
23
24 #include "VISU_Prs3d_i.hh"
25
26 // QT Includes
27 #include <qdialog.h>
28 #include <qptrlist.h>
29
30 class QCheckBox;
31 class QtxDblSpinBox;
32 class VisuGUI;
33
34 struct OffsetStruct {
35   float myOffset[3];
36 };
37
38 class VisuGUI_OffsetDlg: public QDialog
39 {
40   Q_OBJECT
41  public:
42   VisuGUI_OffsetDlg (VisuGUI* theModule);
43   ~VisuGUI_OffsetDlg() {};
44
45   void addPresentation (VISU::Prs3d_i* thePrs);
46   int getPrsCount() const { return myPrsList.count(); }
47
48   void setOffset (const float* theOffset);
49   void getOffset (float* theOffset) const;
50   bool isToSave() const;
51
52  public slots:
53   void onReset();
54
55  protected slots:
56   virtual void accept();
57   virtual void reject();
58   void onApply();
59
60  private:
61   void updateOffset (VISU::Prs3d_i* thePrs, float* theOffset);
62
63   VisuGUI * myModule;
64
65   QtxDblSpinBox * myDxEdt;
66   QtxDblSpinBox * myDyEdt;
67   QtxDblSpinBox * myDzEdt;
68   QCheckBox     * mySaveChk;
69
70   QPtrList<VISU::Prs3d_i>  myPrsList;
71   QValueList<OffsetStruct> myOldOffsets;
72 };
73
74 #endif // DIALOGBOX_OFFSET_H