Welcome to mirror list, hosted at ThFree Co, Russian Federation.

place.hpp « generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 444cbf9ca9f1cc0a96af0261899e189a278490c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#include "generator/feature_builder.hpp"

#include "geometry/point2d.hpp"
#include "geometry/rect2d.hpp"

#include <cstdint>

namespace generator
{
/// Used to make a "good" node for a highway graph with OSRM for low zooms.
class Place
{
public:
  Place(FeatureBuilder1 const & ft, uint32_t type, bool saveParams = true);

  FeatureBuilder1 const & GetFeature() const { return m_ft; }
  m2::RectD GetLimitRect() const;
  bool IsEqual(Place const & r) const;
  /// Check whether we need to replace place @r with place @this.
  bool IsBetterThan(Place const & r) const;

private:
  bool IsPoint() const { return (m_ft.GetGeomType() == feature::GeomType::Point); }
  static bool AreTypesEqual(uint32_t t1, uint32_t t2);

  FeatureBuilder1 m_ft;
  m2::PointD m_pt;
  uint32_t m_type;
  double m_thresholdM;
};
}  // namespace generator