rebase fix

This commit is contained in:
ExMix 2015-05-28 14:01:46 +03:00 committed by r.kuznetsov
parent e3fa5c4974
commit a669180167
40 changed files with 132 additions and 851 deletions

View file

@ -25,7 +25,7 @@ define add_prebuild_static_lib
include $(PREBUILT_STATIC_LIBRARY)
endef
prebuild_static_libs := osrm protobuf tomcrypt jansson minizip fribidi freetype expat base coding geometry anim platform drape indexer storage search routing drape_frontend map stats_client succinct opening_hours
prebuild_static_libs := osrm protobuf tomcrypt jansson minizip fribidi freetype expat base coding geometry platform indexer storage search routing drape drape_frontend map stats_client succinct opening_hours
$(foreach item,$(prebuild_static_libs),$(eval $(call add_prebuild_static_lib,$(item))))
@ -40,7 +40,7 @@ LOCAL_CPP_FEATURES += exceptions rtti
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../
LOCAL_MODULE := mapswithme
LOCAL_STATIC_LIBRARIES := map drape_frontend routing search storage indexer drape platform anim geometry coding base expat freetype fribidi minizip jansson tomcrypt protobuf osrm stats_client succinct opening_hours
LOCAL_STATIC_LIBRARIES := map drape_frontend routing search storage indexer drape platform geometry coding base expat freetype fribidi minizip jansson tomcrypt protobuf osrm stats_client succinct opening_hours
LOCAL_CFLAGS := -ffunction-sections -fdata-sections -Wno-extern-c-compat
ifneq ($(NDK_DEBUG),1)

View file

@ -292,9 +292,9 @@ void Framework::AddString(string const & name, string const & value)
m_work.AddString(name, value);
}
void Framework::Scale(double k)
void Framework::Scale(::Framework::EScaleMode mode)
{
m_work.Scale(k);
m_work.Scale(mode, true);
}
::Framework * Framework::NativeFramework()

View file

@ -117,7 +117,7 @@ namespace android
void AddString(string const & name, string const & value);
void Scale(double k);
void Scale(::Framework::EScaleMode mode);
BookmarkAndCategory AddBookmark(size_t category, m2::PointD const & pt, BookmarkData & bm);
void ReplaceBookmark(BookmarkAndCategory const & ind, BookmarkData & bm);

View file

@ -125,9 +125,29 @@ extern "C"
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_MapFragment_nativeScale(JNIEnv * env, jobject thiz, jdouble k)
Java_com_mapswithme_maps_MapFragment_nativeStorageConnected(JNIEnv * env, jobject thiz)
{
g_framework->Scale(static_cast<double>(k));
android::Platform::Instance().OnExternalStorageStatusChanged(true);
g_framework->AddLocalMaps();
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_MapFragment_nativeStorageDisconnected(JNIEnv * env, jobject thiz)
{
android::Platform::Instance().OnExternalStorageStatusChanged(false);
g_framework->RemoveLocalMaps();
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_MapFragment_nativeScalePlus(JNIEnv * env, jobject thiz)
{
g_framework->Scale(::Framework::SCALE_MAG);
}
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_MapFragment_nativeScaleMinus(JNIEnv * env, jobject thiz)
{
g_framework->Scale(::Framework::SCALE_MIN);
}
JNIEXPORT jboolean JNICALL

View file

@ -31,7 +31,8 @@ public class MapFragment extends NvEventQueueFragment
protected native void nativeCompassUpdated(double magneticNorth, double trueNorth, boolean force);
protected native void nativeScale(double k);
protected native void nativeScalePlus();
protected native void nativeScaleMinus();
public native boolean showMapForUrl(String url);

View file

@ -1153,12 +1153,12 @@ public class MwmActivity extends BaseMwmFragmentActivity
case R.id.map_button_plus:
Statistics.INSTANCE.trackEvent(Statistics.EventName.ZOOM_IN);
AlohaHelper.logClick(AlohaHelper.ZOOM_IN);
mMapFragment.nativeScale(3.0 / 2);
mMapFragment.nativeScalePlus();
break;
case R.id.map_button_minus:
Statistics.INSTANCE.trackEvent(Statistics.EventName.ZOOM_OUT);
AlohaHelper.logClick(AlohaHelper.ZOOM_OUT);
mMapFragment.nativeScale(2 / 3.0);
mMapFragment.nativeScaleMinus();
break;
}
}

View file

