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

Method GetRandomRect

libs/map/mwm_tests/multithread_mwm_test.cpp:45–60  ·  view source on GitHub ↗

Get random rect inside m_src.

Source from the content-addressed store, hash-verified

43private:
44 // Get random rect inside m_src.
45 m2::RectD GetRandomRect() const
46 {
47 int const count = std::max(1, rand() % 50);
48
49 int const x = rand() % count;
50 int const y = rand() % count;
51
52 m2::RectD const r = m_src.GetWorldRect();
53 double const sizeX = r.SizeX() / count;
54 double const sizeY = r.SizeY() / count;
55
56 double const minX = r.minX() + x * sizeX;
57 double const minY = r.minY() + y * sizeY;
58
59 return m2::RectD(minX, minY, minX + sizeX, minY + sizeY);
60 }
61
62 SourceT const & m_src;
63 int m_scale = 0;

Callers

nothing calls this directly

Calls 5

GetWorldRectMethod · 0.80
SizeXMethod · 0.80
SizeYMethod · 0.80
minXMethod · 0.80
minYMethod · 0.80

Tested by

no test coverage detected