| 164 | |
| 165 | template <class TDecodeFun, class TOutPoints> |
| 166 | void DecodeImpl(TDecodeFun fn, DeltasT const & deltas, GeometryCodingParams const & params, TOutPoints & points, |
| 167 | size_t reserveF) |
| 168 | { |
| 169 | size_t const count = deltas.size() * reserveF; |
| 170 | |
| 171 | pts::PointsU upoints; |
| 172 | upoints.resize(count); |
| 173 | |
| 174 | coding::OutPointsT adapt(upoints); |
| 175 | (*fn)(make_read_adapter(deltas), pts::GetBasePoint(params), pts::GetMaxPoint(params), adapt); |
| 176 | |
| 177 | if (points.size() < 2) |
| 178 | { |
| 179 | // Do not call reserve when loading triangles - they are accumulated to one vector. |
| 180 | points.reserve(count); |
| 181 | } |
| 182 | |
| 183 | std::transform(upoints.begin(), upoints.begin() + adapt.size(), std::back_inserter(points), |
| 184 | std::bind(&pts::U2D, std::placeholders::_1, params.GetCoordBits())); |
| 185 | } |
| 186 | |
| 187 | template <class TSink> |
| 188 | void SavePoint(TSink & sink, m2::PointD const & pt, GeometryCodingParams const & cp) |
no test coverage detected