ColorLayerImageBasevtkInteractor::ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase)
{
_state=false;
+ _stateKey=false;
_layerImageBase=layerImageBase;
-
+
}
//---------------------------------------------------------------------------------------------
{
}
+//---------------------------------------------------------------------------------------------
+bool ColorLayerImageBasevtkInteractor::OnChar()
+{
+ return true;
+}
+
//---------------------------------------------------------------------------------------------
bool ColorLayerImageBasevtkInteractor::OnMouseMove() // vitual
{
- printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove \n");
+ printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove start \n");
+
+ vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor();
+
+ // For example in ManualPaint Action
+ // This is not working, because the order of insertion events mecanism (_vtkInteractorStyleBaseView)
+ // Layer first Paint after.
+ // the only way to make it works is to take the axes an paint. this force a first SetParent_refresh_waiting()
+// if ( this->_vtkInteractorStyleBaseView->GetParent_refresh_waiting() == true )
+
+ if ( interactor->GetControlKey()==1 ) // EED This if for ManaulPaint Interaction compatibility
+ {
+ printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove need Refresh \n" );
+ _layerImageBase->onThreshold();
+ _layerImageBase->GetvtkImageReslice()->Modified();
+ }
+ else {
+ printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove NOT need Refresh \n" );
+ }
+
if (_state==true)
{
-
wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*) _vtkInteractorStyleBaseView->GetWxVtk2DBaseView();
wxVTKRenderWindowInteractor *wxVTKiren = wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor();
int px, py;
_layerImageBase->onThreshold();
// _layerImageBase->Refresh();
-
this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
if (_vtkInteractorStyleBaseView->GetRefresh_waiting()==true)
return true;
}
-
+//---------------------------------------------------------------------------------------------
bool ColorLayerImageBasevtkInteractor::OnRightButtonDown() // virtual
{
printf("EED ColorLayerImageBasevtkInteractor::OnRightButtonDown \n");
return true;
}
+//---------------------------------------------------------------------------------------------
bool ColorLayerImageBasevtkInteractor::OnRightButtonUp() // virtual
{
printf("EED ColorLayerImageBasevtkInteractor::OnRightButtonUp \n");