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:
parent
680d903ad5
commit
9f2f60850d
|
@ -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]);
|
||||||
|
|
Loading…
Reference in New Issue