vtkInteractorManualPaint.cpp
Go to the documentation of this file.00001
00002 #include "vtkInteractorManualPaint.h"
00003
00004
00005 #include "wxVtk2DBaseView.h"
00006 #include "wxVTKRenderWindowInteractor.h"
00007
00008
00009 vtkInteractorManualPaint::vtkInteractorManualPaint(ManualPaintControler* mpc)
00010 {
00011 _manualPaintControler = mpc;
00012 _state = false;
00013
00014 }
00015
00016
00017 vtkInteractorManualPaint::~vtkInteractorManualPaint()
00018 {
00019 }
00020
00021
00022 bool vtkInteractorManualPaint::OnLeftButtonDown()
00023 {
00024 vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor();
00025 if ((interactor->GetControlKey()==1) || (interactor->GetShiftKey()==1) ){
00026 _state = true;
00027
00028
00029 }
00030 return true;
00031 }
00032
00033
00034 bool vtkInteractorManualPaint::OnLeftButtonUp()
00035 {
00036 _state = false;
00037 return true;
00038 }
00039
00040
00041 bool vtkInteractorManualPaint::OnMouseMove ()
00042 {
00043 printf("EED vtkInteractorManualPaint::OnMouseMove \n");
00044 if (_state==true)
00045 {
00046 wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView();
00047 wxVTKRenderWindowInteractor *wxVTKiren = wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor();
00048 int px,py;
00049 wxVTKiren->GetEventPosition(px,py);
00050
00051 int typeView = 2;
00052 double X = (double)px;
00053 double Y = (double)py;
00054 double Z = wxvtk2Dbaseview->GetActualSlice();
00055 wxvtk2Dbaseview->TransFromCoordScreenToWorld(X, Y, Z,false, typeView);
00056
00057
00058
00059 printf("EED vtkInteractorManualPaint::OnMouseMove ----------------- %f %f %f\n", X,Y,Z);
00060
00061 _manualPaintControler->PaintImage((int)X,(int)Y,(int)Z);
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 }
00075 return true;
00076 }
00077
00078