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

screen_operations.hpp « drape_frontend - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dd34bdad7ecfaa855728447b45ee8d14cc5d7aab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include "geometry/screenbase.hpp"

namespace df
{

bool CheckMinScale(ScreenBase const & screen);
bool CheckMaxScale(ScreenBase const & screen);
bool CheckMaxScale(ScreenBase const & screen, uint32_t tileSize, double visualScale);
bool CheckBorders(ScreenBase const & screen);

bool CanShrinkInto(ScreenBase const & screen, m2::RectD const & boundRect);

ScreenBase const ShrinkInto(ScreenBase const & screen, m2::RectD boundRect);
ScreenBase const ScaleInto(ScreenBase const & screen, m2::RectD boundRect);
ScreenBase const ShrinkAndScaleInto(ScreenBase const & screen, m2::RectD boundRect);

bool IsScaleAllowableIn3d(int scale);

double CalculateScale(m2::RectD const & pixelRect, m2::RectD const & localRect);

m2::PointD CalculateCenter(ScreenBase const & screen, m2::PointD const & userPos,
                           m2::PointD const & pixelPos, double azimuth);
m2::PointD CalculateCenter(double scale, m2::RectD const & pixelRect,
                           m2::PointD const & userPos, m2::PointD const & pixelPos,
                           double azimuth);

bool ApplyScale(m2::PointD const & pixelScaleCenter, double factor, ScreenBase & screen);

} // namespace df