Salome HOME
Fix for the bug #318: Different styles in folders' design in Object browser.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportImageDlg.cxx
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 #include "HYDROGUI_ImportImageDlg.h"
24
25 #include "HYDROGUI_PrsImage.h"
26 #include "HYDROGUI_Tool.h"
27 #include "HYDROGUI_Module.h"
28
29 #include <HYDROData_Lambert93.h>
30 #include <HYDROData_Image.h>
31
32 #include <LightApp_Application.h>
33 #include <SUIT_FileDlg.h>
34 #include <SUIT_ResourceMgr.h>
35 #include <SUIT_Desktop.h>
36 #include <SUIT_MessageBox.h>
37 #include <SUIT_Session.h>
38
39 #include <QtxDoubleSpinBox.h>
40 #include <QtxIntSpinBox.h>
41
42 #include <QButtonGroup>
43 #include <QComboBox>
44 #include <QGroupBox>
45 #include <QLabel>
46 #include <QLayout>
47 #include <QLineEdit>
48 #include <QPainter>
49 #include <QPicture>
50 #include <QPushButton>
51 #include <QRadioButton>
52 #include <QToolButton>
53 #include <QCheckBox>
54
55 HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, const QString& theTitle )
56 : HYDROGUI_InputPanel( theModule, theTitle ),
57   myIsInitialized( false )
58 {
59   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
60
61   // Import image from file
62   myFileNameGroup = new QGroupBox( tr( "IMPORT_IMAGE_FROM_FILE" ), this );
63
64   QLabel* aFileNameLabel = new QLabel( tr( "FILE_NAME" ), myFileNameGroup );
65
66   myFileName = new QLineEdit( myFileNameGroup );
67   myFileName->setReadOnly( true );
68
69   QToolButton* aBrowseBtn = new QToolButton( myFileNameGroup );
70   aBrowseBtn->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "BROWSE_ICO" ) ) );
71
72   QBoxLayout* aFileNameLayout = new QHBoxLayout( myFileNameGroup );
73   aFileNameLayout->setMargin( 5 );
74   aFileNameLayout->setSpacing( 5 );
75   aFileNameLayout->addWidget( aFileNameLabel );
76   aFileNameLayout->addWidget( myFileName );
77   aFileNameLayout->addWidget( aBrowseBtn );
78
79   // Image name
80   myImageNameGroup = new QGroupBox( tr( "IMAGE_NAME" ), this );
81
82   QLabel* anImageNameLabel = new QLabel( tr( "NAME" ), myImageNameGroup );
83   myImageName = new QLineEdit( myImageNameGroup );
84
85   QBoxLayout* anImageNameLayout = new QHBoxLayout( myImageNameGroup );
86   anImageNameLayout->setMargin( 5 );
87   anImageNameLayout->setSpacing( 5 );
88   anImageNameLayout->addWidget( anImageNameLabel );
89   anImageNameLayout->addWidget( myImageName );
90
91   // Transform image
92   myTransformGroup = new QGroupBox( tr( "TRANSFORM_IMAGE" ), this );
93
94   // Make a pixmap for arrow
95   QPixmap anArrowPixmap = aResMgr->loadPixmap( "HYDRO", tr( "ARROW_RIGHT_ICO" ) );
96
97   QPicture anArrowPicture;
98   anArrowPicture.setBoundingRect( QRect( QPoint( 0, 0 ), anArrowPixmap.size() ) );
99
100   QPainter aPainter;
101   aPainter.begin( &anArrowPicture );
102   aPainter.drawPixmap( 0, 0, anArrowPixmap );
103   aPainter.end();
104
105   QRadioButton* aManualGeodesicBtn = new QRadioButton( tr( "MANUALLY_GEODESIC" ), myTransformGroup );
106   QRadioButton* aManualCartesianBtn = new QRadioButton( tr( "MANUALLY_LAMBERT93" ), myTransformGroup );
107   QRadioButton* aCartesianFromFileBtn = new QRadioButton( tr( "LAMBERT93_FROM_FILE" ), myTransformGroup );
108   QRadioButton* aRefImageBtn = new QRadioButton( tr( "BY_REFERENCE_IMAGE" ), myTransformGroup );
109
110   myModeGroup = new QButtonGroup( myTransformGroup );
111   myModeGroup->addButton( aManualGeodesicBtn, HYDROData_Image::ManualGeodesic );
112   myModeGroup->addButton( aManualCartesianBtn, HYDROData_Image::ManualCartesian );
113   myModeGroup->addButton( aCartesianFromFileBtn, HYDROData_Image::CartesianFromFile );
114   myModeGroup->addButton( aRefImageBtn, HYDROData_Image::ReferenceImage );
115
116   myRefImage = new QComboBox( myTransformGroup );
117
118   QVBoxLayout* aTransformLayout = new QVBoxLayout( myTransformGroup );
119   aTransformLayout->setMargin( 5 );
120   aTransformLayout->setSpacing( 5 );
121
122   QGridLayout* aModeLayout = new QGridLayout( myTransformGroup );
123   aModeLayout->setMargin( 0 );
124   aModeLayout->setSpacing( 5 );
125   aModeLayout->addWidget( aManualGeodesicBtn,   0, 0 );
126   aModeLayout->addWidget( aManualCartesianBtn, 1, 0 );
127   aModeLayout->addWidget( aCartesianFromFileBtn, 2, 0 );
128   aModeLayout->addWidget( aRefImageBtn,        3, 0 );
129   aModeLayout->addWidget( myRefImage,          3, 1 );
130   aModeLayout->setColumnStretch( 1, 1 );
131
132   aTransformLayout->addLayout( aModeLayout );
133
134   // Manual input widget
135   QWidget* aManualInputGroup = new QWidget( myTransformGroup );
136   QGridLayout* aManualInputLayout = new QGridLayout( aManualInputGroup );
137   aManualInputLayout->setMargin( 5 );
138   aManualInputLayout->setSpacing( 5 );
139
140   QLabel* aImageCSLabel = new QLabel( tr( "IMAGE_CS" ), aManualInputGroup );
141   QLabel* aGeodesicLabel = new QLabel( tr( "GEODESIC" ), aManualInputGroup );
142   QLabel* aLambertLabel = new QLabel( tr( "LAMBERT93" ), aManualInputGroup );
143   QLabel* aRefImageLabel = new QLabel( tr( "REFERENCE_IMAGE_CS" ), aManualInputGroup );
144
145   aManualInputLayout->addWidget( aImageCSLabel,  0, 1 );
146   aManualInputLayout->addWidget( aGeodesicLabel, 0, 2, 1, 6 );
147   aManualInputLayout->addWidget( aLambertLabel,  0, 2, 1, 6 );
148   aManualInputLayout->addWidget( aRefImageLabel, 0, 2, 1, 6 );
149
150   for( int aPointType = HYDROGUI_PrsImage::PointA;
151        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
152   {
153     QString aPointStr;
154     switch( aPointType )
155     {
156       case HYDROGUI_PrsImage::PointA: aPointStr = tr( "ACTIVATE_POINT_A_SELECTION" ); break;
157       case HYDROGUI_PrsImage::PointB: aPointStr = tr( "ACTIVATE_POINT_B_SELECTION" ); break;
158       case HYDROGUI_PrsImage::PointC: aPointStr = tr( "ACTIVATE_POINT_C_SELECTION" ); break;
159     }
160     QPushButton* aPointBtn = new QPushButton( aPointStr, myTransformGroup );
161     aPointBtn->setCheckable( true );
162
163     QLabel* aPointXLabel = new QLabel( "X", aManualInputGroup );
164     QLabel* aPointYLabel = new QLabel( "Y", aManualInputGroup );
165
166     QtxIntSpinBox* aPointX = new QtxIntSpinBox( 0, 0, 1, aManualInputGroup ); // max is updated later
167     QtxIntSpinBox* aPointY = new QtxIntSpinBox( 0, 0, 1, aManualInputGroup ); // max is updated later
168
169     QLabel* aPointArrowLabel = new QLabel( aManualInputGroup );
170     aPointArrowLabel->setPicture( anArrowPicture );
171
172     QLabel* aPointXDegLabel = new QLabel( QChar( 0x00B0 ), aManualInputGroup );
173     QLabel* aPointYDegLabel = new QLabel( QChar( 0x00B0 ), aManualInputGroup );
174     QLabel* aPointXMinLabel = new QLabel( "'", aManualInputGroup );
175     QLabel* aPointYMinLabel = new QLabel( "'", aManualInputGroup );
176     QLabel* aPointXSecLabel = new QLabel( "\"", aManualInputGroup );
177     QLabel* aPointYSecLabel = new QLabel( "\"", aManualInputGroup );
178     QLabel* aPointLatLabel = new QLabel( tr( "POINT_LATITUDE" ), aManualInputGroup );
179     QLabel* aPointLonLabel = new QLabel( tr( "POINT_LONGITUDE" ), aManualInputGroup );
180     myGeodesicLabels << aPointXDegLabel << aPointYDegLabel
181                     << aPointXMinLabel << aPointYMinLabel
182                     << aPointXSecLabel << aPointYSecLabel
183                     << aPointLonLabel << aPointLatLabel;
184
185     QtxIntSpinBox* aPointXDeg = new QtxIntSpinBox( -179, 179, 1, aManualInputGroup );
186     QtxIntSpinBox* aPointYDeg = new QtxIntSpinBox( 0, 89, 1, aManualInputGroup );
187     QtxIntSpinBox* aPointXMin = new QtxIntSpinBox( 0, 59, 1, aManualInputGroup );
188     QtxIntSpinBox* aPointYMin = new QtxIntSpinBox( 0, 59, 1, aManualInputGroup );
189     QtxDoubleSpinBox* aPointXSec = new QtxDoubleSpinBox( 0, 59.9999, 1, 4, 4, aManualInputGroup );
190     QtxDoubleSpinBox* aPointYSec = new QtxDoubleSpinBox( 0, 59.9999, 1, 4, 4, aManualInputGroup );
191
192     QtxDoubleSpinBox* aCartPointX = new QtxDoubleSpinBox( 0, 1e8, 1, 2, 2, aManualInputGroup );
193     QtxDoubleSpinBox* aCartPointY = new QtxDoubleSpinBox( 0, 1e8, 1, 2, 2, aManualInputGroup );
194
195     QtxIntSpinBox* aRefPointX = new QtxIntSpinBox( 0, 0, 1, aManualInputGroup ); // max is updated later
196     QtxIntSpinBox* aRefPointY = new QtxIntSpinBox( 0, 0, 1, aManualInputGroup ); // max is updated later
197
198     int aRow = 4 * aPointType;
199     if ( aPointType == HYDROGUI_PrsImage::PointC )
200     {
201       myPointCEnabler = new QCheckBox( aManualInputGroup );
202       aManualInputLayout->addWidget( myPointCEnabler, aRow,    0, 1, 2, Qt::AlignHCenter );
203       aManualInputLayout->addWidget( aPointBtn,       aRow,    2, 1, 8 );
204     }
205     else
206     {
207       aManualInputLayout->addWidget( aPointBtn,       aRow,    0, 1, 10 );
208     }
209
210     aManualInputLayout->addWidget( aPointXLabel,     aRow + 1, 0 );
211     aManualInputLayout->addWidget( aPointX,          aRow + 1, 1 );
212     aManualInputLayout->addWidget( aPointArrowLabel, aRow + 1, 2, 2, 1 );
213     aManualInputLayout->addWidget( aPointXDeg,       aRow + 1, 3 );
214     aManualInputLayout->addWidget( aPointXDegLabel,  aRow + 1, 4 );
215     aManualInputLayout->addWidget( aPointXMin,       aRow + 1, 5 );
216     aManualInputLayout->addWidget( aPointXMinLabel,  aRow + 1, 6 );
217     aManualInputLayout->addWidget( aPointXSec,       aRow + 1, 7 );
218     aManualInputLayout->addWidget( aPointXSecLabel,  aRow + 1, 8 );
219     aManualInputLayout->addWidget( aPointLonLabel,   aRow + 1, 9 );
220
221     aManualInputLayout->addWidget( aCartPointX,      aRow + 1, 3, 1, 6 );
222     aManualInputLayout->addWidget( aRefPointX,       aRow + 1, 3, 1, 6 );
223
224     aManualInputLayout->addWidget( aPointYLabel,     aRow + 2, 0 );
225     aManualInputLayout->addWidget( aPointY,          aRow + 2, 1 );
226     aManualInputLayout->addWidget( aPointYDeg,       aRow + 2, 3 );
227     aManualInputLayout->addWidget( aPointYDegLabel,  aRow + 2, 4 );
228     aManualInputLayout->addWidget( aPointYMin,       aRow + 2, 5 );
229     aManualInputLayout->addWidget( aPointYMinLabel,  aRow + 2, 6 );
230     aManualInputLayout->addWidget( aPointYSec,       aRow + 2, 7 );
231     aManualInputLayout->addWidget( aPointYSecLabel,  aRow + 2, 8 );
232     aManualInputLayout->addWidget( aPointLatLabel,   aRow + 2, 9 );
233
234     aManualInputLayout->addWidget( aCartPointY,      aRow + 2, 3, 1, 6 );
235     aManualInputLayout->addWidget( aRefPointY,       aRow + 2, 3, 1, 6 );
236
237     if( aPointType != HYDROGUI_PrsImage::PointC )
238     {
239       QFrame* aLine = new QFrame( aManualInputGroup );
240       aLine->setFrameShape( QFrame::HLine );
241       aLine->setFrameShadow( QFrame::Sunken );
242       aManualInputLayout->addWidget( aLine, aRow + 3, 0, 1, 10 );
243     }
244
245     myPointBtnMap[ aPointType ] = aPointBtn;
246     myPointXMap[ aPointType ] = aPointX;
247     myPointYMap[ aPointType ] = aPointY;
248     myPointXDegMap[ aPointType ] = aPointXDeg;
249     myPointYDegMap[ aPointType ] = aPointYDeg;
250     myPointXMinMap[ aPointType ] = aPointXMin;
251     myPointYMinMap[ aPointType ] = aPointYMin;
252     myPointXSecMap[ aPointType ] = aPointXSec;
253     myPointYSecMap[ aPointType ] = aPointYSec;
254
255     myCartPointXMap[ aPointType ] = aCartPointX;
256     myCartPointYMap[ aPointType ] = aCartPointY;
257
258     myRefPointXMap[ aPointType ] = aRefPointX;
259     myRefPointYMap[ aPointType ] = aRefPointY;
260
261     connect( aPointBtn, SIGNAL( toggled( bool ) ), this, SLOT( onPointBtnToggled( bool ) ) );
262
263     connect( aPointX, SIGNAL( valueChanged( int ) ), this, SLOT( onPointCoordChanged( int ) ) );
264     connect( aPointY, SIGNAL( valueChanged( int ) ), this, SLOT( onPointCoordChanged( int ) ) );
265
266     connect( aPointXDeg, SIGNAL( valueChanged( int ) ), this, SLOT( onGeodesicCoordChanged() ) );
267     connect( aPointYDeg, SIGNAL( valueChanged( int ) ), this, SLOT( onGeodesicCoordChanged() ) );
268     connect( aPointXMin, SIGNAL( valueChanged( int ) ), this, SLOT( onGeodesicCoordChanged() ) );
269     connect( aPointYMin, SIGNAL( valueChanged( int ) ), this, SLOT( onGeodesicCoordChanged() ) );
270     connect( aPointXSec, SIGNAL( valueChanged( double ) ), this, SLOT( onGeodesicCoordChanged() ) );
271     connect( aPointYSec, SIGNAL( valueChanged( double ) ), this, SLOT( onGeodesicCoordChanged() ) );
272
273     connect( aCartPointX, SIGNAL( valueChanged( double ) ), this, SLOT( onCartesianCoordChanged() ) );
274     connect( aCartPointY, SIGNAL( valueChanged( double ) ), this, SLOT( onCartesianCoordChanged() ) );
275
276     connect( aRefPointX, SIGNAL( valueChanged( int ) ), this, SLOT( onPointCoordChanged( int ) ) );
277     connect( aRefPointY, SIGNAL( valueChanged( int ) ), this, SLOT( onPointCoordChanged( int ) ) );
278   }
279
280   // Connect checkbox enabling point C
281   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointBtnMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
282   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointXMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
283   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointYMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
284   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointXDegMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
285   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointYDegMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
286   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointXMinMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
287   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointYMinMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
288   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointXSecMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
289   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointYSecMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
290   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myCartPointXMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
291   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myCartPointYMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
292   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myRefPointXMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
293   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myRefPointYMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
294
295   connect( myPointCEnabler, SIGNAL( toggled( bool ) ), SLOT( onSetCIsUsed( bool ) ) );
296
297   aManualInputLayout->setColumnStretch( 1, 1 ); // double
298   aManualInputLayout->setColumnStretch( 3, 1 ); // degrees
299   aManualInputLayout->setColumnStretch( 5, 1 ); // minutes
300   aManualInputLayout->setColumnStretch( 7, 2 ); // seconds (double with 4 digits)
301
302   // Image georeferencement file widget
303   QWidget* aFromFileInputGroup = new QWidget( myTransformGroup );
304   QBoxLayout* aFromFileInputLayout = new QHBoxLayout( aFromFileInputGroup );
305   aFromFileInputLayout->setMargin( 5 );
306   aFromFileInputLayout->setSpacing( 5 );
307  
308   QLabel* aGeoFileNameLabel = new QLabel( tr( "FILE_NAME" ), aFromFileInputGroup );
309
310   myGeoFileName = new QLineEdit( aFromFileInputGroup );
311   myGeoFileName->setReadOnly( true );
312
313   QToolButton* aGeoBrowseBtn = new QToolButton( aFromFileInputGroup );
314   aGeoBrowseBtn->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "BROWSE_ICO" ) ) );
315
316   aFromFileInputLayout->addWidget( aGeoFileNameLabel );
317   aFromFileInputLayout->addWidget( myGeoFileName );
318   aFromFileInputLayout->addWidget( aGeoBrowseBtn );
319
320   // Widgets connections
321   connect( aManualCartesianBtn, SIGNAL( toggled( bool ) ), aLambertLabel, SLOT( setVisible ( bool ) ) );
322   connect( aManualCartesianBtn, SIGNAL( toggled( bool ) ), aGeodesicLabel, SLOT( setHidden ( bool ) ) );
323   connect( aManualCartesianBtn, SIGNAL( toggled( bool ) ), aRefImageLabel, SLOT( setHidden ( bool ) ) );
324   connect( aManualCartesianBtn, SIGNAL( toggled( bool ) ), aFromFileInputGroup, SLOT( setHidden ( bool ) ) );
325   connect( aManualGeodesicBtn, SIGNAL( toggled( bool ) ), aGeodesicLabel, SLOT( setVisible ( bool ) ) );
326   connect( aManualGeodesicBtn, SIGNAL( toggled( bool ) ), aLambertLabel, SLOT( setHidden ( bool ) ) );
327   connect( aManualGeodesicBtn, SIGNAL( toggled( bool ) ), aRefImageLabel, SLOT( setHidden ( bool ) ) );
328   connect( aManualGeodesicBtn, SIGNAL( toggled( bool ) ), aFromFileInputGroup, SLOT( setHidden ( bool ) ) );
329   connect( aRefImageBtn, SIGNAL( toggled( bool ) ), aRefImageLabel, SLOT( setVisible ( bool ) ) );
330   connect( aRefImageBtn, SIGNAL( toggled( bool ) ), aGeodesicLabel, SLOT( setHidden ( bool ) ) );
331   connect( aRefImageBtn, SIGNAL( toggled( bool ) ), aLambertLabel, SLOT( setHidden ( bool ) ) );
332   connect( aRefImageBtn, SIGNAL( toggled( bool ) ), aFromFileInputGroup, SLOT( setHidden ( bool ) ) );
333   connect( aCartesianFromFileBtn, SIGNAL( toggled( bool ) ), aFromFileInputGroup, SLOT( setVisible ( bool ) ) );
334   connect( aCartesianFromFileBtn, SIGNAL( toggled( bool ) ), aManualInputGroup, SLOT( setHidden ( bool ) ) );
335
336   // Input widgets
337   aTransformLayout->addWidget( aManualInputGroup );
338   aTransformLayout->addWidget( aFromFileInputGroup );
339
340   // Common
341   addWidget( myFileNameGroup );
342   addWidget( myImageNameGroup );
343   addWidget( myTransformGroup );
344   addStretch();
345
346   connect( aBrowseBtn, SIGNAL( clicked() ), this, SLOT( onBrowse() ) );
347
348   connect( myModeGroup, SIGNAL( buttonClicked( int ) ),
349            this, SLOT( onModeActivated( int ) ) );
350
351   connect( aGeoBrowseBtn, SIGNAL( clicked() ), this, SLOT( onGeoBrowse() ) );
352
353   connect( myRefImage, SIGNAL( activated( const QString& ) ),
354            this, SLOT( onRefImageActivated( const QString& ) ) );
355
356   //setTransformationMode( HYDROData_Image::ManualCartesian );
357
358   setMinimumWidth( 350 );
359 }
360
361 HYDROGUI_ImportImageDlg::~HYDROGUI_ImportImageDlg()
362 {
363 }
364
365 void HYDROGUI_ImportImageDlg::onSetCIsUsed( bool theCIsUsed )
366 {
367   if ( !theCIsUsed  && myPointBtnMap[ HYDROGUI_PrsImage::PointC ]->isChecked() )
368   {
369     // Turn on point A selection if point C selection has been activated and we disable point C.
370     myPointBtnMap[ HYDROGUI_PrsImage::PointA ]->toggle();
371   }
372   emit setCIsUsed( theCIsUsed );
373 }
374
375 void HYDROGUI_ImportImageDlg::setIsEdit( const bool theIsEdit )
376 {
377   myFileNameGroup->setVisible( !theIsEdit );
378   myImageNameGroup->setEnabled( theIsEdit );
379   myTransformGroup->setEnabled( theIsEdit );
380 }
381
382 void HYDROGUI_ImportImageDlg::reset()
383 {
384   myFileName->clear();
385   myImageName->clear();
386   myImageNameGroup->setEnabled( false );
387   myGeoFileName->clear();
388   for( int aPointType = HYDROGUI_PrsImage::PointA;
389        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
390   {
391     QPushButton* aBtn = myPointBtnMap[ aPointType ];
392     bool anIsBlocked = aBtn->blockSignals( true );
393     aBtn->setChecked( false );
394     aBtn->blockSignals( anIsBlocked );
395
396     myPointXMap[ aPointType ]->clear();
397     myPointYMap[ aPointType ]->clear();
398     myPointXDegMap[ aPointType ]->clear();
399     myPointYDegMap[ aPointType ]->clear();
400     myPointXMinMap[ aPointType ]->clear();
401     myPointYMinMap[ aPointType ]->clear();
402     myPointXSecMap[ aPointType ]->clear();
403     myPointYSecMap[ aPointType ]->clear();
404
405     myRefPointXMap[ aPointType ]->clear();
406     myRefPointYMap[ aPointType ]->clear();
407
408     myCartPointXMap[ aPointType ]->clear();
409     myCartPointYMap[ aPointType ]->clear();
410   }
411   
412   // Emulate turning off C point usage
413   myPointCEnabler->blockSignals( true );
414   
415   myPointCEnabler->setChecked( false );
416   myPointBtnMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
417   myPointXMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
418   myPointYMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
419   myPointXDegMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
420   myPointYDegMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
421   myPointXMinMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
422   myPointYMinMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
423   myPointXSecMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
424   myPointYSecMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
425   myCartPointXMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
426   myCartPointYMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
427   myRefPointXMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
428   myRefPointYMap[ HYDROGUI_PrsImage::PointC ]->setEnabled( false );
429   onSetCIsUsed( false );
430
431   myPointCEnabler->blockSignals( false );
432   
433   myTransformGroup->setEnabled( false );
434   myRefImage->clear();
435
436   setTransformationMode( HYDROData_Image::ManualCartesian );
437
438   myPrsPointDataList.clear();
439
440   myIsInitialized = false;
441 }
442
443 void HYDROGUI_ImportImageDlg::setImageName( const QString& theName )
444 {
445   myImageName->setText( theName );
446 }
447
448 QString HYDROGUI_ImportImageDlg::getImageName() const
449 {
450   return myImageName->text();
451 }
452
453 void HYDROGUI_ImportImageDlg::setRefImageName( const QString& theName )
454 {
455   myRefImage->setCurrentIndex( myRefImage->findText( theName ) );
456 }
457
458 QString HYDROGUI_ImportImageDlg::getRefImageName() const
459 {
460   return myRefImage->currentText();
461 }
462
463 QString HYDROGUI_ImportImageDlg::getFileName() const
464 {
465   return myFileName->text();
466 }
467
468 QString HYDROGUI_ImportImageDlg::getGeoreferencementFileName() const
469 {
470   return myGeoFileName->text();
471 }
472
473 void HYDROGUI_ImportImageDlg::setImageSize( const QSize& theSize,
474                                             const bool theIsRefImage )
475 {
476   int aWidth = theSize.width();
477   int aHeight = theSize.height();
478   for( int aPointType = HYDROGUI_PrsImage::PointA;
479        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
480   {
481     if( theIsRefImage )
482     {
483       myRefPointXMap[ aPointType ]->setRange( 0, aWidth );
484       myRefPointYMap[ aPointType ]->setRange( 0, aHeight );
485     }
486     else
487     {
488       myPointXMap[ aPointType ]->setRange( 0, aWidth );
489       myPointYMap[ aPointType ]->setRange( 0, aHeight );
490     }
491   }
492 }
493
494 void HYDROGUI_ImportImageDlg::setTransformationMode( const int theMode )
495 {
496   myModeGroup->button( theMode )->setChecked( true );
497   onModeActivated( theMode );
498 }
499
500 int HYDROGUI_ImportImageDlg::getTransformationMode() const
501 {
502   return myModeGroup->checkedId();
503 }
504
505 void HYDROGUI_ImportImageDlg::setByTwoPoints( const bool theIsByTwoPoints )
506 {
507   myPointCEnabler->setChecked( !theIsByTwoPoints );
508 }
509
510 bool HYDROGUI_ImportImageDlg::isByTwoPoints() const
511 {
512   return !myPointCEnabler->isChecked();
513 }
514
515 void HYDROGUI_ImportImageDlg::setTransformationDataMap( const TransformationDataMap& theMap,
516                                                         const bool theIsOnlyInput,
517                                                         const bool theIsRefImage )
518 {
519   blockSignalsGeodesic( true );
520   blockSignalsCartesian( true );
521   for( int aPointType = HYDROGUI_PrsImage::PointA;
522        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
523   {
524     if( theMap.contains( aPointType ) )
525     {
526       const TransformationData& aData = theMap[ aPointType ];
527
528       QtxIntSpinBox* aPointX = theIsRefImage ? myRefPointXMap[ aPointType ] : myPointXMap[ aPointType ];
529       QtxIntSpinBox* aPointY = theIsRefImage ? myRefPointYMap[ aPointType ] : myPointYMap[ aPointType ];
530       aPointX->setValue( aData.ImagePoint.x() );
531       aPointY->setValue( aData.ImagePoint.y() );
532
533       if( !theIsOnlyInput && !theIsRefImage )
534       {
535         QPointF aLPoint = aData.GeodesicPoint;
536         int aXDeg = 0, aYDeg = 0;
537         int aXMin = 0, aYMin = 0;
538         double aXSec = 0, aYSec = 0;
539         HYDROData_Lambert93::degToDMS( aLPoint.x(), aXDeg, aXMin, aXSec );
540         HYDROData_Lambert93::degToDMS( aLPoint.y(), aYDeg, aYMin, aYSec );
541
542         myPointXDegMap[ aPointType ]->setValue( aXDeg );
543         myPointYDegMap[ aPointType ]->setValue( aYDeg );
544         myPointXMinMap[ aPointType ]->setValue( aXMin );
545         myPointYMinMap[ aPointType ]->setValue( aYMin );
546         myPointXSecMap[ aPointType ]->setValue( aXSec );
547         myPointYSecMap[ aPointType ]->setValue( aYSec );
548
549         QPointF aCPoint = aData.CartesianPoint;
550         myCartPointXMap[ aPointType ]->setValue( aCPoint.x() );
551         myCartPointYMap[ aPointType ]->setValue( aCPoint.y() );
552       }
553     }
554   }
555   blockSignalsGeodesic( false );
556   blockSignalsCartesian( false );
557 }
558
559 bool HYDROGUI_ImportImageDlg::getTransformationDataMap( TransformationDataMap& theMap,
560                                                         const bool theIsRefImage ) const
561 {
562   theMap.clear();
563   for( int aPointType = HYDROGUI_PrsImage::PointA;
564        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
565   {
566     bool anIsOk[10];
567     for( int i = 0; i < 10; i++ )
568       anIsOk[ i ] = true;
569
570     QtxIntSpinBox* aPointX = theIsRefImage ? myRefPointXMap[ aPointType ] : myPointXMap[ aPointType ];
571     QtxIntSpinBox* aPointY = theIsRefImage ? myRefPointYMap[ aPointType ] : myPointYMap[ aPointType ];
572     int aX1 = aPointX->text().toInt( &anIsOk[0] );
573     int aY1 = aPointY->text().toInt( &anIsOk[1] );
574
575     int aXDeg = 0, aYDeg = 0;
576     int aXMin = 0, aYMin = 0;
577     double aXSec = 0, aYSec = 0;
578     double aXCart = 0, aYCart = 0;
579     if( !theIsRefImage )
580     {
581       aXDeg = myPointXDegMap[ aPointType ]->text().toInt( &anIsOk[2] );
582       aYDeg = myPointYDegMap[ aPointType ]->text().toInt( &anIsOk[3] );
583       aXMin = myPointXMinMap[ aPointType ]->text().toInt( &anIsOk[4] );
584       aYMin = myPointYMinMap[ aPointType ]->text().toInt( &anIsOk[5] );
585       aXSec = myPointXSecMap[ aPointType ]->text().toDouble( &anIsOk[6] );
586       aYSec = myPointYSecMap[ aPointType ]->text().toDouble( &anIsOk[7] );
587
588       aXCart = myCartPointXMap[ aPointType ]->text().toDouble( &anIsOk[8] );
589       aYCart = myCartPointYMap[ aPointType ]->text().toDouble( &anIsOk[9] );
590     }
591
592     for( int i = 0; i < 10; i++ )
593       if( !anIsOk[ i ] )
594         return false;
595
596     double aX2 = 0, aY2 = 0;
597     HYDROData_Lambert93::DMSToDeg( aXDeg, aXMin, aXSec, aX2 );
598     HYDROData_Lambert93::DMSToDeg( aYDeg, aYMin, aYSec, aY2 );
599
600     TransformationData aData( QPoint( aX1, aY1 ), QPointF( aX2, aY2 ), QPointF( aXCart, aYCart ) );
601     theMap[ aPointType ] = aData;
602   }
603   return true;
604 }
605
606 void HYDROGUI_ImportImageDlg::setPrsPointDataList( const PrsPointDataList& theList )
607 {
608   myPrsPointDataList = theList;
609
610   if( !myPrsPointDataList.isEmpty() )
611   {
612     myModeGroup->button( HYDROData_Image::ReferenceImage )->setEnabled( true );
613
614     myRefImage->clear();
615     myRefImage->addItem( "" ); // first empty item
616
617     PrsPointDataListIterator anIter( myPrsPointDataList );
618     while( anIter.hasNext() )
619       myRefImage->addItem( anIter.next().first );
620   }
621   else
622     myModeGroup->button( HYDROData_Image::ReferenceImage )->setEnabled( false );
623 }
624
625 void HYDROGUI_ImportImageDlg::initializePointSelection()
626 {
627   if( myIsInitialized )
628     return;
629
630   myIsInitialized = true;
631
632   myPointBtnMap[ HYDROGUI_PrsImage::PointA ]->setChecked( true );
633
634   double aCartX0 = LAMBERT_X0;
635   double aCartY0 = LAMBERT_Y0;
636
637   blockSignalsCartesian( true );
638
639   myCartPointXMap[ HYDROGUI_PrsImage::PointA ]->setValue( aCartX0 );
640   myCartPointYMap[ HYDROGUI_PrsImage::PointA ]->setValue( aCartY0 + IMG_DELTA );
641
642   myCartPointXMap[ HYDROGUI_PrsImage::PointB ]->setValue( aCartX0 + IMG_DELTA );
643   myCartPointYMap[ HYDROGUI_PrsImage::PointB ]->setValue( aCartY0 + IMG_DELTA );
644
645   myCartPointXMap[ HYDROGUI_PrsImage::PointC ]->setValue( aCartX0 );
646   myCartPointYMap[ HYDROGUI_PrsImage::PointC ]->setValue( aCartY0 );
647
648   for( int aPointType = HYDROGUI_PrsImage::PointA;
649        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
650     onCartesianCoordChanged( aPointType );
651
652   blockSignalsCartesian( false );
653 }
654
655 HYDROGUI_ImportImageDlg::TransformationData HYDROGUI_ImportImageDlg::ComputeTrsfData(
656   const int      theMode,
657   const QPoint&  theLocalPoint,
658   const QPointF& theGlobalPoint )
659 {
660   TransformationData aResTrsfData;
661   aResTrsfData.ImagePoint = theLocalPoint;
662
663   double arx = theGlobalPoint.x();
664   double ary = theGlobalPoint.y();
665   if ( theMode == HYDROData_Image::ManualGeodesic )
666   {
667     // Geodesic to Cartesian
668     double aXCart = 0, aYCart = 0;
669     // Interpreting arY as attitude and arX as longitude
670     HYDROData_Lambert93::toXY( ary, arx, aXCart, aYCart );
671
672     aResTrsfData.GeodesicPoint = theGlobalPoint;
673     aResTrsfData.CartesianPoint = QPointF( aXCart, aYCart );
674   }
675   else if ( theMode == HYDROData_Image::ManualCartesian )
676   {
677     // Cartesian to Geodesic
678     double aLonDeg = 0, aLatDeg = 0;
679     HYDROData_Lambert93::toGeo( arx, ary, aLatDeg, aLonDeg );
680
681     aResTrsfData.CartesianPoint = theGlobalPoint;
682     aResTrsfData.GeodesicPoint = QPointF( aLonDeg, aLatDeg );
683   }
684
685   return aResTrsfData;
686 }
687
688 void HYDROGUI_ImportImageDlg::onBrowse()
689 {
690   QString aFilter( tr( "IMAGE_FILTER" ) );
691   QString aFileName = SUIT_FileDlg::getFileName( this, "", aFilter, tr( "IMPORT_IMAGE_FROM_FILE" ), true );
692   if( !aFileName.isEmpty() )
693   {
694     QImage anImage( aFileName );
695     if( anImage.isNull() )
696     {
697       QString aTitle = QObject::tr( "INPUT_VALID_DATA" );
698       QString aMessage = QObject::tr( "FILE_CAN_NOT_BE_IMPORTED" ).
699         arg( aFileName ).arg( QFileInfo( aFileName ).suffix() );
700       SUIT_MessageBox::warning( module()->getApp()->desktop(), aTitle, aMessage );
701     }
702     else
703     {
704       myFileName->setText( aFileName );
705       emit createPreview( anImage );
706       myImageNameGroup->setEnabled( true );
707       myTransformGroup->setEnabled( true );
708     }
709   }
710 }
711
712 void HYDROGUI_ImportImageDlg::onGeoBrowse()
713 {
714   QString aFilter( tr( "IMAGE_GEOREFERENCEMENT_FILTER" ) );
715   QString aGeoFileName = SUIT_FileDlg::getFileName( this, "", aFilter, tr( "IMPORT_GEO_DATA_FROM_FILE" ), true );
716   if( !aGeoFileName.isEmpty() ) {
717     myGeoFileName->setText( aGeoFileName );
718   }
719 }
720
721 void HYDROGUI_ImportImageDlg::onModeActivated( int theMode )
722 {
723   bool anIsManualGeodesic = theMode == HYDROData_Image::ManualGeodesic;
724   bool anIsManualCartesian = theMode == HYDROData_Image::ManualCartesian;
725   bool anIsRefImage = theMode == HYDROData_Image::ReferenceImage;
726
727   myRefImage->setEnabled( anIsRefImage );
728
729   for( int aPointType = HYDROGUI_PrsImage::PointA;
730        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
731   {
732     myPointXDegMap[ aPointType ]->setVisible( anIsManualGeodesic );
733     myPointYDegMap[ aPointType ]->setVisible( anIsManualGeodesic );
734     myPointXMinMap[ aPointType ]->setVisible( anIsManualGeodesic );
735     myPointYMinMap[ aPointType ]->setVisible( anIsManualGeodesic );
736     myPointXSecMap[ aPointType ]->setVisible( anIsManualGeodesic );
737     myPointYSecMap[ aPointType ]->setVisible( anIsManualGeodesic );
738
739     myCartPointXMap[ aPointType ]->setVisible( anIsManualCartesian );
740     myCartPointYMap[ aPointType ]->setVisible( anIsManualCartesian );
741
742     myRefPointXMap[ aPointType ]->setVisible( anIsRefImage );
743     myRefPointYMap[ aPointType ]->setVisible( anIsRefImage );
744   }
745
746   QListIterator<QLabel*> anIter( myGeodesicLabels );
747   while( anIter.hasNext() )
748     anIter.next()->setVisible( anIsManualGeodesic );
749
750   emit modeActivated( theMode );
751 }
752
753 void HYDROGUI_ImportImageDlg::onRefImageActivated( const QString& theName )
754 {
755   emit refImageActivated( theName );
756 }
757
758 void HYDROGUI_ImportImageDlg::onPointBtnToggled( bool theState )
759 {
760   int aPointType = HYDROGUI_PrsImage::None;
761   if( theState )
762   {
763     QMapIterator<int, QPushButton*> anIter( myPointBtnMap );
764     while( anIter.hasNext() )
765     {
766       int aBtnPointType = anIter.next().key();
767       QPushButton* aBtn = anIter.value();
768       if( aBtn == sender() )
769         aPointType = aBtnPointType;
770       else
771       {
772         bool anIsBlocked = aBtn->blockSignals( true );
773         aBtn->setChecked( false );
774         aBtn->blockSignals( anIsBlocked );
775       }
776     }
777   }
778   emit activatePointSelection( aPointType );
779 }
780
781 void HYDROGUI_ImportImageDlg::onPointCoordChanged( int theValue )
782 {
783   QObject* aSender = sender();
784   if( !aSender )
785     return;
786
787   for( int aPointType = HYDROGUI_PrsImage::PointA;
788        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
789   {
790     if( aSender == myPointXMap[ aPointType ] ||
791         aSender == myPointYMap[ aPointType ] )
792     {
793       bool anIsY = aSender == myPointYMap[ aPointType ];
794       emit pointCoordChanged( false, aPointType, anIsY, theValue );
795     }
796     else if( aSender == myRefPointXMap[ aPointType ] ||
797              aSender == myRefPointYMap[ aPointType ] )
798     {
799       bool anIsY = aSender == myRefPointYMap[ aPointType ];
800       emit pointCoordChanged( true, aPointType, anIsY, theValue );
801     }
802   }
803 }
804
805 void HYDROGUI_ImportImageDlg::onGeodesicCoordChanged()
806 {
807   QObject* aSender = sender();
808   if( !aSender )
809     return;
810
811   for( int aPointType = HYDROGUI_PrsImage::PointA;
812        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
813   {
814     if( aSender == myPointXDegMap[ aPointType ] ||
815         aSender == myPointYDegMap[ aPointType ] ||
816         aSender == myPointXMinMap[ aPointType ] ||
817         aSender == myPointYMinMap[ aPointType ] ||
818         aSender == myPointXSecMap[ aPointType ] ||
819         aSender == myPointYSecMap[ aPointType ] )
820     {
821       onGeodesicCoordChanged( aPointType );
822       return;
823     }
824   }
825 }
826
827 void HYDROGUI_ImportImageDlg::onGeodesicCoordChanged( const int thePointType )
828 {
829   bool anIsOk[6];
830   for( int i = 0; i < 6; i++ )
831     anIsOk[ i ] = true;
832
833   int aXDeg = myPointXDegMap[ thePointType ]->text().toInt( &anIsOk[0] );
834   int aYDeg = myPointYDegMap[ thePointType ]->text().toInt( &anIsOk[1] );
835   int aXMin = myPointXMinMap[ thePointType ]->text().toInt( &anIsOk[2] );
836   int aYMin = myPointYMinMap[ thePointType ]->text().toInt( &anIsOk[3] );
837   double aXSec = myPointXSecMap[ thePointType ]->text().toDouble( &anIsOk[4] );
838   double aYSec = myPointYSecMap[ thePointType ]->text().toDouble( &anIsOk[5] );
839
840   for( int i = 0; i < 6; i++ )
841     if( !anIsOk[ i ] )
842       return;
843
844   double aLonDeg = 0, aLatDeg = 0;
845   HYDROData_Lambert93::DMSToDeg( aXDeg, aXMin, aXSec, aLonDeg );
846   HYDROData_Lambert93::DMSToDeg( aYDeg, aYMin, aYSec, aLatDeg );
847
848   double aXCart = 0, aYCart = 0;
849   HYDROData_Lambert93::toXY( aLatDeg, aLonDeg, aXCart, aYCart );
850
851   blockSignalsCartesian( true );
852
853   myCartPointXMap[ thePointType ]->setValue( aXCart );
854   myCartPointYMap[ thePointType ]->setValue( aYCart );
855
856   blockSignalsCartesian( false );
857 }
858
859 void HYDROGUI_ImportImageDlg::onCartesianCoordChanged()
860 {
861   QObject* aSender = sender();
862   if( !aSender )
863     return;
864
865   for( int aPointType = HYDROGUI_PrsImage::PointA;
866        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
867   {
868     if( aSender == myCartPointXMap[ aPointType ] ||
869         aSender == myCartPointYMap[ aPointType ] )
870     {
871       onCartesianCoordChanged( aPointType );
872       return;
873     }
874   }
875 }
876
877 void HYDROGUI_ImportImageDlg::onCartesianCoordChanged( const int thePointType )
878 {
879   bool anIsOk[2];
880   for( int i = 0; i < 2; i++ )
881     anIsOk[ i ] = true;
882
883   double aXCart = myCartPointXMap[ thePointType ]->text().toDouble( &anIsOk[0] );
884   double aYCart = myCartPointYMap[ thePointType ]->text().toDouble( &anIsOk[1] );
885
886   for( int i = 0; i < 2; i++ )
887     if( !anIsOk[ i ] )
888       return;
889
890   double aLonDeg = 0, aLatDeg = 0;
891   HYDROData_Lambert93::toGeo( aXCart, aYCart, aLatDeg, aLonDeg );
892
893   int aXDeg = 0, aYDeg = 0;
894   int aXMin = 0, aYMin = 0;
895   double aXSec = 0, aYSec = 0;
896   HYDROData_Lambert93::degToDMS( aLonDeg, aXDeg, aXMin, aXSec );
897   HYDROData_Lambert93::degToDMS( aLatDeg, aYDeg, aYMin, aYSec );
898
899   blockSignalsGeodesic( true );
900
901   myPointXDegMap[ thePointType ]->setValue( aXDeg );
902   myPointYDegMap[ thePointType ]->setValue( aYDeg );
903   myPointXMinMap[ thePointType ]->setValue( aXMin );
904   myPointYMinMap[ thePointType ]->setValue( aYMin );
905   myPointXSecMap[ thePointType ]->setValue( aXSec );
906   myPointYSecMap[ thePointType ]->setValue( aYSec );
907
908   blockSignalsGeodesic( false );
909 }
910
911 void HYDROGUI_ImportImageDlg::blockSignalsGeodesic( const bool theState )
912 {
913   for( int aPointType = HYDROGUI_PrsImage::PointA;
914        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
915   {
916     myPointXDegMap[ aPointType ]->blockSignals( theState );
917     myPointXMinMap[ aPointType ]->blockSignals( theState );
918     myPointXSecMap[ aPointType ]->blockSignals( theState );
919     myPointYDegMap[ aPointType ]->blockSignals( theState );
920     myPointYMinMap[ aPointType ]->blockSignals( theState );
921     myPointYSecMap[ aPointType ]->blockSignals( theState );
922   }
923 }
924
925 void HYDROGUI_ImportImageDlg::blockSignalsCartesian( const bool theState )
926 {
927   for( int aPointType = HYDROGUI_PrsImage::PointA;
928        aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ )
929   {
930     myCartPointXMap[ aPointType ]->blockSignals( theState );
931     myCartPointYMap[ aPointType ]->blockSignals( theState );
932   }
933 }