Skip to content

v0.2.55..v0.2.56 changeset NodeDensityTileBoundsCalculator.h

Garret Voltz edited this page Aug 14, 2020 · 3 revisions
diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/tile/NodeDensityTileBoundsCalculator.h b/hoot-core/src/main/cpp/hoot/core/conflate/tile/NodeDensityTileBoundsCalculator.h
index c133308..c918e75 100644
--- a/hoot-core/src/main/cpp/hoot/core/conflate/tile/NodeDensityTileBoundsCalculator.h
+++ b/hoot-core/src/main/cpp/hoot/core/conflate/tile/NodeDensityTileBoundsCalculator.h
@@ -81,8 +81,6 @@ public:
 
   static std::string className() { return "hoot::NodeDensityTileBoundsCalculator"; }
 
-  static int logWarnCount;
-
   /**
    * Specifies the index of a pixel. When specifying a bounding box this represents the lower left
    * pixel relative to the bounding box.
@@ -96,7 +94,7 @@ public:
 
     Pixel(int x, int y) { this->x = x; this->y = y; }
 
-    Pixel() {}
+    Pixel() = default;
   };
 
   /**
@@ -159,18 +157,21 @@ public:
   };
 
   NodeDensityTileBoundsCalculator();
+  virtual ~NodeDensityTileBoundsCalculator() = default;
 
   /**
    * Calculates a set of boundary tiles
    *
    * @param map the map containing the nodes
    */
-  void calculateTiles(OsmMapPtr map);
+  void calculateTiles(const ConstOsmMapPtr& map);
 
   static QString tilesToString(const std::vector<std::vector<geos::geom::Envelope>>& tiles);
 
   std::vector<std::vector<geos::geom::Envelope>> getTiles() const { return _tiles; }
 
+  int getTileCount() const { return _tileCount; }
+
   /**
    * Returns the node counts for each computed tile bounding box
    *
@@ -205,6 +206,8 @@ public:
 
 private:
 
+  static int logWarnCount;
+
   // used for white box testing.
   friend class NodeDensityTileBoundsCalculatorTest;
 
@@ -232,6 +235,7 @@ private:
 
   std::vector<std::vector<long>> _nodeCounts;
   std::vector<std::vector<geos::geom::Envelope>> _tiles;
+  int _tileCount;
 
   /*
    * Calculates a set of rectangular bounding boxes that at most contain a configured set of nodes;
@@ -239,8 +243,8 @@ private:
    */
   void _calculateTiles();
 
-  void _renderImage(const std::shared_ptr<OsmMap>& map);
-  void _renderImage(const std::shared_ptr<OsmMap>& map, cv::Mat& r1, cv::Mat& r2);
+  void _renderImage(const ConstOsmMapPtr& map);
+  void _renderImage(const ConstOsmMapPtr& map, cv::Mat& r1, cv::Mat& r2);
   void _setImages(const cv::Mat& r1, const cv::Mat& r2);
 
   void _calculateMin();
Clone this wiki locally