Salome HOME
refs #430: incorrect coordinates in dump polyline
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_TwoImagesDlg.h
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef HYDROGUI_TWOIMAGESDLG_H
24 #define HYDROGUI_TWOIMAGESDLG_H
25
26 #include "HYDROGUI_InputPanel.h"
27
28 class QCheckBox;
29 class QLabel;
30 class QLineEdit;
31 class QRadioButton;
32 class QFrame;
33
34 class HYDROGUI_ColorWidget;
35 class HYDROGUI_ObjSelector;
36
37 class HYDROGUI_TwoImagesDlg : public HYDROGUI_InputPanel
38 {
39   Q_OBJECT
40
41 public:
42   enum Mode { TwoFuseImage = 0, TwoCutImage, ImageAndPolyline };
43
44 public:
45   HYDROGUI_TwoImagesDlg( HYDROGUI_Module* theModule, const QString& theTitle );
46   virtual ~HYDROGUI_TwoImagesDlg();
47
48   void                       reset();
49
50   void                       setMode( const int theMode, const bool theIsEdit );
51
52   bool                       isModifySelected() const;
53
54   void                       setImageName( const QString& theName );
55   QString                    getImageName() const;
56
57   void                       setSelectedObjects( const QString& theName1,
58                                                  const QString& theName2 );
59   bool                       getSelectedObjects( QString& theName1,
60                                                  QString& theName2 ) const;
61
62   void                       setPreselectedObject( const QString& theName );
63
64   void                       setColor( const QColor& theColor );
65   QColor                     getColor() const;
66
67 signals:
68   /** Signal is emitted if the name has already been selected 
69    *  in other selector of the same parent widget. 
70    * @param theName the selected object name
71    */
72   void                       alreadySelected( const QString& theName );
73
74 protected slots:
75   void                       onModifySelectedImage( bool theState );
76
77 private:
78   /**
79    * Returns whether the mode is to select two images, that corresponds to cut or fuse mode
80    */
81   bool                       isTwoImagesMode() const;
82
83 private:
84   int                        myMode;
85   bool                       myIsEdit;
86
87   QLineEdit*                 myImageName;
88   QCheckBox*                 myModifySelectedImage;
89
90   QLabel*                    myImage1Label;
91   HYDROGUI_ObjSelector*      myImage1;
92
93   QLabel*                    myImage2Label;
94   HYDROGUI_ObjSelector*      myImage2;
95
96   QLabel*                    myPolylineLabel;
97   HYDROGUI_ObjSelector*      myPolyline;
98
99   QFrame*                    myBackgroundFrame;
100   QRadioButton*              myTransparent;
101   QRadioButton*              myColor;
102   HYDROGUI_ColorWidget*      myColorBox;
103 };
104
105 #endif