From bf026eb33db3f7fbc919b646d5b005e86088612f Mon Sep 17 00:00:00 2001 From: cbeall3 Date: Wed, 20 May 2015 13:30:36 -0400 Subject: [PATCH] Small fixes to make it actually work in Matlab --- gtsam.h | 5 +++-- gtsam/geometry/SimpleCamera.h | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/gtsam.h b/gtsam.h index 46913f55c..a716a25cb 100644 --- a/gtsam.h +++ b/gtsam.h @@ -861,7 +861,7 @@ class PinholeCamera { void serialize() const; }; -class SimpleCamera { +virtual class SimpleCamera { // Standard Constructors and Named Constructors SimpleCamera(); SimpleCamera(const gtsam::Pose3& pose); @@ -898,7 +898,8 @@ class SimpleCamera { }; -// Do typedefs here so we can also define SimpleCamera +// Some typedefs for common camera types +// PinholeCameraCal3_S2 is the same as SimpleCamera above typedef gtsam::PinholeCamera PinholeCameraCal3_S2; typedef gtsam::PinholeCamera PinholeCameraCal3DS2; typedef gtsam::PinholeCamera PinholeCameraCal3Unified; diff --git a/gtsam/geometry/SimpleCamera.h b/gtsam/geometry/SimpleCamera.h index 38f0804b6..a119096d4 100644 --- a/gtsam/geometry/SimpleCamera.h +++ b/gtsam/geometry/SimpleCamera.h @@ -24,10 +24,16 @@ namespace gtsam { /// A simple camera class with a Cal3_S2 calibration -// typedef PinholeCamera SimpleCamera; -class SimpleCamera : public PinholeCamera { +typedef gtsam::PinholeCamera PinholeCameraCal3_S2; + +/** + * @deprecated: SimpleCamera for backwards compatability with GTSAM 3.x + * Use PinholeCameraCal3_S2 instead + */ +class SimpleCamera : public PinholeCameraCal3_S2 { typedef PinholeCamera Base; + typedef boost::shared_ptr shared_ptr; public: @@ -98,6 +104,10 @@ public: Base(v, K) { } + /// Copy this object as its actual derived type. + SimpleCamera::shared_ptr clone() const { return boost::make_shared(*this); } + + /// @} /// @name Manifold /// @{