Salome HOME
Fix for the bug #42: point C is not activated, but point C is shown in preview in...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportImageOp.cxx
index d3a82f89b9b147c73096e8a65dede7ee3bc5e361..82de7403539b8b971b7840dbdd4ed93afed7f3a5 100644 (file)
@@ -217,6 +217,7 @@ void HYDROGUI_ImportImageOp::setPresentationTrsfPoints( HYDROGUI_PrsImage* thePr
       if ( !theIsByTwoPoints )
         aPointMap[ HYDROGUI_PrsImage::PointC ].Point = theLocalPointC;
 
+      thePrs->setIsByTwoPoints( theIsByTwoPoints );
       thePrs->setTransformationPointMap( aPointMap );
     }
   }
@@ -262,19 +263,29 @@ void HYDROGUI_ImportImageOp::commitOperation()
 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( setIsByTwoPoints( bool ) ), SLOT( onSetIsByTwoPoints( bool ) ) );
   return aPanel;
 }
 
+void HYDROGUI_ImportImageOp::onSetIsByTwoPoints( bool theIsSetByTwoPoints )
+{
+  if ( myPreviewPrs )
+  {
+    myPreviewPrs->setIsByTwoPoints( theIsSetByTwoPoints );
+  }
+  if ( myRefPreviewPrs )
+  {
+    myRefPreviewPrs->setIsByTwoPoints( theIsSetByTwoPoints );
+  }
+}
+
 bool HYDROGUI_ImportImageOp::checkPoints( const QPointF& thePointA,
                                           const QPointF& thePointB,
                                           const QPointF& thePointC,