@ -32,10 +32,6 @@ OverlayHandle::OverlayHandle(FeatureID const & id,
bool OverlayHandle::IsVisible() const
{
#ifdef DEBUG
if (m_isVisible)
ASSERT(m_isValid, ());
#endif
return m_isVisible;
}

View file

@ -5,6 +5,7 @@
#include "std/map.hpp"
#include "std/mutex.hpp"
#include "std/type_traits.hpp"
#include "std/typeinfo.hpp"
//#define TRACK_POINTERS

View file

@ -42,12 +42,12 @@ const double VSyncInterval = 0.014;
FrontendRenderer::FrontendRenderer(Params const & params)
: BaseRenderer(ThreadsCommutator::RenderThread, params)
, m_gpuProgramManager(new dp::GpuProgramManager())
, m_overlayTree(new dp::OverlayTree())
, m_overlayTreeIsUpdating(true)
, m_viewport(params.m_viewport)
, m_userEventStream(params.m_isCountryLoadedFn)
, m_modelViewChangedFn(params.m_modelViewChangedFn)
, m_tileTree(new TileTree())
, m_overlayTree(new dp::OverlayTree())
, m_overlayTreeIsUpdating(true)
{
#ifdef DRAW_INFO
m_tpf = 0,0;

View file

@ -23,7 +23,7 @@ namespace df
struct Touch
{
m2::PointF m_location = m2::PointF::Zero();
int m_id = -1; // if id == -1 then touch invalid
int64_t m_id = -1; // if id == -1 then touch invalid
};
struct TouchEvent

View file

@ -514,21 +514,6 @@ void TestingEngine::DrawImpl()
LineShape(spl1, lvp).Draw(make_ref(m_batcher), make_ref(m_textures));
}
{
PoiSymbolViewParams p(FeatureID(-1, 0));
p.m_depth = 0.0f;
p.m_symbolName = "subway-station-l";
PoiSymbolShape(m2::PointF(92.27f, 30.0f), p).Draw(make_ref(m_batcher), make_ref(m_textures));
}
{
CircleViewParams p(FeatureID(-1, 0));
p.m_color = dp::Color::Red();
p.m_depth = 0.0f;
p.m_radius = 28.0f;
CircleShape(m2::PointF(94.27f, 30.0f), p).Draw(make_ref(m_batcher), make_ref(m_textures));
}
{
vector<m2::PointF> trg{ m2::PointD(110.0f, 30.0f), m2::PointD(112.0f, 30.0f), m2::PointD(112.0f, 28.0f),
m2::PointD(110.0f, 30.0f), m2::PointD(112.0f, 28.0f), m2::PointD(110.0f, 28.0f) };

View file

@ -45,5 +45,6 @@
- (void)routingNavigation;
- (void)handleRoutingError;
- (void)setRouteBuildingProgress:(CGFloat)progress;
- (void)setMyPositionMode:(location::EMyPositionMode)mode;
@end

View file

@ -44,6 +44,11 @@ extern NSString * const kAlohalyticsTapEventKey;
@implementation MWMMapViewControlsManager
- (void)setMyPositionMode:(location::EMyPositionMode) mode
{
[self.locationButton setMyPositionMode:mode];
}
- (instancetype)initWithParentController:(MapViewController *)controller
{
if (!controller)

View file

@ -59,14 +59,14 @@ extern NSString * const kAlohalyticsTapEventKey;
{
[[Statistics instance] logEvent:kStatEventName(kStatZoom, kStatIn)];
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"+"];
[self zoom:2.0];
GetFramework().Scale(Framework::SCALE_MAG, true);
}
- (void)zoomOut
{
[[Statistics instance] logEvent:kStatEventName(kStatZoom, kStatOut)];
[Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"-"];
[self zoom:0.5];
GetFramework().Scale(Framework::SCALE_MIN, true);
}
#pragma mark - Actions
@ -97,8 +97,8 @@ extern NSString * const kAlohalyticsTapEventKey;
UIView * const superview = self.zoomView.superview;
CGFloat const translation = -[sender translationInView:superview].y / superview.bounds.size.height;
CGFloat const scale = pow(2, translation);
[self zoom:scale];
CGFloat const scaleFactor = pow(2, translation);
GetFramework().Scale(scaleFactor, false);
}
#pragma mark - Properties

View file

@ -5,6 +5,8 @@
@property (nonatomic) CGFloat topBound;
@property (nonatomic) CGFloat bottomBound;
@property (nonatomic) location::EMyPositionMode myPositionMode;
- (instancetype)initWithFrame:(CGRect)frame __attribute__((unavailable("initWithFrame is not available")));
- (instancetype)init __attribute__((unavailable("init is not available")));

View file

@ -172,6 +172,7 @@ typedef NS_ENUM(NSUInteger, UserTouchesAction)
- (void)onLocationStateModeChanged:(location::EMyPositionMode)newMode
{
[m_predictor setMode:newMode];
[self.controlsManager setMyPositionMode:newMode];
switch (newMode)
{
@ -271,13 +272,13 @@ typedef NS_ENUM(NSUInteger, UserTouchesAction)
df::TouchEvent e;
UITouch * touch = [allTouches objectAtIndex:0];
CGPoint const pt = [touch locationInView:v];
e.m_touches[0].m_id = reinterpret_cast<int>(touch);
e.m_touches[0].m_id = reinterpret_cast<int64_t>(touch);
e.m_touches[0].m_location = m2::PointD(pt.x * scaleFactor, pt.y * scaleFactor);
if (allTouches.count > 1)
{
UITouch * touch = [allTouches objectAtIndex:1];
CGPoint const pt = [touch locationInView:v];
e.m_touches[1].m_id = reinterpret_cast<int>(touch);
e.m_touches[1].m_id = reinterpret_cast<int64_t>(touch);
e.m_touches[1].m_location = m2::PointD(pt.x * scaleFactor, pt.y * scaleFactor);
}
e.m_type = type;

View file

@ -134,7 +134,6 @@
4540406C1AD2D92D007A9B12 /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97C98651186C5EF000AF7E9E /* iAd.framework */; };
4540406D1AD2D958007A9B12 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 97ECD870183620CE00F77A46 /* AdSupport.framework */; };
4540406F1AD2D9C5007A9B12 /* WatchKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4540406E1AD2D9C5007A9B12 /* WatchKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
454040701AD2DB30007A9B12 /* RenderContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = EE7F297E1219ECA300EB67A9 /* RenderContext.mm */; };
454040761AD2DD73007A9B12 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
4579C8951AD2F98B001D6B90 /* synonyms.txt in Resources */ = {isa = PBXBuildFile; fileRef = FAAEA7D0161BD26600CCD661 /* synonyms.txt */; };
4579C8961AD2F9A1001D6B90 /* categories.txt in Resources */ = {isa = PBXBuildFile; fileRef = FAAFD696139D9BE2000AE70C /* categories.txt */; };
@ -153,7 +152,6 @@
4579C8A41AD2FAB1001D6B90 /* 04_padauk.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEA615E8134C4968003A9827 /* 04_padauk.ttf */; };
4579C8A51AD2FAB1001D6B90 /* 05_khmeros.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EEA615E9134C4968003A9827 /* 05_khmeros.ttf */; };
4579C8A61AD2FAB1001D6B90 /* 06_code2000.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EE164810135CEE49003B8A3E /* 06_code2000.ttf */; };
45FE96831AD315EF00CB7560 /* RenderBuffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = EE7F297D1219ECA300EB67A9 /* RenderBuffer.mm */; };
46F26C7310F61FD600ECCA39 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46F26C7210F61FD600ECCA39 /* OpenGLES.framework */; };
46F26CD810F623BA00ECCA39 /* EAGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46F26CD710F623BA00ECCA39 /* EAGLView.mm */; };
46F26D1F10F626CB00ECCA39 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 46F26D1E10F626CB00ECCA39 /* QuartzCore.framework */; };
@ -3713,8 +3711,6 @@
F6C6FE201AD6BEA0009FDED7 /* MWMWatchLocationTracker.mm in Sources */,
34DF4D111AE77B9F0012702D /* MWMWKInterfaceController.mm in Sources */,
343F262E1AEFC4A300388A6D /* MWMFrameworkUtils.mm in Sources */,
45FE96831AD315EF00CB7560 /* RenderBuffer.mm in Sources */,
454040701AD2DB30007A9B12 /* RenderContext.mm in Sources */,
345C31791AE799B600EA0CC2 /* MWMSearchResultController.mm in Sources */,
345C31721AE798DD00EA0CC2 /* MWMCategoriesInterfaceController.mm in Sources */,
);
@ -4744,7 +4740,6 @@
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
@ -4866,7 +4861,6 @@
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
@ -4990,7 +4984,6 @@
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
@ -5115,7 +5108,6 @@
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
@ -5239,7 +5231,6 @@
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
@ -5361,7 +5352,6 @@
"-lstorage",
"-lrouting",
"-lindexer",
"-lanim",
"-lplatform",
"-lgeometry",
"-lcoding",
@ -5486,10 +5476,8 @@
F6D434681AD2AB97007C7728 /* Simulator */,
F6D434691AD2AB97007C7728 /* Simulator Release */,
F6D4346A1AD2AB97007C7728 /* Debug */,
F6D4346B1AD2AB97007C7728 /* Drape Debug */,
F6D4346C1AD2AB97007C7728 /* AdHoc */,
F6D4346D1AD2AB97007C7728 /* Release */,
F6D4346E1AD2AB97007C7728 /* Drape Release */,
F6D4346F1AD2AB97007C7728 /* Production Full */,
);
defaultConfigurationIsVisible = 0;
@ -5501,10 +5489,8 @@
F6D434601AD2AB97007C7728 /* Simulator */,
F6D434611AD2AB97007C7728 /* Simulator Release */,
F6D434621AD2AB97007C7728 /* Debug */,
F6D434631AD2AB97007C7728 /* Drape Debug */,
F6D434641AD2AB97007C7728 /* AdHoc */,
F6D434651AD2AB97007C7728 /* Release */,
F6D434661AD2AB97007C7728 /* Drape Release */,
F6D434671AD2AB97007C7728 /* Production Full */,
);
defaultConfigurationIsVisible = 0;

