WIP: Helicopter navigation #4917
|
@ -1404,6 +1404,7 @@ Java_app_organicmaps_Framework_nativeSetRouter(JNIEnv * env, jclass, jint router
|
|||
case 1: type = Type::Pedestrian; break;
|
||||
case 2: type = Type::Bicycle; break;
|
||||
case 3: type = Type::Transit; break;
|
||||
case 4: type = Type::Helicopter; break;
|
||||
default: assert(false); break;
|
||||
}
|
||||
g_framework->GetRoutingManager().SetRouter(type);
|
||||
|
@ -1448,6 +1449,23 @@ Java_app_organicmaps_Framework_nativeAddRoutePoint(JNIEnv * env, jclass, jstring
|
|||
frm()->GetRoutingManager().AddRoutePoint(std::move(data));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_app_organicmaps_Framework_nativeContinueRouteToPoint(JNIEnv * env, jclass, jstring title,
|
||||
jstring subtitle, jint intermediateIndex,
|
||||
jboolean isMyPosition,
|
||||
jdouble lat, jdouble lon)
|
||||
{
|
||||
RouteMarkData data;
|
||||
data.m_title = jni::ToNativeString(env, title);
|
||||
data.m_subTitle = jni::ToNativeString(env, subtitle);
|
||||
data.m_pointType = RouteMarkType::Finish;
|
||||
data.m_intermediateIndex = static_cast<size_t>(intermediateIndex);
|
||||
|
||||
data.m_isMyPosition = static_cast<bool>(isMyPosition);
|
||||
data.m_position = m2::PointD(mercator::FromLatLon(lat, lon));
|
||||
|
||||
frm()->GetRoutingManager().ContinueRouteToPoint(std::move(data));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_app_organicmaps_Framework_nativeRemoveRoutePoint(JNIEnv * env, jclass,
|
||||
jint markType, jint intermediateIndex)
|
||||
|
|
5
android/res/drawable/ic_helicopter.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<vector android:height="40dp" android:viewportHeight="24"
|
||||
android:viewportWidth="24" android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M8,6C7,6 7,7 8,7h4v1C11.723,8 11.5,8.223 11.5,8.5L11.5,9L9,9L7.971,9L7.932,9C7.704,8.12 6.912,7.501 6,7.5c-1.105,0 -2,0.895 -2,2s0.895,2 2,2c0.372,-0.001 0.737,-0.106 1.053,-0.303L9.5,14.5C10.507,15.95 12.318,16 13,16h5c0,0 1,0 1,-1v-0.994C19,13.273 18.874,12.874 18.5,12.5l-3,-3c0,0 -0.592,-0.5 -1.273,-0.5L13.5,9L13.5,8.5C13.5,8.223 13.277,8 13,8L13,7h4c1,0 1,-1 0,-1C17,6 8,6 8,6zM6,8.5c0.552,0 1,0.448 1,1s-0.448,1 -1,1s-1,-0.448 -1,-1C5,8.948 5.448,8.5 6,8.5zM14,10c0.5,0 0.79,0.323 1,0.5L17.5,13L14,13c0,0 -1,0 -1,-1L13,11C13,11 13,10 14,10z"/>
|
||||
</vector>
|
||||
<!-- Source: https://labs.mapbox.com/maki-icons/ -->
|
6
android/res/drawable/ic_route_continue.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp" android:width="24dp"
|
||||
android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:fillColor="#FFFFFFFF" android:fillType="evenOdd" android:pathData="M8.829,20C8.417,21.165 7.306,22 6,22C4.343,22 3,20.657 3,19C3,17.343 4.343,16 6,16C7.306,16 8.417,16.835 8.829,18L17.5,18C18.881,18 20,16.881 20,15.5C20,14.119 18.881,13 17.5,13L6.5,13C4.015,13 2,10.985 2,8.5C2,6.015 4.015,4 6.5,4L9.586,4L8.293,2.707L9.707,1.293L13.414,5L9.707,8.707L8.293,7.293L9.586,6L6.5,6C5.119,6 4,7.119 4,8.5C4,9.881 5.119,11 6.5,11L17.5,11C19.985,11 22,13.015 22,15.5C22,17.985 19.985,20 17.5,20L8.829,20ZM6,18C5.448,18 5,18.448 5,19C5,19.552 5.448,20 6,20C6.552,20 7,19.552 7,19C7,18.448 6.552,18 6,18ZM18,2C19.657,2 21,3.343 21,5C21,6.657 19.657,8 18,8C16.343,8 15,6.657 15,5C15,3.343 16.343,2 18,2ZM18,4C17.448,4 17,4.448 17,5C17,5.552 17.448,6 18,6C18.552,6 19,5.552 19,5C19,4.448 18.552,4 18,4Z"/>
|
||||
</vector>
|
||||
<!-- Source: http://www.evericons.com/ -->
|
7
android/res/drawable/ic_triangle_up.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp" android:width="24dp"
|
||||
android:viewportHeight="24" android:viewportWidth="24">
|
||||
<path
|
||||
android:pathData="M17.0,10.0l-3.75,-3.75L10,10z"
|
||||
android:fillColor="#FFF"/>
|
||||
</vector>
|
|
@ -7,6 +7,13 @@
|
|||
tools:layout_height="@dimen/place_page_buttons_height"
|
||||
tools:ignore="UseCompoundDrawables"
|
||||
tools:background="#40202020">
|
||||
<ImageView
|
||||
android:id="@+id/icon_up"
|
||||
style="@style/PlacePageButtonUpIcon"
|
||||
android:contentDescription="@string/back"
|
||||
tools:src="@drawable/ic_triangle_up"
|
||||
android:layout_gravity="end"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
style="@style/PlacePageButtonImage"
|
||||
|
|
|
@ -73,6 +73,14 @@
|
|||
android:layout_marginEnd="12dp"
|
||||
tools:button="@drawable/ic_bike"
|
||||
tools:buttonTint="?iconTintLight" />
|
||||
|
||||
<app.organicmaps.widget.RoutingToolbarButton
|
||||
android:id="@+id/helicopter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
tools:button="@drawable/ic_helicopter"
|
||||
tools:buttonTint="?iconTintLight" />
|
||||
</RadioGroup>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -113,6 +121,13 @@
|
|||
android:layout_marginTop="@dimen/routing_selector_wheel_margin"
|
||||
android:layout_marginBottom="@dimen/routing_selector_wheel_margin"
|
||||
android:layout_marginEnd="12dp"/>
|
||||
|
||||
<app.organicmaps.widget.WheelProgressView
|
||||
android:id="@+id/progress_helicopter"
|
||||
style="@style/MwmWidget.ProgressWheel.RoutingPlan"
|
||||
android:layout_marginTop="@dimen/routing_selector_wheel_margin"
|
||||
android:layout_marginBottom="@dimen/routing_selector_wheel_margin"
|
||||
android:layout_marginEnd="12dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer name="pp_title_lines">5</integer>
|
||||
<integer name="pp_buttons_max">4</integer>
|
||||
<integer name="pp_buttons_max">5</integer>
|
||||
<integer name="place_page_description_max_length">500</integer>
|
||||
</resources>
|
||||
|
|
|
@ -20,6 +20,18 @@
|
|||
<item name="android:color">?iconTint</item>
|
||||
</style>
|
||||
|
||||
<style name="PlacePageButtonUpIcon">
|
||||
<item name="android:layout_width">@dimen/margin_half_plus</item>
|
||||
<item name="android:layout_height">@dimen/margin_half_plus</item>
|
||||
<item name="android:layout_weight">0</item>
|
||||
<item name="android:layout_marginBottom">@dimen/neg_margin_half_plus</item>
|
||||
<item name="android:paddingTop">0dp</item>
|
||||
<item name="android:paddingBottom">0dp</item>
|
||||
<item name="android:layout_marginRight">@dimen/margin_half_double_plus</item>
|
||||
<item name="android:scaleType">center</item>
|
||||
<item name="android:color">?iconTint</item>
|
||||
</style>
|
||||
|
||||
<style name="PlacePageButton">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">@dimen/place_page_buttons_height</item>
|
||||
|
|
|
@ -45,7 +45,7 @@ public class Framework
|
|||
public static final int MAP_STYLE_VEHICLE_DARK = 4;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({ ROUTER_TYPE_VEHICLE, ROUTER_TYPE_PEDESTRIAN, ROUTER_TYPE_BICYCLE, ROUTER_TYPE_TRANSIT })
|
||||
@IntDef({ ROUTER_TYPE_VEHICLE, ROUTER_TYPE_PEDESTRIAN, ROUTER_TYPE_BICYCLE, ROUTER_TYPE_TRANSIT, ROUTER_TYPE_HELICOPTER })
|
||||
|
||||
public @interface RouterType {}
|
||||
|
||||
|
@ -53,6 +53,7 @@ public class Framework
|
|||
public static final int ROUTER_TYPE_PEDESTRIAN = 1;
|
||||
public static final int ROUTER_TYPE_BICYCLE = 2;
|
||||
public static final int ROUTER_TYPE_TRANSIT = 3;
|
||||
public static final int ROUTER_TYPE_HELICOPTER = 4;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({DO_AFTER_UPDATE_NOTHING, DO_AFTER_UPDATE_AUTO_UPDATE, DO_AFTER_UPDATE_ASK_FOR_UPDATE})
|
||||
|
@ -311,6 +312,10 @@ public class Framework
|
|||
int intermediateIndex, boolean isMyPosition,
|
||||
double lat, double lon);
|
||||
|
||||
public static native void nativeContinueRouteToPoint(String title, String subtitle,
|
||||
int intermediateIndex, boolean isMyPosition,
|
||||
double lat, double lon);
|
||||
|
||||
public static native void nativeRemoveRoutePoint(@RoutePointInfo.RouteMarkType int markType,
|
||||
int intermediateIndex);
|
||||
|
||||
|
|
|
@ -410,6 +410,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
|||
categoryBlock.setOnClickListener(this);
|
||||
// TODO show icon and fill it when core will implement that
|
||||
UiUtils.hide(categoryBlock.findViewById(R.id.icon));
|
||||
UiUtils.hide(categoryBlock, R.id.icon_up);
|
||||
mCategory = categoryBlock.findViewById(R.id.name);
|
||||
mCardName = view.findViewById(R.id.cv__name);
|
||||
mCardAddress = view.findViewById(R.id.cv__address);
|
||||
|
|
|
@ -135,9 +135,11 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
|
||||
void showAltitudeChartAndRoutingDetails()
|
||||
{
|
||||
UiUtils.hide(mError, mActionFrame, mTransitFrame);
|
||||
UiUtils.hide(mError, mActionFrame, mAltitudeChart, mAltitudeDifference, mTransitFrame);
|
||||
|
||||
showRouteAltitudeChart();
|
||||
if (!RoutingController.get().isVehicleRouterType() &&
|
||||
!RoutingController.get().isHelicopterRouterType())
|
||||
showRouteAltitudeChart();
|
||||
showRoutingDetails();
|
||||
UiUtils.show(mAltitudeChartFrame);
|
||||
}
|
||||
|
@ -206,15 +208,17 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
UiUtils.hide(mActionFrame);
|
||||
}
|
||||
|
||||
void setStartButton()
|
||||
void setStartButton(boolean show)
|
||||
{
|
||||
mStart.setText(mContext.getText(R.string.p2p_start));
|
||||
mStart.setOnClickListener(v -> {
|
||||
if (mListener != null)
|
||||
mListener.onRoutingStart();
|
||||
});
|
||||
if (show) {
|
||||
mStart.setText(mContext.getText(R.string.p2p_start));
|
||||
mStart.setOnClickListener(v -> {
|
||||
if (mListener != null)
|
||||
mListener.onRoutingStart();
|
||||
});
|
||||
}
|
||||
|
||||
showStartButton(true);
|
||||
showStartButton(show);
|
||||
}
|
||||
|
||||
private void showError(@NonNull String message)
|
||||
|
@ -250,12 +254,6 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
|
||||
private void showRouteAltitudeChart()
|
||||
{
|
||||
if (RoutingController.get().isVehicleRouterType())
|
||||
{
|
||||
UiUtils.hide(mAltitudeChart, mAltitudeDifference);
|
||||
return;
|
||||
}
|
||||
|
||||
int chartWidth = UiUtils.dimen(mContext, R.dimen.altitude_chart_image_width);
|
||||
int chartHeight = UiUtils.dimen(mContext, R.dimen.altitude_chart_image_height);
|
||||
Framework.RouteAltitudeLimits limits = new Framework.RouteAltitudeLimits();
|
||||
|
@ -281,7 +279,8 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
return;
|
||||
}
|
||||
|
||||
Spanned spanned = makeSpannedRoutingDetails(mContext, rinfo);
|
||||
boolean isHelicopter = RoutingController.get().isHelicopterRouterType();
|
||||
Spanned spanned = makeSpannedRoutingDetails(mContext, rinfo, !isHelicopter);
|
||||
TextView numbersTime = mNumbersFrame.findViewById(R.id.time);
|
||||
numbersTime.setText(spanned);
|
||||
|
||||
|
@ -294,7 +293,9 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
}
|
||||
|
||||
@NonNull
|
||||
private static Spanned makeSpannedRoutingDetails(@NonNull Context context, @NonNull RoutingInfo routingInfo)
|
||||
private static Spanned makeSpannedRoutingDetails(@NonNull Context context,
|
||||
@NonNull RoutingInfo routingInfo,
|
||||
boolean showTime)
|
||||
|
||||
{
|
||||
CharSequence time = RoutingController.formatRoutingTime(context,
|
||||
|
@ -302,10 +303,13 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
|||
R.dimen.text_size_routing_number);
|
||||
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
initTimeBuilderSequence(context, time, builder);
|
||||
|
||||
String dot = "\u00A0• ";
|
||||
initDotBuilderSequence(context, dot, builder);
|
||||
if (showTime)
|
||||
{
|
||||
initTimeBuilderSequence(context, time, builder);
|
||||
final String dot = "\u00A0• ";
|
||||
initDotBuilderSequence(context, dot, builder);
|
||||
}
|
||||
|
||||
String dist = routingInfo.distToTarget + "\u00A0" + routingInfo.targetUnits;
|
||||
initDistanceBuilderSequence(context, dist, builder);
|
||||
|
|
|
@ -603,6 +603,11 @@ public class RoutingController implements Initializable<Void>
|
|||
return mLastRouterType == Framework.ROUTER_TYPE_VEHICLE;
|
||||
}
|
||||
|
||||
boolean isHelicopterRouterType()
|
||||
{
|
||||
return mLastRouterType == Framework.ROUTER_TYPE_HELICOPTER;
|
||||
}
|
||||
|
||||
public boolean isNavigating()
|
||||
{
|
||||
return mState == State.NAVIGATION;
|
||||
|
@ -839,6 +844,36 @@ public class RoutingController implements Initializable<Void>
|
|||
return true;
|
||||
}
|
||||
|
||||
public boolean continueToPoint(@NonNull MapObject point)
|
||||
{
|
||||
MapObject startPoint = getStartPoint();
|
||||
MapObject endPoint = getEndPoint();
|
||||
boolean isSamePoint = MapObject.same(endPoint, point);
|
||||
|
||||
int type = RoutePointInfo.ROUTE_MARK_FINISH;
|
||||
Pair<String, String> description = getDescriptionForPoint(point);
|
||||
Framework.nativeContinueRouteToPoint(description.first /* title */, description.second /* subtitle */,
|
||||
0 /* intermediateIndex */, MapObject.isOfType(MapObject.MY_POSITION, point),
|
||||
point.getLat(), point.getLon());
|
||||
|
||||
if (point.sameAs(startPoint))
|
||||
{
|
||||
if (endPoint == null)
|
||||
{
|
||||
Logger.d(TAG, "setEndPoint: skip because end point is empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
Logger.d(TAG, "setEndPoint: swap with starting point");
|
||||
startPoint = endPoint;
|
||||
}
|
||||
|
||||
endPoint = point;
|
||||
setPointsInternal(startPoint, endPoint);
|
||||
checkAndBuildRoute();
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void addRoutePoint(@RoutePointInfo.RouteMarkType int type, @NonNull MapObject point)
|
||||
{
|
||||
Pair<String, String> description = getDescriptionForPoint(point);
|
||||
|
|
|
@ -40,6 +40,9 @@ public class RoutingPlanController extends ToolbarController
|
|||
@NonNull
|
||||
private final WheelProgressView mProgressBicycle;
|
||||
|
||||
@NonNull
|
||||
private final WheelProgressView mProgressHelicopter;
|
||||
|
||||
// @NonNull
|
||||
// private final WheelProgressView mProgressTaxi;
|
||||
|
||||
|
@ -93,6 +96,7 @@ public class RoutingPlanController extends ToolbarController
|
|||
mProgressPedestrian = progressFrame.findViewById(R.id.progress_pedestrian);
|
||||
mProgressTransit = progressFrame.findViewById(R.id.progress_transit);
|
||||
mProgressBicycle = progressFrame.findViewById(R.id.progress_bicycle);
|
||||
mProgressHelicopter = progressFrame.findViewById(R.id.progress_helicopter);
|
||||
// mProgressTaxi = (WheelProgressView) progressFrame.findViewById(R.id.progress_taxi);
|
||||
|
||||
mRoutingBottomMenuController = RoutingBottomMenuController.newInstance(requireActivity(), mFrame, listener);
|
||||
|
@ -128,12 +132,13 @@ public class RoutingPlanController extends ToolbarController
|
|||
{
|
||||
setupRouterButton(R.id.vehicle, R.drawable.ic_car, this::onVehicleModeSelected);
|
||||
setupRouterButton(R.id.pedestrian, R.drawable.ic_pedestrian, this::onPedestrianModeSelected);
|
||||
setupRouterButton(R.id.bicycle, R.drawable.ic_bike, this::onBicycleModeSelected);
|
||||
// setupRouterButton(R.id.taxi, R.drawable.ic_taxi, this::onTaxiModeSelected);
|
||||
setupRouterButton(R.id.transit, R.drawable.ic_transit, v -> onTransitModeSelected());
|
||||
setupRouterButton(R.id.transit, R.drawable.ic_transit, this::onTransitModeSelected);
|
||||
setupRouterButton(R.id.bicycle, R.drawable.ic_bike, this::onBicycleModeSelected);
|
||||
setupRouterButton(R.id.helicopter, R.drawable.ic_helicopter, this::onHelicopterModeSelected);
|
||||
}
|
||||
|
||||
private void onTransitModeSelected()
|
||||
private void onTransitModeSelected(@NonNull View v)
|
||||
{
|
||||
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_TRANSIT);
|
||||
}
|
||||
|
@ -143,6 +148,11 @@ public class RoutingPlanController extends ToolbarController
|
|||
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_BICYCLE);
|
||||
}
|
||||
|
||||
private void onHelicopterModeSelected(@NonNull View v)
|
||||
{
|
||||
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_HELICOPTER);
|
||||
}
|
||||
|
||||
private void onPedestrianModeSelected(@NonNull View v)
|
||||
{
|
||||
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_PEDESTRIAN);
|
||||
|
@ -188,39 +198,45 @@ public class RoutingPlanController extends ToolbarController
|
|||
return;
|
||||
}
|
||||
|
||||
mRoutingBottomMenuController.setStartButton();
|
||||
boolean showStartButton = !RoutingController.get().isHelicopterRouterType();
|
||||
mRoutingBottomMenuController.setStartButton(showStartButton);
|
||||
mRoutingBottomMenuController.showAltitudeChartAndRoutingDetails();
|
||||
}
|
||||
|
||||
public void updateBuildProgress(int progress, @Framework.RouterType int router)
|
||||
{
|
||||
UiUtils.invisible(mProgressVehicle, mProgressPedestrian, mProgressTransit,
|
||||
mProgressBicycle);
|
||||
mProgressBicycle, mProgressHelicopter);
|
||||
WheelProgressView progressView;
|
||||
if (router == Framework.ROUTER_TYPE_VEHICLE)
|
||||
switch(router)
|
||||
{
|
||||
case Framework.ROUTER_TYPE_VEHICLE:
|
||||
mRouterTypes.check(R.id.vehicle);
|
||||
progressView = mProgressVehicle;
|
||||
}
|
||||
else if (router == Framework.ROUTER_TYPE_PEDESTRIAN)
|
||||
{
|
||||
break;
|
||||
case Framework.ROUTER_TYPE_PEDESTRIAN:
|
||||
mRouterTypes.check(R.id.pedestrian);
|
||||
progressView = mProgressPedestrian;
|
||||
}
|
||||
// else if (router == Framework.ROUTER_TYPE_TAXI)
|
||||
// {
|
||||
// mRouterTypes.check(R.id.taxi);
|
||||
// progressView = mProgressTaxi;
|
||||
// }
|
||||
else if (router == Framework.ROUTER_TYPE_TRANSIT)
|
||||
{
|
||||
break;
|
||||
//case Framework.ROUTER_TYPE_TAXI:
|
||||
// {
|
||||
// mRouterTypes.check(R.id.taxi);
|
||||
// progressView = mProgressTaxi;
|
||||
// }
|
||||
case Framework.ROUTER_TYPE_TRANSIT:
|
||||
mRouterTypes.check(R.id.transit);
|
||||
progressView = mProgressTransit;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
case Framework.ROUTER_TYPE_BICYCLE:
|
||||
mRouterTypes.check(R.id.bicycle);
|
||||
progressView = mProgressBicycle;
|
||||
break;
|
||||
case Framework.ROUTER_TYPE_HELICOPTER:
|
||||
mRouterTypes.check(R.id.helicopter);
|
||||
progressView = mProgressHelicopter;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("unknown router: " + router);
|
||||
}
|
||||
|
||||
RoutingToolbarButton button = mRouterTypes
|
||||
|
|
|
@ -57,6 +57,11 @@ public class PlacePageButtonFactory
|
|||
titleId = R.string.avoid_ferry_crossing_placepage;
|
||||
iconId = R.drawable.ic_avoid_ferry;
|
||||
break;
|
||||
case ROUTE_CONTINUE:
|
||||
case ROUTE_TO_OR_CONTINUE:
|
||||
titleId = R.string.next_button;
|
||||
iconId = R.drawable.ic_route_continue;
|
||||
break;
|
||||
case SHARE:
|
||||
titleId = R.string.share;
|
||||
iconId = R.drawable.ic_share;
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.PopupMenu;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.AttrRes;
|
||||
|
@ -15,6 +19,7 @@ import androidx.core.view.ViewCompat;
|
|||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import app.organicmaps.MwmApplication;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.util.Graphics;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
|
@ -26,6 +31,8 @@ import java.util.List;
|
|||
public final class PlacePageButtons extends Fragment implements Observer<List<PlacePageButtons.ButtonType>>
|
||||
{
|
||||
public static final String PLACEPAGE_MORE_MENU_ID = "PLACEPAGE_MORE_MENU_BOTTOM_SHEET";
|
||||
private static final String BUTTON_ROUTE_FINISH_OPTION = "button_route_finish_option";
|
||||
|
||||
private int mMaxButtons;
|
||||
|
||||
private PlacePageButtonClickListener mItemListener;
|
||||
|
@ -110,23 +117,92 @@ public final class PlacePageButtons extends Fragment implements Observer<List<Pl
|
|||
private View createButton(@NonNull final PlacePageButton current)
|
||||
{
|
||||
LayoutInflater inflater = LayoutInflater.from(requireContext());
|
||||
View parent = inflater.inflate(R.layout.place_page_button, mButtonsContainer, false);
|
||||
final View parent = inflater.inflate(R.layout.place_page_button, mButtonsContainer, false);
|
||||
|
||||
ImageView icon = parent.findViewById(R.id.icon);
|
||||
TextView title = parent.findViewById(R.id.title);
|
||||
boolean isMultiButton = current.getType() == ButtonType.ROUTE_TO_OR_CONTINUE;
|
||||
|
||||
title.setText(current.getTitle());
|
||||
@AttrRes final int tint = current.getType() == ButtonType.BOOKMARK_DELETE
|
||||
int actualTitle = current.getTitle();
|
||||
int actualIcon = current.getIcon();
|
||||
ButtonType actualType = current.getType();
|
||||
|
||||
if (isMultiButton)
|
||||
{
|
||||
// Read selected option
|
||||
List<ButtonType> types = List.of(ButtonType.ROUTE_TO, ButtonType.ROUTE_CONTINUE);
|
||||
int pickedButton = MwmApplication.prefs(requireContext()).getInt(BUTTON_ROUTE_FINISH_OPTION, 0);
|
||||
if (pickedButton < 0 || pickedButton>=types.size())
|
||||
pickedButton = 0;
|
||||
actualType = types.get(pickedButton);
|
||||
|
||||
PlacePageButton actualButton = PlacePageButtonFactory.createButton(actualType, requireContext());
|
||||
actualTitle = actualButton.getTitle();
|
||||
actualIcon = actualButton.getIcon();
|
||||
|
||||
// Show up arrow icon
|
||||
ImageView iconUp = parent.findViewById(R.id.icon_up);
|
||||
iconUp.setImageDrawable(Graphics.tint(getContext(), R.drawable.ic_triangle_up, R.attr.iconTint));
|
||||
UiUtils.show(iconUp);
|
||||
|
||||
parent.setOnLongClickListener((v) -> {
|
||||
showButtonsSelectMenu(parent, types, BUTTON_ROUTE_FINISH_OPTION);
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
setButtonType(parent, actualType, actualTitle, actualIcon);
|
||||
return parent;
|
||||
}
|
||||
|
||||
private void showButtonsSelectMenu(View buttonView, List<ButtonType> types, String prefsKey)
|
||||
{
|
||||
final PopupMenu popup = new PopupMenu(requireContext(), buttonView);
|
||||
final Menu menu = popup.getMenu();
|
||||
|
||||
for (int i=0; i < types.size(); i++)
|
||||
{
|
||||
PlacePageButton buttonData = PlacePageButtonFactory.createButton(types.get(i), requireContext());
|
||||
MenuItem item = menu.add(Menu.NONE, i, i, buttonData.getTitle());
|
||||
item.setIcon(Graphics.tint(getContext(), buttonData.getIcon(), R.attr.iconTint));
|
||||
}
|
||||
|
||||
popup.setOnMenuItemClickListener(item -> {
|
||||
final int selectedFinishOption = item.getItemId();
|
||||
MwmApplication.prefs(requireContext())
|
||||
.edit()
|
||||
.putInt(prefsKey, selectedFinishOption)
|
||||
.apply();
|
||||
|
||||
final ButtonType selectedType = types.get(selectedFinishOption);
|
||||
final PlacePageButton selectedButton = PlacePageButtonFactory.createButton(selectedType, requireContext());
|
||||
setButtonType(buttonView, selectedType, selectedButton.getTitle(), selectedButton.getIcon());
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||
popup.setForceShowIcon(true);
|
||||
|
||||
popup.show();
|
||||
}
|
||||
|
||||
private void setButtonType(@NonNull View buttonView, @NonNull ButtonType buttonType,
|
||||
int title, int icon) {
|
||||
ImageView iconImg = buttonView.findViewById(R.id.icon);
|
||||
TextView titleTv = buttonView.findViewById(R.id.title);
|
||||
|
||||
titleTv.setText(title);
|
||||
@AttrRes final int tint = buttonType == ButtonType.BOOKMARK_DELETE
|
||||
? R.attr.iconTintActive
|
||||
: R.attr.iconTint;
|
||||
icon.setImageDrawable(Graphics.tint(getContext(), current.getIcon(), tint));
|
||||
parent.setOnClickListener((view) -> {
|
||||
if (current.getType() == ButtonType.MORE)
|
||||
iconImg.setImageDrawable(Graphics.tint(getContext(), icon, tint));
|
||||
|
||||
buttonView.setOnClickListener((view) -> {
|
||||
if (buttonType == ButtonType.MORE)
|
||||
showMoreBottomSheet();
|
||||
else
|
||||
mItemListener.onPlacePageButtonClick(current.getType());
|
||||
mItemListener.onPlacePageButtonClick(buttonType);
|
||||
});
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -147,6 +223,8 @@ public final class PlacePageButtons extends Fragment implements Observer<List<Pl
|
|||
ROUTE_AVOID_TOLL,
|
||||
ROUTE_AVOID_FERRY,
|
||||
ROUTE_AVOID_UNPAVED,
|
||||
ROUTE_CONTINUE,
|
||||
ROUTE_TO_OR_CONTINUE,
|
||||
SHARE,
|
||||
MORE
|
||||
}
|
||||
|
|
|
@ -458,23 +458,20 @@ public class PlacePageController implements Initializable<Activity>,
|
|||
if (needToShowRoutingButtons)
|
||||
buttons.add(PlacePageButtons.ButtonType.ROUTE_FROM);
|
||||
|
||||
// If we can show the add route button, put it in the place of the bookmark button
|
||||
// And move the bookmark button at the end
|
||||
if (needToShowRoutingButtons && RoutingController.get().isStopPointAllowed())
|
||||
buttons.add(PlacePageButtons.ButtonType.ROUTE_ADD);
|
||||
else
|
||||
buttons.add(mapObject.getMapObjectType() == MapObject.BOOKMARK
|
||||
? PlacePageButtons.ButtonType.BOOKMARK_DELETE
|
||||
: PlacePageButtons.ButtonType.BOOKMARK_SAVE);
|
||||
buttons.add(mapObject.getMapObjectType() == MapObject.BOOKMARK
|
||||
? PlacePageButtons.ButtonType.BOOKMARK_DELETE
|
||||
: PlacePageButtons.ButtonType.BOOKMARK_SAVE);
|
||||
|
||||
if (needToShowRoutingButtons)
|
||||
{
|
||||
buttons.add(PlacePageButtons.ButtonType.ROUTE_TO);
|
||||
if (RoutingController.get().isPlanning() && RoutingController.get().hasEndPoint())
|
||||
buttons.add(PlacePageButtons.ButtonType.ROUTE_CONTINUE);
|
||||
|
||||
if (RoutingController.get().isStopPointAllowed())
|
||||
buttons.add(mapObject.getMapObjectType() == MapObject.BOOKMARK
|
||||
? PlacePageButtons.ButtonType.BOOKMARK_DELETE
|
||||
: PlacePageButtons.ButtonType.BOOKMARK_SAVE);
|
||||
buttons.add(PlacePageButtons.ButtonType.ROUTE_ADD);
|
||||
}
|
||||
|
||||
buttons.add(PlacePageButtons.ButtonType.SHARE);
|
||||
}
|
||||
mViewModel.setCurrentButtons(buttons);
|
||||
|
|
|
@ -323,6 +323,10 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
|
|||
case ROUTE_AVOID_FERRY:
|
||||
onAvoidFerryBtnClicked();
|
||||
break;
|
||||
|
||||
case ROUTE_CONTINUE:
|
||||
onRouteContinueBtnClicked();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -389,6 +393,21 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
|
|||
RoutingController.get().addStop(mMapObject);
|
||||
}
|
||||
|
||||
private void onRouteContinueBtnClicked()
|
||||
{
|
||||
RoutingController controller = RoutingController.get();
|
||||
if (controller.isPlanning())
|
||||
{
|
||||
controller.continueToPoint(mMapObject);
|
||||
mPlacePageViewListener.onPlacePageRequestClose();
|
||||
}
|
||||
else
|
||||
{
|
||||
// This should never happen 'cause "Continue route" button is visible only in route planning mode
|
||||
((MwmActivity) requireActivity()).startLocationToPoint(mMapObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void onRouteRemoveBtnClicked()
|
||||
{
|
||||
RoutingController.get().removeStop(mMapObject);
|
||||
|
|
|
@ -308,6 +308,7 @@
|
|||
436207616
|
||||
437326080
|
||||
442260561
|
||||
442905727
|
||||
444234362
|
||||
451800027
|
||||
452984831
|
||||
|
@ -359,6 +360,7 @@
|
|||
1300793480
|
||||
1301043238
|
||||
1301133440
|
||||
1301433013
|
||||
1304608947
|
||||
1306780114
|
||||
1308576652
|
||||
|
|
|
@ -101613,6 +101613,10 @@ colors {
|
|||
name: "RouteFakeOutline"
|
||||
color: 7434609
|
||||
}
|
||||
value {
|
||||
name: "RouteHelicopter"
|
||||
color: 442905727
|
||||
}
|
||||
value {
|
||||
name: "RouteMarkPrimaryText"
|
||||
}
|
||||
|
|
|
@ -101699,6 +101699,10 @@ colors {
|
|||
name: "RouteFakeOutline"
|
||||
color: 7434609
|
||||
}
|
||||
value {
|
||||
name: "RouteHelicopter"
|
||||
color: 1301433013
|
||||
}
|
||||
value {
|
||||
name: "RouteMarkPrimaryText"
|
||||
color: 8947848
|
||||
|
|
|
@ -73881,6 +73881,10 @@ colors {
|
|||
name: "RouteFakeOutline"
|
||||
color: 7434609
|
||||
}
|
||||
value {
|
||||
name: "RouteHelicopter"
|
||||
color: 857551774
|
||||
}
|
||||
value {
|
||||
name: "RouteMarkPrimaryText"
|
||||
}
|
||||
|
|
|
@ -74206,6 +74206,10 @@ colors {
|
|||
name: "RouteFakeOutline"
|
||||
color: 7434609
|
||||
}
|
||||
value {
|
||||
name: "RouteHelicopter"
|
||||
color: 1308604747
|
||||
}
|
||||
value {
|
||||
name: "RouteMarkPrimaryText"
|
||||
color: 8947848
|
||||
|
|
|
@ -36,6 +36,8 @@ colors
|
|||
RoutePedestrian-opacity: 0.8;
|
||||
RouteBicycle-color: #9C27B0;
|
||||
RouteBicycle-opacity: 0.8;
|
||||
RouteHelicopter-color: #66347F;
|
||||
RouteHelicopter-opacity: 0.9;
|
||||
RoutePreview-color: #000000;
|
||||
RoutePreview-opacity: 0.3;
|
||||
RouteMaskCar-color: #000000;
|
||||
|
|
|
@ -36,6 +36,8 @@ colors
|
|||
RoutePedestrian-opacity: 0.7;
|
||||
RouteBicycle-color: #FF4B8C;
|
||||
RouteBicycle-opacity: 0.7;
|
||||
RouteHelicopter-color: #924ab5;
|
||||
RouteHelicopter-opacity: 0.7;
|
||||
RoutePreview-color: #FFFFFF;
|
||||
RoutePreview-opacity: 0.3;
|
||||
RouteMaskCar-color: #000000;
|
||||
|
|
|
@ -36,6 +36,8 @@ colors
|
|||
RoutePedestrian-opacity: 0.8;
|
||||
RouteBicycle-color: #9C27B0;
|
||||
RouteBicycle-opacity: 0.8;
|
||||
RouteHelicopter-color: #1D339E;
|
||||
RouteHelicopter-opacity: 0.8;
|
||||
RoutePreview-color: #000000;
|
||||
RoutePreview-opacity: 0.3;
|
||||
RouteMaskCar-color: #000000;
|
||||
|
|
|
@ -36,6 +36,8 @@ colors
|
|||
RoutePedestrian-opacity: 0.7;
|
||||
RouteBicycle-color: #FF4B8C;
|
||||
RouteBicycle-opacity: 0.7;
|
||||
RouteHelicopter-color: #FFB94B;
|
||||
RouteHelicopter-opacity: 0.7;
|
||||
RoutePreview-color: #FFFFFF;
|
||||
RoutePreview-opacity: 0.3;
|
||||
RouteMaskCar-color: #000000;
|
||||
|
|
|
@ -17,6 +17,7 @@ std::string const kRouteColor = "Route";
|
|||
std::string const kRouteOutlineColor = "RouteOutline";
|
||||
std::string const kRoutePedestrian = "RoutePedestrian";
|
||||
std::string const kRouteBicycle = "RouteBicycle";
|
||||
std::string const kRouteHelicopter = "RouteHelicopter";
|
||||
std::string const kRoutePreview = "RoutePreview";
|
||||
std::string const kRouteMaskCar = "RouteMaskCar";
|
||||
std::string const kRouteArrowsMaskCar = "RouteArrowsMaskCar";
|
||||
|
|
|
@ -24,6 +24,7 @@ extern std::string const kRouteColor;
|
|||
extern std::string const kRouteOutlineColor;
|
||||
extern std::string const kRoutePedestrian;
|
||||
extern std::string const kRouteBicycle;
|
||||
extern std::string const kRouteHelicopter;
|
||||
extern std::string const kTransitStopInnerMarkerColor;
|
||||
|
||||
class RouteRenderer final
|
||||
|
|
|
@ -46,7 +46,8 @@ enum class RouteType : uint8_t
|
|||
Pedestrian,
|
||||
Bicycle,
|
||||
Taxi,
|
||||
Transit
|
||||
Transit,
|
||||
Helicopter
|
||||
};
|
||||
|
||||
struct RoutePattern
|
||||
|
|
|
@ -69,10 +69,13 @@ UIImage *image(routing::turns::PedestrianDirection t) {
|
|||
}
|
||||
|
||||
NSAttributedString *estimate(NSTimeInterval time, NSString *distance, NSString *distanceUnits,
|
||||
NSDictionary *primaryAttributes, NSDictionary *secondaryAttributes, BOOL isWalk) {
|
||||
NSString *eta = [NSDateComponentsFormatter etaStringFrom:time];
|
||||
auto result = [[NSMutableAttributedString alloc] initWithString:eta attributes:primaryAttributes];
|
||||
[result appendAttributedString:MWMNavigationDashboardEntity.estimateDot];
|
||||
NSDictionary *primaryAttributes, NSDictionary *secondaryAttributes, BOOL isWalk, BOOL showEta) {
|
||||
auto result = [[NSMutableAttributedString alloc] initWithString:@""];
|
||||
if (showEta) {
|
||||
NSString *eta = [NSDateComponentsFormatter etaStringFrom:time];
|
||||
[result appendAttributedString:[[NSMutableAttributedString alloc] initWithString:eta attributes:primaryAttributes]];
|
||||
[result appendAttributedString:MWMNavigationDashboardEntity.estimateDot];
|
||||
}
|
||||
|
||||
if (isWalk) {
|
||||
UIFont *font = primaryAttributes[NSFontAttributeName];
|
||||
|
@ -163,6 +166,8 @@ NSAttributedString *estimate(NSTimeInterval time, NSString *distance, NSString *
|
|||
}
|
||||
|
||||
if (auto entity = self.entity) {
|
||||
BOOL showEta = (type != MWMRouterTypeHelicopter);
|
||||
|
||||
entity.isValid = YES;
|
||||
entity.timeToTarget = info.m_time;
|
||||
entity.targetDistance = @(info.m_distToTarget.c_str());
|
||||
|
@ -174,7 +179,7 @@ NSAttributedString *estimate(NSTimeInterval time, NSString *distance, NSString *
|
|||
entity.speedLimitMps = info.m_speedLimitMps;
|
||||
|
||||
entity.estimate = estimate(entity.timeToTarget, entity.targetDistance, entity.targetUnits,
|
||||
self.etaAttributes, self.etaSecondaryAttributes, NO);
|
||||
self.etaAttributes, self.etaSecondaryAttributes, NO, showEta);
|
||||
|
||||
if (type == MWMRouterTypePedestrian) {
|
||||
entity.turnImage = image(info.m_pedestrianTurn);
|
||||
|
@ -200,7 +205,7 @@ NSAttributedString *estimate(NSTimeInterval time, NSString *distance, NSString *
|
|||
entity.isValid = YES;
|
||||
entity.estimate =
|
||||
estimate(info.m_totalTimeInSec, @(info.m_totalPedestrianDistanceStr.c_str()),
|
||||
@(info.m_totalPedestrianUnitsSuffix.c_str()), self.etaAttributes, self.etaSecondaryAttributes, YES);
|
||||
@(info.m_totalPedestrianUnitsSuffix.c_str()), self.etaAttributes, self.etaSecondaryAttributes, YES, YES);
|
||||
NSMutableArray<MWMRouterTransitStepInfo *> *transitSteps = [@[] mutableCopy];
|
||||
for (auto const &stepInfo : info.m_steps)
|
||||
[transitSteps addObject:[[MWMRouterTransitStepInfo alloc] initWithStepInfo:stepInfo]];
|
||||
|
|
|
@ -176,13 +176,19 @@ NSString *const kNavigationControlViewXibName = @"NavigationControlView";
|
|||
[self setRouteBuilderProgress:100.];
|
||||
[self updateGoButtonTitle];
|
||||
auto const isTransport = ([MWMRouter type] == MWMRouterTypePublicTransport);
|
||||
auto const isHelicopter = ([MWMRouter type] == MWMRouterTypeHelicopter);
|
||||
if (isTransport)
|
||||
[self.transportRoutePreviewStatus showReady];
|
||||
else
|
||||
[self.baseRoutePreviewStatus showReady];
|
||||
self.goButtonsContainer.hidden = isTransport;
|
||||
self.goButtonsContainer.hidden = (isTransport || isHelicopter);
|
||||
for (MWMRouteStartButton *button in self.goButtons)
|
||||
[button stateReady];
|
||||
{
|
||||
if (isHelicopter)
|
||||
[button stateHidden];
|
||||
else
|
||||
[button stateReady];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onRouteStart {
|
||||
|
|
|
@ -73,6 +73,7 @@ static CGFloat const kDrivingOptionsHeight = 48;
|
|||
imageName:@"ic_train"
|
||||
routerType:MWMRouterTypePublicTransport];
|
||||
[self addProgress:self.bicycle imageName:@"ic_bike" routerType:MWMRouterTypeBicycle];
|
||||
[self addProgress:self.helicopter imageName:@"ic_helicopter" routerType:MWMRouterTypeHelicopter];
|
||||
}
|
||||
|
||||
- (void)addProgress:(UIView *)parentView
|
||||
|
|
|
@ -139,9 +139,6 @@
|
|||
<constraint firstItem="jDl-pu-eov" firstAttribute="top" secondItem="sXu-tl-a0m" secondAttribute="top" id="sf1-S5-kmZ"/>
|
||||
</constraints>
|
||||
<variation key="default">
|
||||
<mask key="subviews">
|
||||
<exclude reference="f6i-lw-K3R"/>
|
||||
</mask>
|
||||
<mask key="constraints">
|
||||
<exclude reference="BWr-hr-pwo"/>
|
||||
<exclude reference="Cd3-ev-uFS"/>
|
||||
|
@ -459,7 +456,7 @@
|
|||
<outlet property="drivingOptionsButton" destination="Opi-yT-xIZ" id="tMG-Af-HEo"/>
|
||||
<outlet property="pedestrian" destination="VhE-hA-Leo" id="R3O-th-Jw0"/>
|
||||
<outlet property="publicTransport" destination="Eu3-bT-Dom" id="XNh-uW-Kog"/>
|
||||
<outlet property="taxi" destination="f6i-lw-K3R" id="s0G-le-Kbz"/>
|
||||
<outlet property="helicopter" destination="f6i-lw-K3R" id="s0G-le-Kbz"/>
|
||||
<outlet property="vehicle" destination="jDl-pu-eov" id="awM-KI-2xO"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="448" y="573.46326836581716"/>
|
||||
|
|
|
@ -142,17 +142,6 @@
|
|||
<variation key="heightClass=compact" constant="16"/>
|
||||
</constraint>
|
||||
</constraints>
|
||||
<variation key="default">
|
||||
<mask key="subviews">
|
||||
<exclude reference="15Q-ZN-NzE"/>
|
||||
</mask>
|
||||
<mask key="constraints">
|
||||
<exclude reference="D1r-cA-jTR"/>
|
||||
<exclude reference="WHK-N0-dCc"/>
|
||||
<exclude reference="Wve-9m-8zL"/>
|
||||
<exclude reference="my7-I5-Qu3"/>
|
||||
</mask>
|
||||
</variation>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.12156862745098039" green="0.59999999999999998" blue="0.32156862745098036" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
|
|
|
@ -15,6 +15,11 @@ final class RouteStartButton: UIButton {
|
|||
isEnabled = true
|
||||
}
|
||||
|
||||
@objc func stateHidden() {
|
||||
isHidden = true
|
||||
isEnabled = true
|
||||
}
|
||||
|
||||
override func applyTheme() {
|
||||
super.applyTheme()
|
||||
setBackgroundImage(UIColor.linkBlue().getImage(), for: .normal)
|
||||
|
|
|
@ -10,6 +10,7 @@ static inline routing::RouterType coreRouterType(MWMRouterType type)
|
|||
case MWMRouterTypePedestrian: return routing::RouterType::Pedestrian;
|
||||
case MWMRouterTypePublicTransport: return routing::RouterType::Transit;
|
||||
case MWMRouterTypeBicycle: return routing::RouterType::Bicycle;
|
||||
case MWMRouterTypeHelicopter: return routing::RouterType::Helicopter;
|
||||
default:
|
||||
ASSERT(false, ("Invalid routing type"));
|
||||
return routing::RouterType::Vehicle;
|
||||
|
@ -24,6 +25,7 @@ static inline MWMRouterType routerType(routing::RouterType type)
|
|||
case routing::RouterType::Transit: return MWMRouterTypePublicTransport;
|
||||
case routing::RouterType::Pedestrian: return MWMRouterTypePedestrian;
|
||||
case routing::RouterType::Bicycle: return MWMRouterTypeBicycle;
|
||||
case routing::RouterType::Helicopter: return MWMRouterTypeHelicopter;
|
||||
default:
|
||||
ASSERT(false, ("Invalid routing type"));
|
||||
return MWMRouterTypeVehicle;
|
||||
|
|
|
@ -55,6 +55,7 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm
|
|||
switch ([self type]) {
|
||||
case MWMRouterTypeVehicle:
|
||||
case MWMRouterTypePublicTransport:
|
||||
case MWMRouterTypeHelicopter:
|
||||
return NO;
|
||||
case MWMRouterTypePedestrian:
|
||||
case MWMRouterTypeBicycle:
|
||||
|
|
|
@ -3,4 +3,5 @@ typedef NS_ENUM(NSUInteger, MWMRouterType) {
|
|||
MWMRouterTypePedestrian,
|
||||
MWMRouterTypePublicTransport,
|
||||
MWMRouterTypeBicycle,
|
||||
MWMRouterTypeHelicopter,
|
||||
};
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "routing/absent_regions_finder.hpp"
|
||||
#include "routing/checkpoint_predictor.hpp"
|
||||
#include "routing/helicopter_router.hpp"
|
||||
#include "routing/index_router.hpp"
|
||||
#include "routing/route.hpp"
|
||||
#include "routing/routing_callbacks.hpp"
|
||||
|
@ -200,6 +201,7 @@ VehicleType GetVehicleType(RouterType routerType)
|
|||
case RouterType::Bicycle: return VehicleType::Bicycle;
|
||||
case RouterType::Vehicle: return VehicleType::Car;
|
||||
case RouterType::Transit: return VehicleType::Transit;
|
||||
case RouterType::Helicopter: return VehicleType::Transit;
|
||||
case RouterType::Count: CHECK(false, ("Invalid type", routerType)); return VehicleType::Count;
|
||||
}
|
||||
UNREACHABLE();
|
||||
|
@ -479,7 +481,8 @@ RouterType RoutingManager::GetLastUsedRouter() const
|
|||
{
|
||||
case RouterType::Pedestrian:
|
||||
case RouterType::Bicycle:
|
||||
case RouterType::Transit: return routerType;
|
||||
case RouterType::Transit:
|
||||
case RouterType::Helicopter: return routerType;
|
||||
default: return RouterType::Vehicle;
|
||||
}
|
||||
}
|
||||
|
@ -517,10 +520,14 @@ void RoutingManager::SetRouterImpl(RouterType type)
|
|||
auto regionsFinder =
|
||||
make_unique<AbsentRegionsFinder>(countryFileGetter, localFileChecker, numMwmIds, dataSource);
|
||||
|
||||
auto router = make_unique<IndexRouter>(vehicleType, m_loadAltitudes, m_callbacks.m_countryParentNameGetterFn,
|
||||
std::unique_ptr<IRouter> router;
|
||||
if (type != RouterType::Helicopter)
|
||||
router = make_unique<IndexRouter>(vehicleType, m_loadAltitudes, m_callbacks.m_countryParentNameGetterFn,
|
||||
countryFileGetter, getMwmRectByName, numMwmIds,
|
||||
MakeNumMwmTree(*numMwmIds, m_callbacks.m_countryInfoGetter()),
|
||||
m_routingSession, dataSource);
|
||||
else
|
||||
router = make_unique<HelicopterRouter>();
|
||||
|
||||
m_routingSession.SetRoutingSettings(GetRoutingSettings(vehicleType));
|
||||
m_routingSession.SetRouter(move(router), move(regionsFinder));
|
||||
|
@ -668,7 +675,8 @@ bool RoutingManager::InsertRoute(Route const & route)
|
|||
|
||||
auto const startPt = route.GetSubrouteAttrs(subrouteIndex).GetStart().GetPoint();
|
||||
auto subroute = CreateDrapeSubroute(segments, startPt, distance,
|
||||
static_cast<double>(subroutesCount - subrouteIndex - 1), isTransitRoute);
|
||||
static_cast<double>(subroutesCount - subrouteIndex - 1),
|
||||
isTransitRoute);
|
||||
if (!subroute)
|
||||
continue;
|
||||
distance = segments.back().GetDistFromBeginningMerc();
|
||||
|
@ -702,6 +710,14 @@ bool RoutingManager::InsertRoute(Route const & route)
|
|||
FillTurnsDistancesForRendering(segments, subroute->m_baseDistance, subroute->m_turns);
|
||||
break;
|
||||
}
|
||||
case RouterType::Helicopter:
|
||||
{
|
||||
subroute->m_routeType = df::RouteType::Helicopter;
|
||||
subroute->m_headFakeDistance = -1.0f;
|
||||
subroute->m_tailFakeDistance = 90.0f; //Assuming that Helicopter line is shorter than 90°. Otherwise line tail would have a gray color.
|
||||
subroute->AddStyle(df::SubrouteStyle(df::kRouteHelicopter, df::RoutePattern(16.0, 2.0)));
|
||||
break;
|
||||
}
|
||||
default: CHECK(false, ("Unknown router type"));
|
||||
}
|
||||
|
||||
|
@ -838,6 +854,30 @@ void RoutingManager::AddRoutePoint(RouteMarkData && markData)
|
|||
ReorderIntermediatePoints();
|
||||
}
|
||||
|
||||
void RoutingManager::ContinueRouteToPoint(RouteMarkData && markData)
|
||||
{
|
||||
ASSERT(m_bmManager != nullptr, ());
|
||||
ASSERT(markData.m_pointType == RouteMarkType::Finish, ("New route point should have type RouteMarkType::Finish"));
|
||||
RoutePointsLayout routePoints(*m_bmManager);
|
||||
|
||||
// Finish point is now Intermediate point
|
||||
RouteMarkPoint * finishMarkData = routePoints.GetRoutePointForEdit(RouteMarkType::Finish);
|
||||
finishMarkData->SetRoutePointType(RouteMarkType::Intermediate);
|
||||
finishMarkData->SetIntermediateIndex(routePoints.GetRoutePointsCount()-1);
|
||||
|
||||
if (markData.m_isMyPosition)
|
||||
{
|
||||
RouteMarkPoint const * mark = routePoints.GetMyPositionPoint();
|
||||
if (mark)
|
||||
routePoints.RemoveRoutePoint(mark->GetRoutePointType(), mark->GetIntermediateIndex());
|
||||
}
|
||||
|
||||
markData.m_intermediateIndex = routePoints.GetRoutePointsCount();
|
||||
markData.m_isVisible = !markData.m_isMyPosition;
|
||||
routePoints.AddRoutePoint(move(markData));
|
||||
ReorderIntermediatePoints();
|
||||
}
|
||||
|
||||
void RoutingManager::RemoveRoutePoint(RouteMarkType type, size_t intermediateIndex)
|
||||
{
|
||||
ASSERT(m_bmManager != nullptr, ());
|
||||
|
|
|
@ -226,6 +226,7 @@ public:
|
|||
void GenerateNotifications(std::vector<std::string> & notifications);
|
||||
|
||||
void AddRoutePoint(RouteMarkData && markData);
|
||||
void ContinueRouteToPoint(RouteMarkData && markData);
|
||||
std::vector<RouteMarkData> GetRoutePoints() const;
|
||||
size_t GetRoutePointsCount() const;
|
||||
void RemoveRoutePoint(RouteMarkType type, size_t intermediateIndex = 0);
|
||||
|
|
|
@ -133,6 +133,7 @@ RoutingSettings::RoutingSettings(QWidget * parent, Framework & framework)
|
|||
m_routerType->insertItem(static_cast<int>(RouterType::Pedestrian), "pedestrian");
|
||||
m_routerType->insertItem(static_cast<int>(RouterType::Bicycle), "bicycle");
|
||||
m_routerType->insertItem(static_cast<int>(RouterType::Transit), "transit");
|
||||
m_routerType->insertItem(static_cast<int>(RouterType::Helicopter), "helicopter");
|
||||
form->addRow("Choose router:", m_routerType);
|
||||
|
||||
m_showTurnsCheckbox = new QCheckBox({}, frame);
|
||||
|
|
|
@ -60,6 +60,8 @@ set(SRC
|
|||
guides_connections.hpp
|
||||
guides_graph.cpp
|
||||
guides_graph.hpp
|
||||
helicopter_router.cpp
|
||||
helicopter_router.hpp
|
||||
index_graph.cpp
|
||||
index_graph.hpp
|
||||
index_graph_loader.cpp
|
||||
|
|
|
@ -371,17 +371,21 @@ void AsyncRouter::CalculateRoute()
|
|||
[delegateProxy, route, code]() { delegateProxy->OnReady(route, code); });
|
||||
}
|
||||
|
||||
bool const needAbsentRegions = (code != RouterResultCode::Cancelled);
|
||||
bool const needAbsentRegions = (code != RouterResultCode::Cancelled &&
|
||||
route->GetRouterId() != "helicopter-router");
|
||||
|
||||
strump
commented
How to replace string comparison here? How to replace string comparison here?
![]() That line is not called too often, so should be ok. I would also try to reuse a router-id constexpr constant instead of copy-pasting a string. Or maybe add a method like route->IsHelicopterRouter() That line is not called too often, so should be ok. I would also try to reuse a router-id constexpr constant instead of copy-pasting a string. Or maybe add a method like route->IsHelicopterRouter()
|
||||
std::set<std::string> absent;
|
||||
if (absentRegionsFinder && needAbsentRegions)
|
||||
absentRegionsFinder->GetAbsentRegions(absent);
|
||||
|
||||
absent.insert(route->GetAbsentCountries().cbegin(), route->GetAbsentCountries().cend());
|
||||
if (!absent.empty())
|
||||
if (needAbsentRegions)
|
||||
{
|
||||
code = RouterResultCode::NeedMoreMaps;
|
||||
LOG(LDEBUG, ("Absent regions:", absent));
|
||||
if (absentRegionsFinder)
|
||||
absentRegionsFinder->GetAbsentRegions(absent);
|
||||
|
||||
absent.insert(route->GetAbsentCountries().cbegin(), route->GetAbsentCountries().cend());
|
||||
if (!absent.empty())
|
||||
{
|
||||
code = RouterResultCode::NeedMoreMaps;
|
||||
LOG(LDEBUG, ("Absent regions:", absent));
|
||||
}
|
||||
}
|
||||
|
||||
elapsedSec = timer.ElapsedSeconds(); // routing time + absents fetch time
|
||||
|
|
139
routing/helicopter_router.cpp
Normal file
|
@ -0,0 +1,139 @@
|
|||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
#include "routing/helicopter_router.hpp"
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
#include "routing/route.hpp"
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
#include "routing/routing_helpers.hpp"
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
namespace routing
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
using namespace std;
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
void HelicopterRouter::ClearState()
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
}
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
void HelicopterRouter::SetGuides(GuidesTracks && guides) { /*m_guides = GuidesConnections(guides);*/ }
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
/* Helicopter router doesn't read roads graph and uses only checkpoints to build a route.
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
1-----------2
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
/ \
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
/ \
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
/ F
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
S
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
For example we need to build route from start (S) to finish (F) with intermidiate
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
points (1) and (2).
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
Target route should have parameters:
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
m_geometry = [S, S, 1, 1, 2, 2, F, F]
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
m_routeSegments = [S, 1, 1, 2, 2, F, F]
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
m_subroutes =
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
+-------+--------+-----------------+---------------+
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
| start | finish | beginSegmentIdx | endSegmentIdx |
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
+-------+--------+-----------------+---------------+
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
| S | 1 | 0 | 1 |
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
| 1 | 1 | 1 | 2 |
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
| 1 | 2 | 2 | 3 |
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
| 2 | 2 | 3 | 4 |
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
| 2 | F | 4 | 6 |
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
| 2 | F | 4 | 6 |
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
+-------+--------+-----------------+---------------+
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
Constraints:
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
* m_geometry.size() == 2 * checkpoints.size()
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
* m_routeSegments.size() == m_geometry.size()-1
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
* m_subroutes.size() == m_routeSegments.size()-1
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
*/
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
RouterResultCode HelicopterRouter::CalculateRoute(Checkpoints const & checkpoints,
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
m2::PointD const & startDirection,
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
![]() Выравнивание? Выравнивание?
|
||||
bool adjustToPrevRoute,
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
RouterDelegate const & delegate, Route & route)
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
vector<m2::PointD> const & points = checkpoints.GetPoints();
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
geometry::Altitude const mockAltitude = 0;
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
vector<RouteSegment> routeSegments;
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
vector<double> times;
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
times.reserve(points.size()*2-1);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
Segment const segment(kFakeNumMwmId, 0, 0, false);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
for (size_t i = 0; i < points.size(); ++i)
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
turns::TurnItem turn(i, turns::PedestrianDirection::None);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
geometry::PointWithAltitude const junction(points[i], mockAltitude);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
RouteSegment::RoadNameInfo const roadNameInfo;
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
routeSegments.push_back(move(routeSegment));
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
times.push_back(0);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
if (i == points.size() - 1)
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
// Create final segment.
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
turn = turns::TurnItem(i+1, turns::PedestrianDirection::ReachedYourDestination);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
RouteSegment lastSegment = RouteSegment(segment, turn, junction, roadNameInfo);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
routeSegments.push_back(move(lastSegment));
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
times.push_back(0);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
}
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
else if (i > 0)
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
// Duplicate intermidiate points.
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
RouteSegment intermidiateSegment = RouteSegment(segment, turn, junction, roadNameInfo);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
routeSegments.push_back(move(intermidiateSegment));
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
times.push_back(0);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
}
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
}
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
FillSegmentInfo(times, routeSegments);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
route.SetRouteSegments(move(routeSegments));
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
vector<Route::SubrouteAttrs> subroutes;
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
for(size_t i = 1; i < points.size(); ++i)
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
if (i<points.size()-1)
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
auto subrt1 = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i-1], mockAltitude),
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
geometry::PointWithAltitude(points[i], mockAltitude), i*2-2, i*2-1);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
subroutes.push_back(move(subrt1));
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
auto subrt2 = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i-1], mockAltitude),
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
geometry::PointWithAltitude(points[i], mockAltitude), i*2-1, i*2);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
subroutes.push_back(move(subrt2));
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
}
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
else
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
// Duplicate last subroute attrs.
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i-1], mockAltitude),
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
geometry::PointWithAltitude(points[i+1], mockAltitude), i*2-2, i*2);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
subroutes.push_back(move(subrt));
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i-1], mockAltitude),
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
geometry::PointWithAltitude(points[i+1], mockAltitude), i*2-2, i*2);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
subroutes.push_back(move(subrt));
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
}
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
}
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
route.SetCurrentSubrouteIdx(checkpoints.GetPassedIdx());
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
route.SetSubroteAttrs(move(subroutes));
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
vector<m2::PointD> routeGeometry;
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
for (auto p: points)
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
routeGeometry.push_back(p);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
routeGeometry.push_back(p);
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
}
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
route.SetGeometry(routeGeometry.begin(), routeGeometry.end());
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
return RouterResultCode::NoError;
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
}
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
bool HelicopterRouter::FindClosestProjectionToRoad(m2::PointD const & point,
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
m2::PointD const & direction, double radius,
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
EdgeProj & proj)
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
//TODO
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
![]() Is it really needed? When is it used? Is it really needed? When is it used?
|
||||
return false;
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
}
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
||||
} // namespace routing
|
||||
![]() Не нужно создавать лишнюю копию вектора.
Не нужно создавать лишнюю копию вектора.
```suggestion
vector<m2::PointD> const & points = checkpoints.GetPoints();
```
![]()
```suggestion
Segment const segment(kFakeNumMwmId, 0, 0, false);
for (size_t i = 1; i < points.size(); ++i)
{
turns::TurnItem turn;
turn.m_index = i;
if (i == points.size() - 1)
turn.m_pedestrianTurn = turns::PedestrianDirection::ReachedYourDestination;
geometry::PointWithAltitude const junction(points[i], mockAltitude);
RouteSegment::RoadNameInfo const roadNameInfo;
auto routeSegment = RouteSegment(segment, turn, junction, roadNameInfo);
routeSegments.push_back(move(routeSegment));
}
```
![]()
```suggestion
for(size_t i = 1; i < points.size(); ++i)
{
auto subrt = Route::SubrouteAttrs(geometry::PointWithAltitude(points[i - 1], mockAltitude),
geometry::PointWithAltitude(points[i], mockAltitude), i - 1, i);
```
![]() indent indent
![]()
```suggestion
} // namespace routing
```
|
23
routing/helicopter_router.hpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
#pragma once
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
#include "routing/router.hpp"
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
#include <string>
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
namespace routing
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
class HelicopterRouter : public IRouter
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
{
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
std::string GetName() const override { return {"helicopter-router"}; }
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
void ClearState() override;
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
void SetGuides(GuidesTracks && guides) override;
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
RouterResultCode CalculateRoute(Checkpoints const & checkpoints,
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
m2::PointD const & startDirection, bool adjustToPrevRoute,
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
RouterDelegate const & delegate, Route & route) override;
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
bool FindClosestProjectionToRoad(m2::PointD const & point, m2::PointD const & direction,
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
double radius, EdgeProj & proj) override;
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
// Do we need guides in this router?
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
![]() @vng это о чём? @vng это о чём?
|
||||
//GuidesConnections m_guides;
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
};
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
||||
} // namespace routing
|
||||
![]()
```suggestion
std::string GetName() const override { return {"helicopter-router"}; }
```
![]()
```suggestion
} // namespace routing
```
|
|
@ -120,9 +120,11 @@ unique_ptr<DirectionsEngine> CreateDirectionsEngine(VehicleType vehicleType,
|
|||
switch (vehicleType)
|
||||
{
|
||||
case VehicleType::Pedestrian:
|
||||
case VehicleType::Transit: return make_unique<PedestrianDirectionsEngine>(dataSource, numMwmIds);
|
||||
case VehicleType::Transit:
|
||||
return make_unique<PedestrianDirectionsEngine>(dataSource, numMwmIds);
|
||||
case VehicleType::Bicycle:
|
||||
case VehicleType::Car: return make_unique<CarDirectionsEngine>(dataSource, numMwmIds);
|
||||
case VehicleType::Car:
|
||||
return make_unique<CarDirectionsEngine>(dataSource, numMwmIds);
|
||||
case VehicleType::Count:
|
||||
CHECK(false, ("Can't create DirectionsEngine for", vehicleType));
|
||||
return nullptr;
|
||||
|
|
|
@ -10,6 +10,7 @@ std::string ToString(RouterType type)
|
|||
case RouterType::Pedestrian: return "pedestrian";
|
||||
case RouterType::Bicycle: return "bicycle";
|
||||
case RouterType::Transit: return "transit";
|
||||
case RouterType::Helicopter: return "helicopter";
|
||||
case RouterType::Count: return "count";
|
||||
}
|
||||
ASSERT(false, ());
|
||||
|
@ -26,6 +27,8 @@ RouterType FromString(std::string const & str)
|
|||
return RouterType::Bicycle;
|
||||
if (str == "transit")
|
||||
return RouterType::Transit;
|
||||
if (str == "helicopter")
|
||||
return RouterType::Helicopter;
|
||||
|
||||
ASSERT(false, ("Incorrect routing string:", str));
|
||||
return RouterType::Vehicle;
|
||||
|
|
|
@ -43,6 +43,7 @@ enum class RouterType
|
|||
Pedestrian, /// For A star pedestrian routing.
|
||||
Bicycle, /// For A star bicycle routing.
|
||||
Transit, /// For A star pedestrian + transit routing.
|
||||
Helicopter, /// For simple straight line router.
|
||||
Count /// Number of router types.
|
||||
};
|
||||
|
||||
|
|
|
@ -79,6 +79,8 @@
|
|||
4433A8EB23993BD700E1350B /* leaps_graph.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4433A8EA23993BD700E1350B /* leaps_graph.hpp */; };
|
||||
4443DC3722789793000C8E32 /* leaps_postprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4443DC3522789793000C8E32 /* leaps_postprocessor.cpp */; };
|
||||
4443DC3822789793000C8E32 /* leaps_postprocessor.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4443DC3622789793000C8E32 /* leaps_postprocessor.hpp */; };
|
||||
44642D2D29CDA44700F8813A /* helicopter_router.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 44642D2B29CDA44600F8813A /* helicopter_router.hpp */; };
|
||||
44642D2E29CDA44700F8813A /* helicopter_router.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44642D2C29CDA44700F8813A /* helicopter_router.cpp */; };
|
||||
44A95C71225F6A4F00C22F4F /* astar_graph.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 44A95C6F225F6A4F00C22F4F /* astar_graph.hpp */; };
|
||||
44A95C72225F6A4F00C22F4F /* astar_progress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44A95C70225F6A4F00C22F4F /* astar_progress.cpp */; };
|
||||
44AE4A12214FBB8E006321F5 /* speed_camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44AE4A10214FBB8D006321F5 /* speed_camera.cpp */; };
|
||||
|
@ -363,6 +365,8 @@
|
|||
4433A8EA23993BD700E1350B /* leaps_graph.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = leaps_graph.hpp; sourceTree = "<group>"; };
|
||||
4443DC3522789793000C8E32 /* leaps_postprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = leaps_postprocessor.cpp; sourceTree = "<group>"; };
|
||||
4443DC3622789793000C8E32 /* leaps_postprocessor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = leaps_postprocessor.hpp; sourceTree = "<group>"; };
|
||||
44642D2B29CDA44600F8813A /* helicopter_router.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = helicopter_router.hpp; sourceTree = "<group>"; };
|
||||
44642D2C29CDA44700F8813A /* helicopter_router.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = helicopter_router.cpp; sourceTree = "<group>"; };
|
||||
448FD3F2228B1BC500180D90 /* bfs_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bfs_tests.cpp; sourceTree = "<group>"; };
|
||||
44A95C6F225F6A4F00C22F4F /* astar_graph.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = astar_graph.hpp; path = base/astar_graph.hpp; sourceTree = "<group>"; };
|
||||
44A95C70225F6A4F00C22F4F /* astar_progress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = astar_progress.cpp; sourceTree = "<group>"; };
|
||||
|
@ -685,6 +689,8 @@
|
|||
675343FA1A3F640D00A0A8C3 /* routing */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
44642D2C29CDA44700F8813A /* helicopter_router.cpp */,
|
||||
44642D2B29CDA44600F8813A /* helicopter_router.hpp */,
|
||||
ACAE44A327426EDB0054DD15 /* junction_visitor.cpp */,
|
||||
D549BEBC25765CFB009131F2 /* absent_regions_finder.cpp */,
|
||||
D549BEBA25765CFA009131F2 /* absent_regions_finder.hpp */,
|
||||
|
@ -931,6 +937,7 @@
|
|||
674F9BCD1B0A580E00704FFA /* features_road_graph.hpp in Headers */,
|
||||
40576F781F7A788B000B593B /* fake_vertex.hpp in Headers */,
|
||||
670EE5741B664796001E8064 /* pedestrian_directions.hpp in Headers */,
|
||||
44642D2D29CDA44700F8813A /* helicopter_router.hpp in Headers */,
|
||||
56CBED5522E9CE2600D51AF7 /* position_accumulator.hpp in Headers */,
|
||||
5694CECB1EBA25F7004576D3 /* road_access_serialization.hpp in Headers */,
|
||||
0C08AA371DF8324D004195DD /* vehicle_mask.hpp in Headers */,
|
||||
|
@ -1210,6 +1217,7 @@
|
|||
D5481E4F24BF4F70008FB1D8 /* mwm_hierarchy_handler.cpp in Sources */,
|
||||
0C5FEC641DDE192A0017688C /* joint.cpp in Sources */,
|
||||
0C090C871E4E276700D52AFD /* world_graph.cpp in Sources */,
|
||||
44642D2E29CDA44700F8813A /* helicopter_router.cpp in Sources */,
|
||||
44C56C0B22296498006C2A1D /* routing_options.cpp in Sources */,
|
||||
D526BA7A241FC5580076E0B0 /* guides_connections.cpp in Sources */,
|
||||
ACAE44A427426EDB0054DD15 /* junction_visitor.cpp in Sources */,
|
||||
|
|
Почему-то поплыло форматирование здесь и в других местах...