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