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

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coding/coding_tests/geometry_coding_test.cpp38
-rw-r--r--coding/coding_tests/test_polylines.cpp377
-rw-r--r--coding/geometry_coding.cpp124
-rw-r--r--coding/geometry_coding.hpp129
-rw-r--r--generator/dumper.cpp3
-rw-r--r--generator/feature_builder.cpp3
-rw-r--r--generator/feature_builder.hpp3
-rw-r--r--generator/geometry_holder.hpp1
-rw-r--r--generator/search_index_builder.cpp3
-rw-r--r--generator/tesselator.cpp20
-rw-r--r--indexer/centers_table.hpp3
-rw-r--r--indexer/cities_boundaries_serdes.hpp8
-rw-r--r--indexer/data_header.cpp6
-rw-r--r--routing/cross_mwm_connector_serialization.hpp8
-rw-r--r--search/lazy_centers_table.cpp3
-rw-r--r--search/retrieval.cpp3
-rw-r--r--search/search_index_values.hpp5
-rw-r--r--search/search_trie.hpp5
-rw-r--r--storage/country_polygon.hpp6
-rw-r--r--transit/transit_serdes.hpp3
20 files changed, 540 insertions, 211 deletions
diff --git a/coding/coding_tests/geometry_coding_test.cpp b/coding/coding_tests/geometry_coding_test.cpp
index 7d56444560..ab769042d7 100644
--- a/coding/coding_tests/geometry_coding_test.cpp
+++ b/coding/coding_tests/geometry_coding_test.cpp
@@ -25,20 +25,16 @@ m2::PointU D2U(m2::PointD const & p) { return PointDToPointU(p, POINT_COORD_BITS
m2::PointU GetMaxPoint() { return D2U(m2::PointD(MercatorBounds::maxX, MercatorBounds::maxY)); }
-void TestPolylineEncode(string testName,
- vector<m2::PointU> const & points,
+void TestPolylineEncode(string testName, vector<m2::PointU> const & points,
m2::PointU const & maxPoint,
- void (* fnEncode)(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas),
- void (* fnDecode)(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points))
+ void (*fnEncode)(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas),
+ void (*fnDecode)(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points))
{
size_t const count = points.size();
- if (count == 0) return;
+ if (count == 0)
+ return;
m2::PointU const basePoint = m2::PointU::Zero();
@@ -59,7 +55,7 @@ void TestPolylineEncode(string testName,
if (points.size() > 10)
{
vector<char> data;
- MemWriter<vector<char> > writer(data);
+ MemWriter<vector<char>> writer(data);
for (size_t i = 0; i != deltas.size(); ++i)
WriteVarUint(writer, deltas[i]);
@@ -96,11 +92,13 @@ UNIT_TEST(EncodeDelta)
PU pred = PU(100, 100);
TEST_EQUAL(orig, DecodeDelta(EncodeDelta(orig, pred), pred), ());
vector<char> data;
- PushBackByteSink<vector<char> > sink(data);
+ PushBackByteSink<vector<char>> sink(data);
WriteVarUint(sink, EncodeDelta(orig, pred));
size_t expectedSize = 1;
- if (x >= 8 || x < -8 || y >= 4 || y < -4) expectedSize = 2;
- if (x >= 64 || x < -64 || y >= 64 || y < -64) expectedSize = 3;
+ if (x >= 8 || x < -8 || y >= 4 || y < -4)
+ expectedSize = 2;
+ if (x >= 64 || x < -64 || y >= 64 || y < -64)
+ expectedSize = 3;
TEST_EQUAL(data.size(), expectedSize, (x, y));
}
}
@@ -146,7 +144,7 @@ UNIT_TEST(PredictPointsInPolyline3_90deg)
UNIT_TEST(EncodePolyline)
{
- size_t const kSizes [] = { 0, 1, 2, 3, 4, ARRAY_SIZE(LargePolygon::kLargePolygon) };
+ size_t const kSizes[] = {0, 1, 2, 3, 4, ARRAY_SIZE(LargePolygon::kLargePolygon)};
m2::PointU const maxPoint(1000000000, 1000000000);
for (size_t iSize = 0; iSize < ARRAY_SIZE(kSizes); ++iSize)
{
@@ -154,8 +152,9 @@ UNIT_TEST(EncodePolyline)
vector<m2::PointU> points;
points.reserve(polygonSize);
for (size_t i = 0; i < polygonSize; ++i)
- points.push_back(m2::PointU(static_cast<uint32_t>(LargePolygon::kLargePolygon[i].x * 10000),
- static_cast<uint32_t>((LargePolygon::kLargePolygon[i].y + 200) * 10000)));
+ points.push_back(
+ m2::PointU(static_cast<uint32_t>(LargePolygon::kLargePolygon[i].x * 10000),
+ static_cast<uint32_t>((LargePolygon::kLargePolygon[i].y + 200) * 10000)));
TestEncodePolyline("Unsimp", maxPoint, points);
TestEncodePolyline("1simp", maxPoint, SimplifyPoints(points, 1));
@@ -180,6 +179,5 @@ UNIT_TEST(DecodeEncodePolyline_DataSet1)
for (size_t i = 0; i < count; ++i)
points.push_back(D2U(geometry_coding_tests::arr1[i]));
- TestPolylineEncode("DataSet1", points, GetMaxPoint(),
- &EncodePolyline, &DecodePolyline);
+ TestPolylineEncode("DataSet1", points, GetMaxPoint(), &EncodePolyline, &DecodePolyline);
}
diff --git a/coding/coding_tests/test_polylines.cpp b/coding/coding_tests/test_polylines.cpp
index 1d2e24a092..fd15cd28e8 100644
--- a/coding/coding_tests/test_polylines.cpp
+++ b/coding/coding_tests/test_polylines.cpp
@@ -2,5 +2,380 @@
namespace geometry_coding_tests
{
- P arr1[376] = { P(25.624035299999999182, 72.26346513007850092), P(25.624273200000001083, 72.263461698303601111), P(25.624488899999999347, 72.26341365347376211), P(25.624979400000000851, 72.263304218156179104), P(25.626030799999998777, 72.263025101705878228), P(25.629390999999998257, 72.261676817778678128), P(25.630162399999999678, 72.26138836631159279), P(25.631299500000000791, 72.260963603282490908), P(25.63236829999999955, 72.26051310574631259), P(25.63325580000000059, 72.260190152533994024), P(25.633720499999999021, 72.260019906865807116), P(25.634314799999998513, 72.259865485075735592), P(25.634578999999998672, 72.259830215951140531), P(25.635424199999999217, 72.259772832171691448), P(25.635776400000001018, 72.259834791404088605), P(25.638406499999998545, 72.260604806439260983), P(25.639231599999998679, 72.260931765228107793), P(25.639867699999999928, 72.261237563690428942), P(25.640699399999999031, 72.261850499331046649), P(25.643624299999999039, 72.264447578158552687), P(25.644772700000000754, 72.265904403664706024), P(25.645413800000000037, 72.267106341816230497), P(25.646751600000001758, 72.270404536824941033), P(25.64890219999999843, 72.275985791150915816), P(25.649064599999999103, 72.276404165523842948), P(25.650549500000000336, 72.279974564589863917), P(25.651433600000000723, 72.281545386607334081), P(25.652029899999998719, 72.282193025251160634), P(25.652814700000000414, 72.282915237415323872), P(25.654197199999998702, 72.283799562153532747), P(25.656540400000000801, 72.285055792411071707), P(25.658162999999998277, 72.286263412818769325), P(25.661959599999999426, 72.289916920742129491), P(25.663380199999998865, 72.291039561736027963), P(25.665810499999999195, 72.292780588759853799), P(25.6700361000000008, 72.29585629709197292), P(25.670962599999999298, 72.296655718166547899), P(25.672222699999998952, 72.297961211704517837), P(25.673103499999999855, 72.29896171301187735), P(25.674837499999998869, 72.300952077677095531), P(25.676358000000000459, 72.302732468128681376), P(25.678018200000000348, 72.304444228347662715), P(25.680309600000001069, 72.306619426588397914), P(25.682252600000001763, 72.308208994982337003), P(25.685880300000000886, 72.310749482551628375), P(25.6871223999999998, 72.311619291531712861), P(25.689502399999998516, 72.313337574126506979), P(25.689994200000001001, 72.313685586072296019), P(25.691337099999998372, 72.314639003020189989), P(25.694014100000000411, 72.316465930359882464), P(25.696650399999999337, 72.318133963117716689), P(25.697924300000000386, 72.31863598381848135), P(25.699229800000001234, 72.31891418618496914), P(25.700213699999999051, 72.319045273707061483), P(25.703616300000000194, 72.319271576784373678), P(25.707311499999999427, 72.319273484907995453), P(25.715181600000001083, 72.318046763400587906), P(25.72608460000000008, 72.315978426880036523), P(25.728649600000000675, 72.31539857900408208), P(25.730824299999998317, 72.315156452495600092), P(25.732753200000001215, 72.314945427265811873), P(25.736661200000000349, 72.315042353781024076), P(25.74480259999999987, 72.315568583243575063), P(25.747831600000001373, 72.315649864883624787), P(25.749809599999998966, 72.315866807206518274), P(25.752535200000000515, 72.316023647210727177), P(25.755610000000000781, 72.315910501039496694), P(25.760463999999998919, 72.315272459413776573), P(25.762314700000001011, 72.315021747344800929), P(25.763456399999999036, 72.314812630534717641), P(25.763716200000001066, 72.31478954377344337), P(25.771413500000001306, 72.314102668549878672), P(25.779617200000000565, 72.313375160856324442), P(25.784148800000000534, 72.313357035273327256), P(25.790238899999998523, 72.313577786126856495), P(25.793676300000001334, 72.313716876708198811), P(25.796280599999999339, 72.314048100429985766), P(25.798680499999999682, 72.31463614103191162), P(25.800190700000001698, 72.315239260045032665), P(25.803071100000000371, 72.316310615756250968), P(25.806439499999999754, 72.316835901112042961), P(25.809219599999998707, 72.316657116642062419), P(25.813906700000000427, 72.315918133153061831), P(25.817769800000000657, 72.31543750249576874), P(25.819804099999998925, 72.315482531661231747), P(25.823219200000000484, 72.315995217547779816), P(25.824360999999999677, 72.316092908788874638), P(25.825752500000000111, 72.316000750836963107), P(25.833053499999998337, 72.315183355397863352), P(25.835087900000001326, 72.314863574077250519), P(25.836477299999998536, 72.314986830897922232), P(25.838510800000001666, 72.315843910886087542), P(25.84021669999999915, 72.316586137240363996), P(25.845591399999999993, 72.318366369042564656), P(25.847287900000001315, 72.318912278071522337), P(25.852937300000000675, 72.321233538069833457), P(25.857534099999998745, 72.324114950429262194), P(25.858493899999999144, 72.324638770105451613), P(25.859516599999999187, 72.325101910243901671), P(25.860960299999998568, 72.325309341574609334), P(25.864481800000000078, 72.325170990340012622), P(25.866295099999998541, 72.325066225249685203), P(25.871619400000000155, 72.324758609934391984), P(25.873917800000000966, 72.324524655307570242), P(25.875719000000000136, 72.324229064532204347), P(25.882352300000000866, 72.322516991669758113), P(25.886094899999999797, 72.321551632301222412), P(25.891463999999999146, 72.320154280548763381), P(25.892594599999998906, 72.32000410941930113), P(25.893775399999999109, 72.320041127430243932), P(25.895055100000000436, 72.320205228136387632), P(25.901716900000000265, 72.321479884460799781), P(25.905201399999999268, 72.322148897878847151), P(25.906758400000001075, 72.322300409542663147), P(25.908453200000000294, 72.322276366107203671), P(25.910453700000001476, 72.322039939449879853), P(25.912611200000000622, 72.321379323121732341), P(25.914446699999999169, 72.320507670602822259), P(25.915890699999998503, 72.319578403757603269), P(25.916971199999998987, 72.318721085380474278), P(25.923277999999999821, 72.312682767056259081), P(25.924315100000001166, 72.311643903530907096), P(25.925479700000000349, 72.310661910829537646), P(25.926380200000000542, 72.31012846985993292), P(25.927288000000000778, 72.309673827336439444), P(25.929170299999999116, 72.308742039167825055), P(25.931695000000001272, 72.307558244187632113), P(25.935542200000000435, 72.305689970006980616), P(25.936291600000000557, 72.305420216334297834), P(25.937011699999999337, 72.3052109385934898), P(25.937444899999999137, 72.305171830245583919), P(25.938065999999999178, 72.305126426436075349), P(25.939194700000001603, 72.305346959512363014), P(25.941637199999998842, 72.306187700803491225), P(25.951531899999999098, 72.309363611414866568), P(25.958591599999998323, 72.311600021678131611), P(25.961859900000000323, 72.312588133461261464), P(25.9623209000000017, 72.312845323461488078), P(25.962808800000001241, 72.313126745396871797), P(25.963783500000001681, 72.313929806056449934), P(25.964454100000001091, 72.315054565005411291), P(25.966293799999998981, 72.319575350745964215), P(25.966609900000001687, 72.320173934482440359), P(25.966938999999999993, 72.320628647970096381), P(25.968776200000000642, 72.322731857094510133), P(25.969766299999999859, 72.323772036806516894), P(25.97039970000000153, 72.324406914991570261), P(25.971057800000000526, 72.324904784282267656), P(25.972805199999999815, 72.325716763759459127), P(25.973508700000000005, 72.326106631888762877), P(25.974174900000001287, 72.326699167072590058), P(25.974623600000001034, 72.327462886785923502), P(25.97499170000000035, 72.32822527930542833), P(25.975826399999998984, 72.329784823533856297), P(25.976481499999998448, 72.330935420885211329), P(25.977230399999999833, 72.332212952428704966), P(25.978115400000000079, 72.333512265445278899), P(25.9789551000000003, 72.33474671239962106), P(25.980276700000001, 72.336402410819303554), P(25.98169719999999927, 72.337880836033434662), P(25.983172299999999666, 72.33911288186702393), P(25.984414600000000917, 72.340068567971513858), P(25.985398499999998734, 72.340636603533639004), P(25.986058100000001048, 72.340908025445514795), P(25.987230000000000274, 72.341316496490946975), P(25.988157300000001015, 72.341676869267246275), P(25.991148400000000152, 72.342299318530393748), P(25.997876999999999015, 72.343701138883602653), P(25.999752600000000768, 72.344154484369809666), P(26.001479700000000861, 72.344723890629211382), P(26.003023999999999916, 72.345420432028205937), P(26.005314899999998346, 72.346859159309715892), P(26.007066099999999409, 72.348322733682408625), P(26.008686999999998335, 72.35014618535842601), P(26.012360000000001037, 72.354910262506038521), P(26.013286199999999582, 72.355943685106993257), P(26.013858500000001328, 72.35652369166834319), P(26.014633599999999802, 72.357135968669368253), P(26.015746700000001113, 72.357673410043958029), P(26.017126499999999822, 72.358212001250265644), P(26.020520199999999988, 72.359278695677289761), P(26.021437599999998724, 72.359644892510004865), P(26.022532699999999295, 72.360275718006846546), P(26.028545999999998628, 72.365263533617877556), P(26.029226600000001213, 72.365797602942478761), P(26.030111600000001459, 72.366317546512846093), P(26.032004199999999372, 72.367306080501194288), P(26.033209299999999331, 72.367834246590078351), P(26.034265699999998844, 72.368067397148493569), P(26.035592099999998794, 72.368224167962054594), P(26.03677019999999942, 72.368129074294643033), P(26.043432299999999202, 72.366408627750374194), P(26.045431499999999403, 72.365842856777021552), P(26.048415399999999664, 72.36504242213915461), P(26.052753299999999115, 72.363920454888528866), P(26.05556269999999941, 72.363008918012667436), P(26.060303699999998628, 72.360393712052541559), P(26.065962500000001256, 72.35698705139280662), P(26.067612400000001571, 72.356026924714299753), P(26.069255399999999412, 72.355021374242639354), P(26.070335599999999943, 72.354163985856629893), P(26.071483900000000489, 72.353231772141796796), P(26.073087300000000965, 72.351530224288538307), P(26.07495580000000146, 72.349052146600300262), P(26.077375199999998756, 72.345412414793742073), P(26.079008800000000434, 72.34322240936705839), P(26.080636800000000619, 72.341554327036718064), P(26.081818800000000635, 72.340620379333103074), P(26.083176200000000478, 72.339615440891947173), P(26.085581000000001239, 72.338285853103528211), P(26.092078799999999461, 72.335142167729841844), P(26.099516500000000008, 72.332061609286498083), P(26.102282500000001164, 72.330882175026999903), P(26.105014700000001682, 72.329521843521945357), P(26.108211900000000583, 72.327720133658942814), P(26.116759299999998234, 72.322424061632020198), P(26.118289900000000614, 72.321345929920937579), P(26.124188000000000187, 72.316306990481081129), P(26.126093300000000852, 72.314456217615472156), P(26.13131840000000139, 72.308768748722727082), P(26.133807300000000851, 72.305896196846916268), P(26.135103199999999646, 72.304208818196542552), P(26.13615610000000089, 72.3027141546473473), P(26.136958199999998698, 72.301545345164157652), P(26.137658200000000619, 72.300474224549915903), P(26.140487000000000251, 72.29551524417688313), P(26.146685800000000199, 72.285760107870132174), P(26.151274499999999534, 72.277504651282583836), P(26.151979099999998368, 72.276113553331668982), P(26.152562700000000717, 72.274582520714972134), P(26.152978600000000853, 72.272986691312326002), P(26.154697899999998612, 72.264608683472175699), P(26.155105599999998844, 72.263003939235275652), P(26.155811400000001044, 72.261258344309723611), P(26.156706599999999696, 72.259655777039213831), P(26.158511799999999425, 72.257073180827120495), P(26.163497199999998344, 72.251147710512896083), P(26.164152500000000146, 72.250452144382251163), P(26.165397099999999853, 72.249370018656591697), P(26.171159400000000517, 72.245101348184562084), P(26.171824600000000771, 72.244502288299599968), P(26.172791700000001214, 72.243464858038208831), P(26.173422299999998586, 72.24251111483852128), P(26.174280599999999453, 72.240982180618559028), P(26.174924399999998315, 72.239409446329290176), P(26.175138900000000319, 72.238550480576279256), P(26.177894599999998348, 72.222417606854094174), P(26.178249600000000896, 72.220799387733251251), P(26.178700899999999052, 72.219414415122045625), P(26.179689899999999625, 72.217234222262234766), P(26.182073200000001378, 72.213506738076645775), P(26.18310470000000123, 72.211533626956168064), P(26.183614800000000855, 72.210338776927230242), P(26.18428000000000111, 72.208417574177602205), P(26.185804499999999706, 72.203266316303412964), P(26.186153000000000901, 72.202346286216979365), P(26.186549599999999316, 72.201465316811109574), P(26.187059699999998941, 72.200685882789031211), P(26.187643699999998859, 72.200064170625580573), P(26.188815999999999207, 72.199110470754774838), P(26.189986799999999789, 72.198491439723213148), P(26.190943999999998226, 72.198205925482497491), P(26.192045499999998981, 72.198064597333782899), P(26.201502200000000187, 72.19749033573828001), P(26.204289599999999183, 72.197194731015855496), P(26.212046699999998367, 72.196023752898682346), P(26.217400099999998986, 72.195033541852339454), P(26.220660899999998605, 72.194099530393685882), P(26.223864100000000121, 72.193042117073559893), P(26.227025699999998665, 72.192404096537160285), P(26.229406099999998503, 72.192154413131575552), P(26.23379059999999896, 72.191934250652863625), P(26.241092200000000645, 72.191652763688111349), P(26.247795599999999894, 72.191305763109099303), P(26.259740499999999486, 72.190710990755292187), P(26.262441899999998896, 72.190662426481935654), P(26.26396259999999927, 72.190803739092231694), P(26.265582200000000768, 72.19108065172507338), P(26.271514700000000886, 72.192273445913514252), P(26.275603900000000124, 72.192994312937273094), P(26.278289999999998372, 72.193506828374651718), P(26.280647800000000558, 72.193799369593079973), P(26.284991699999999071, 72.194193426147350579), P(26.295021899999998283, 72.194996021158502231), P(26.296629599999999272, 72.195353135208762296), P(26.298219400000000689, 72.195936520796209379), P(26.299353599999999886, 72.196573622487093758), P(26.300700500000001369, 72.19746290844136638), P(26.301440499999998224, 72.198127833072547332), P(26.302059899999999715, 72.198747051231549676), P(26.302597999999999701, 72.199118470577644757), P(26.30326700000000173, 72.200164931796578571), P(26.304018299999999186, 72.201524555689601925), P(26.305375600000001413, 72.20513574950004454), P(26.306215500000000418, 72.206942181028665573), P(26.307179600000001329, 72.208595118825385839), P(26.307805599999998236, 72.209443034325843769), P(26.308593200000000678, 72.210334966852684602), P(26.309511400000001657, 72.211171854914510959), P(26.310345000000001647, 72.211829485157878139), P(26.313103999999999161, 72.213550746524816759), P(26.313808999999999116, 72.214105903186023738), P(26.315858999999999668, 72.21616368063173752), P(26.316473599999998356, 72.216713905276705532), P(26.317261800000000704, 72.217105619191144683), P(26.318279199999999207, 72.217451609641841515), P(26.31951039999999864, 72.217778930438797147), P(26.319995200000001034, 72.217883719155963718), P(26.322028199999998321, 72.21814340535271981), P(26.323134799999998279, 72.218219615725388394), P(26.324022500000001656, 72.218280774611798734), P(26.32581220000000144, 72.218525220186265301), P(26.327261700000001099, 72.218861882068196678), P(26.330273800000000506, 72.219715642811124212), P(26.337171999999998917, 72.221928497785057743), P(26.339137900000000769, 72.222394361231621929), P(26.341438799999998821, 72.222689314479467271), P(26.343669200000000785, 72.222811640430336411), P(26.346788899999999956, 72.222677310542948703), P(26.356923500000000615, 72.222042438730937874), P(26.359536099999999692, 72.2221015051835451), P(26.36183730000000125, 72.222299854521224916), P(26.366428899999998947, 72.222842507761527031), P(26.374883000000000521, 72.223912965077033732), P(26.380090800000001394, 72.224542709845593436), P(26.39073850000000121, 72.225869670908153353), P(26.393878699999998361, 72.226187124115313054), P(26.400813700000000495, 72.226887965488728582), P(26.405969100000000083, 72.227408932782296347), P(26.434136200000001082, 72.23031015029567925), P(26.437651200000001239, 72.230672215773722655), P(26.439650799999999009, 72.230860300030158783), P(26.442400500000001529, 72.230918230849241013), P(26.444426599999999894, 72.230815518016711962), P(26.454957100000001446, 72.229639190945519545), P(26.455386699999998257, 72.229609273288744475), P(26.470600499999999755, 72.227804710557407475), P(26.485397899999998828, 72.226080035891357056), P(26.487313600000000235, 72.226084418502168205), P(26.488673999999999609, 72.226209799401686951), P(26.489974300000000085, 72.226456941463752059), P(26.493316499999998825, 72.227405883949458598), P(26.497907399999999001, 72.228727947008763977), P(26.507186099999998419, 72.231355762593423719), P(26.521764000000001005, 72.235531322949142918), P(26.522283200000000392, 72.235663963313356817), P(26.52274799999999999, 72.235808991367022713), P(26.523495799999999178, 72.236006428221017472), P(26.537509100000001183, 72.239985971537208798), P(26.540924100000001573, 72.240959309764491536), P(26.544420699999999869, 72.241674408812258434), P(26.546888100000000321, 72.242183101965366632), P(26.5518616999999999, 72.242874580127462991), P(26.562219100000000083, 72.244128903051048951), P(26.564274399999998622, 72.244315309516480283), P(26.576127799999998302, 72.245028538203385438), P(26.58263820000000166, 72.244424904560787581), P(26.591367999999999228, 72.243389190867901561), P(26.598972199999998622, 72.242452221067154028), P(26.600826200000000199, 72.242522931717928714), P(26.603627199999998254, 72.242683603364909573), P(26.606756300000000692, 72.243241096929352807), P(26.612569100000001754, 72.244800578667096147), P(26.615042299999998932, 72.246052459623328446), P(26.621848599999999863, 72.249011664844303482), P(26.627471299999999843, 72.250195383365820589), P(26.641823800000000944, 72.252710806698729584), P(26.648778100000001245, 72.254338371527666141), P(26.655288500000001051, 72.25700169234383452), P(26.660515000000000185, 72.259171735257126556), P(26.662390800000000723, 72.25996099777080417), P(26.670629300000001649, 72.263625851730935779), P(26.671595899999999801, 72.264267979553508781), P(26.676856199999999575, 72.267335711577246116), P(26.677412499999999085, 72.267929636079472289), P(26.676856199999999575, 72.267335711577246116) };
+P arr1[376] = {P(25.624035299999999182, 72.26346513007850092),
+ P(25.624273200000001083, 72.263461698303601111),
+ P(25.624488899999999347, 72.26341365347376211),
+ P(25.624979400000000851, 72.263304218156179104),
+ P(25.626030799999998777, 72.263025101705878228),
+ P(25.629390999999998257, 72.261676817778678128),
+ P(25.630162399999999678, 72.26138836631159279),
+ P(25.631299500000000791, 72.260963603282490908),
+ P(25.63236829999999955, 72.26051310574631259),
+ P(25.63325580000000059, 72.260190152533994024),
+ P(25.633720499999999021, 72.260019906865807116),
+ P(25.634314799999998513, 72.259865485075735592),
+ P(25.634578999999998672, 72.259830215951140531),
+ P(25.635424199999999217, 72.259772832171691448),
+ P(25.635776400000001018, 72.259834791404088605),
+ P(25.638406499999998545, 72.260604806439260983),
+ P(25.639231599999998679, 72.260931765228107793),
+ P(25.639867699999999928, 72.261237563690428942),
+ P(25.640699399999999031, 72.261850499331046649),
+ P(25.643624299999999039, 72.264447578158552687),
+ P(25.644772700000000754, 72.265904403664706024),
+ P(25.645413800000000037, 72.267106341816230497),
+ P(25.646751600000001758, 72.270404536824941033),
+ P(25.64890219999999843, 72.275985791150915816),
+ P(25.649064599999999103, 72.276404165523842948),
+ P(25.650549500000000336, 72.279974564589863917),
+ P(25.651433600000000723, 72.281545386607334081),
+ P(25.652029899999998719, 72.282193025251160634),
+ P(25.652814700000000414, 72.282915237415323872),
+ P(25.654197199999998702, 72.283799562153532747),
+ P(25.656540400000000801, 72.285055792411071707),
+ P(25.658162999999998277, 72.286263412818769325),
+ P(25.661959599999999426, 72.289916920742129491),
+ P(25.663380199999998865, 72.291039561736027963),
+ P(25.665810499999999195, 72.292780588759853799),
+ P(25.6700361000000008, 72.29585629709197292),
+ P(25.670962599999999298, 72.296655718166547899),
+ P(25.672222699999998952, 72.297961211704517837),
+ P(25.673103499999999855, 72.29896171301187735),
+ P(25.674837499999998869, 72.300952077677095531),
+ P(25.676358000000000459, 72.302732468128681376),
+ P(25.678018200000000348, 72.304444228347662715),
+ P(25.680309600000001069, 72.306619426588397914),
+ P(25.682252600000001763, 72.308208994982337003),
+ P(25.685880300000000886, 72.310749482551628375),
+ P(25.6871223999999998, 72.311619291531712861),
+ P(25.689502399999998516, 72.313337574126506979),
+ P(25.689994200000001001, 72.313685586072296019),
+ P(25.691337099999998372, 72.314639003020189989),
+ P(25.694014100000000411, 72.316465930359882464),
+ P(25.696650399999999337, 72.318133963117716689),
+ P(25.697924300000000386, 72.31863598381848135),
+ P(25.699229800000001234, 72.31891418618496914),
+ P(25.700213699999999051, 72.319045273707061483),
+ P(25.703616300000000194, 72.319271576784373678),
+ P(25.707311499999999427, 72.319273484907995453),
+ P(25.715181600000001083, 72.318046763400587906),
+ P(25.72608460000000008, 72.315978426880036523),
+ P(25.728649600000000675, 72.31539857900408208),
+ P(25.730824299999998317, 72.315156452495600092),
+ P(25.732753200000001215, 72.314945427265811873),
+ P(25.736661200000000349, 72.315042353781024076),
+ P(25.74480259999999987, 72.315568583243575063),
+ P(25.747831600000001373, 72.315649864883624787),
+ P(25.749809599999998966, 72.315866807206518274),
+ P(25.752535200000000515, 72.316023647210727177),
+ P(25.755610000000000781, 72.315910501039496694),
+ P(25.760463999999998919, 72.315272459413776573),
+ P(25.762314700000001011, 72.315021747344800929),
+ P(25.763456399999999036, 72.314812630534717641),
+ P(25.763716200000001066, 72.31478954377344337),
+ P(25.771413500000001306, 72.314102668549878672),
+ P(25.779617200000000565, 72.313375160856324442),
+ P(25.784148800000000534, 72.313357035273327256),
+ P(25.790238899999998523, 72.313577786126856495),
+ P(25.793676300000001334, 72.313716876708198811),
+ P(25.796280599999999339, 72.314048100429985766),
+ P(25.798680499999999682, 72.31463614103191162),
+ P(25.800190700000001698, 72.315239260045032665),
+ P(25.803071100000000371, 72.316310615756250968),
+ P(25.806439499999999754, 72.316835901112042961),
+ P(25.809219599999998707, 72.316657116642062419),
+ P(25.813906700000000427, 72.315918133153061831),
+ P(25.817769800000000657, 72.31543750249576874),
+ P(25.819804099999998925, 72.315482531661231747),
+ P(25.823219200000000484, 72.315995217547779816),
+ P(25.824360999999999677, 72.316092908788874638),
+ P(25.825752500000000111, 72.316000750836963107),
+ P(25.833053499999998337, 72.315183355397863352),
+ P(25.835087900000001326, 72.314863574077250519),
+ P(25.836477299999998536, 72.314986830897922232),
+ P(25.838510800000001666, 72.315843910886087542),
+ P(25.84021669999999915, 72.316586137240363996),
+ P(25.845591399999999993, 72.318366369042564656),
+ P(25.847287900000001315, 72.318912278071522337),
+ P(25.852937300000000675, 72.321233538069833457),
+ P(25.857534099999998745, 72.324114950429262194),
+ P(25.858493899999999144, 72.324638770105451613),
+ P(25.859516599999999187, 72.325101910243901671),
+ P(25.860960299999998568, 72.325309341574609334),
+ P(25.864481800000000078, 72.325170990340012622),
+ P(25.866295099999998541, 72.325066225249685203),
+ P(25.871619400000000155, 72.324758609934391984),
+ P(25.873917800000000966, 72.324524655307570242),
+ P(25.875719000000000136, 72.324229064532204347),
+ P(25.882352300000000866, 72.322516991669758113),
+ P(25.886094899999999797, 72.321551632301222412),
+ P(25.891463999999999146, 72.320154280548763381),
+ P(25.892594599999998906, 72.32000410941930113),
+ P(25.893775399999999109, 72.320041127430243932),
+ P(25.895055100000000436, 72.320205228136387632),
+ P(25.901716900000000265, 72.321479884460799781),
+ P(25.905201399999999268, 72.322148897878847151),
+ P(25.906758400000001075, 72.322300409542663147),
+ P(25.908453200000000294, 72.322276366107203671),
+ P(25.910453700000001476, 72.322039939449879853),
+ P(25.912611200000000622, 72.321379323121732341),
+ P(25.914446699999999169, 72.320507670602822259),
+ P(25.915890699999998503, 72.319578403757603269),
+ P(25.916971199999998987, 72.318721085380474278),
+ P(25.923277999999999821, 72.312682767056259081),
+ P(25.924315100000001166, 72.311643903530907096),
+ P(25.925479700000000349, 72.310661910829537646),
+ P(25.926380200000000542, 72.31012846985993292),
+ P(25.927288000000000778, 72.309673827336439444),
+ P(25.929170299999999116, 72.308742039167825055),
+ P(25.931695000000001272, 72.307558244187632113),
+ P(25.935542200000000435, 72.305689970006980616),
+ P(25.936291600000000557, 72.305420216334297834),
+ P(25.937011699999999337, 72.3052109385934898),
+ P(25.937444899999999137, 72.305171830245583919),
+ P(25.938065999999999178, 72.305126426436075349),
+ P(25.939194700000001603, 72.305346959512363014),
+ P(25.941637199999998842, 72.306187700803491225),
+ P(25.951531899999999098, 72.309363611414866568),
+ P(25.958591599999998323, 72.311600021678131611),
+ P(25.961859900000000323, 72.312588133461261464),
+ P(25.9623209000000017, 72.312845323461488078),
+ P(25.962808800000001241, 72.313126745396871797),
+ P(25.963783500000001681, 72.313929806056449934),
+ P(25.964454100000001091, 72.315054565005411291),
+ P(25.966293799999998981, 72.319575350745964215),
+ P(25.966609900000001687, 72.320173934482440359),
+ P(25.966938999999999993, 72.320628647970096381),
+ P(25.968776200000000642, 72.322731857094510133),
+ P(25.969766299999999859, 72.323772036806516894),
+ P(25.97039970000000153, 72.324406914991570261),
+ P(25.971057800000000526, 72.324904784282267656),
+ P(25.972805199999999815, 72.325716763759459127),
+ P(25.973508700000000005, 72.326106631888762877),
+ P(25.974174900000001287, 72.326699167072590058),
+ P(25.974623600000001034, 72.327462886785923502),
+ P(25.97499170000000035, 72.32822527930542833),
+ P(25.975826399999998984, 72.329784823533856297),
+ P(25.976481499999998448, 72.330935420885211329),
+ P(25.977230399999999833, 72.332212952428704966),
+ P(25.978115400000000079, 72.333512265445278899),
+ P(25.9789551000000003, 72.33474671239962106),
+ P(25.980276700000001, 72.336402410819303554),
+ P(25.98169719999999927, 72.337880836033434662),
+ P(25.983172299999999666, 72.33911288186702393),
+ P(25.984414600000000917, 72.340068567971513858),
+ P(25.985398499999998734, 72.340636603533639004),
+ P(25.986058100000001048, 72.340908025445514795),
+ P(25.987230000000000274, 72.341316496490946975),
+ P(25.988157300000001015, 72.341676869267246275),
+ P(25.991148400000000152, 72.342299318530393748),
+ P(25.997876999999999015, 72.343701138883602653),
+ P(25.999752600000000768, 72.344154484369809666),
+ P(26.001479700000000861, 72.344723890629211382),
+ P(26.003023999999999916, 72.345420432028205937),
+ P(26.005314899999998346, 72.346859159309715892),
+ P(26.007066099999999409, 72.348322733682408625),
+ P(26.008686999999998335, 72.35014618535842601),
+ P(26.012360000000001037, 72.354910262506038521),
+ P(26.013286199999999582, 72.355943685106993257),
+ P(26.013858500000001328, 72.35652369166834319),
+ P(26.014633599999999802, 72.357135968669368253),
+ P(26.015746700000001113, 72.357673410043958029),
+ P(26.017126499999999822, 72.358212001250265644),
+ P(26.020520199999999988, 72.359278695677289761),
+ P(26.021437599999998724, 72.359644892510004865),
+ P(26.022532699999999295, 72.360275718006846546),
+ P(26.028545999999998628, 72.365263533617877556),
+ P(26.029226600000001213, 72.365797602942478761),
+ P(26.030111600000001459, 72.366317546512846093),
+ P(26.032004199999999372, 72.367306080501194288),
+ P(26.033209299999999331, 72.367834246590078351),
+ P(26.034265699999998844, 72.368067397148493569),
+ P(26.035592099999998794, 72.368224167962054594),
+ P(26.03677019999999942, 72.368129074294643033),
+ P(26.043432299999999202, 72.366408627750374194),
+ P(26.045431499999999403, 72.365842856777021552),
+ P(26.048415399999999664, 72.36504242213915461),
+ P(26.052753299999999115, 72.363920454888528866),
+ P(26.05556269999999941, 72.363008918012667436),
+ P(26.060303699999998628, 72.360393712052541559),
+ P(26.065962500000001256, 72.35698705139280662),
+ P(26.067612400000001571, 72.356026924714299753),
+ P(26.069255399999999412, 72.355021374242639354),
+ P(26.070335599999999943, 72.354163985856629893),
+ P(26.071483900000000489, 72.353231772141796796),
+ P(26.073087300000000965, 72.351530224288538307),
+ P(26.07495580000000146, 72.349052146600300262),
+ P(26.077375199999998756, 72.345412414793742073),
+ P(26.079008800000000434, 72.34322240936705839),
+ P(26.080636800000000619, 72.341554327036718064),
+ P(26.081818800000000635, 72.340620379333103074),
+ P(26.083176200000000478, 72.339615440891947173),
+ P(26.085581000000001239, 72.338285853103528211),
+ P(26.092078799999999461, 72.335142167729841844),
+ P(26.099516500000000008, 72.332061609286498083),
+ P(26.102282500000001164, 72.330882175026999903),
+ P(26.105014700000001682, 72.329521843521945357),
+ P(26.108211900000000583, 72.327720133658942814),
+ P(26.116759299999998234, 72.322424061632020198),
+ P(26.118289900000000614, 72.321345929920937579),
+ P(26.124188000000000187, 72.316306990481081129),
+ P(26.126093300000000852, 72.314456217615472156),
+ P(26.13131840000000139, 72.308768748722727082),
+ P(26.133807300000000851, 72.305896196846916268),
+ P(26.135103199999999646, 72.304208818196542552),
+ P(26.13615610000000089, 72.3027141546473473),
+ P(26.136958199999998698, 72.301545345164157652),
+ P(26.137658200000000619, 72.300474224549915903),
+ P(26.140487000000000251, 72.29551524417688313),
+ P(26.146685800000000199, 72.285760107870132174),
+ P(26.151274499999999534, 72.277504651282583836),
+ P(26.151979099999998368, 72.276113553331668982),
+ P(26.152562700000000717, 72.274582520714972134),
+ P(26.152978600000000853, 72.272986691312326002),
+ P(26.154697899999998612, 72.264608683472175699),
+ P(26.155105599999998844, 72.263003939235275652),
+ P(26.155811400000001044, 72.261258344309723611),
+ P(26.156706599999999696, 72.259655777039213831),
+ P(26.158511799999999425, 72.257073180827120495),
+ P(26.163497199999998344, 72.251147710512896083),
+ P(26.164152500000000146, 72.250452144382251163),
+ P(26.165397099999999853, 72.249370018656591697),
+ P(26.171159400000000517, 72.245101348184562084),
+ P(26.171824600000000771, 72.244502288299599968),
+ P(26.172791700000001214, 72.243464858038208831),
+ P(26.173422299999998586, 72.24251111483852128),
+ P(26.174280599999999453, 72.240982180618559028),
+ P(26.174924399999998315, 72.239409446329290176),
+ P(26.175138900000000319, 72.238550480576279256),
+ P(26.177894599999998348, 72.222417606854094174),
+ P(26.178249600000000896, 72.220799387733251251),
+ P(26.178700899999999052, 72.219414415122045625),
+ P(26.179689899999999625, 72.217234222262234766),
+ P(26.182073200000001378, 72.213506738076645775),
+ P(26.18310470000000123, 72.211533626956168064),
+ P(26.183614800000000855, 72.210338776927230242),
+ P(26.18428000000000111, 72.208417574177602205),
+ P(26.185804499999999706, 72.203266316303412964),
+ P(26.186153000000000901, 72.202346286216979365),
+ P(26.186549599999999316, 72.201465316811109574),
+ P(26.187059699999998941, 72.200685882789031211),
+ P(26.187643699999998859, 72.200064170625580573),
+ P(26.188815999999999207, 72.199110470754774838),
+ P(26.189986799999999789, 72.198491439723213148),
+ P(26.190943999999998226, 72.198205925482497491),
+ P(26.192045499999998981, 72.198064597333782899),
+ P(26.201502200000000187, 72.19749033573828001),
+ P(26.204289599999999183, 72.197194731015855496),
+ P(26.212046699999998367, 72.196023752898682346),
+ P(26.217400099999998986, 72.195033541852339454),
+ P(26.220660899999998605, 72.194099530393685882),
+ P(26.223864100000000121, 72.193042117073559893),
+ P(26.227025699999998665, 72.192404096537160285),
+ P(26.229406099999998503, 72.192154413131575552),
+ P(26.23379059999999896, 72.191934250652863625),
+ P(26.241092200000000645, 72.191652763688111349),
+ P(26.247795599999999894, 72.191305763109099303),
+ P(26.259740499999999486, 72.190710990755292187),
+ P(26.262441899999998896, 72.190662426481935654),
+ P(26.26396259999999927, 72.190803739092231694),
+ P(26.265582200000000768, 72.19108065172507338),
+ P(26.271514700000000886, 72.192273445913514252),
+ P(26.275603900000000124, 72.192994312937273094),
+ P(26.278289999999998372, 72.193506828374651718),
+ P(26.280647800000000558, 72.193799369593079973),
+ P(26.284991699999999071, 72.194193426147350579),
+ P(26.295021899999998283, 72.194996021158502231),
+ P(26.296629599999999272, 72.195353135208762296),
+ P(26.298219400000000689, 72.195936520796209379),
+ P(26.299353599999999886, 72.196573622487093758),
+ P(26.300700500000001369, 72.19746290844136638),
+ P(26.301440499999998224, 72.198127833072547332),
+ P(26.302059899999999715, 72.198747051231549676),
+ P(26.302597999999999701, 72.199118470577644757),
+ P(26.30326700000000173, 72.200164931796578571),
+ P(26.304018299999999186, 72.201524555689601925),
+ P(26.305375600000001413, 72.20513574950004454),
+ P(26.306215500000000418, 72.206942181028665573),
+ P(26.307179600000001329, 72.208595118825385839),
+ P(26.307805599999998236, 72.209443034325843769),
+ P(26.308593200000000678, 72.210334966852684602),
+ P(26.309511400000001657, 72.211171854914510959),
+ P(26.310345000000001647, 72.211829485157878139),
+ P(26.313103999999999161, 72.213550746524816759),
+ P(26.313808999999999116, 72.214105903186023738),
+ P(26.315858999999999668, 72.21616368063173752),
+ P(26.316473599999998356, 72.216713905276705532),
+ P(26.317261800000000704, 72.217105619191144683),
+ P(26.318279199999999207, 72.217451609641841515),
+ P(26.31951039999999864, 72.217778930438797147),
+ P(26.319995200000001034, 72.217883719155963718),
+ P(26.322028199999998321, 72.21814340535271981),
+ P(26.323134799999998279, 72.218219615725388394),
+ P(26.324022500000001656, 72.218280774611798734),
+ P(26.32581220000000144, 72.218525220186265301),
+ P(26.327261700000001099, 72.218861882068196678),
+ P(26.330273800000000506, 72.219715642811124212),
+ P(26.337171999999998917, 72.221928497785057743),
+ P(26.339137900000000769, 72.222394361231621929),
+ P(26.341438799999998821, 72.222689314479467271),
+ P(26.343669200000000785, 72.222811640430336411),
+ P(26.346788899999999956, 72.222677310542948703),
+ P(26.356923500000000615, 72.222042438730937874),
+ P(26.359536099999999692, 72.2221015051835451),
+ P(26.36183730000000125, 72.222299854521224916),
+ P(26.366428899999998947, 72.222842507761527031),
+ P(26.374883000000000521, 72.223912965077033732),
+ P(26.380090800000001394, 72.224542709845593436),
+ P(26.39073850000000121, 72.225869670908153353),
+ P(26.393878699999998361, 72.226187124115313054),
+ P(26.400813700000000495, 72.226887965488728582),
+ P(26.405969100000000083, 72.227408932782296347),
+ P(26.434136200000001082, 72.23031015029567925),
+ P(26.437651200000001239, 72.230672215773722655),
+ P(26.439650799999999009, 72.230860300030158783),
+ P(26.442400500000001529, 72.230918230849241013),
+ P(26.444426599999999894, 72.230815518016711962),
+ P(26.454957100000001446, 72.229639190945519545),
+ P(26.455386699999998257, 72.229609273288744475),
+ P(26.470600499999999755, 72.227804710557407475),
+ P(26.485397899999998828, 72.226080035891357056),
+ P(26.487313600000000235, 72.226084418502168205),
+ P(26.488673999999999609, 72.226209799401686951),
+ P(26.489974300000000085, 72.226456941463752059),
+ P(26.493316499999998825, 72.227405883949458598),
+ P(26.497907399999999001, 72.228727947008763977),
+ P(26.507186099999998419, 72.231355762593423719),
+ P(26.521764000000001005, 72.235531322949142918),
+ P(26.522283200000000392, 72.235663963313356817),
+ P(26.52274799999999999, 72.235808991367022713),
+ P(26.523495799999999178, 72.236006428221017472),
+ P(26.537509100000001183, 72.239985971537208798),
+ P(26.540924100000001573, 72.240959309764491536),
+ P(26.544420699999999869, 72.241674408812258434),
+ P(26.546888100000000321, 72.242183101965366632),
+ P(26.5518616999999999, 72.242874580127462991),
+ P(26.562219100000000083, 72.244128903051048951),
+ P(26.564274399999998622, 72.244315309516480283),
+ P(26.576127799999998302, 72.245028538203385438),
+ P(26.58263820000000166, 72.244424904560787581),
+ P(26.591367999999999228, 72.243389190867901561),
+ P(26.598972199999998622, 72.242452221067154028),
+ P(26.600826200000000199, 72.242522931717928714),
+ P(26.603627199999998254, 72.242683603364909573),
+ P(26.606756300000000692, 72.243241096929352807),
+ P(26.612569100000001754, 72.244800578667096147),
+ P(26.615042299999998932, 72.246052459623328446),
+ P(26.621848599999999863, 72.249011664844303482),
+ P(26.627471299999999843, 72.250195383365820589),
+ P(26.641823800000000944, 72.252710806698729584),
+ P(26.648778100000001245, 72.254338371527666141),
+ P(26.655288500000001051, 72.25700169234383452),
+ P(26.660515000000000185, 72.259171735257126556),
+ P(26.662390800000000723, 72.25996099777080417),
+ P(26.670629300000001649, 72.263625851730935779),
+ P(26.671595899999999801, 72.264267979553508781),
+ P(26.676856199999999575, 72.267335711577246116),
+ P(26.677412499999999085, 72.267929636079472289),
+ P(26.676856199999999575, 72.267335711577246116)};
} // namespace geometry_coding_tests
diff --git a/coding/geometry_coding.cpp b/coding/geometry_coding.cpp
index fd0f5b4f9f..347871ff64 100644
--- a/coding/geometry_coding.cpp
+++ b/coding/geometry_coding.cpp
@@ -41,14 +41,10 @@ struct edge_less_p0
namespace coding
{
-bool TestDecoding(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT const & deltas,
- void (* fnDecode)(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points))
+bool TestDecoding(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT const & deltas,
+ void (*fnDecode)(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points))
{
size_t const count = points.size();
@@ -63,8 +59,7 @@ bool TestDecoding(InPointsT const & points,
return true;
}
-m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
- m2::PointU const & p1,
+m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint, m2::PointU const & p1,
m2::PointU const & p2)
{
// return ClampPoint(maxPoint, m2::PointI64(p1) + m2::PointI64(p1) - m2::PointI64(p2));
@@ -75,8 +70,8 @@ m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
uint64_t EncodeDelta(m2::PointU const & actual, m2::PointU const & prediction)
{
return bits::BitwiseMerge(
- bits::ZigZagEncode(static_cast<int32_t>(actual.x) - static_cast<int32_t>(prediction.x)),
- bits::ZigZagEncode(static_cast<int32_t>(actual.y) - static_cast<int32_t>(prediction.y)));
+ bits::ZigZagEncode(static_cast<int32_t>(actual.x) - static_cast<int32_t>(prediction.x)),
+ bits::ZigZagEncode(static_cast<int32_t>(actual.y) - static_cast<int32_t>(prediction.y)));
}
m2::PointU DecodeDelta(uint64_t delta, m2::PointU const & prediction)
@@ -86,10 +81,8 @@ m2::PointU DecodeDelta(uint64_t delta, m2::PointU const & prediction)
return m2::PointU(prediction.x + bits::ZigZagDecode(x), prediction.y + bits::ZigZagDecode(y));
}
-m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2,
- m2::PointU const & p3)
+m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint, m2::PointU const & p1,
+ m2::PointU const & p2, m2::PointU const & p3)
{
CHECK_NOT_EQUAL(p2, p3, ());
@@ -112,35 +105,29 @@ m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
return ClampPoint(maxPoint, m2::PointD(c0.real(), c0.imag()));
}
-m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2,
- m2::PointU const & p3)
+m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint, m2::PointU const & p1,
+ m2::PointU const & p2, m2::PointU const & p3)
{
// parallelogram prediction
return ClampPoint(maxPoint, p1 + p2 - p3);
}
-void EncodePolylinePrev1(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas)
+void EncodePolylinePrev1(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas)
{
size_t const count = points.size();
if (count > 0)
{
deltas.push_back(EncodeDelta(points[0], basePoint));
for (size_t i = 1; i < count; ++i)
- deltas.push_back(EncodeDelta(points[i], points[i-1]));
+ deltas.push_back(EncodeDelta(points[i], points[i - 1]));
}
ASSERT(TestDecoding(points, basePoint, maxPoint, deltas, &DecodePolylinePrev1), ());
}
-void DecodePolylinePrev1(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & /*maxPoint*/,
- OutPointsT & points)
+void DecodePolylinePrev1(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & /*maxPoint*/, OutPointsT & points)
{
size_t const count = deltas.size();
if (count > 0)
@@ -151,10 +138,8 @@ void DecodePolylinePrev1(InDeltasT const & deltas,
}
}
-void EncodePolylinePrev2(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas)
+void EncodePolylinePrev2(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas)
{
size_t const count = points.size();
if (count > 0)
@@ -164,18 +149,16 @@ void EncodePolylinePrev2(InPointsT const & points,
{
deltas.push_back(EncodeDelta(points[1], points[0]));
for (size_t i = 2; i < count; ++i)
- deltas.push_back(EncodeDelta(points[i],
- PredictPointInPolyline(maxPoint, points[i-1], points[i-2])));
+ deltas.push_back(
+ EncodeDelta(points[i], PredictPointInPolyline(maxPoint, points[i - 1], points[i - 2])));
}
}
ASSERT(TestDecoding(points, basePoint, maxPoint, deltas, &DecodePolylinePrev2), ());
}
-void DecodePolylinePrev2(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points)
+void DecodePolylinePrev2(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points)
{
size_t const count = deltas.size();
if (count > 0)
@@ -187,17 +170,15 @@ void DecodePolylinePrev2(InDeltasT const & deltas,
for (size_t i = 2; i < count; ++i)
{
size_t const n = points.size();
- points.push_back(DecodeDelta(deltas[i],
- PredictPointInPolyline(maxPoint, points[n-1], points[n-2])));
+ points.push_back(
+ DecodeDelta(deltas[i], PredictPointInPolyline(maxPoint, points[n - 1], points[n - 2])));
}
}
}
}
-void EncodePolylinePrev3(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas)
+void EncodePolylinePrev3(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas)
{
ASSERT_LESS_OR_EQUAL(basePoint.x, maxPoint.x, (basePoint, maxPoint));
ASSERT_LESS_OR_EQUAL(basePoint.y, maxPoint.y, (basePoint, maxPoint));
@@ -216,7 +197,7 @@ void EncodePolylinePrev3(InPointsT const & points,
for (size_t i = 3; i < count; ++i)
{
m2::PointU const prediction =
- PredictPointInPolyline(maxPoint, points[i-1], points[i-2], points[i-3]);
+ PredictPointInPolyline(maxPoint, points[i - 1], points[i - 2], points[i - 3]);
deltas.push_back(EncodeDelta(points[i], prediction));
}
}
@@ -226,16 +207,14 @@ void EncodePolylinePrev3(InPointsT const & points,
ASSERT(TestDecoding(points, basePoint, maxPoint, deltas, &DecodePolylinePrev3), ());
}
-void DecodePolylinePrev3(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points)
+void DecodePolylinePrev3(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points)
{
ASSERT_LESS_OR_EQUAL(basePoint.x, maxPoint.x, (basePoint, maxPoint));
ASSERT_LESS_OR_EQUAL(basePoint.y, maxPoint.y, (basePoint, maxPoint));
size_t const count = deltas.size();
- if (count> 0)
+ if (count > 0)
{
points.push_back(DecodeDelta(deltas[0], basePoint));
if (count > 1)
@@ -244,13 +223,13 @@ void DecodePolylinePrev3(InDeltasT const & deltas,
points.push_back(DecodeDelta(deltas[1], pt0));
if (count > 2)
{
- points.push_back(DecodeDelta(deltas[2],
- PredictPointInPolyline(maxPoint, points.back(), pt0)));
+ points.push_back(
+ DecodeDelta(deltas[2], PredictPointInPolyline(maxPoint, points.back(), pt0)));
for (size_t i = 3; i < count; ++i)
{
size_t const n = points.size();
m2::PointU const prediction =
- PredictPointInPolyline(maxPoint, points[n-1], points[n-2], points[n-3]);
+ PredictPointInPolyline(maxPoint, points[n - 1], points[n - 2], points[n - 3]);
points.push_back(DecodeDelta(deltas[i], prediction));
}
}
@@ -258,26 +237,20 @@ void DecodePolylinePrev3(InDeltasT const & deltas,
}
}
-void EncodePolyline(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas)
+void EncodePolyline(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas)
{
EncodePolylinePrev2(points, basePoint, maxPoint, deltas);
}
-void DecodePolyline(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points)
+void DecodePolyline(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points)
{
DecodePolylinePrev2(deltas, basePoint, maxPoint, points);
}
-void EncodeTriangleStrip(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas)
+void EncodeTriangleStrip(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas)
{
size_t const count = points.size();
if (count > 0)
@@ -291,16 +264,14 @@ void EncodeTriangleStrip(InPointsT const & points,
for (size_t i = 3; i < count; ++i)
{
m2::PointU const prediction =
- PredictPointInTriangle(maxPoint, points[i-1], points[i-2], points[i-3]);
+ PredictPointInTriangle(maxPoint, points[i - 1], points[i - 2], points[i - 3]);
deltas.push_back(EncodeDelta(points[i], prediction));
}
}
}
-void DecodeTriangleStrip(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points)
+void DecodeTriangleStrip(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points)
{
size_t const count = deltas.size();
if (count > 0)
@@ -315,7 +286,7 @@ void DecodeTriangleStrip(InDeltasT const & deltas,
{
size_t const n = points.size();
m2::PointU const prediction =
- PredictPointInTriangle(maxPoint, points[n-1], points[n-2], points[n-3]);
+ PredictPointInTriangle(maxPoint, points[n - 1], points[n - 2], points[n - 3]);
points.push_back(DecodeDelta(deltas[i], prediction));
}
}
@@ -365,14 +336,11 @@ m2::PointU GetMaxPoint(GeometryCodingParams const & params)
return D2U(m2::PointD(MercatorBounds::maxX, MercatorBounds::maxY), params.GetCoordBits());
}
-m2::PointU GetBasePoint(GeometryCodingParams const & params)
-{
- return params.GetBasePoint();
-}
+m2::PointU GetBasePoint(GeometryCodingParams const & params) { return params.GetBasePoint(); }
} // namespace pts
-void Encode(EncodeFunT fn, vector<m2::PointD> const & points,
- GeometryCodingParams const & params, DeltasT & deltas)
+void Encode(EncodeFunT fn, vector<m2::PointD> const & points, GeometryCodingParams const & params,
+ DeltasT & deltas)
{
size_t const count = points.size();
diff --git a/coding/geometry_coding.hpp b/coding/geometry_coding.hpp
index 6fd37e0e5f..8eb9c5a079 100644
--- a/coding/geometry_coding.hpp
+++ b/coding/geometry_coding.hpp
@@ -33,72 +33,47 @@ uint64_t EncodeDelta(m2::PointU const & actual, m2::PointU const & prediction);
m2::PointU DecodeDelta(uint64_t delta, m2::PointU const & prediction);
/// Predict next point for polyline with given previous points (p1, p2).
-m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
- m2::PointU const & p1,
+m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint, m2::PointU const & p1,
m2::PointU const & p2);
/// Predict next point for polyline with given previous points (p1, p2, p3).
-m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2,
- m2::PointU const & p3);
+m2::PointU PredictPointInPolyline(m2::PointU const & maxPoint, m2::PointU const & p1,
+ m2::PointU const & p2, m2::PointU const & p3);
/// Predict point for neighbour triangle with given
/// previous triangle (p1, p2, p3) and common edge (p1, p2).
-m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint,
- m2::PointU const & p1,
- m2::PointU const & p2,
- m2::PointU const & p3);
-
-void EncodePolylinePrev1(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas);
-
-void DecodePolylinePrev1(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points);
-
-void EncodePolylinePrev2(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas);
-
-void DecodePolylinePrev2(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points);
-
-void EncodePolylinePrev3(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas);
-
-void DecodePolylinePrev3(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points);
-
-void EncodePolyline(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas);
-
-void DecodePolyline(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points);
-
-void EncodeTriangleStrip(InPointsT const & points,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutDeltasT & deltas);
-
-void DecodeTriangleStrip(InDeltasT const & deltas,
- m2::PointU const & basePoint,
- m2::PointU const & maxPoint,
- OutPointsT & points);
+m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint, m2::PointU const & p1,
+ m2::PointU const & p2, m2::PointU const & p3);
+
+void EncodePolylinePrev1(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas);
+
+void DecodePolylinePrev1(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points);
+
+void EncodePolylinePrev2(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas);
+
+void DecodePolylinePrev2(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points);
+
+void EncodePolylinePrev3(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas);
+
+void DecodePolylinePrev3(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points);
+
+void EncodePolyline(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas);
+
+void DecodePolyline(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points);
+
+void EncodeTriangleStrip(InPointsT const & points, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutDeltasT & deltas);
+
+void DecodeTriangleStrip(InDeltasT const & deltas, m2::PointU const & basePoint,
+ m2::PointU const & maxPoint, OutPointsT & points);
} // namespace coding
namespace serial
@@ -153,10 +128,10 @@ m2::PointU GetBasePoint(GeometryCodingParams const & params);
} // namespace pts
/// @name Encode and Decode function types.
-typedef void (*EncodeFunT)(coding::InPointsT const &, m2::PointU const &,
- m2::PointU const &, coding::OutDeltasT &);
-typedef void (*DecodeFunT)(coding::InDeltasT const &, m2::PointU const &,
- m2::PointU const &, coding::OutPointsT &);
+typedef void (*EncodeFunT)(coding::InPointsT const &, m2::PointU const &, m2::PointU const &,
+ coding::OutDeltasT &);
+typedef void (*DecodeFunT)(coding::InDeltasT const &, m2::PointU const &, m2::PointU const &,
+ coding::OutPointsT &);
using DeltasT = buffer_vector<uint64_t, 32>;
using OutPointsT = buffer_vector<m2::PointD, 32>;
@@ -201,8 +176,8 @@ void SavePoint(TSink & sink, m2::PointD const & pt, GeometryCodingParams const &
template <class TSource>
m2::PointD LoadPoint(TSource & src, GeometryCodingParams const & cp)
{
- m2::PointD const pt =
- PointUToPointD(coding::DecodeDelta(ReadVarUint<uint64_t>(src), cp.GetBasePoint()), cp.GetCoordBits());
+ m2::PointD const pt = PointUToPointD(
+ coding::DecodeDelta(ReadVarUint<uint64_t>(src), cp.GetBasePoint()), cp.GetCoordBits());
return pt;
}
@@ -241,8 +216,8 @@ void const * LoadInner(DecodeFunT fn, void const * pBeg, size_t count,
GeometryCodingParams const & params, OutPointsT & points);
template <class TSource, class TPoints>
-void LoadOuter(DecodeFunT fn, TSource & src, GeometryCodingParams const & params,
- TPoints & points, size_t reserveF = 1)
+void LoadOuter(DecodeFunT fn, TSource & src, GeometryCodingParams const & params, TPoints & points,
+ size_t reserveF = 1)
{
uint32_t const count = ReadVarUint<uint32_t>(src);
std::vector<char> buffer(count);
@@ -258,15 +233,15 @@ void LoadOuter(DecodeFunT fn, TSource & src, GeometryCodingParams const & params
/// @name Paths.
template <class TSink>
-void SaveInnerPath(std::vector<m2::PointD> const & points,
- GeometryCodingParams const & params, TSink & sink)
+void SaveInnerPath(std::vector<m2::PointD> const & points, GeometryCodingParams const & params,
+ TSink & sink)
{
SaveInner(&coding::EncodePolyline, points, params, sink);
}
template <class TSink>
-void SaveOuterPath(std::vector<m2::PointD> const & points,
- GeometryCodingParams const & params, TSink & sink)
+void SaveOuterPath(std::vector<m2::PointD> const & points, GeometryCodingParams const & params,
+ TSink & sink)
{
SaveOuter(&coding::EncodePolyline, points, params, sink);
}
@@ -285,15 +260,14 @@ void LoadOuterPath(TSource & src, GeometryCodingParams const & params, TPoints &
/// @name Triangles.
template <class TSink>
-void SaveInnerTriangles(std::vector<m2::PointD> const & points,
- GeometryCodingParams const & params, TSink & sink)
+void SaveInnerTriangles(std::vector<m2::PointD> const & points, GeometryCodingParams const & params,
+ TSink & sink)
{
SaveInner(&coding::EncodeTriangleStrip, points, params, sink);
}
inline void const * LoadInnerTriangles(void const * pBeg, size_t count,
- GeometryCodingParams const & params,
- OutPointsT & triangles)
+ GeometryCodingParams const & params, OutPointsT & triangles)
{
CHECK_GREATER_OR_EQUAL(count, 2, ());
triangles.clear();
@@ -314,8 +288,7 @@ void DecodeTriangles(coding::InDeltasT const & deltas, m2::PointU const & basePo
m2::PointU const & maxPoint, coding::OutPointsT & triangles);
template <class TSource>
-void LoadOuterTriangles(TSource & src, GeometryCodingParams const & params,
- OutPointsT & triangles)
+void LoadOuterTriangles(TSource & src, GeometryCodingParams const & params, OutPointsT & triangles)
{
uint32_t const count = ReadVarUint<uint32_t>(src);
diff --git a/generator/dumper.cpp b/generator/dumper.cpp
index cf0d0913d3..259e4caaff 100644
--- a/generator/dumper.cpp
+++ b/generator/dumper.cpp
@@ -197,7 +197,8 @@ namespace feature
FilesContainerR container(make_unique<FileReader>(fPath));
feature::DataHeader header(container);
- serial::GeometryCodingParams codingParams(trie::GetGeometryCodingParams(header.GetDefGeometryCodingParams()));
+ serial::GeometryCodingParams codingParams(
+ trie::GetGeometryCodingParams(header.GetDefGeometryCodingParams()));
auto const trieRoot = trie::ReadTrie<ModelReaderPtr, ValueList<TValue>>(
container.GetReader(SEARCH_INDEX_FILE_TAG), SingleValueSerializer<TValue>(codingParams));
diff --git a/generator/feature_builder.cpp b/generator/feature_builder.cpp
index 2ccbdbf944..0555e6721b 100644
--- a/generator/feature_builder.cpp
+++ b/generator/feature_builder.cpp
@@ -363,7 +363,8 @@ bool FeatureBuilder1::CheckValid() const
return true;
}
-void FeatureBuilder1::SerializeBase(TBuffer & data, serial::GeometryCodingParams const & params, bool saveAddInfo) const
+void FeatureBuilder1::SerializeBase(TBuffer & data, serial::GeometryCodingParams const & params,
+ bool saveAddInfo) const
{
PushBackByteSink<TBuffer> sink(data);
diff --git a/generator/feature_builder.hpp b/generator/feature_builder.hpp
index 4dae2cb51d..25b37b1a06 100644
--- a/generator/feature_builder.hpp
+++ b/generator/feature_builder.hpp
@@ -94,7 +94,8 @@ public:
/// @name Serialization.
//@{
void Serialize(TBuffer & data) const;
- void SerializeBase(TBuffer & data, serial::GeometryCodingParams const & params, bool saveAddInfo) const;
+ void SerializeBase(TBuffer & data, serial::GeometryCodingParams const & params,
+ bool saveAddInfo) const;
void Deserialize(TBuffer & data);
//@}
diff --git a/generator/geometry_holder.hpp b/generator/geometry_holder.hpp
index 1c87d5d7b6..507b93654d 100644
--- a/generator/geometry_holder.hpp
+++ b/generator/geometry_holder.hpp
@@ -5,7 +5,6 @@
#include "generator/feature_helpers.hpp"
#include "generator/tesselator.hpp"
-
#include "geometry/distance.hpp"
#include "geometry/point2d.hpp"
#include "geometry/polygon.hpp"
diff --git a/generator/search_index_builder.cpp b/generator/search_index_builder.cpp
index b6a8c6690e..cd8177fe89 100644
--- a/generator/search_index_builder.cpp
+++ b/generator/search_index_builder.cpp
@@ -469,7 +469,8 @@ void BuildSearchIndex(FilesContainerR & container, Writer & indexWriter)
CategoriesHolder categoriesHolder(platform.GetReader(SEARCH_CATEGORIES_FILE_NAME));
FeaturesVectorTest features(container);
- auto codingParams = trie::GetGeometryCodingParams(features.GetHeader().GetDefGeometryCodingParams());
+ auto codingParams =
+ trie::GetGeometryCodingParams(features.GetHeader().GetDefGeometryCodingParams());
SingleValueSerializer<Value> serializer(codingParams);
vector<pair<Key, Value>> searchIndexKeyValuePairs;
diff --git a/generator/tesselator.cpp b/generator/tesselator.cpp
index fe259d2060..69c138f58d 100644
--- a/generator/tesselator.cpp
+++ b/generator/tesselator.cpp
@@ -101,9 +101,10 @@ int TesselateInterior(PolygonsT const & polys, TrianglesInfo & info)
{
uint64_t deltas[3];
deltas[0] = coding::EncodeDelta(points.m_points[i->first.first], points.m_base);
- deltas[1] = coding::EncodeDelta(points.m_points[i->first.second], points.m_points[i->first.first]);
+ deltas[1] =
+ coding::EncodeDelta(points.m_points[i->first.second], points.m_points[i->first.first]);
deltas[2] = coding::EncodeDelta(points.m_points[m_triangles[i->second].GetPoint3(i->first)],
- points.m_points[i->first.second]);
+ points.m_points[i->first.second]);
size_t const sz = GetBufferSize(deltas, deltas + 3);
if (sz < cr)
@@ -158,16 +159,15 @@ int TesselateInterior(PolygonsT const & polys, TrianglesInfo & info)
{
std::pair<int, int> const p = CommonEdge(to, from);
- m2::PointU const prediction =
- coding::PredictPointInTriangle(points.m_max,
- // common edge with 'to'
- points.m_points[from.m_p[(p.second+1) % 3]],
- points.m_points[from.m_p[(p.second)]],
- // diagonal point of 'from'
- points.m_points[from.m_p[(p.second+2) % 3]]);
+ m2::PointU const prediction = coding::PredictPointInTriangle(
+ points.m_max,
+ // common edge with 'to'
+ points.m_points[from.m_p[(p.second + 1) % 3]], points.m_points[from.m_p[(p.second)]],
+ // diagonal point of 'from'
+ points.m_points[from.m_p[(p.second + 2) % 3]]);
// delta from prediction to diagonal point of 'to'
- return coding::EncodeDelta(points.m_points[to.m_p[(p.first+2) % 3]], prediction);
+ return coding::EncodeDelta(points.m_points[to.m_p[(p.first + 2) % 3]], prediction);
}
template <class TPopOrder>
diff --git a/indexer/centers_table.hpp b/indexer/centers_table.hpp
index 68e151c614..428d9c9dc6 100644
--- a/indexer/centers_table.hpp
+++ b/indexer/centers_table.hpp
@@ -53,7 +53,8 @@ public:
// Loads CentersTable instance. Note that |reader| must be alive
// until the destruction of loaded table. Returns nullptr if
// CentersTable can't be loaded.
- static unique_ptr<CentersTable> Load(Reader & reader, serial::GeometryCodingParams const & codingParams);
+ static unique_ptr<CentersTable> Load(Reader & reader,
+ serial::GeometryCodingParams const & codingParams);
private:
virtual bool Init() = 0;
diff --git a/indexer/cities_boundaries_serdes.hpp b/indexer/cities_boundaries_serdes.hpp
index 9e3456d49f..3b895331b9 100644
--- a/indexer/cities_boundaries_serdes.hpp
+++ b/indexer/cities_boundaries_serdes.hpp
@@ -398,8 +398,8 @@ struct CitiesBoundariesSerDes
HeaderV0 const header;
visitor(header);
- serial::GeometryCodingParams const params(header.m_coordBits,
- m2::PointD(MercatorBounds::minX, MercatorBounds::minY));
+ serial::GeometryCodingParams const params(
+ header.m_coordBits, m2::PointD(MercatorBounds::minX, MercatorBounds::minY));
CitiesBoundariesEncoder<Sink> encoder(sink, params);
encoder(boundaries);
}
@@ -422,8 +422,8 @@ struct CitiesBoundariesSerDes
auto const wy = MercatorBounds::maxY - MercatorBounds::minY;
precision = std::max(wx, wy) / pow(2, header.m_coordBits);
- serial::GeometryCodingParams const params(header.m_coordBits,
- m2::PointD(MercatorBounds::minX, MercatorBounds::minY));
+ serial::GeometryCodingParams const params(
+ header.m_coordBits, m2::PointD(MercatorBounds::minX, MercatorBounds::minY));
CitiesBoundariesDecoderV0<Source> decoder(source, params);
decoder(boundaries);
}
diff --git a/indexer/data_header.cpp b/indexer/data_header.cpp
index 030950ce63..0f4b2a3317 100644
--- a/indexer/data_header.cpp
+++ b/indexer/data_header.cpp
@@ -27,9 +27,9 @@ namespace feature
serial::GeometryCodingParams DataHeader::GetGeometryCodingParams(int scaleIndex) const
{
- return serial::GeometryCodingParams(m_codingParams.GetCoordBits() -
- (m_scales.back() - m_scales[scaleIndex]) / 2,
- m_codingParams.GetBasePointUint64());
+ return serial::GeometryCodingParams(
+ m_codingParams.GetCoordBits() - (m_scales.back() - m_scales[scaleIndex]) / 2,
+ m_codingParams.GetBasePointUint64());
}
m2::RectD const DataHeader::GetBounds() const
diff --git a/routing/cross_mwm_connector_serialization.hpp b/routing/cross_mwm_connector_serialization.hpp
index 4f5a115d2c..4615699394 100644
--- a/routing/cross_mwm_connector_serialization.hpp
+++ b/routing/cross_mwm_connector_serialization.hpp
@@ -362,7 +362,8 @@ private:
Header() = default;
Header(uint32_t numTransitions, uint64_t sizeTransitions,
- serial::GeometryCodingParams const & codingParams, uint32_t bitsPerCrossMwmId, uint8_t bitsPerMask)
+ serial::GeometryCodingParams const & codingParams, uint32_t bitsPerCrossMwmId,
+ uint8_t bitsPerMask)
: m_numTransitions(numTransitions)
, m_sizeTransitions(sizeTransitions)
, m_codingParams(codingParams)
@@ -465,8 +466,9 @@ private:
template <typename CrossMwmId>
static void WriteTransitions(std::vector<Transition<CrossMwmId>> const & transitions,
- serial::GeometryCodingParams const & codingParams, uint32_t bitsPerOsmId,
- uint8_t bitsPerMask, std::vector<uint8_t> & buffer)
+ serial::GeometryCodingParams const & codingParams,
+ uint32_t bitsPerOsmId, uint8_t bitsPerMask,
+ std::vector<uint8_t> & buffer)
{
MemWriter<std::vector<uint8_t>> memWriter(buffer);
diff --git a/search/lazy_centers_table.cpp b/search/lazy_centers_table.cpp
index 82ad062163..c5df29accc 100644
--- a/search/lazy_centers_table.cpp
+++ b/search/lazy_centers_table.cpp
@@ -31,7 +31,8 @@ void LazyCentersTable::EnsureTableLoaded()
return;
}
- m_table = CentersTable::Load(*m_reader.GetPtr(), m_value.GetHeader().GetDefGeometryCodingParams());
+ m_table =
+ CentersTable::Load(*m_reader.GetPtr(), m_value.GetHeader().GetDefGeometryCodingParams());
if (m_table)
m_state = STATE_LOADED;
else
diff --git a/search/retrieval.cpp b/search/retrieval.cpp
index d74087bf7e..5c33fc3d3d 100644
--- a/search/retrieval.cpp
+++ b/search/retrieval.cpp
@@ -291,7 +291,8 @@ struct RetrievePostcodeFeaturesAdaptor
template <typename Value>
unique_ptr<Retrieval::TrieRoot<Value>> ReadTrie(MwmValue & value, ModelReaderPtr & reader)
{
- serial::GeometryCodingParams params(trie::GetGeometryCodingParams(value.GetHeader().GetDefGeometryCodingParams()));
+ serial::GeometryCodingParams params(
+ trie::GetGeometryCodingParams(value.GetHeader().GetDefGeometryCodingParams()));
return trie::ReadTrie<SubReaderWrapper<Reader>, ValueList<Value>>(
SubReaderWrapper<Reader>(reader.GetPtr()), SingleValueSerializer<Value>(params));
}
diff --git a/search/search_index_values.hpp b/search/search_index_values.hpp
index 8b59026062..cde4fd48de 100644
--- a/search/search_index_values.hpp
+++ b/search/search_index_values.hpp
@@ -96,7 +96,10 @@ class SingleValueSerializer<FeatureWithRankAndCenter>
public:
using Value = FeatureWithRankAndCenter;
- SingleValueSerializer(serial::GeometryCodingParams const & codingParams) : m_codingParams(codingParams) {}
+ SingleValueSerializer(serial::GeometryCodingParams const & codingParams)
+ : m_codingParams(codingParams)
+ {
+ }
template <typename Sink>
void Serialize(Sink & sink, Value const & v) const
diff --git a/search/search_trie.hpp b/search/search_trie.hpp
index b10ca53bd8..18d195f0da 100644
--- a/search/search_trie.hpp
+++ b/search/search_trie.hpp
@@ -12,9 +12,10 @@ static const uint8_t kPointCodingBits = 20;
namespace trie
{
-inline serial::GeometryCodingParams GetGeometryCodingParams(serial::GeometryCodingParams const & orig)
+inline serial::GeometryCodingParams GetGeometryCodingParams(
+ serial::GeometryCodingParams const & orig)
{
return serial::GeometryCodingParams(search::kPointCodingBits,
- PointUToPointD(orig.GetBasePoint(), orig.GetCoordBits()));
+ PointUToPointD(orig.GetBasePoint(), orig.GetCoordBits()));
}
} // namespace trie
diff --git a/storage/country_polygon.hpp b/storage/country_polygon.hpp
index 70f1ad0d0c..57f1f896a0 100644
--- a/storage/country_polygon.hpp
+++ b/storage/country_polygon.hpp
@@ -9,7 +9,8 @@
namespace storage
{
-template <class TSource> void Read(TSource & src, CountryDef & p)
+template <class TSource>
+void Read(TSource & src, CountryDef & p)
{
rw::Read(src, p.m_countryId);
@@ -19,7 +20,8 @@ template <class TSource> void Read(TSource & src, CountryDef & p)
p.m_rect = Int64ToRectObsolete(r, serial::GeometryCodingParams().GetCoordBits());
}
-template <class TSink> void Write(TSink & sink, CountryDef const & p)
+template <class TSink>
+void Write(TSink & sink, CountryDef const & p)
{
rw::Write(sink, p.m_countryId);
diff --git a/transit/transit_serdes.hpp b/transit/transit_serdes.hpp
index 38e1e34e72..901f2c2fa2 100644
--- a/transit/transit_serdes.hpp
+++ b/transit/transit_serdes.hpp
@@ -289,7 +289,8 @@ public:
vs.resize(size);
for (auto & p : vs)
{
- m2::PointU const pointU = coding::DecodeDelta(ReadVarUint<uint64_t, Source>(m_source), lastDecodedPoint);
+ m2::PointU const pointU =
+ coding::DecodeDelta(ReadVarUint<uint64_t, Source>(m_source), lastDecodedPoint);
p = PointUToPointD(pointU, POINT_COORD_BITS);
lastDecodedPoint = pointU;
}