+ else
+ {
+ // Get global points from the edited image
+ myEditedObject->GetGlobalPoints( aTrsfMode, aTrsfPointA, aTrsfPointB, aTrsfPointC );
+ // Build the local-global points map
+ computeTrsfData( aTrsfMode, anIsByTwoPoints, aLocalPointA, aLocalPointB, aLocalPointC,
+ aTrsfPointA, aTrsfPointB, aTrsfPointC, 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 );
+ }
+ }
+ }
+ }
+
+ // 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 );