View file

@ -56,16 +56,16 @@ extern NSString * const kSearchResultPointKey;
+ (void)initSoftwareRenderer
{
// @TODO. It's a hard code of apple watch dpi. It should be gotten dynamicly.
int const iWatchDPI = 384;
Framework & f = GetFramework();
if (!f.IsSingleFrameRendererInited())
f.InitSingleFrameRenderer(graphics::EDensityXHDPI, iWatchDPI);
// @TODO UVR
//Framework & f = GetFramework();
//if (!f.IsSingleFrameRendererInited())
// f.InitSingleFrameRenderer(graphics::EDensityXHDPI);
}
+ (void)releaseSoftwareRenderer
{
GetFramework().ReleaseSingleFrameRenderer();
// @TODO UVR
//GetFramework().ReleaseSingleFrameRenderer();
}
+ (UIImage *)getFrame:(CGSize)frameSize withZoomModifier:(int)zoomModifier
@ -88,11 +88,13 @@ extern NSString * const kSearchResultPointKey;
else
symbols.m_showSearchResult = false;
FrameImage image;
[MWMFrameworkUtils initSoftwareRenderer];
f.DrawSingleFrame(center, zoomModifier, pxWidth, pxHeight, image, symbols);
NSData * imadeData = [NSData dataWithBytes:image.m_data.data() length:image.m_data.size()];
return [UIImage imageWithData:imadeData];
// @TODO UVR
//FrameImage image;
//[MWMFrameworkUtils initSoftwareRenderer];
//f.DrawSingleFrame(center, zoomModifier, pxWidth, pxHeight, image, symbols);
//NSData * imadeData = [NSData dataWithBytes:image.m_data.data() length:image.m_data.size()];
//return [UIImage imageWithData:imadeData];
return nil;
}
+ (void)searchAroundCurrentLocation:(NSString *)query callback:(void(^)(NSMutableArray *result))reply

