@@ -69,8 +69,8 @@ void vvCropReturnsDialog::pqInternal::saveSettings()
6969 this ->CropGroupBox ->isChecked ());
7070
7171 this ->Settings ->setValue (
72- " VelodyneHDLPlugin/CropReturnsDialog/CropInside " ,
73- this ->CropInsideCheckBox ->isChecked ());
72+ " VelodyneHDLPlugin/CropReturnsDialog/CropOutside " ,
73+ this ->CropOutsideCheckBox ->isChecked ());
7474
7575 this ->Settings ->setValue (
7676 " VelodyneHDLPlugin/CropReturnsDialog/FirstCornerX" ,
@@ -120,10 +120,10 @@ void vvCropReturnsDialog::pqInternal::restoreSettings()
120120 " VelodyneHDLPlugin/CropReturnsDialog/EnableCropping" ,
121121 false ).toBool ());
122122
123- this ->CropInsideCheckBox ->setChecked (
123+ this ->CropOutsideCheckBox ->setChecked (
124124 this ->Settings ->value (
125- " VelodyneHDLPlugin/CropReturnsDialog/CropInside " ,
126- this ->CropInsideCheckBox ->isChecked ()).toBool ());
125+ " VelodyneHDLPlugin/CropReturnsDialog/CropOutside " ,
126+ this ->CropOutsideCheckBox ->isChecked ()).toBool ());
127127
128128 this ->X1SpinBox ->setValue (
129129 this ->Settings ->value (
@@ -193,9 +193,10 @@ vvCropReturnsDialog::vvCropReturnsDialog(QWidget *p)
193193 connect (this ->Internal ->noneRadioButton ,SIGNAL (clicked ()),this ,SLOT (onNoneToggled ()));
194194 connect (this ->Internal ->cartesianRadioButton ,SIGNAL (clicked ()),this ,SLOT (onCartesianToggled ()));
195195 connect (this ->Internal ->sphericalRadioButton ,SIGNAL (clicked ()),this ,SLOT (onSphericalToggled ()));
196+ connect (this ->Internal ->CropGroupBox , SIGNAL (clicked ()), this , SLOT (onCropGroupBoxToggled ()));
196197
197- // Without configuration file, the none mode is set by default
198- this ->Internal ->noneRadioButton ->setChecked (true );
198+ // Without configuration file, the cartesian mode is set by default
199+ this ->Internal ->cartesianRadioButton ->setChecked (true );
199200 this ->Internal ->restoreSettings ();
200201}
201202
@@ -217,15 +218,15 @@ void vvCropReturnsDialog::setCroppingEnabled(bool checked)
217218}
218219
219220// -----------------------------------------------------------------------------
220- bool vvCropReturnsDialog::cropInside () const
221+ bool vvCropReturnsDialog::cropOutside () const
221222{
222- return this ->Internal ->CropInsideCheckBox ->isChecked ();
223+ return this ->Internal ->CropOutsideCheckBox ->isChecked ();
223224}
224225
225226// -----------------------------------------------------------------------------
226- void vvCropReturnsDialog::setCropInside (bool checked)
227+ void vvCropReturnsDialog::setCropOutside (bool checked)
227228{
228- this ->Internal ->CropInsideCheckBox ->setChecked (checked);
229+ this ->Internal ->CropOutsideCheckBox ->setChecked (checked);
229230}
230231
231232// -----------------------------------------------------------------------------
@@ -330,9 +331,9 @@ void vvCropReturnsDialog::pqInternal::SetSphericalSettings()
330331 this ->ActivateSpinBox ();
331332 // change the labels
332333 // list of unicode symbol : http://sites.psu.edu/symbolcodes/languages/ancient/greek/greekchart/
333- this ->XLabel ->setText (QString ( " theta " ) + QString ((QChar) 0x03b8 )); // theta symbol
334- this ->YLabel ->setText (QString ( " phi " ) + QString ((QChar) 0x03c6 )); // phi symbol
335- this ->ZLabel ->setText (" R " );
334+ this ->XLabel ->setText (" Rotational angle " );
335+ this ->YLabel ->setText (" Vertical angle " );
336+ this ->ZLabel ->setText (" Distance " );
336337
337338 // Here we take the spherical coordinates used in mathematics (and not physic)
338339 // (r,theta,phi)
@@ -354,15 +355,9 @@ void vvCropReturnsDialog::pqInternal::SetSphericalSettings()
354355 this ->Z1SpinBox ->setMinimum (0 );
355356 this ->Z2SpinBox ->setMinimum (0 );
356357 this ->ZDoubleRangeSlider .setMinimum (0 );
357- this ->Z1SpinBox ->setMaximum (1000 );
358- this ->Z2SpinBox ->setMaximum (1000 );
359- this ->ZDoubleRangeSlider .setMaximum (1000 );
360-
361- // Hide phi selection since the laser
362- // selection does almost the same thing
363- this ->Y1SpinBox ->setDisabled (true );
364- this ->Y2SpinBox ->setDisabled (true );
365- this ->YDoubleRangeSlider .setDisabled (true );
358+ this ->Z1SpinBox ->setMaximum (120 );
359+ this ->Z2SpinBox ->setMaximum (120 );
360+ this ->ZDoubleRangeSlider .setMaximum (120 );
366361}
367362
368363// -----------------------------------------------------------------------------
@@ -382,7 +377,7 @@ void vvCropReturnsDialog::pqInternal::SetCartesianSettings()
382377 this ->XDoubleRangeSlider .setMinimum (minV);
383378 this ->X1SpinBox ->setMaximum (maxV);
384379 this ->X2SpinBox ->setMaximum (maxV);
385- this ->XDoubleRangeSlider .setMaximumValue (maxV);
380+ this ->XDoubleRangeSlider .setMaximum (maxV);
386381 // Y [-10000,10000]
387382 this ->Y1SpinBox ->setMinimum (minV);
388383 this ->Y2SpinBox ->setMinimum (minV);
@@ -397,19 +392,13 @@ void vvCropReturnsDialog::pqInternal::SetCartesianSettings()
397392 this ->Z1SpinBox ->setMaximum (maxV);
398393 this ->Z2SpinBox ->setMaximum (maxV);
399394 this ->ZDoubleRangeSlider .setMaximum (maxV);
400-
401- // Activate the Y SpinBox since the Spherical
402- // settings desactivate it
403- this ->Y1SpinBox ->setDisabled (false );
404- this ->Y2SpinBox ->setDisabled (false );
405- this ->YDoubleRangeSlider .setDisabled (false );
406395}
407396
408397// -----------------------------------------------------------------------------
409398void vvCropReturnsDialog::onNoneToggled ()
410399{
411400 this ->Internal ->DesactivateSpinBox ();
412- this ->Internal ->CropInsideCheckBox ->setChecked (false );
401+ this ->Internal ->CropOutsideCheckBox ->setChecked (false );
413402}
414403
415404// -----------------------------------------------------------------------------
@@ -458,7 +447,7 @@ void vvCropReturnsDialog::pqInternal::ActivateSpinBox()
458447 this ->YDoubleRangeSlider .setDisabled (false );
459448 this ->ZDoubleRangeSlider .setDisabled (false );
460449
461- this ->CropInsideCheckBox ->setDisabled (false );
450+ this ->CropOutsideCheckBox ->setDisabled (false );
462451}
463452
464453// -----------------------------------------------------------------------------
@@ -569,7 +558,7 @@ void vvCropReturnsDialog::pqInternal::DesactivateSpinBox()
569558 this ->YDoubleRangeSlider .setDisabled (true );
570559 this ->ZDoubleRangeSlider .setDisabled (true );
571560
572- this ->CropInsideCheckBox ->setDisabled (true );
561+ this ->CropOutsideCheckBox ->setDisabled (true );
573562}
574563
575564// -----------------------------------------------------------------------------
@@ -644,4 +633,32 @@ void vvCropReturnsDialog::pqInternal::updateRangeValues(bool isSliderMode)
644633void vvCropReturnsDialog::onSpinBoxChanged (double value)
645634{
646635 this ->Internal ->updateRangeValues (false );
636+ }
637+
638+ // -----------------------------------------------------------------------------
639+ void vvCropReturnsDialog::onCropGroupBoxToggled ()
640+ {
641+ this ->Internal ->X1SpinBox ->setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
642+ this ->Internal ->X2SpinBox ->setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
643+ this ->Internal ->Y1SpinBox ->setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
644+ this ->Internal ->Y2SpinBox ->setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
645+ this ->Internal ->Z1SpinBox ->setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
646+ this ->Internal ->Z2SpinBox ->setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
647+ this ->Internal ->XDoubleRangeSlider .setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
648+ this ->Internal ->YDoubleRangeSlider .setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
649+ this ->Internal ->ZDoubleRangeSlider .setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
650+ this ->Internal ->noneRadioButton ->setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
651+ this ->Internal ->cartesianRadioButton ->setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
652+ this ->Internal ->sphericalRadioButton ->setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
653+ this ->Internal ->CropOutsideCheckBox ->setDisabled (!this ->Internal ->CropGroupBox ->isChecked ());
654+ }
655+
656+ // -----------------------------------------------------------------------------
657+ void vvCropReturnsDialog::UpdateDialogWithCurrentSetting ()
658+ {
659+ this ->onCropGroupBoxToggled ();
660+ if (this ->Internal ->noneRadioButton ->isChecked ())
661+ {
662+ this ->onNoneToggled ();
663+ }
647664}
0 commit comments