- HYDROGUI_ImportImageDlg::TransformationDataMap aDataMap;
- aDataMap[ HYDROGUI_PrsImage::PointA ] =
- HYDROGUI_ImportImageDlg::TransformationData( aPointA1, aPointA2 );
- aDataMap[ HYDROGUI_PrsImage::PointB ] =
- HYDROGUI_ImportImageDlg::TransformationData( aPointB1, aPointB2 );
- aDataMap[ HYDROGUI_PrsImage::PointC ] =
- HYDROGUI_ImportImageDlg::TransformationData( aPointC1, aPointC2 );
- ( (HYDROGUI_ImportImageDlg*)inputPanel() )->setTransformationDataMap( aDataMap );
+ // Initialize the dialog mode, local and global coordinates
+ // except coordinates on the reference image
+ aPanel->setTransformationMode( aTrsfMode );
+ aPanel->setTransformationDataMap( aDataMap );
+ aPanel->setByTwoPoints( anIsByTwoPoints );
+
+ // Set points of the reference image
+ if ( aTrsfMode == HYDROData_Image::ReferenceImage )
+ {
+ Handle(HYDROData_Image) aRefImage;
+ myEditedObject->GetReferencePoints( aRefImage,
+ aTrsfPointA, aTrsfPointB, aTrsfPointC );
+ if ( !aRefImage.IsNull() )
+ {
+ aRefImageName = aRefImage->GetName();
+
+ // Create the reference image presentation in the viewer
+ onRefImageActivated( aRefImageName );
+
+ // Set transformation points A,B,C to the reference image presentation
+ setPresentationTrsfPoints( myRefPreviewPrs, anIsByTwoPoints, aTrsfPointA.toPoint(),
+ aTrsfPointB.toPoint(), aTrsfPointC.toPoint() );
+
+ // Prepare A, B, C points on the reference image
+ HYDROGUI_ImportImageDlg::TransformationDataMap aRefDataMap;
+ aRefDataMap[ HYDROGUI_PrsImage::PointA ] =
+ HYDROGUI_ImportImageDlg::TransformationData( aTrsfPointA.toPoint() );
+ aRefDataMap[ HYDROGUI_PrsImage::PointB ] =
+ HYDROGUI_ImportImageDlg::TransformationData( aTrsfPointB.toPoint() );
+ if ( !anIsByTwoPoints )
+ aRefDataMap[ HYDROGUI_PrsImage::PointC ] =
+ HYDROGUI_ImportImageDlg::TransformationData( aTrsfPointC.toPoint() );
+
+ // Initialize the dialog's A, B, C points coordinates of the reference image
+ aPanel->setTransformationDataMap( aRefDataMap, true, true );
+ }
+ }