From ea2133565c2a2899bb100f79ae479447b9e5bc66 Mon Sep 17 00:00:00 2001 From: Marco Callieri mcallieri Date: Tue, 17 Dec 2013 15:47:22 +0000 Subject: [PATCH] corrected problem in displaying picked point with double-click: now it displays SCENE-SPACE coordinates, as initially intended [to be properly tested before release!] --- src/meshlab/glarea.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/meshlab/glarea.cpp b/src/meshlab/glarea.cpp index f1fe5d6c1..aa5967c4a 100644 --- a/src/meshlab/glarea.cpp +++ b/src/meshlab/glarea.cpp @@ -540,6 +540,19 @@ void GLArea::paintEvent(QPaintEvent */*event*/) decorInterface->decorateDoc(p,*this->md(),this->glas.currentGlobalParamSet, this,&painter,md()->Log); } + // we want to write scene-space the point picked with double-click in the log + // we have to do it now, before leaving this transformation space + // we hook to the same mechanism double-click will be managed later on to move trackball + if(hasToPick && !hasToGetPickPos) + { + Point3f pp; + if(Pick(pointToPick[0],pointToPick[1],pp)) + { + // write picked point in the log + Logf(0,"Recentering on point [%f %f %f] [%d,%d]",pp[0],pp[1],pp[2],pointToPick[0],pointToPick[1]); + } + } + glPopMatrix(); // We restore the state to immediately before the trackball //If it is a raster viewer draw the image as a texture @@ -554,9 +567,6 @@ void GLArea::paintEvent(QPaintEvent */*event*/) hasToPick=false; if(Pick(pointToPick[0],pointToPick[1],pp)) { - // write picked point in the log - Logf(0,"Recentering on point [%f %f %f] [%d,%d]",pp[0],pp[1],pp[2],pointToPick[0],pointToPick[1]); - trackball.MouseUp(pointToPick[0],pointToPick[1], vcg::Trackball::BUTTON_NONE ); trackball.Translate(-pp); trackball.Scale(1.25f);