From 98cc54e0fd44cd97f0eca95f2f4b7dbe1ae4f25a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu>
Date: Tue, 27 Sep 2022 12:15:36 +0200
Subject: [PATCH] Add getTopologyString() method

---
 include/core/factor/factor_base.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/include/core/factor/factor_base.h b/include/core/factor/factor_base.h
index 1894148de..0ca91c9c6 100644
--- a/include/core/factor/factor_base.h
+++ b/include/core/factor/factor_base.h
@@ -123,6 +123,31 @@ class FactorBase : public NodeBase, public std::enable_shared_from_this<FactorBa
             return topology_;
         }
 
+        std::string getTopologyString() const
+        {
+            switch (topology_)
+            {
+            case TOP_GEOM:
+                return "GEOM";
+                break;
+            case TOP_ABS:
+                return "ABS";
+                break;
+            case TOP_LMK:
+                return "LMK";
+                break;
+            case TOP_LOOP:
+                return "LOOP";
+                break;
+            case TOP_OTHER:
+                return "OTHER";
+                break;
+            default:
+                return "UNDEFINED";
+            }
+        }
+
+
         /** \brief Evaluate the factor given the input parameters and returning the residuals and jacobians
         **/
         virtual bool evaluate(double const* const* _parameters, double* _residuals, double** _jacobians) const = 0;
-- 
GitLab