#include <QPushButton>
#include <QRadioButton>
#include <QToolButton>
+#include <QCheckBox>
HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, const QString& theTitle )
: HYDROGUI_InputPanel( theModule, theTitle ),
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
// Import image from file
- myFileNameGroup = new QGroupBox( tr( "IMPORT_IMAGE_FROM_FILE" ) );
+ myFileNameGroup = new QGroupBox( tr( "IMPORT_IMAGE_FROM_FILE" ), this );
QLabel* aFileNameLabel = new QLabel( tr( "FILE_NAME" ), myFileNameGroup );
aFileNameLayout->addWidget( aBrowseBtn );
// Image name
- myImageNameGroup = new QGroupBox( tr( "IMAGE_NAME" ) );
+ myImageNameGroup = new QGroupBox( tr( "IMAGE_NAME" ), this );
QLabel* anImageNameLabel = new QLabel( tr( "NAME" ), myImageNameGroup );
myImageName = new QLineEdit( myImageNameGroup );
anImageNameLayout->addWidget( myImageName );
// Transform image
- myTransformGroup = new QGroupBox( tr( "TRANSFORM_IMAGE" ) );
+ myTransformGroup = new QGroupBox( tr( "TRANSFORM_IMAGE" ), this );
// Make a pixmap for arrow
QPixmap anArrowPixmap = aResMgr->loadPixmap( "HYDRO", tr( "ARROW_RIGHT_ICO" ) );
myRefImage = new QComboBox( myTransformGroup );
- QGridLayout* aModeLayout = new QGridLayout();
+ QGridLayout* aTransformLayout = new QGridLayout( myTransformGroup );
+ aTransformLayout->setMargin( 5 );
+ aTransformLayout->setSpacing( 5 );
+
+ QGridLayout* aModeLayout = new QGridLayout( myTransformGroup );
aModeLayout->setMargin( 0 );
aModeLayout->setSpacing( 5 );
aModeLayout->addWidget( aManualCartesianBtn, 0, 0 );
aModeLayout->addWidget( myRefImage, 2, 1 );
aModeLayout->setColumnStretch( 1, 1 );
- QGridLayout* aTransformLayout = new QGridLayout( myTransformGroup );
- aTransformLayout->setMargin( 5 );
- aTransformLayout->setSpacing( 5 );
aTransformLayout->addLayout( aModeLayout, 0, 0, 1, 9 );
QLabel* aImageCSLabel = new QLabel( tr( "IMAGE_CS" ), myTransformGroup );
- QLabel* aGeodesicLabel = new QLabel( "GEODESIC", myTransformGroup );
- QLabel* aLambertLabel = new QLabel( "LAMBERT93", myTransformGroup );
- QLabel* aRefImageLabel = new QLabel( "REFERENCE_IMAGE_CS", myTransformGroup );
+ QLabel* aGeodesicLabel = new QLabel( tr( "GEODESIC" ), myTransformGroup );
+ QLabel* aLambertLabel = new QLabel( tr( "LAMBERT93" ), myTransformGroup );
+ QLabel* aRefImageLabel = new QLabel( tr( "REFERENCE_IMAGE_CS" ), myTransformGroup );
aTransformLayout->addWidget( aImageCSLabel, 2, 1 );
aTransformLayout->addWidget( aGeodesicLabel, 2, 3, 1, 6 );
QtxIntSpinBox* aRefPointY = new QtxIntSpinBox( 0, 0, 1, myTransformGroup ); // max is updated later
int aRow = 4 * aPointType + 3;
- aTransformLayout->addWidget( aPointBtn, aRow, 0, 1, 9 );
+ if ( aPointType == HYDROGUI_PrsImage::PointC )
+ {
+ myPointCEnabler = new QCheckBox( myTransformGroup );
+ aTransformLayout->addWidget( myPointCEnabler, aRow, 0, 1, 2, Qt::AlignHCenter );
+ aTransformLayout->addWidget( aPointBtn, aRow, 2, 1, 7 );
+ }
+ else
+ {
+ aTransformLayout->addWidget( aPointBtn, aRow, 0, 1, 9 );
+ }
aTransformLayout->addWidget( aPointXLabel, aRow + 1, 0 );
aTransformLayout->addWidget( aPointX, aRow + 1, 1 );
connect( aRefPointX, SIGNAL( valueChanged( int ) ), this, SLOT( onPointCoordChanged( int ) ) );
connect( aRefPointY, SIGNAL( valueChanged( int ) ), this, SLOT( onPointCoordChanged( int ) ) );
}
+
+ // Connect checkbox enabling point C
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointBtnMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointXMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointYMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointXDegMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointYDegMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointXMinMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointYMinMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointXSecMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myPointYSecMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myCartPointXMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myCartPointYMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myRefPointXMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+ connect( myPointCEnabler, SIGNAL( toggled( bool ) ), myRefPointYMap[ HYDROGUI_PrsImage::PointC ], SLOT( setEnabled( bool ) ) );
+
aTransformLayout->setColumnStretch( 1, 1 ); // double
aTransformLayout->setColumnStretch( 3, 1 ); // degrees
aTransformLayout->setColumnStretch( 5, 1 ); // minutes
HYDROGUI_ImportImageDlg::~HYDROGUI_ImportImageDlg()
{
- delete myFileNameGroup;
- delete myImageNameGroup;
- delete myTransformGroup;
}
void HYDROGUI_ImportImageDlg::setIsEdit( const bool theIsEdit )
myCartPointXMap[ aPointType ]->clear();
myCartPointYMap[ aPointType ]->clear();
}
+ myPointCEnabler->setChecked( true );
+ myPointCEnabler->toggle();
myTransformGroup->setEnabled( false );
myRefImage->clear();