View file

@ -1,54 +0,0 @@
#include "map/alfa_animation_task.hpp"
#include "map/framework.hpp"
AlfaAnimationTask::AlfaAnimationTask(double start, double end,
double timeInterval, double timeOffset,
Framework * f)
: m_start(start)
, m_end(end)
, m_current(start)
, m_timeInterval(timeInterval)
, m_timeOffset(timeOffset)
, m_f(f)
{
}
bool AlfaAnimationTask::IsHiding() const
{
return m_start > m_end;
}
float AlfaAnimationTask::GetCurrentAlfa() const
{
return m_current;
}
void AlfaAnimationTask::OnStart(double ts)
{
m_timeStart = ts;
BaseT::OnStart(ts);
///@TODO UVR
//m_f->Invalidate();
}
void AlfaAnimationTask::OnStep(double ts)
{
BaseT::OnStep(ts);
double const elapsed = ts - (m_timeStart + m_timeOffset);
if (elapsed >= 0.0)
{
double const t = elapsed / m_timeInterval;
if (t > 1.0)
{
m_current = m_end;
End();
}
else
m_current = m_start + t * (m_end - m_start);
}
///@TODO UVR
//m_f->Invalidate();
}

View file

@ -1,32 +0,0 @@
#pragma once
#include "anim/task.hpp"
class Framework;
class AlfaAnimationTask : public anim::Task
{
typedef anim::Task BaseT;
public:
AlfaAnimationTask(double start, double end,
double timeInterval, double timeOffset,
Framework * f);
bool IsHiding() const;
float GetCurrentAlfa() const;
virtual void OnStart(double ts);
virtual void OnStep(double ts);
private:
double m_start;
double m_end;
double m_current;
double m_timeInterval;
double m_timeOffset;
double m_timeStart;
Framework * m_f;
};

View file

@ -1,69 +0,0 @@
#include "map/anim_phase_chain.hpp"
#include "map/framework.hpp"
AnimPhase::AnimPhase(double endScale, double timeInterval)
: m_endScale(endScale)
, m_timeInterval(timeInterval)
{
}
AnimPhaseChain::AnimPhaseChain(Framework & f, double & scale)
: m_f(f)
, m_scale(scale)
{
}
void AnimPhaseChain::AddAnimPhase(AnimPhase const & phase)
{
m_animPhases.push_back(phase);
}
void AnimPhaseChain::OnStart(double ts)
{
m_startTime = ts;
m_startScale = m_scale;
m_phaseIndex = 0;
}
void AnimPhaseChain::OnStep(double ts)
{
ASSERT(m_phaseIndex < m_animPhases.size(), ());
AnimPhase const * phase = &m_animPhases[m_phaseIndex];
double elapsedTime = ts - m_startTime;
if (elapsedTime > phase->m_timeInterval)
{
m_startTime = ts;
m_scale = phase->m_endScale;
m_startScale = m_scale;
m_phaseIndex++;
if (m_phaseIndex >= m_animPhases.size())
{
End();
return;
}
}
elapsedTime = ts - m_startTime;
double t = elapsedTime / phase->m_timeInterval;
m_scale = m_startScale + t * (phase->m_endScale - m_startScale);
///@TODO UVR
//m_f.Invalidate();
}
void InitDefaultPinAnim(AnimPhaseChain * chain)
{
chain->AddAnimPhase(AnimPhase(1.2, 0.15));
chain->AddAnimPhase(AnimPhase(0.8, 0.08));
chain->AddAnimPhase(AnimPhase(1, 0.05));
}
shared_ptr<anim::Task> CreateDefaultPinAnim(Framework & f, double & scale)
{
shared_ptr<AnimPhaseChain> anim = make_shared<AnimPhaseChain>(f, scale);
InitDefaultPinAnim(anim.get());
return anim;
}

View file

@ -1,37 +0,0 @@
#pragma once
#include "anim/task.hpp"
#include "std/shared_ptr.hpp"
class Framework;
struct AnimPhase
{
AnimPhase(double endScale, double timeInterval);
double m_endScale;
double m_timeInterval;
};
class AnimPhaseChain : public anim::Task
{
public:
AnimPhaseChain(Framework & f, double & scale);
void AddAnimPhase(AnimPhase const & phase);
virtual void OnStart(double ts);
virtual void OnStep(double ts);
private:
Framework & m_f;
vector<AnimPhase> m_animPhases;
size_t m_phaseIndex;
double & m_scale;
double m_startTime;
double m_startScale;
};
void InitDefaultPinAnim(AnimPhaseChain * chain);
shared_ptr<anim::Task> CreateDefaultPinAnim(Framework & f, double & scale);

View file

