[Navigation] Refactoring of CarDirectionsEngine and PedestrianDirectionsEngine #2547
No reviewers
Labels
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference: organicmaps/organicmaps-tmp#2547
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "navigation-refactoring"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reason:
A lot of duplicated code which is not easy to read.
Results are not easy to understand.
Logical continuation is changing of CarDirectionsEngine and PedestrianDirectionsEngine (childs of DirectionsEngine).
Currently the only method they have - almost identical Generate().
Suggested changes:
MakeTurnAnnotation() - becomes method of DirectionsEngine.
All VehicleType dependent logic is incapsulated in virtual methods GetTurnDirection(), FixupTurns().
Existing functions become methods of CarDirectionsEngine and PedestrianDirectionsEngine.
If this next step is OK, I will make changes in this PR.
@AntonM030481 You are doing great, so do not hesitate to refactor according to your vision of a better code.
No further changes are planned. Ready for review.
Is it necessary to update icu and boost here?
Sure that junctions is not empty here?
So if validFirstOutgoingSeg == false, we can return false immediately before this loop.
Or there is an error here in logic ..
Should we take out named constant = 70?
Can assign directly without intermediate outgoingSegmentDist here
Split on 2 lines
Split like normal block:
{
...
};
Reset + push --force to remove accidental icu and boost changes.
Yes. Added assert just in case.
ok
ok
ok
ok
In fact this check can be removed.
It was checked before in GetTurnDirectionBasic().
Ready for merge.
Please, rebase and resolve conflicts.
I am not an expert in git.
This branch is 11 commits ahead of organicmaps/organicmaps:master.
Does it mean that there are no conflicts now?
A had merge before organicmaps/organicmaps#2547/commits/be8f4e064e13b904700c2f541c1f7ef44a150d39
Update: trying to rebase.
@AntonM030481 Don't worry, seems like I can squash and merge. You have got conflicts between your commits some how ..
@vng Do you need any assistance?
This is commit message for squash:
@vng Thank you!