Skip to content

v0.2.54..v0.2.55 changeset ReportMissingElementsVisitor.h

Garret Voltz edited this page Aug 14, 2020 · 1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/visitors/ReportMissingElementsVisitor.h b/hoot-core/src/main/cpp/hoot/core/visitors/ReportMissingElementsVisitor.h
index ee26cbc..cd13ca2 100644
--- a/hoot-core/src/main/cpp/hoot/core/visitors/ReportMissingElementsVisitor.h
+++ b/hoot-core/src/main/cpp/hoot/core/visitors/ReportMissingElementsVisitor.h
@@ -33,14 +33,15 @@
 #include <hoot/core/util/Configurable.h>
 #include <hoot/core/util/Log.h>
 #include <hoot/core/util/StringUtils.h>
+#include <hoot/core/conflate/review/ReviewMarker.h>
 
 namespace hoot
 {
 
 /**
- * Reports references to missing elements in a given map. If removeMissing is set to true then
- * all missing references are removed. Note: This may not give desired results if your data
- * shouldn't contain missing references.
+ * Reports references to missing elements in a given map. If removeMissing is set to true, then
+ * all missing references are removed. The option also exists to either mark elements with missing
+ * children as needing review or add a custom tag to the elements.
  */
 class ReportMissingElementsVisitor : public ConstElementVisitor, public OsmMapConsumer,
   public Configurable
@@ -53,15 +54,11 @@ public:
                                const Log::WarningLevel& logLevel = Log::Trace,
                                const int maxReport = Log::getWarnMessageLimit());
 
-  virtual void setOsmMap(OsmMap* map) { _map = map; }
-
   virtual void visit(const ConstElementPtr& e);
 
-  virtual void setConfiguration(const Settings& conf);
-
-  void setMaxReport(int maxReport) { _maxReport = maxReport; }
+  virtual void setOsmMap(OsmMap* map) { _map = map; }
 
-  int getMissingCount() const { return _missingCount; }
+  virtual void setConfiguration(const Settings& conf);
 
   virtual QString getDescription() const
   { return "Reports references to missing elements in a map"; }
@@ -73,17 +70,39 @@ public:
 
   virtual std::string getClassName() const { return className(); }
 
+  int getMissingCount() const { return _missingCount; }
+
+  void setMaxReport(int maxReport) { _maxReport = maxReport; }
+  void setMarkWaysForReview(bool mark) { _markWaysForReview = mark; }
+  void setMarkRelationsForReview(bool mark) { _markRelationsForReview = mark; }
+  void setWayKvp(QString kvp) { _wayKvp = kvp; }
+  void setRelationKvp(QString kvp) { _relationKvp = kvp; }
+
 protected:
 
   OsmMap* _map;
+
   Log::WarningLevel _logLevel;
+
   int _maxReport;
   int _missingCount;
   bool _removeMissing;
 
+  // allows for marking any elements with missing children as needing review
+  bool _markWaysForReview;
+  bool _markRelationsForReview;
+  ReviewMarker _reviewMarker;
+
+  // allows for custom tagging any elements with missing children as needing review
+  QString _wayKvp;
+  QString _relationKvp;
+
   virtual void _reportMissing(ElementId referer, ElementId missing);
-  virtual void _visitRo(ElementType type, long id);
-  virtual void _visitRw(ElementType type, long id);
+  virtual void _visitAndReport(ElementType type, long id);
+  virtual void _visitAndRemove(ElementType type, long id);
+
+  void _updateWay(const WayPtr& way, const QStringList& missingChildIds);
+  void _updateRelation(const RelationPtr& relation, const QStringList& missingChildIds);
 };
 
 }
Clone this wiki locally