blob: 4ded6c347f926e1e47d533087cc7eb23041c8bb0 (
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
39
40
41
42
43
44
|
#include "generator/emitter_world.hpp"
#include "generator/cities_boundaries_builder.hpp"
#include "generator/city_boundary_processor.hpp"
#include "generator/feature_builder.hpp"
#include "generator/feature_processing_layers.hpp"
#include "generator/generate_info.hpp"
#include "defines.hpp"
using namespace feature;
namespace generator
{
EmitterWorld::EmitterWorld(feature::GenerateInfo const & info)
: m_cityBoundaryProcessor(std::make_shared<CityBoundaryProcessor>(
std::make_shared<generator::OsmIdToBoundariesTable>()))
, m_worldMapper(std::make_shared<WorldMapper>(
info.GetTmpFileName(WORLD_FILE_NAME),
info.GetIntermediateFileName(WORLD_COASTS_FILE_NAME, RAW_GEOM_FILE_EXTENSION),
info.m_popularPlacesFilename))
{
m_processingChain = std::make_shared<RepresentationLayer>(m_cityBoundaryProcessor);
m_processingChain->Add(std::make_shared<PrepareFeatureLayer>());
m_processingChain->Add(std::make_shared<PromoCatalogLayer>(info.m_promoCatalogCitiesFilename));
m_processingChain->Add(std::make_shared<CityBoundaryLayer>(m_cityBoundaryProcessor));
m_processingChain->Add(std::make_shared<WorldAreaLayer>(m_worldMapper));
}
void EmitterWorld::Process(FeatureBuilder & feature)
{
m_processingChain->Handle(feature);
}
bool EmitterWorld::Finish()
{
for (auto & feature : m_cityBoundaryProcessor->GetFeatures())
m_worldMapper->RemoveInvalidTypesAndMap(feature);
return true;
}
void EmitterWorld::GetNames(vector<string> &) const {}
} // namespace generator
|