diff --git a/forms/icons/JPSvis.png b/forms/icons/JPSvis.png new file mode 100644 index 0000000000000000000000000000000000000000..e320c8977f8dff45d966c95d2d2a263a209ce6d2 Binary files /dev/null and b/forms/icons/JPSvis.png differ diff --git a/forms/visualisation.ico b/forms/visualisation.ico new file mode 100644 index 0000000000000000000000000000000000000000..d0053f4b6b57f66f10537da50ee6e2e6364ee349 Binary files /dev/null and b/forms/visualisation.ico differ diff --git a/src/InteractorStyle.cpp b/src/InteractorStyle.cpp index 61fcbb1733af55dd02289070c815cffe6b5982c9..f7b615fdff82b7a61dc343c56e15676aef9e9b45 100644 --- a/src/InteractorStyle.cpp +++ b/src/InteractorStyle.cpp @@ -280,21 +280,36 @@ void InteractorStyle::OnChar() { //http://vtk.1045678.n5.nabble.com/Coordinate-conversions-World-Display-td2808312.html void InteractorStyle::OnLeftButtonUp(){ - vtkRenderWindowInteractor *rwi = this->Interactor; - - int pos_x=0; - int pos_y=0; - rwi->GetMousePosition(&pos_x, &pos_y); - - VTK_CREATE(vtkCoordinate,coordinate); - coordinate->SetCoordinateSystemToDisplay(); - coordinate->SetValue(pos_x,pos_y,0); - double* world = coordinate->GetComputedWorldValue(this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); - - std::cout<<"mouse position: " <<endl; - std::cout<<"\t screen: " <<pos_x<<" "<<pos_y<<endl; - std::cout<<"\t world : " <<world[0] << " " << world[1] << " " << world[2] << std::endl; + vtkRenderWindowInteractor *rwi = this->Interactor; + + int pos_x=0; + int pos_y=0; + //rwi->GetMousePosition(&pos_x, &pos_y); + int pos[2]; + rwi->GetEventPosition(pos); + pos_x=pos[0]; + pos_y=pos[1]; + + VTK_CREATE(vtkCoordinate,coordinate); + coordinate->SetCoordinateSystemToDisplay(); + coordinate->SetValue(pos_x,pos_y,0); + double* world = coordinate->GetComputedWorldValue(this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); + world[0]/=100; + world[1]/=100; + world[2]/=100; + + std::cout<<"mouse position: " <<endl; + std::cout<<"\t screen: " <<pos_x<<" "<<pos_y<<endl; + std::cout<<"\t world : " <<world[0] << " " << world[1] << " " << world[2] << std::endl; + + //vtkRenderer *ren =rwi->GetRenderWindow()->GetRenderers()->GetFirstRenderer(); + //vtkCamera *cam = ren->GetActiveCamera(); + //cam->SetFocalPoint(world[0],world[1],world[2]); + //cam->Zoom(1.05); + //cam->Modified(); + //double p[2]={pos[0],pos[1]}; + //rwi->FlyToImage(ren,p); + // forward events for who ever needs it + vtkInteractorStyleTrackballCamera::OnLeftButtonUp(); - // forward events for who ever needs it - vtkInteractorStyleTrackballCamera::OnLeftButtonUp(); }