+ HYDROGUI_ImportImageDlg::ComputeTrsfData( aTrsfMode, aLocalPointB, aTrsfPointB );
+ if ( !anIsByTwoPoints )
+ aDataMap[ HYDROGUI_PrsImage::PointC ] =
+ HYDROGUI_ImportImageDlg::ComputeTrsfData( aTrsfMode, aLocalPointC, aTrsfPointC );
+
+ aPanel->setTransformationMode( aTrsfMode );
+ aPanel->setTransformationDataMap( aDataMap );
+ aPanel->setByTwoPoints( anIsByTwoPoints );
+
+ // Set points on reference image
+ if ( aTrsfMode = HYDROData_Image::ReferenceImage )
+ {
+ Handle(HYDROData_Image) aRefImage = myEditedObject->GetTrsfReferenceImage();
+ if ( !aRefImage.IsNull() )
+ {
+ aRefImageName = aRefImage->GetName();
+
+ onRefImageActivated( aRefImageName );
+ if( myRefPreviewPrs )
+ {
+ HYDROGUI_PrsImage::TransformationPointMap aRefPointMap =
+ myRefPreviewPrs->getTransformationPointMap();
+ if( !aRefPointMap.isEmpty() )
+ {
+ aRefPointMap[ HYDROGUI_PrsImage::PointA ].Point = aTrsfPointA.toPoint();
+ aRefPointMap[ HYDROGUI_PrsImage::PointB ].Point = aTrsfPointB.toPoint();
+ if ( !anIsByTwoPoints )
+ aRefPointMap[ HYDROGUI_PrsImage::PointC ].Point = aTrsfPointC.toPoint();
+
+ myRefPreviewPrs->setTransformationPointMap( aRefPointMap );
+ }
+ }
+
+ 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() );
+
+ aPanel->setTransformationDataMap( aRefDataMap, true, true );
+ }
+ }
+ }
+ }
+
+ // collect information about existing images
+ 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;
+ aDataMap[ HYDROGUI_PrsImage::PointA ] =
+ HYDROGUI_ImportImageDlg::ComputeTrsfData( aImgTrsfMode, aLocalPointA, aTrsfPointA );
+ aDataMap[ HYDROGUI_PrsImage::PointB ] =
+ HYDROGUI_ImportImageDlg::ComputeTrsfData( aImgTrsfMode, aLocalPointB, aTrsfPointB );