@ -1,123 +0,0 @@
#include "map/animator.hpp"
#include "map/rotate_screen_task.hpp"
#include "map/change_viewport_task.hpp"
#include "map/move_screen_task.hpp"
#include "map/framework.hpp"
#include "anim/controller.hpp"
#include "geometry/angles.hpp"
Animator::Animator(Framework * framework)
: m_framework(framework)
{}
void Animator::StopAnimation(shared_ptr<anim::Task> const & task)
{
if (task)
{
task->Lock();
if (!task->IsEnded()
&& !task->IsCancelled())
task->Cancel();
task->Unlock();
}
}
void Animator::RotateScreen(double startAngle, double endAngle)
{
if (m_rotateScreenTask)
m_rotateScreenTask->Lock();
bool const inProgress =
m_rotateScreenTask &&
!m_rotateScreenTask->IsCancelled() &&
!m_rotateScreenTask->IsEnded();
if (inProgress)
{
m_rotateScreenTask->SetEndAngle(endAngle);
}
else
{
double const eps = my::DegToRad(1.5);
if (fabs(ang::GetShortestDistance(startAngle, endAngle)) > eps)
{
if (m_rotateScreenTask)
{
m_rotateScreenTask->Unlock();
m_rotateScreenTask.reset();
}
m_rotateScreenTask.reset(new RotateScreenTask(m_framework,
startAngle,
endAngle,
GetRotationSpeed()));
//m_framework->GetAnimController()->AddTask(m_rotateScreenTask);
return;
}
}
if (m_rotateScreenTask)
m_rotateScreenTask->Unlock();
}
void Animator::StopRotation()
{
StopAnimation(m_rotateScreenTask);
m_rotateScreenTask.reset();
}
shared_ptr<MoveScreenTask> const & Animator::MoveScreen(m2::PointD const & startPt,
m2::PointD const & endPt,
double speed)
{
StopMoveScreen();
m_moveScreenTask.reset(new MoveScreenTask(m_framework,
startPt,
endPt,
speed));
//m_framework->GetAnimController()->AddTask(m_moveScreenTask);
return m_moveScreenTask;
}
void Animator::StopMoveScreen()
{
StopAnimation(m_moveScreenTask);
m_moveScreenTask.reset();
}
shared_ptr<ChangeViewportTask> const & Animator::ChangeViewport(m2::AnyRectD const & start,
m2::AnyRectD const & end,
double rotationSpeed)
{
StopChangeViewport();
m_changeViewportTask.reset(new ChangeViewportTask(start,
end,
rotationSpeed,
m_framework));
//m_framework->GetAnimController()->AddTask(m_changeViewportTask);
return m_changeViewportTask;
}
void Animator::StopChangeViewport()
{
StopAnimation(m_changeViewportTask);
m_changeViewportTask.reset();
}
double Animator::GetRotationSpeed() const
{
// making full circle in ~1 seconds.
return 6.0;
}

View file

@ -1,50 +0,0 @@
#pragma once
#include "std/shared_ptr.hpp"
#include "geometry/point2d.hpp"
#include "geometry/any_rect2d.hpp"
#include "anim/task.hpp"
class Framework;
class RotateScreenTask;
class ChangeViewportTask;
class MoveScreenTask;
/// Class, which is responsible for
/// tracking all map animations.
class Animator
{
private:
Framework * m_framework;
shared_ptr<RotateScreenTask> m_rotateScreenTask;
shared_ptr<ChangeViewportTask> m_changeViewportTask;
shared_ptr<MoveScreenTask> m_moveScreenTask;
void StopAnimation(shared_ptr<anim::Task> const & task);
public:
/// constructor by Framework
Animator(Framework * framework);
/// rotate screen by shortest path.
void RotateScreen(double startAngle,
double endAngle);
/// stopping screen rotation
void StopRotation();
/// move screen from one point to another
shared_ptr<ChangeViewportTask> const & ChangeViewport(m2::AnyRectD const & start,
m2::AnyRectD const & endPt,
double rotationSpeed);
/// stop screen moving
void StopChangeViewport();
/// get screen rotation speed
double GetRotationSpeed() const;
/// move screen from one point to another
shared_ptr<MoveScreenTask> const & MoveScreen(m2::PointD const & startPt,
m2::PointD const & endPt,
double speed);
/// stopping screen movement
void StopMoveScreen();
};

View file

@ -1,6 +1,5 @@
#include "map/bookmark.hpp"
#include "map/track.hpp"
#include "map/anim_phase_chain.hpp"
#include "map/framework.hpp"

View file

@ -56,7 +56,6 @@ public:
BookmarkCategory * GetBmCategory(size_t index) const;
size_t CreateBmCategory(string const & name);
void DrawItems(Drawer * drawer) const;
/// @name Delete bookmarks category with all bookmarks.
/// @return true if category was deleted

View file

@ -1,28 +0,0 @@
#include "map/change_viewport_task.hpp"
#include "map/framework.hpp"
ChangeViewportTask::ChangeViewportTask(m2::AnyRectD const & startRect,
m2::AnyRectD const & endRect,
double rotationSpeed,
Framework * framework)
: BaseT(startRect, endRect, rotationSpeed, m_outRect),
m_framework(framework)
{
}
void ChangeViewportTask::OnStep(double ts)
{
// BaseT::OnStep(ts);
// m_framework->ShowRectEx(m_outRect.GetGlobalRect());
}
void ChangeViewportTask::OnEnd(double ts)
{
// BaseT::OnEnd(ts);
// m_framework->ShowRectEx(m_outRect.GetGlobalRect());
}
bool ChangeViewportTask::IsVisual() const
{
return true;
}

View file

@ -1,25 +0,0 @@
#pragma once
#include "anim/anyrect_interpolation.hpp"
class Framework;
class ChangeViewportTask : public anim::AnyRectInterpolation
{
typedef anim::AnyRectInterpolation BaseT;
Framework * m_framework;
m2::AnyRectD m_outRect;
public:
ChangeViewportTask(m2::AnyRectD const & startRect,
m2::AnyRectD const & endRect,
double rotationSpeed,
Framework * framework);
void OnStep(double ts);
void OnEnd(double ts);
bool IsVisual() const;
};

View file

