if ( !theIsByTwoPoints )
aPointMap[ HYDROGUI_PrsImage::PointC ].Point = theLocalPointC;
+ thePrs->setIsByTwoPoints( theIsByTwoPoints );
thePrs->setTransformationPointMap( aPointMap );
}
}
HYDROGUI_InputPanel* HYDROGUI_ImportImageOp::createInputPanel() const
{
HYDROGUI_InputPanel* aPanel = new HYDROGUI_ImportImageDlg( module(), getName() );
- connect( aPanel, SIGNAL( createPreview( QImage ) ),
- this, SLOT( onCreatePreview( QImage ) ) );
- connect( aPanel, SIGNAL( activatePointSelection( int ) ),
- this, SLOT( onActivatePointSelection( int ) ) );
- connect( aPanel, SIGNAL( pointCoordChanged( bool, int, bool, int ) ),
- this, SLOT( onPointCoordChanged( bool, int, bool, int ) ) );
- connect( aPanel, SIGNAL( modeActivated( int ) ),
- this, SLOT( onModeActivated( int ) ) );
+ connect( aPanel, SIGNAL( createPreview( QImage ) ), SLOT( onCreatePreview( QImage ) ) );
+ connect( aPanel, SIGNAL( activatePointSelection( int ) ), SLOT( onActivatePointSelection( int ) ) );
+ connect( aPanel, SIGNAL( pointCoordChanged( bool, int, bool, int ) ),
+ SLOT( onPointCoordChanged( bool, int, bool, int ) ) );
+ connect( aPanel, SIGNAL( modeActivated( int ) ), SLOT( onModeActivated( int ) ) );
connect( aPanel, SIGNAL( refImageActivated( const QString& ) ),
- this, SLOT( onRefImageActivated( const QString& ) ) );
+ SLOT( onRefImageActivated( const QString& ) ) );
+ connect( aPanel, SIGNAL( setCIsUsed( bool ) ), SLOT( onSetCIsUsed( bool ) ) );
return aPanel;
}
+void HYDROGUI_ImportImageOp::onSetCIsUsed( bool theCIsUsed )
+{
+ if ( myPreviewPrs )
+ {
+ myPreviewPrs->setIsByTwoPoints( !theCIsUsed );
+ }
+ if ( myRefPreviewPrs )
+ {
+ myRefPreviewPrs->setIsByTwoPoints( !theCIsUsed );
+ }
+}
+
bool HYDROGUI_ImportImageOp::checkPoints( const QPointF& thePointA,
const QPointF& thePointB,
const QPointF& thePointC,
theErrorMsg = theLineErrMsg;
return false;
}
+
+ if ( theIsToCheckInvertibles )
+ {
+ QTransform aTransform1( xa, ya, 1, xb, yb, 1, xc, yc, 1 );
+
+ bool anIsInvertible = false;
+ QTransform aTransform1Inverted = aTransform1.inverted( &anIsInvertible );
+ if( !anIsInvertible )
+ {
+ theErrorMsg = tr( "TRANSFORMATION_MATRIX_CANNOT_BE_COMPUTED" );
+ return false;
+ }
+ }
}
else
{
// check that two points are not identical
- if ( ValuesEquals( xa, ya ) && ValuesEquals( xb, yb ) )
+ if ( ValuesEquals( xa, xb ) && ValuesEquals( ya, yb ) )
{
theErrorMsg = thePoinErrMsg;
return false;
}
}
- if ( theIsToCheckInvertibles )
- {
- QTransform aTransform1( xa, ya, 1, xb, yb, 1, xc, yc, 1 );
-
- bool anIsInvertible = false;
- QTransform aTransform1Inverted = aTransform1.inverted( &anIsInvertible );
- if( !anIsInvertible )
- {
- theErrorMsg = tr( "TRANSFORMATION_MATRIX_CANNOT_BE_COMPUTED" );
- return false;
- }
- }
-
return true;
}
anImageName = myEditedObject->GetName();
}
else
- anImageName = HYDROGUI_Tool::GenerateObjectName( module(), "Image" );
+ anImageName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_IMAGE_NAME" ) );
aPanel->setImageName( anImageName );
}
const HYDROGUI_PrsImage::TransformationPointMap& aPointMap =
aPrs->getTransformationPointMap();
+
HYDROGUI_PrsImage::TransformationPointMapIterator anIter( aPointMap );
while( anIter.hasNext() )
{