Skip to content
Snippets Groups Projects
Commit b74b8614 authored by Ulrich Kemloh's avatar Ulrich Kemloh
Browse files

mouse position is now displayed in meter.

added missing icons
parent c0b86ee1
No related branches found
No related tags found
No related merge requests found
forms/icons/JPSvis.png

39.3 KiB

forms/visualisation.ico

123 KiB

...@@ -284,17 +284,32 @@ void InteractorStyle::OnLeftButtonUp(){ ...@@ -284,17 +284,32 @@ void InteractorStyle::OnLeftButtonUp(){
int pos_x=0; int pos_x=0;
int pos_y=0; int pos_y=0;
rwi->GetMousePosition(&pos_x, &pos_y); //rwi->GetMousePosition(&pos_x, &pos_y);
int pos[2];
rwi->GetEventPosition(pos);
pos_x=pos[0];
pos_y=pos[1];
VTK_CREATE(vtkCoordinate,coordinate); VTK_CREATE(vtkCoordinate,coordinate);
coordinate->SetCoordinateSystemToDisplay(); coordinate->SetCoordinateSystemToDisplay();
coordinate->SetValue(pos_x,pos_y,0); coordinate->SetValue(pos_x,pos_y,0);
double* world = coordinate->GetComputedWorldValue(this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer()); 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<<"mouse position: " <<endl;
std::cout<<"\t screen: " <<pos_x<<" "<<pos_y<<endl; std::cout<<"\t screen: " <<pos_x<<" "<<pos_y<<endl;
std::cout<<"\t world : " <<world[0] << " " << world[1] << " " << world[2] << std::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 // forward events for who ever needs it
vtkInteractorStyleTrackballCamera::OnLeftButtonUp(); vtkInteractorStyleTrackballCamera::OnLeftButtonUp();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment