MCPcopy Create free account
hub / github.com/comaps/comaps / DecodeImpl

Function DecodeImpl

libs/coding/geometry_coding.hpp:166–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164
165template <class TDecodeFun, class TOutPoints>
166void 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
187template <class TSink>
188void SavePoint(TSink & sink, m2::PointD const & pt, GeometryCodingParams const & cp)

Callers 1

DecodeFunction · 0.85

Calls 8

make_read_adapterFunction · 0.85
GetBasePointFunction · 0.85
GetCoordBitsMethod · 0.80
GetMaxPointFunction · 0.70
sizeMethod · 0.45
resizeMethod · 0.45
reserveMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected