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

Method SetFromRects

libs/geometry/screenbase.cpp:131–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void ScreenBase::SetFromRects(m2::AnyRectD const & glbRect, m2::RectD const & pxRect)
132{
133 m2::RectD const & lRect = glbRect.GetLocalRect();
134 ASSERT(lRect.IsValid(), (lRect));
135 ASSERT(!pxRect.IsEmptyInterior(), (pxRect));
136
137 double const hScale = lRect.SizeX() / pxRect.SizeX();
138 double const vScale = lRect.SizeY() / pxRect.SizeY();
139 m_Scale = std::max(hScale, vScale);
140 ASSERT_GREATER(m_Scale, 0.0, ());
141
142 m_Angle = glbRect.Angle();
143 m_Org = glbRect.GlobalCenter();
144
145 UpdateDependentParameters();
146}
147
148void ScreenBase::SetFromRect(m2::AnyRectD const & glbRect)
149{

Callers 2

UNIT_TESTFunction · 0.80
SetRectMethod · 0.80

Calls 7

ASSERTFunction · 0.85
IsEmptyInteriorMethod · 0.80
SizeXMethod · 0.80
SizeYMethod · 0.80
AngleMethod · 0.80
GlobalCenterMethod · 0.80
IsValidMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.64