@ -1,162 +0,0 @@
#include "map/compass_arrow.hpp"
#include "map/framework.hpp"
#include "map/alfa_animation_task.hpp"
#include "anim/controller.hpp"
#include "geometry/transformations.hpp"
CompassArrow::Params::Params()
: m_framework(0)
{}
CompassArrow::CompassArrow(Params const & p)
: m_angle(0),
m_framework(p.m_framework)
{
}
void CompassArrow::AnimateShow()
{
///@TODO UVR
// if (!isVisible())
// {
// setIsVisible(true);
// double startValue = m_animTask == nullptr ? 0.1 : GetCurrentAlfa();
// CreateAnim(startValue, 1.0, 0.2, 0.0, true);
// }
}
void CompassArrow::AnimateHide()
{
///@TODO UVR
// if (isBaseVisible() && (m_animTask == NULL || !IsHidingAnim()))
// CreateAnim(1.0, 0.0, 0.3, 0.0, false);
}
void CompassArrow::SetAngle(double angle)
{
m_angle = angle;
}
///@TODO UVR
//void CompassArrow::draw(OverlayRenderer * r,
// math::Matrix<double, 3, 3> const & m) const
//{
// if (isBaseVisible())
// {
// checkDirtyLayout();
// UniformsHolder holder;
// holder.insertValue(ETransparency, GetCurrentAlfa());
// math::Matrix<double, 3, 3> drawM = math::Shift(
// math::Rotate(
// math::Identity<double, 3>(),
// m_angle),
// pivot());
// r->drawDisplayList(m_dl.get(), drawM * m, &holder);
// }
//}
bool CompassArrow::isVisible() const
{
if (m_animTask != NULL && IsHidingAnim())
return false;
return isBaseVisible();
}
void CompassArrow::AlfaAnimEnded(bool isVisible)
{
///@TODO UVR
//setIsVisible(isVisible);
m_animTask.reset();
}
bool CompassArrow::IsHidingAnim() const
{
ASSERT(m_animTask != NULL, ());
AlfaAnimationTask * a = static_cast<AlfaAnimationTask *>(m_animTask.get());
return a->IsHiding();
}
float CompassArrow::GetCurrentAlfa() const
{
if (m_animTask)
{
AlfaAnimationTask * a = static_cast<AlfaAnimationTask *>(m_animTask.get());
return a->GetCurrentAlfa();
}
return 1.0;
}
void CompassArrow::CreateAnim(double startAlfa, double endAlfa, double timeInterval, double timeOffset, bool isVisibleAtEnd)
{
// if (m_framework->GetAnimController() == NULL)
// return;
// if (m_animTask)
// m_animTask->Cancel();
// m_animTask.reset(new AlfaAnimationTask(startAlfa, endAlfa, timeInterval, timeOffset, m_framework));
// m_animTask->AddCallback(anim::Task::EEnded, bind(&CompassArrow::AlfaAnimEnded, this, isVisibleAtEnd));
// m_framework->GetAnimController()->AddTask(m_animTask);
}
void CompassArrow::cache()
{
///@TODO UVR
// Screen * cacheScreen = m_controller->GetCacheScreen();
// m_dl.reset();
// m_dl.reset(cacheScreen->createDisplayList());
// cacheScreen->beginFrame();
// cacheScreen->setDisplayList(m_dl.get());
// cacheScreen->applyVarAlfaStates();
// Resource const * res = GetCompassResource();
// shared_ptr<gl::BaseTexture> texture = cacheScreen->pipeline(res->m_pipelineID).texture();
// m2::RectU rect = res->m_texRect;
// double halfW = rect.SizeX() / 2.0;
// double halfH = rect.SizeY() / 2.0;
// m2::PointD coords[] =
// {
// m2::PointD(-halfW, -halfH),
// m2::PointD(-halfW, halfH),
// m2::PointD(halfW, -halfH),
// m2::PointD(halfW, halfH),
// };
// m2::PointF normal(0.0, 0.0);
// m2::PointF texCoords[] =
// {
// texture->mapPixel(m2::PointF(rect.minX(), rect.minY())),
// texture->mapPixel(m2::PointF(rect.minX(), rect.maxY())),
// texture->mapPixel(m2::PointF(rect.maxX(), rect.minY())),
// texture->mapPixel(m2::PointF(rect.maxX(), rect.maxY())),
// };
// cacheScreen->addTexturedStripStrided(coords, sizeof(m2::PointD),
// &normal, 0,
// texCoords, sizeof(m2::PointF),
// 4, depth(), res->m_pipelineID);
// cacheScreen->setDisplayList(0);
// cacheScreen->endFrame();
}
void CompassArrow::purge()
{
}
bool CompassArrow::isBaseVisible() const
{
///@TODO UVR
return false;
}

View file

@ -1,54 +0,0 @@
#pragma once
#include "std/shared_ptr.hpp"
#include "std/unique_ptr.hpp"
namespace anim
{
class Task;
}
class Framework;
/// Compass Arrow, which shows up when the screen is rotated,
/// and rotates screen back to straight orientation when beeing pressed
class CompassArrow
{
double m_angle;
shared_ptr<anim::Task> m_animTask;
void AlfaAnimEnded(bool isVisible);
bool IsHidingAnim() const;
float GetCurrentAlfa() const;
void CreateAnim(double startAlfa, double endAlfa, double timeInterval, double timeOffset, bool isVisibleAtEnd);
Framework * m_framework;
bool isBaseVisible() const;
public:
struct Params
{
Framework * m_framework;
Params();
};
CompassArrow(Params const & p);
void AnimateShow();
void AnimateHide();
void SetAngle(double angle);
/// @name Override from graphics::Overlayelement and gui::Element.
//@{
bool isVisible() const;
//bool hitTest(m2::PointD const & pt) const;
void cache();
void purge();
//bool onTapEnded(m2::PointD const & pt);
//@}
};

