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

coastlines_generator.hpp « generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f52ccd52cab2347b7e920866a0380ff54ff3a91c (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
34
35
36
37
38
#pragma once

#include "feature_merger.hpp"

#include "../indexer/cell_id.hpp"

#include "../geometry/tree4d.hpp"
#include "../geometry/region2d.hpp"


class FeatureBuilder1;

class CoastlineFeaturesGenerator
{
  typedef RectId CellIdT;

  FeatureMergeProcessor m_merger;

  typedef m4::Tree<m2::RegionI> TreeT;
  TreeT m_tree;

  uint32_t m_coastType;
  int m_lowLevel, m_highLevel, m_maxPoints;

  bool GetFeature(CellIdT const & cell, FeatureBuilder1 & fb);

public:
  CoastlineFeaturesGenerator(uint32_t coastType,
                             int lowLevel, int highLevel, int maxPoints);

  void AddRegionToTree(FeatureBuilder1 const & fb);

  void operator() (FeatureBuilder1 const & fb);
  void Finish();

  inline size_t GetCellsCount() const { return 1 << 2 * m_lowLevel; }
  void GetFeatures(size_t i, vector<FeatureBuilder1> & vecFb);
};