From 9f2f60850df45f1ec91bc633cfc2dbfb68b33fbe Mon Sep 17 00:00:00 2001 From: Marco Callieri Date: Tue, 25 Oct 2016 14:32:29 +0200 Subject: [PATCH] added cameraType in XML export/import added "cameraType" property in Intrinsics XML export and import, for better handling of orthographic cameras in MeshLab --- wrap/qt/shot_qt.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wrap/qt/shot_qt.h b/wrap/qt/shot_qt.h index 4313ab8e..cf0bd586 100644 --- a/wrap/qt/shot_qt.h +++ b/wrap/qt/shot_qt.h @@ -30,6 +30,7 @@ template shot.Extrinsics.SetRot(rot); vcg::Camera &cam = shot.Intrinsics; + if(attr.contains("CameraType")) cam.cameraType = attr.namedItem("CameraType").nodeValue().toInt(); cam.FocalMm = attr.namedItem("FocalMm").nodeValue().toDouble(); cam.ViewportPx.X() = attr.namedItem("ViewportPx").nodeValue().section(' ',0,0).toInt(); cam.ViewportPx.Y() = attr.namedItem("ViewportPx").nodeValue().section(' ',1,1).toInt(); @@ -118,6 +119,8 @@ template const vcg::Camera &cam = shot.Intrinsics; + shotElem.setAttribute("CameraType", cam.cameraType); + shotElem.setAttribute( "FocalMm", cam.FocalMm); str = QString("%1 %2").arg(cam.k[0]).arg(cam.k[1]);