View file

@ -1956,8 +1956,8 @@ void Framework::RemoveRoute()
{
ASSERT_THREAD_CHECKER(m_threadChecker, ("RemoveRoute"));
m_bmManager.UserMarksClear(UserMarkContainer::DEBUG_MARK);
UserMarkControllerGuard g(m_bmManager, UserMarkType::DEBUG_MARK);
g.m_controller.Clear();
m_bmManager.ResetRouteTrack();
}
@ -1984,8 +1984,6 @@ void Framework::CloseRouting()
//GetLocationState()->StopRoutingMode();
m_routingSession.Reset();
RemoveRoute();
///@TODO UVR
//Invalidate();
}
void Framework::InsertRoute(Route const & route)

View file

@ -137,23 +137,24 @@ public:
int m_bottomZoom = -1;
};
/// @param density - for Retina Display you must use EDensityXHDPI
void InitSingleFrameRenderer(graphics::EDensity density, int exactDensityDPI);
/// @param center - map center in ercator
/// @param zoomModifier - result zoom calculate like "base zoom" + zoomModifier
/// if we are have search result "base zoom" calculate that my position and search result
/// will be see with some bottom clamp.
/// if we are't have search result "base zoom" == scales::GetUpperComfortScale() - 1
/// @param pxWidth - result image width.
/// It must be equal render buffer width. For retina it's equal 2.0 * displayWidth
/// @param pxHeight - result image height.
/// It must be equal render buffer height. For retina it's equal 2.0 * displayHeight
/// @param image [out] - result image
void DrawSingleFrame(m2::PointD const & center, int zoomModifier,
uint32_t pxWidth, uint32_t pxHeight, FrameImage & image,
SingleFrameSymbols const & symbols);
void ReleaseSingleFrameRenderer();
bool IsSingleFrameRendererInited() const;
//@TODO UVR
// /// @param density - for Retina Display you must use EDensityXHDPI
// void InitSingleFrameRenderer(graphics::EDensity density);
// /// @param center - map center in ercator
// /// @param zoomModifier - result zoom calculate like "base zoom" + zoomModifier
// /// if we are have search result "base zoom" calculate that my position and search result
// /// will be see with some bottom clamp.
// /// if we are't have search result "base zoom" == scales::GetUpperComfortScale() - 1
// /// @param pxWidth - result image width.
// /// It must be equal render buffer width. For retina it's equal 2.0 * displayWidth
// /// @param pxHeight - result image height.
// /// It must be equal render buffer height. For retina it's equal 2.0 * displayHeight
// /// @param image [out] - result image
// void DrawSingleFrame(m2::PointD const & center, int zoomModifier,
// uint32_t pxWidth, uint32_t pxHeight, FrameImage & image,
// SingleFrameSymbols const & symbols);
// void ReleaseSingleFrameRenderer();
// bool IsSingleFrameRendererInited() const;
/// Registers all local map files in internal indexes.
void RegisterAllMaps();

View file

@ -12,13 +12,8 @@ include($$ROOT_DIR/common.pri)
HEADERS += \
active_maps_layout.hpp \
alfa_animation_task.hpp \
anim_phase_chain.hpp \
animator.hpp \
bookmark.hpp \
bookmark_manager.hpp \
change_viewport_task.hpp \
compass_arrow.hpp \
country_tree.hpp \
feature_vec_model.hpp \
framework.hpp \
@ -37,13 +32,8 @@ SOURCES += \
../api/src/c/api-client.c \
active_maps_layout.cpp \
address_finder.cpp \
alfa_animation_task.cpp \
anim_phase_chain.cpp \
animator.cpp \
bookmark.cpp \
bookmark_manager.cpp \
change_viewport_task.cpp \
compass_arrow.cpp \
country_tree.cpp \
feature_vec_model.cpp \
framework.cpp \

View file

@ -1,38 +0,0 @@
#include "map/rotate_screen_task.hpp"
#include "map/framework.hpp"
RotateScreenTask::RotateScreenTask(Framework * framework,
double startAngle,
double endAngle,
double speed)
: anim::AngleInterpolation(startAngle,
endAngle,
speed,
m_outAngle),
m_framework(framework)
{
}
void RotateScreenTask::OnStep(double ts)
{
double prevAngle = m_outAngle;
anim::AngleInterpolation::OnStep(ts);
///@TODO UVR
// Navigator & nav = m_framework->GetNavigator();
// nav.SetAngle(nav.Screen().GetAngle() + m_outAngle - prevAngle);
//m_framework->Invalidate();
}
void RotateScreenTask::OnEnd(double ts)
{
anim::AngleInterpolation::OnEnd(ts);
///@TODO UVR
// Navigator & nav = m_framework->GetNavigator();
// nav.SetAngle(m_outAngle);
//m_framework->Invalidate();
}
bool RotateScreenTask::IsVisual() const
{
return true;
}

View file

@ -1,25 +0,0 @@
#pragma once
#include "anim/angle_interpolation.hpp"
class Framework;
class RotateScreenTask : public anim::AngleInterpolation
{
private:
Framework * m_framework;
double m_outAngle;
public:
RotateScreenTask(Framework * framework,
double startAngle,
double endAngle,
double speed);
void OnStep(double ts);
void OnEnd(double ts);
bool IsVisual() const;
};

