From b41fb941f6f515a69d05ea432f888ead2c3ac037 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 13 Jan 2014 11:50:04 +0000 Subject: [PATCH] Refs #320 - Point C is shown in reference image, however it isn't checked Import image dockable panel refs #324 - Point C is shown in reference image, however it isn't checked Import image dockable panel --- src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx | 87 +++++++++++--- src/HYDROGUI/HYDROGUI_ImportImageDlg.h | 8 +- src/HYDROGUI/HYDROGUI_ImportImageOp.cxx | 136 +++++++++++---------- src/HYDROGUI/HYDROGUI_ImportImageOp.h | 6 + src/HYDROGUI/HYDROGUI_PrsImage.cxx | 143 +++++++++++++---------- src/HYDROGUI/HYDROGUI_PrsImage.h | 16 ++- 6 files changed, 250 insertions(+), 146 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx index e39985b3..4286978d 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportImageDlg.cxx @@ -385,6 +385,9 @@ void HYDROGUI_ImportImageDlg::reset() myImageName->clear(); myImageNameGroup->setEnabled( false ); myGeoFileName->clear(); + bool isPBlocked = blockSignalsPoints( true ); + bool isGBlocked = blockSignalsGeodesic( true ); + bool isCBlocked = blockSignalsCartesian( true ); for( int aPointType = HYDROGUI_PrsImage::PointA; aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ ) { @@ -393,21 +396,24 @@ void HYDROGUI_ImportImageDlg::reset() aBtn->setChecked( false ); aBtn->blockSignals( anIsBlocked ); - myPointXMap[ aPointType ]->clear(); - myPointYMap[ aPointType ]->clear(); - myPointXDegMap[ aPointType ]->clear(); - myPointYDegMap[ aPointType ]->clear(); - myPointXMinMap[ aPointType ]->clear(); - myPointYMinMap[ aPointType ]->clear(); - myPointXSecMap[ aPointType ]->clear(); - myPointYSecMap[ aPointType ]->clear(); + clearSpins( myPointXMap[ aPointType ] ); + clearSpins( myPointYMap[ aPointType ] ); + clearSpins( myPointXDegMap[ aPointType ] ); + clearSpins( myPointYDegMap[ aPointType ] ); + clearSpins( myPointXMinMap[ aPointType ] ); + clearSpins( myPointYMinMap[ aPointType ] ); + clearSpins( myPointXSecMap[ aPointType ] ); + clearSpins( myPointYSecMap[ aPointType ] ); - myRefPointXMap[ aPointType ]->clear(); - myRefPointYMap[ aPointType ]->clear(); + clearSpins( myRefPointXMap[ aPointType ] ); + clearSpins( myRefPointYMap[ aPointType ] ); - myCartPointXMap[ aPointType ]->clear(); - myCartPointYMap[ aPointType ]->clear(); + clearSpins( myCartPointXMap[ aPointType ] ); + clearSpins( myCartPointYMap[ aPointType ] ); } + blockSignalsPoints( isPBlocked ); + blockSignalsGeodesic( isGBlocked ); + blockSignalsCartesian( isCBlocked ); // Emulate turning off C point usage myPointCEnabler->blockSignals( true ); @@ -465,6 +471,13 @@ QString HYDROGUI_ImportImageDlg::getFileName() const return myFileName->text(); } +void HYDROGUI_ImportImageDlg::setFileName( const QString& theName ) +{ + myFileName->setText( theName ); + myImageNameGroup->setEnabled( true ); + myTransformGroup->setEnabled( true ); +} + QString HYDROGUI_ImportImageDlg::getGeoreferencementFileName() const { return myGeoFileName->text(); @@ -701,10 +714,8 @@ void HYDROGUI_ImportImageDlg::onBrowse() } else { - myFileName->setText( aFileName ); + setFileName( aFileName ); emit createPreview( anImage ); - myImageNameGroup->setEnabled( true ); - myTransformGroup->setEnabled( true ); } } } @@ -908,26 +919,64 @@ void HYDROGUI_ImportImageDlg::onCartesianCoordChanged( const int thePointType ) blockSignalsGeodesic( false ); } -void HYDROGUI_ImportImageDlg::blockSignalsGeodesic( const bool theState ) +void HYDROGUI_ImportImageDlg::clearSpins( QAbstractSpinBox* theSpin ) +{ + if ( dynamic_cast( theSpin ) ) + { + QtxIntSpinBox* aSpin = dynamic_cast( theSpin ); + aSpin->setValue( aSpin->minimum() ); + } + else if ( dynamic_cast( theSpin ) ) + { + QtxDoubleSpinBox* aDblSpin = dynamic_cast( theSpin ); + aDblSpin->setValue( aDblSpin->minimum() ); + } + + theSpin->clear(); +} + +bool HYDROGUI_ImportImageDlg::blockSignalsPoints( const bool theState ) +{ + bool isBlocked = false; + for( int aPointType = HYDROGUI_PrsImage::PointA; + aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ ) + { + isBlocked = + myPointXMap[ aPointType ]->blockSignals( theState ) || isBlocked; + myPointYMap[ aPointType ]->blockSignals( theState ); + + myRefPointXMap[ aPointType ]->blockSignals( theState ); + myRefPointYMap[ aPointType ]->blockSignals( theState ); + } + return isBlocked; +} + +bool HYDROGUI_ImportImageDlg::blockSignalsGeodesic( const bool theState ) { + bool isBlocked = false; for( int aPointType = HYDROGUI_PrsImage::PointA; aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ ) { - myPointXDegMap[ aPointType ]->blockSignals( theState ); + isBlocked = + myPointXDegMap[ aPointType ]->blockSignals( theState ) || isBlocked; myPointXMinMap[ aPointType ]->blockSignals( theState ); myPointXSecMap[ aPointType ]->blockSignals( theState ); myPointYDegMap[ aPointType ]->blockSignals( theState ); myPointYMinMap[ aPointType ]->blockSignals( theState ); myPointYSecMap[ aPointType ]->blockSignals( theState ); } + return isBlocked; } -void HYDROGUI_ImportImageDlg::blockSignalsCartesian( const bool theState ) +bool HYDROGUI_ImportImageDlg::blockSignalsCartesian( const bool theState ) { + bool isBlocked = false; for( int aPointType = HYDROGUI_PrsImage::PointA; aPointType <= HYDROGUI_PrsImage::PointC; aPointType++ ) { - myCartPointXMap[ aPointType ]->blockSignals( theState ); + isBlocked = + myCartPointXMap[ aPointType ]->blockSignals( theState ) || isBlocked; myCartPointYMap[ aPointType ]->blockSignals( theState ); } + return isBlocked; } diff --git a/src/HYDROGUI/HYDROGUI_ImportImageDlg.h b/src/HYDROGUI/HYDROGUI_ImportImageDlg.h index f1f2a647..b4a2c950 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageDlg.h +++ b/src/HYDROGUI/HYDROGUI_ImportImageDlg.h @@ -42,6 +42,7 @@ class QCheckBox; class QtxDoubleSpinBox; class QtxIntSpinBox; +class QAbstractSpinBox; class HYDROGUI_ImportImageDlg : public HYDROGUI_InputPanel { @@ -86,6 +87,7 @@ public: QString getRefImageName() const; QString getFileName() const; + void setFileName( const QString& theName ); QString getGeoreferencementFileName() const; void setImageSize( const QSize& theSize, @@ -129,8 +131,10 @@ protected slots: void onCartesianCoordChanged( const int thePointType ); private: - void blockSignalsGeodesic( const bool theState ); - void blockSignalsCartesian( const bool theState ); + void clearSpins( QAbstractSpinBox* theSpin ); + bool blockSignalsPoints( const bool theState ); + bool blockSignalsGeodesic( const bool theState ); + bool blockSignalsCartesian( const bool theState ); signals: void createPreview( QImage ); diff --git a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx index 3533cee2..58ca39f3 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx @@ -166,36 +166,8 @@ void HYDROGUI_ImportImageOp::startOperation() } } - // Collect information about existing images and initialize the combobox - // reference image selector in the dialog. HYDROGUI_ImportImageDlg::PrsPointDataList aPrsPointDataList; - HYDROData_Iterator anIterator( doc(), KIND_IMAGE ); - for( ; anIterator.More(); anIterator.Next() ) - { - Handle(HYDROData_Image) anImageObj = Handle(HYDROData_Image)::DownCast( anIterator.Current() ); - if( !anImageObj.IsNull() ) - { - if( myIsEdit && IsEqual( anImageObj, myEditedObject ) ) - continue; - - QPoint aLocalPointA, aLocalPointB, aLocalPointC; - anImageObj->GetLocalPoints( aLocalPointA, aLocalPointB, aLocalPointC ); - - HYDROData_Image::TransformationMode aImgTrsfMode; - QPointF aTrsfPointA, aTrsfPointB, aTrsfPointC; - anImageObj->GetGlobalPoints( aImgTrsfMode, - aTrsfPointA, aTrsfPointB, aTrsfPointC ); - - HYDROGUI_ImportImageDlg::TransformationDataMap aDataMap; - computeTrsfData( aImgTrsfMode, false, aLocalPointA, aLocalPointB, aLocalPointC, - aTrsfPointA, aTrsfPointB, aTrsfPointC, aDataMap ); - - HYDROGUI_ImportImageDlg::PrsPointData aPrsPointData( anImageObj->GetName(), aDataMap ); - aPrsPointDataList.append( aPrsPointData ); - } - } - - // Initialize the combobox in the dialog with the list of available reference images + getReferenceDataList( aPrsPointDataList ); aPanel->setPrsPointDataList( aPrsPointDataList ); // Select the current reference image in the dialog combobox aPanel->setRefImageName( aRefImageName ); @@ -225,6 +197,38 @@ void HYDROGUI_ImportImageOp::setPresentationTrsfPoints( HYDROGUI_PrsImage* thePr } } +void HYDROGUI_ImportImageOp::getReferenceDataList( + HYDROGUI_ImportImageDlg::PrsPointDataList& theList ) const +{ + // Collect information about existing images and initialize the combobox + // reference image selector in the dialog. + HYDROData_Iterator anIterator( doc(), KIND_IMAGE ); + for( ; anIterator.More(); anIterator.Next() ) + { + Handle(HYDROData_Image) anImageObj = Handle(HYDROData_Image)::DownCast( anIterator.Current() ); + if( !anImageObj.IsNull() ) + { + if( myIsEdit && IsEqual( anImageObj, myEditedObject ) ) + continue; + + QPoint aLocalPointA, aLocalPointB, aLocalPointC; + anImageObj->GetLocalPoints( aLocalPointA, aLocalPointB, aLocalPointC ); + + HYDROData_Image::TransformationMode aImgTrsfMode; + QPointF aTrsfPointA, aTrsfPointB, aTrsfPointC; + anImageObj->GetGlobalPoints( aImgTrsfMode, + aTrsfPointA, aTrsfPointB, aTrsfPointC ); + + HYDROGUI_ImportImageDlg::TransformationDataMap aDataMap; + computeTrsfData( aImgTrsfMode, false, aLocalPointA, aLocalPointB, aLocalPointC, + aTrsfPointA, aTrsfPointB, aTrsfPointC, aDataMap ); + + HYDROGUI_ImportImageDlg::PrsPointData aPrsPointData( anImageObj->GetName(), aDataMap ); + theList.append( aPrsPointData ); + } + } +} + void HYDROGUI_ImportImageOp::computeTrsfData( HYDROData_Image::TransformationMode theTrsfMode, bool theIsByTwoPoints, const QPoint& theLocalPointA, @@ -553,9 +557,20 @@ void HYDROGUI_ImportImageOp::onCreatePreview( QImage theImage ) if( myPreviewPrs ) // if the image is changed by choosing another file { - myPreviewPrs->setImage( myImage ); - myPreviewPrs->compute(); - + myPreviewPrs->setImage( myImage, true ); + if ( sender() ) // reset the previous presentation settings + { + QString aFileName = aPanel->getFileName(); + + aPanel->reset(); + aPanel->setIsEdit( myIsEdit ); + // restore the file name + aPanel->setFileName( aFileName ); + // fill the reference list + HYDROGUI_ImportImageDlg::PrsPointDataList aPrsPointDataList; + getReferenceDataList( aPrsPointDataList ); + aPanel->setPrsPointDataList( aPrsPointDataList ); + } if( myPreviewViewManager ) { if( GraphicsView_Viewer* aViewer = myPreviewViewManager->getViewer() ) @@ -575,8 +590,7 @@ void HYDROGUI_ImportImageOp::onCreatePreview( QImage theImage ) myActiveViewManager = anApp->activeViewManager(); myPreviewPrs = new HYDROGUI_PrsImage( myIsEdit ? myEditedObject : 0 ); - myPreviewPrs->setImage( myImage ); - myPreviewPrs->compute(); + myPreviewPrs->setImage( myImage, true ); myPreviewViewManager = dynamic_cast( anApp->createViewManager( GraphicsView_Viewer::Type() ) ); @@ -602,30 +616,29 @@ void HYDROGUI_ImportImageOp::onCreatePreview( QImage theImage ) this, SLOT( onPointSelected() ) ); } } + } - // Set the image name in the dialog - QString anImageName = aPanel->getImageName().simplified(); - // If edit mode and the name was not set yet then get from the edited object - if( myIsEdit && anImageName.isEmpty() ) - { - if( !myEditedObject.IsNull() ) - anImageName = myEditedObject->GetName(); + // Set the image name in the dialog + QString anImageName = aPanel->getImageName().simplified(); + // If edit mode and the name was not set yet then get from the edited object + if( myIsEdit && anImageName.isEmpty() ) + { + if( !myEditedObject.IsNull() ) + anImageName = myEditedObject->GetName(); + } + // If the name was not set then initialize it from the selected file name + if ( anImageName.isEmpty() ) + { + anImageName = aPanel->getFileName(); + if ( !anImageName.isEmpty() ) { + anImageName = QFileInfo( anImageName ).baseName(); } - // If the name was not set then initialize it from the selected file name - if ( anImageName.isEmpty() ) - { - anImageName = aPanel->getFileName(); - if ( !anImageName.isEmpty() ) { - anImageName = QFileInfo( anImageName ).baseName(); - } - // If no file name then generate a new image name - if ( anImageName.isEmpty() ) { - anImageName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_IMAGE_NAME" ) ); - } + // If no file name then generate a new image name + if ( anImageName.isEmpty() ) { + anImageName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_IMAGE_NAME" ) ); } - - aPanel->setImageName( anImageName ); } + aPanel->setImageName( anImageName ); aPanel->setImageSize( myImage.size() ); @@ -677,17 +690,19 @@ void HYDROGUI_ImportImageOp::onModeActivated( int theMode ) void HYDROGUI_ImportImageOp::onRefImageActivated( const QString& theName ) { + if( theName.isEmpty() ) { + if( myRefViewManager ) + closeView( myRefViewManager ); + return; + } + GraphicsView_ViewPort* aViewPort = 0; LightApp_Application* anApp = module()->getApp(); ///// Get a view port for the reference image preview if( myRefViewManager ) { - if( theName.isEmpty() ) - { - closeView( myRefViewManager ); - } - else if( GraphicsView_Viewer* aViewer = myRefViewManager->getViewer() ) + if( GraphicsView_Viewer* aViewer = myRefViewManager->getViewer() ) { aViewPort = aViewer->getActiveViewPort(); } @@ -737,8 +752,7 @@ void HYDROGUI_ImportImageOp::onRefImageActivated( const QString& theName ) anImage = anImageObj->Image(); myRefPreviewPrs = new HYDROGUI_PrsImage( anImageObj ); - myRefPreviewPrs->setImage( anImage ); - myRefPreviewPrs->compute(); + myRefPreviewPrs->setImage( anImage, true ); myRefPreviewPrs->setIsTransformationPointPreview( true ); myRefPreviewPrs->setTransformationPointType( myPointType ); diff --git a/src/HYDROGUI/HYDROGUI_ImportImageOp.h b/src/HYDROGUI/HYDROGUI_ImportImageOp.h index 5a7e858f..0acdd0bc 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageOp.h +++ b/src/HYDROGUI/HYDROGUI_ImportImageOp.h @@ -103,6 +103,12 @@ private: const QPoint theLocalPointB, const QPoint theLocalPointC ); + /* + * Initialize the combobox in the dialog with the list of available reference images + */ + void getReferenceDataList( + HYDROGUI_ImportImageDlg::PrsPointDataList& theList ) const; + private: bool myIsEdit; Handle(HYDROData_Image) myEditedObject; diff --git a/src/HYDROGUI/HYDROGUI_PrsImage.cxx b/src/HYDROGUI/HYDROGUI_PrsImage.cxx index 8b2c8a0e..985dc27d 100644 --- a/src/HYDROGUI/HYDROGUI_PrsImage.cxx +++ b/src/HYDROGUI/HYDROGUI_PrsImage.cxx @@ -62,9 +62,13 @@ HYDROGUI_PrsImage::~HYDROGUI_PrsImage() // Function : setImage // Purpose : //================================================================ -void HYDROGUI_PrsImage::setImage( const QImage& theImage ) +void HYDROGUI_PrsImage::setImage( const QImage& theImage, const bool theCompute ) { myImage = theImage; + if ( theCompute ) { + compute(); + computeTransformationPoints( true ); + } } //================================================================ @@ -293,76 +297,91 @@ void HYDROGUI_PrsImage::setSelected( bool theState ) // Function : computeTransformationPoints // Purpose : //================================================================ -void HYDROGUI_PrsImage::computeTransformationPoints() +void HYDROGUI_PrsImage::computeTransformationPoints( const bool theObligatoryInit ) { - if( myTransformationPointMap.isEmpty() ) { - int aWidth = myImage.width(); - int aHeight = myImage.height(); - - // Create presentations for transformation points A, B and C for( int aPointType = PointA; aPointType <= PointC; aPointType++ ) { - TransformationPoint aTransformationPoint; - - QPoint aPoint; - QString aCaption; - QColor aColor = Qt::black; - switch( aPointType ) - { - case PointA: - aPoint = QPoint( 0, 0 ); - aCaption = "A"; - aColor = Qt::darkRed; - break; - case PointB: - aPoint = QPoint( aWidth, 0 ); - aCaption = "B"; - aColor = Qt::darkGreen; - break; - case PointC: - aPoint = QPoint( 0, aHeight ); - aCaption = "C"; - aColor = Qt::darkBlue; - break; - } - - aTransformationPoint.Point = aPoint; - aTransformationPoint.Caption = aCaption; - - QGraphicsEllipseItem* aPointItem = new QGraphicsEllipseItem( this ); - aPointItem->setPen( QPen( aColor ) ); - aPointItem->setBrush( QBrush( aColor ) ); - - double aRadius = 3; - QRectF aRect( -QPointF( aRadius, aRadius ), QSizeF( aRadius * 2 + 1, aRadius * 2 + 1 ) ); - aPointItem->setRect( aRect ); - aPointItem->setPos( QPointF( 0, 0 ) ); - - QGraphicsSimpleTextItem* aCaptionItem = aCaptionItem = new QGraphicsSimpleTextItem( aCaption, this ); - aCaptionItem->setPen( QPen( aColor ) ); - aCaptionItem->setBrush( QBrush( aColor ) ); - QFont aFont = aCaptionItem->font(); - aFont.setPointSize( qApp->font().pointSize() ); - aCaptionItem->setFont( aFont ); - aCaptionItem->setPos( QPointF( -aRadius * 2, aRadius * 2 ) ); - - aTransformationPoint.GroupItem = new QGraphicsItemGroup( this ); - aTransformationPoint.GroupItem->addToGroup( aPointItem ); - aTransformationPoint.GroupItem->addToGroup( aCaptionItem ); - aTransformationPoint.GroupItem->setVisible( false ); - aTransformationPoint.GroupItem->setFlag( QGraphicsItem::ItemIgnoresTransformations ); - aTransformationPoint.GroupItem->setPos( aPoint ); - - myTransformationPointMap[ aPointType ] = aTransformationPoint; + if( myTransformationPointMap.isEmpty() || theObligatoryInit ) + initTrsfPoints( aPointType ); + // Show/hide the point if necessary + updateTrsfPoint( aPointType ); + } } +} + +QGraphicsItemGroup* HYDROGUI_PrsImage::createPointItem( const QString& theCaption, + const QColor& theColor ) +{ + QGraphicsEllipseItem* aPointItem = new QGraphicsEllipseItem( this ); + aPointItem->setPen( QPen( theColor ) ); + aPointItem->setBrush( QBrush( theColor ) ); + + double aRadius = 3; + QRectF aRect( -QPointF( aRadius, aRadius ), QSizeF( aRadius * 2 + 1, aRadius * 2 + 1 ) ); + aPointItem->setRect( aRect ); + aPointItem->setPos( QPointF( 0, 0 ) ); + + QGraphicsSimpleTextItem* aCaptionItem = aCaptionItem = new QGraphicsSimpleTextItem( theCaption, this ); + aCaptionItem->setPen( QPen( theColor ) ); + aCaptionItem->setBrush( QBrush( theColor ) ); + QFont aFont = aCaptionItem->font(); + aFont.setPointSize( qApp->font().pointSize() ); + aCaptionItem->setFont( aFont ); + aCaptionItem->setPos( QPointF( -aRadius * 2, aRadius * 2 ) ); + + QGraphicsItemGroup* aGroupItem = new QGraphicsItemGroup( this ); + aGroupItem->addToGroup( aPointItem ); + aGroupItem->addToGroup( aCaptionItem ); + aGroupItem->setVisible( false ); + aGroupItem->setFlag( QGraphicsItem::ItemIgnoresTransformations ); + + return aGroupItem; +} + +//================================================================ +// Function : initTrsfPoints +// Purpose : +//================================================================ +void HYDROGUI_PrsImage::initTrsfPoints( const int thePointType ) +{ + QPoint aPoint; + QString aCaption; + QColor aColor = Qt::black; - for( int aPointType = PointA; aPointType <= PointC; aPointType++ ) + int aWidth = myImage.width(); + int aHeight = myImage.height(); + switch( thePointType ) { - // Show/hide the point if necessary - updateTrsfPoint( aPointType ); + case PointA: + aPoint = QPoint( 0, 0 ); + aCaption = "A"; + aColor = Qt::darkRed; + break; + case PointB: + aPoint = QPoint( aWidth, 0 ); + aCaption = "B"; + aColor = Qt::darkGreen; + break; + case PointC: + aPoint = QPoint( 0, aHeight ); + aCaption = "C"; + aColor = Qt::darkBlue; + break; } + + TransformationPoint aTransformationPoint; + if ( myTransformationPointMap.contains( thePointType ) ) + aTransformationPoint = myTransformationPointMap[thePointType]; + + aTransformationPoint.Point = aPoint; + aTransformationPoint.Caption = aCaption; + if ( !aTransformationPoint.GroupItem ) + aTransformationPoint.GroupItem = createPointItem( aCaption, aColor ); + aTransformationPoint.GroupItem->setPos( aPoint ); + + myTransformationPointMap[ thePointType ] = aTransformationPoint; } //================================================================ diff --git a/src/HYDROGUI/HYDROGUI_PrsImage.h b/src/HYDROGUI/HYDROGUI_PrsImage.h index f0111520..1fafe354 100644 --- a/src/HYDROGUI/HYDROGUI_PrsImage.h +++ b/src/HYDROGUI/HYDROGUI_PrsImage.h @@ -37,6 +37,8 @@ public: enum TransformationPointType { None = 0, PointA, PointB, PointC }; struct TransformationPoint { + TransformationPoint() : Point( 0, 0 ), Caption( "" ), GroupItem( 0 ) {} + QPoint Point; QString Caption; QGraphicsItemGroup* GroupItem; @@ -49,7 +51,8 @@ public: virtual ~HYDROGUI_PrsImage(); public: - void setImage( const QImage& theImage ); + void setImage( const QImage& theImage, + const bool theCompute = false ); QImage getImage() const; void setCaption( const QString& theCaption ); @@ -89,7 +92,16 @@ public: virtual void setSelected( bool theState ); protected: - void computeTransformationPoints(); + void computeTransformationPoints( const bool theObligatoryInit = false ); + + QGraphicsItemGroup* createPointItem( const QString& theCaption, + const QColor& theColor ); + + /** + * Create presentations for transformation points A, B and C or update the presentation + * parameters if it is already created + */ + void initTrsfPoints( const int thePointType ); /** * Show/hide a transformation point if necessary. */ -- 2.30.2