forked from mapsme/omim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_model.cpp
46 lines (33 loc) · 1.08 KB
/
check_model.cpp
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
45
46
#include "generator/check_model.hpp"
#include "defines.hpp"
#include "indexer/features_vector.hpp"
#include "indexer/classificator.hpp"
#include "indexer/feature_visibility.hpp"
#include "base/logging.hpp"
#include <vector>
using namespace feature;
namespace check_model
{
void ReadFeatures(std::string const & fName)
{
Classificator const & c = classif();
FeaturesVectorTest(fName).GetVector().ForEach([&](FeatureType & ft, uint32_t) {
TypesHolder types(ft);
std::vector<uint32_t> vTypes;
for (uint32_t t : types)
{
CHECK_EQUAL(c.GetTypeForIndex(c.GetIndexForType(t)), t, ());
vTypes.push_back(t);
}
sort(vTypes.begin(), vTypes.end());
CHECK(unique(vTypes.begin(), vTypes.end()) == vTypes.end(), ());
m2::RectD const r = ft.GetLimitRect(FeatureType::BEST_GEOMETRY);
CHECK(r.IsValid(), ());
GeomType const type = ft.GetGeomType();
if (type == GeomType::Line)
CHECK_GREATER(ft.GetPointsCount(), 1, ());
IsDrawableLike(vTypes, ft.GetGeomType());
});
LOG(LINFO, ("OK"));
}
}