View file

@ -226,3 +226,25 @@ void MyPositionMarkPoint::FillLogEvent(UserMark::TEventContainer & details) cons
PoiMarkPoint::FillLogEvent(details);
details.emplace("markType", "MY_POSITION");
}
DebugMarkPoint::DebugMarkPoint(const m2::PointD & ptOrg, UserMarkContainer * container)
: UserMark(ptOrg, container)
{
}
string DebugMarkPoint::GetSymbolName() const
{
return "api-result";
}
unique_ptr<UserMarkCopy> DebugMarkPoint::Copy() const
{
return unique_ptr<UserMarkCopy>(new UserMarkCopy(new DebugMarkPoint(m_ptOrg, m_container)));
}
void DebugMarkPoint::FillLogEvent(UserMark::TEventContainer & details) const
{
UserMark::FillLogEvent(details);
details.emplace("markType", "DEBUG");
}

View file

@ -97,28 +97,6 @@ private:
string m_id;
};
class DebugMarkPoint : public UserMark
{
public:
DebugMarkPoint(m2::PointD const & ptOrg, UserMarkContainer * container)
: UserMark(ptOrg, container)
{
}
UserMark::Type GetMarkType() const override { return UserMark::Type::DEBUG_MARK; }
unique_ptr<UserMarkCopy> Copy() const override
{
return unique_ptr<UserMarkCopy>(new UserMarkCopy(new DebugMarkPoint(m_ptOrg, m_container)));
}
virtual void FillLogEvent(TEventContainer & details) const override
{
UserMark::FillLogEvent(details);
details["markType"] = "DEBUG";
}
};
class SearchMarkPoint : public UserMark
{
public:
@ -164,5 +142,18 @@ public:
MyPositionMarkPoint(UserMarkContainer * container);
UserMark::Type GetMarkType() const override;
virtual void FillLogEvent(TEventContainer & details) const override;
void FillLogEvent(TEventContainer & details) const override;
};
class DebugMarkPoint : public UserMark
{
public:
DebugMarkPoint(m2::PointD const & ptOrg, UserMarkContainer * container);
;
string GetSymbolName() const override;
Type GetMarkType() const override { return UserMark::Type::DEBUG_MARK; }
unique_ptr<UserMarkCopy> Copy() const override;
void FillLogEvent(TEventContainer & details) const override;
};

View file

@ -256,28 +256,6 @@ bool UserMarkContainer::IsDrawableFlagDirty()
return m_flags[DrawableDirtyFlag];
}
DebugUserMarkContainer::DebugUserMarkContainer(double layerDepth, Framework & framework)
: UserMarkContainer(layerDepth, framework)
{
}
string DebugUserMarkContainer::GetTypeName() const
{
// api-result.png is reused for debug markers
return "api-result";
}
string DebugUserMarkContainer::GetActiveTypeName() const
{
// api-result.png is reused for debug markers
return "api-result";
}
UserMark * DebugUserMarkContainer::AllocateUserMark(const m2::PointD & ptOrg)
{
return new DebugMarkPoint(ptOrg, this);
}
namespace
{
@ -325,3 +303,13 @@ UserMark * ApiUserMarkContainer::AllocateUserMark(const m2::PointD & ptOrg)
{
return new ApiMarkPoint(ptOrg, this);
}
DebugUserMarkContainer::DebugUserMarkContainer(double layerDepth, Framework & framework)
: UserMarkContainer(layerDepth, UserMarkType::DEBUG_MARK, framework)
{
}
UserMark * DebugUserMarkContainer::AllocateUserMark(const m2::PointD & ptOrg)
{
return new DebugMarkPoint(ptOrg, this);
}

View file

@ -111,7 +111,7 @@ public:
SearchUserMarkContainer(double layerDepth, Framework & framework);
protected:
virtual UserMark * AllocateUserMark(m2::PointD const & ptOrg);
UserMark * AllocateUserMark(m2::PointD const & ptOrg) override;
};
class ApiUserMarkContainer : public UserMarkContainer
@ -120,7 +120,7 @@ public:
ApiUserMarkContainer(double layerDepth, Framework & framework);
protected:
virtual UserMark * AllocateUserMark(m2::PointD const & ptOrg);
virtual UserMark * AllocateUserMark(m2::PointD const & ptOrg) override;
};
class DebugUserMarkContainer : public UserMarkContainer
@ -128,10 +128,6 @@ class DebugUserMarkContainer : public UserMarkContainer
public:
DebugUserMarkContainer(double layerDepth, Framework & framework);
virtual Type GetType() const { return DEBUG_MARK; }
virtual string GetActiveTypeName() const;
protected:
virtual string GetTypeName() const;
virtual UserMark * AllocateUserMark(m2::PointD const & ptOrg);
UserMark * AllocateUserMark(m2::PointD const & ptOrg) override;
};

View file

@ -11,7 +11,6 @@ if [[ $# < 1 ]]; then
exit 1
fi
CONFIGURATION="$1"
DRAPE_CONF="$2"
source "$MY_PATH/build.sh"
source "$MY_PATH/detect_xcode.sh"
@ -39,11 +38,6 @@ else
exit 1
fi
if [[ $DRAPE_CONF == *drape* ]]; then
QMAKE_PARAMS=$QMAKE_PARAMS" drape drape_device"
SHADOW_DIR="${SHADOW_DIR}-drape"
fi
if [[ $CONFIGURATION == *simulator* ]]; then
MKSPEC="$MY_PATH/../mkspecs/iphonesimulator"
else