added cameraType in XML export/import

added "cameraType" property in Intrinsics XML export and import, for
better handling of orthographic cameras in MeshLab
This commit is contained in:
Marco Callieri 2016-10-25 14:32:29 +02:00
parent 680d903ad5
commit 9f2f60850d
1 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,7 @@ template <class ShotType>
shot.Extrinsics.SetRot(rot); shot.Extrinsics.SetRot(rot);
vcg::Camera<ScalarType> &cam = shot.Intrinsics; vcg::Camera<ScalarType> &cam = shot.Intrinsics;
if(attr.contains("CameraType")) cam.cameraType = attr.namedItem("CameraType").nodeValue().toInt();
cam.FocalMm = attr.namedItem("FocalMm").nodeValue().toDouble(); cam.FocalMm = attr.namedItem("FocalMm").nodeValue().toDouble();
cam.ViewportPx.X() = attr.namedItem("ViewportPx").nodeValue().section(' ',0,0).toInt(); cam.ViewportPx.X() = attr.namedItem("ViewportPx").nodeValue().section(' ',0,0).toInt();
cam.ViewportPx.Y() = attr.namedItem("ViewportPx").nodeValue().section(' ',1,1).toInt(); cam.ViewportPx.Y() = attr.namedItem("ViewportPx").nodeValue().section(' ',1,1).toInt();
@ -118,6 +119,8 @@ template <class ShotType>
const vcg::Camera<ScalarType> &cam = shot.Intrinsics; const vcg::Camera<ScalarType> &cam = shot.Intrinsics;
shotElem.setAttribute("CameraType", cam.cameraType);
shotElem.setAttribute( "FocalMm", cam.FocalMm); shotElem.setAttribute( "FocalMm", cam.FocalMm);
str = QString("%1 %2").arg(cam.k[0]).arg(cam.k[1]); str = QString("%1 %2").arg(cam.k[0]).arg(cam.k[1]);