From c874fabf131c86df3f867c094ed3a2a0813a784e Mon Sep 17 00:00:00 2001 From: adv Date: Thu, 7 Nov 2013 05:39:32 +0000 Subject: [PATCH] Lambert changed to Geodesic. --- src/HYDROData/HYDROData_Image.cxx | 4 +- src/HYDROData/HYDROData_Image.h | 2 +- src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx | 82 ++++++++++++------------ src/HYDROGUI/HYDROGUI_ImportImageDlg.h | 16 ++--- src/HYDROGUI/HYDROGUI_ImportImageOp.cxx | 10 ++- 5 files changed, 56 insertions(+), 58 deletions(-) diff --git a/src/HYDROData/HYDROData_Image.cxx b/src/HYDROData/HYDROData_Image.cxx index 3556d543..64996729 100644 --- a/src/HYDROData/HYDROData_Image.cxx +++ b/src/HYDROData/HYDROData_Image.cxx @@ -335,7 +335,7 @@ void HYDROData_Image::UpdateTrsf() bool anIsByTwoPoints = IsByTwoPoints(); // Convert lambert coordinates to cartesian - if ( aTrsfMode == ManualLambert ) + if ( aTrsfMode == ManualGeodesic ) { double aXCart = 0, aYCart = 0; @@ -639,7 +639,7 @@ void HYDROData_Image::SetTrsfMode( const TransformationMode& theMode ) HYDROData_Image::TransformationMode HYDROData_Image::GetTrsfMode() const { - TransformationMode aResMode = ManualLambert; + TransformationMode aResMode = ManualGeodesic; TDF_Label aLabel = myLab.FindChild( DataTag_TrsfPoints, false ); if ( !aLabel.IsNull() ) diff --git a/src/HYDROData/HYDROData_Image.h b/src/HYDROData/HYDROData_Image.h index 7cf8a05f..90dec9c3 100644 --- a/src/HYDROData/HYDROData_Image.h +++ b/src/HYDROData/HYDROData_Image.h @@ -22,7 +22,7 @@ public: enum TransformationMode { - ManualLambert = 0, + ManualGeodesic = 0, ManualCartesian, ReferenceImage }; diff --git a/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx index 26f9b5ad..a65d5015 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx @@ -98,12 +98,12 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co aPainter.drawPixmap( 0, 0, anArrowPixmap ); aPainter.end(); - QRadioButton* aManualLambertBtn = new QRadioButton( tr( "MANUALLY_GEODESIC" ), myTransformGroup ); + QRadioButton* aManualGeodesicBtn = new QRadioButton( tr( "MANUALLY_GEODESIC" ), myTransformGroup ); QRadioButton* aManualCartesianBtn = new QRadioButton( tr( "MANUALLY_LAMBERT93" ), myTransformGroup ); QRadioButton* aRefImageBtn = new QRadioButton( tr( "BY_REFERENCE_IMAGE" ), myTransformGroup ); myModeGroup = new QButtonGroup( myTransformGroup ); - myModeGroup->addButton( aManualLambertBtn, HYDROData_Image::ManualLambert ); + myModeGroup->addButton( aManualGeodesicBtn, HYDROData_Image::ManualGeodesic ); myModeGroup->addButton( aManualCartesianBtn, HYDROData_Image::ManualCartesian ); myModeGroup->addButton( aRefImageBtn, HYDROData_Image::ReferenceImage ); @@ -116,7 +116,7 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co QGridLayout* aModeLayout = new QGridLayout( myTransformGroup ); aModeLayout->setMargin( 0 ); aModeLayout->setSpacing( 5 ); - aModeLayout->addWidget( aManualLambertBtn, 0, 0 ); + aModeLayout->addWidget( aManualGeodesicBtn, 0, 0 ); aModeLayout->addWidget( aManualCartesianBtn, 1, 0 ); aModeLayout->addWidget( aRefImageBtn, 2, 0 ); aModeLayout->addWidget( myRefImage, 2, 1 ); @@ -137,9 +137,9 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co connect( aManualCartesianBtn, SIGNAL( toggled( bool ) ), aGeodesicLabel, SLOT( setVisible ( bool ) ) ); connect( aManualCartesianBtn, SIGNAL( toggled( bool ) ), aLambertLabel, SLOT( setHidden ( bool ) ) ); connect( aManualCartesianBtn, SIGNAL( toggled( bool ) ), aRefImageLabel, SLOT( setHidden ( bool ) ) ); - connect( aManualLambertBtn, SIGNAL( toggled( bool ) ), aLambertLabel, SLOT( setVisible ( bool ) ) ); - connect( aManualLambertBtn, SIGNAL( toggled( bool ) ), aGeodesicLabel, SLOT( setHidden ( bool ) ) ); - connect( aManualLambertBtn, SIGNAL( toggled( bool ) ), aRefImageLabel, SLOT( setHidden ( bool ) ) ); + connect( aManualGeodesicBtn, SIGNAL( toggled( bool ) ), aLambertLabel, SLOT( setVisible ( bool ) ) ); + connect( aManualGeodesicBtn, SIGNAL( toggled( bool ) ), aGeodesicLabel, SLOT( setHidden ( bool ) ) ); + connect( aManualGeodesicBtn, SIGNAL( toggled( bool ) ), aRefImageLabel, SLOT( setHidden ( bool ) ) ); connect( aRefImageBtn, SIGNAL( toggled( bool ) ), aRefImageLabel, SLOT( setVisible ( bool ) ) ); connect( aRefImageBtn, SIGNAL( toggled( bool ) ), aGeodesicLabel, SLOT( setHidden ( bool ) ) ); connect( aRefImageBtn, SIGNAL( toggled( bool ) ), aLambertLabel, SLOT( setHidden ( bool ) ) ); @@ -172,7 +172,7 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co QLabel* aPointYMinLabel = new QLabel( "'", myTransformGroup ); QLabel* aPointXSecLabel = new QLabel( "\"", myTransformGroup ); QLabel* aPointYSecLabel = new QLabel( "\"", myTransformGroup ); - myLambertLabels << aPointXDegLabel << aPointYDegLabel + myGeodesicLabels << aPointXDegLabel << aPointYDegLabel << aPointXMinLabel << aPointYMinLabel << aPointXSecLabel << aPointYSecLabel; @@ -255,12 +255,12 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co connect( aPointX, SIGNAL( valueChanged( int ) ), this, SLOT( onPointCoordChanged( int ) ) ); connect( aPointY, SIGNAL( valueChanged( int ) ), this, SLOT( onPointCoordChanged( int ) ) ); - connect( aPointXDeg, SIGNAL( valueChanged( int ) ), this, SLOT( onLambertCoordChanged() ) ); - connect( aPointYDeg, SIGNAL( valueChanged( int ) ), this, SLOT( onLambertCoordChanged() ) ); - connect( aPointXMin, SIGNAL( valueChanged( int ) ), this, SLOT( onLambertCoordChanged() ) ); - connect( aPointYMin, SIGNAL( valueChanged( int ) ), this, SLOT( onLambertCoordChanged() ) ); - connect( aPointXSec, SIGNAL( valueChanged( double ) ), this, SLOT( onLambertCoordChanged() ) ); - connect( aPointYSec, SIGNAL( valueChanged( double ) ), this, SLOT( onLambertCoordChanged() ) ); + connect( aPointXDeg, SIGNAL( valueChanged( int ) ), this, SLOT( onGeodesicCoordChanged() ) ); + connect( aPointYDeg, SIGNAL( valueChanged( int ) ), this, SLOT( onGeodesicCoordChanged() ) ); + connect( aPointXMin, SIGNAL( valueChanged( int ) ), this, SLOT( onGeodesicCoordChanged() ) ); + connect( aPointYMin, SIGNAL( valueChanged( int ) ), this, SLOT( onGeodesicCoordChanged() ) ); + connect( aPointXSec, SIGNAL( valueChanged( double ) ), this, SLOT( onGeodesicCoordChanged() ) ); + connect( aPointYSec, SIGNAL( valueChanged( double ) ), this, SLOT( onGeodesicCoordChanged() ) ); connect( aCartPointX, SIGNAL( valueChanged( double ) ), this, SLOT( onCartesianCoordChanged() ) ); connect( aCartPointY, SIGNAL( valueChanged( double ) ), this, SLOT( onCartesianCoordChanged() ) ); @@ -303,7 +303,7 @@ HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, co connect( myRefImage, SIGNAL( activated( const QString& ) ), this, SLOT( onRefImageActivated( const QString& ) ) ); - setTransformationMode( HYDROData_Image::ManualLambert ); + setTransformationMode( HYDROData_Image::ManualGeodesic ); setMinimumWidth( 350 ); } @@ -352,7 +352,7 @@ void HYDROGUI_ImportImageDlg::reset() myTransformGroup->setEnabled( false ); myRefImage->clear(); - setTransformationMode( HYDROData_Image::ManualLambert ); + setTransformationMode( HYDROData_Image::ManualGeodesic ); myPrsPointDataList.clear(); @@ -430,7 +430,7 @@ void HYDROGUI_ImportImageDlg::setTransformationDataMap( const TransformationData const bool theIsOnlyInput, const bool theIsRefImage ) { - blockSignalsLambert( true ); + blockSignalsGeodesic( true ); blockSignalsCartesian( true ); for( int aPointType = HYDROGUI_PrsImage::PointA; aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ ) @@ -446,7 +446,7 @@ void HYDROGUI_ImportImageDlg::setTransformationDataMap( const TransformationData if( !theIsOnlyInput && !theIsRefImage ) { - QPointF aLPoint = aData.LambertPoint; + QPointF aLPoint = aData.GeodesicPoint; int aXDeg = 0, aYDeg = 0; int aXMin = 0, aYMin = 0; double aXSec = 0, aYSec = 0; @@ -466,7 +466,7 @@ void HYDROGUI_ImportImageDlg::setTransformationDataMap( const TransformationData } } } - blockSignalsLambert( false ); + blockSignalsGeodesic( false ); blockSignalsCartesian( false ); } @@ -547,7 +547,7 @@ void HYDROGUI_ImportImageDlg::initializePointSelection() // ouv: tmp /* - blockSignalsLambert( true ); + blockSignalsGeodesic( true ); myPointXDegMap[ HYDROGUI_PrsImage::PointA ]->setValue( 50 ); myPointXMinMap[ HYDROGUI_PrsImage::PointA ]->setValue( 0 ); @@ -572,9 +572,9 @@ void HYDROGUI_ImportImageDlg::initializePointSelection() for( int aPointType = HYDROGUI_PrsImage::PointA; aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ ) - onLambertCoordChanged( aPointType ); + onGeodesicCoordChanged( aPointType ); - blockSignalsLambert( false ); + blockSignalsGeodesic( false ); */ //double aCartX0 = 600000; @@ -610,23 +610,23 @@ HYDROGUI_ImportImageDlg::TransformationData HYDROGUI_ImportImageDlg::ComputeTrsf double arx = theGlobalPoint.x(); double ary = theGlobalPoint.y(); - if ( theMode == HYDROData_Image::ManualLambert ) + if ( theMode == HYDROData_Image::ManualGeodesic ) { - // Lambert to Cartesian + // Geodesic to Cartesian double aXCart = 0, aYCart = 0; HYDROData_Lambert93::toXY( arx, ary, aXCart, aYCart ); - aResTrsfData.LambertPoint = theGlobalPoint; + aResTrsfData.GeodesicPoint = theGlobalPoint; aResTrsfData.CartesianPoint = QPointF( aXCart, aYCart ); } else if ( theMode == HYDROData_Image::ManualCartesian ) { - // Cartesian to Lambert + // Cartesian to Geodesic double aLonDeg = 0, aLatDeg = 0; HYDROData_Lambert93::toGeo( arx, ary, aLatDeg, aLonDeg ); aResTrsfData.CartesianPoint = theGlobalPoint; - aResTrsfData.LambertPoint = QPointF( aLonDeg, aLatDeg ); + aResTrsfData.GeodesicPoint = QPointF( aLonDeg, aLatDeg ); } return aResTrsfData; @@ -651,7 +651,7 @@ void HYDROGUI_ImportImageDlg::onBrowse() void HYDROGUI_ImportImageDlg::onModeActivated( int theMode ) { - bool anIsManualLambert = theMode == HYDROData_Image::ManualLambert; + bool anIsManualGeodesic = theMode == HYDROData_Image::ManualGeodesic; bool anIsManualCartesian = theMode == HYDROData_Image::ManualCartesian; bool anIsRefImage = theMode == HYDROData_Image::ReferenceImage; @@ -660,12 +660,12 @@ void HYDROGUI_ImportImageDlg::onModeActivated( int theMode ) for( int aPointType = HYDROGUI_PrsImage::PointA; aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ ) { - myPointXDegMap[ aPointType ]->setVisible( anIsManualLambert ); - myPointYDegMap[ aPointType ]->setVisible( anIsManualLambert ); - myPointXMinMap[ aPointType ]->setVisible( anIsManualLambert ); - myPointYMinMap[ aPointType ]->setVisible( anIsManualLambert ); - myPointXSecMap[ aPointType ]->setVisible( anIsManualLambert ); - myPointYSecMap[ aPointType ]->setVisible( anIsManualLambert ); + myPointXDegMap[ aPointType ]->setVisible( anIsManualGeodesic ); + myPointYDegMap[ aPointType ]->setVisible( anIsManualGeodesic ); + myPointXMinMap[ aPointType ]->setVisible( anIsManualGeodesic ); + myPointYMinMap[ aPointType ]->setVisible( anIsManualGeodesic ); + myPointXSecMap[ aPointType ]->setVisible( anIsManualGeodesic ); + myPointYSecMap[ aPointType ]->setVisible( anIsManualGeodesic ); myCartPointXMap[ aPointType ]->setVisible( anIsManualCartesian ); myCartPointYMap[ aPointType ]->setVisible( anIsManualCartesian ); @@ -674,9 +674,9 @@ void HYDROGUI_ImportImageDlg::onModeActivated( int theMode ) myRefPointYMap[ aPointType ]->setVisible( anIsRefImage ); } - QListIterator anIter( myLambertLabels ); + QListIterator anIter( myGeodesicLabels ); while( anIter.hasNext() ) - anIter.next()->setVisible( anIsManualLambert ); + anIter.next()->setVisible( anIsManualGeodesic ); emit modeActivated( theMode ); } @@ -733,7 +733,7 @@ void HYDROGUI_ImportImageDlg::onPointCoordChanged( int theValue ) } } -void HYDROGUI_ImportImageDlg::onLambertCoordChanged() +void HYDROGUI_ImportImageDlg::onGeodesicCoordChanged() { QObject* aSender = sender(); if( !aSender ) @@ -749,13 +749,13 @@ void HYDROGUI_ImportImageDlg::onLambertCoordChanged() aSender == myPointXSecMap[ aPointType ] || aSender == myPointYSecMap[ aPointType ] ) { - onLambertCoordChanged( aPointType ); + onGeodesicCoordChanged( aPointType ); return; } } } -void HYDROGUI_ImportImageDlg::onLambertCoordChanged( const int thePointType ) +void HYDROGUI_ImportImageDlg::onGeodesicCoordChanged( const int thePointType ) { bool anIsOk[6]; for( int i = 0; i < 6; i++ ) @@ -827,7 +827,7 @@ void HYDROGUI_ImportImageDlg::onCartesianCoordChanged( const int thePointType ) HYDROData_Lambert93::degToDMS( aLonDeg, aXDeg, aXMin, aXSec ); HYDROData_Lambert93::degToDMS( aLatDeg, aYDeg, aYMin, aYSec ); - blockSignalsLambert( true ); + blockSignalsGeodesic( true ); myPointXDegMap[ thePointType ]->setValue( aXDeg ); myPointYDegMap[ thePointType ]->setValue( aYDeg ); @@ -836,10 +836,10 @@ void HYDROGUI_ImportImageDlg::onCartesianCoordChanged( const int thePointType ) myPointXSecMap[ thePointType ]->setValue( aXSec ); myPointYSecMap[ thePointType ]->setValue( aYSec ); - blockSignalsLambert( false ); + blockSignalsGeodesic( false ); } -void HYDROGUI_ImportImageDlg::blockSignalsLambert( const bool theState ) +void HYDROGUI_ImportImageDlg::blockSignalsGeodesic( const bool theState ) { for( int aPointType = HYDROGUI_PrsImage::PointA; aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ ) diff --git a/src/HYDROGUI/HYDROGUI_ImportImageDlg.h b/src/HYDROGUI/HYDROGUI_ImportImageDlg.h index 3473fdfb..ac77bbaa 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageDlg.h +++ b/src/HYDROGUI/HYDROGUI_ImportImageDlg.h @@ -45,7 +45,7 @@ public: struct TransformationData { QPoint ImagePoint; - QPointF LambertPoint; + QPointF GeodesicPoint; QPointF CartesianPoint; TransformationData() {} @@ -53,11 +53,11 @@ public: TransformationData( const QPoint& theImagePoint ) : ImagePoint( theImagePoint ) {} - TransformationData( const QPoint& theImagePoint, - const QPointF& theLambertPoint, + TransformationData( const QPoint& theImagePoint, + const QPointF& theGeodesicPoint, const QPointF& theCartesianPoint ) : ImagePoint( theImagePoint ), - LambertPoint( theLambertPoint ), + GeodesicPoint( theGeodesicPoint ), CartesianPoint( theCartesianPoint ) {} }; typedef QMap< int, TransformationData > TransformationDataMap; @@ -113,14 +113,14 @@ protected slots: void onPointBtnToggled( bool ); void onPointCoordChanged( int ); - void onLambertCoordChanged(); - void onLambertCoordChanged( const int thePointType ); + void onGeodesicCoordChanged(); + void onGeodesicCoordChanged( const int thePointType ); void onCartesianCoordChanged(); void onCartesianCoordChanged( const int thePointType ); private: - void blockSignalsLambert( const bool theState ); + void blockSignalsGeodesic( const bool theState ); void blockSignalsCartesian( const bool theState ); signals: @@ -145,7 +145,7 @@ private: QButtonGroup* myModeGroup; QComboBox* myRefImage; - QList myLambertLabels; + QList myGeodesicLabels; QMap myPointBtnMap; QMap myPointXMap; diff --git a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx index d53d3a8b..ffd893a7 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx @@ -30,8 +30,6 @@ #include "HYDROGUI_UpdateFlags.h" #include -#include -#include #include #include @@ -349,12 +347,12 @@ bool HYDROGUI_ImportImageOp::processApply( int& theUpdateFlags, } else { - if ( aTransformationMode == HYDROData_Image::ManualLambert ) + if ( aTransformationMode == HYDROData_Image::ManualGeodesic ) { - aTrsfPointA = aMap[ HYDROGUI_PrsImage::PointA ].LambertPoint; - aTrsfPointB = aMap[ HYDROGUI_PrsImage::PointB ].LambertPoint; + aTrsfPointA = aMap[ HYDROGUI_PrsImage::PointA ].GeodesicPoint; + aTrsfPointB = aMap[ HYDROGUI_PrsImage::PointB ].GeodesicPoint; if ( !anIsByTwoPoints ) - aTrsfPointC = aMap[ HYDROGUI_PrsImage::PointC ].LambertPoint; + aTrsfPointC = aMap[ HYDROGUI_PrsImage::PointC ].GeodesicPoint; } else { -- 2.39.2