amap_map_fluttify

This commit is contained in:
2024-11-17 15:45:43 +08:00
commit ee80f75473
554 changed files with 220726 additions and 0 deletions

View File

@ -0,0 +1,59 @@
//
// MASmoothPathTool.h
// iOS-path-smooth
//
// Created by shaobin on 2017/10/12.
// Copyright © 2017年 autonavi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MALonLatPoint : NSObject
@property (nonatomic, assign) double lat;
@property (nonatomic, assign) double lon;
@end
@interface MASmoothPathTool : NSObject
@property (nonatomic, assign) int intensity;
@property (nonatomic, assign) float threshHold;
@property (nonatomic, assign) int noiseThreshhold;
/**
* 轨迹平滑优化
* @param originlist 原始轨迹list,list.size大于2
* @return 优化后轨迹list
*/
- (NSArray<MALonLatPoint*>*)pathOptimize:(NSArray<MALonLatPoint*>*)originlist;
/**
* 轨迹线路滤波
* @param originlist 原始轨迹list,list.size大于2
* @return 滤波处理后的轨迹list
*/
- (NSArray<MALonLatPoint*>*)kalmanFilterPath:(NSArray<MALonLatPoint*>*)originlist;
/**
* 轨迹去噪删除垂距大于20m的点
* @param originlist 原始轨迹list,list.size大于2
* @return 去燥后的list
*/
- (NSArray<MALonLatPoint*>*)removeNoisePoint:(NSArray<MALonLatPoint*>*)originlist;
/**
* 单点滤波
* @param lastLoc 上次定位点坐标
* @param curLoc 本次定位点坐标
* @return 滤波后本次定位点坐标值
*/
- (MALonLatPoint*)kalmanFilterPoint:(MALonLatPoint*)lastLoc curLoc:(MALonLatPoint*)curLoc;
/**
* 轨迹抽稀
* @param inPoints 待抽稀的轨迹list至少包含两个点删除垂距小于mThreshhold的点
* @return 抽稀后的轨迹list
*/
- (NSArray<MALonLatPoint*>*)reducerVerticalThreshold:(NSArray<MALonLatPoint*>*)inPoints;
@end

View File

@ -0,0 +1,297 @@
//
// MASmoothPathTool.m
// iOS-path-smooth
//
// Created by shaobin on 2017/10/12.
// Copyright © 2017 autonavi. All rights reserved.
//
#import "MASmoothPathTool.h"
#import <MAMapKit/MAMapKit.h>
@implementation MALonLatPoint
@end
@implementation MASmoothPathTool
{
double lastLocation_x; //
double currentLocation_x;//
double lastLocation_y; //
double currentLocation_y;//
double estimate_x; //
double estimate_y; //
double pdelt_x; //
double pdelt_y; //
double mdelt_x; //
double mdelt_y; //
double gauss_x; //
double gauss_y; //
double kalmanGain_x; //
double kalmanGain_y; //
double m_R;
double m_Q;
}
- (id)init {
self = [super init];
if(self) {
self.intensity = 3;
self.threshHold = 0.3f;
self.noiseThreshhold = 10;
}
return self;
}
/**
*
* @param originlist list,list.size2
* @return list
*/
- (NSArray<MALonLatPoint*>*)pathOptimize:(NSArray<MALonLatPoint*>*)originlist {
NSArray<MALonLatPoint*>* list = [self removeNoisePoint:originlist];//
NSArray<MALonLatPoint*>* afterList = [self kalmanFilterPath:list intensity:self.intensity];//
NSArray<MALonLatPoint*>* pathoptimizeList = [self reducerVerticalThreshold:afterList threshHold:self.threshHold];//
return pathoptimizeList;
}
/**
* 线
* @param originlist list,list.size2
* @return list
*/
- (NSArray<MALonLatPoint*>*)kalmanFilterPath:(NSArray<MALonLatPoint*>*)originlist {
return [self kalmanFilterPath:originlist intensity:self.intensity];
}
/**
* 20m
* @param originlist list,list.size2
* @return list
*/
- (NSArray<MALonLatPoint*>*)removeNoisePoint:(NSArray<MALonLatPoint*>*)originlist{
return [self reduceNoisePoint:originlist threshHold:self.noiseThreshhold];
}
/**
*
* @param lastLoc
* @param curLoc
* @return
*/
- (MALonLatPoint*)kalmanFilterPoint:(MALonLatPoint*)lastLoc curLoc:(MALonLatPoint*)curLoc {
return [self kalmanFilterPoint:lastLoc curLoc:curLoc intensity:self.intensity];
}
/**
*
* @param inPoints listmThreshhold
* @return list
*/
- (NSArray<MALonLatPoint*>*)reducerVerticalThreshold:(NSArray<MALonLatPoint*>*)inPoints {
return [self reducerVerticalThreshold:inPoints threshHold:self.threshHold];
}
/********************************************************************************************************/
/**
* 线
* @param originlist list,list.size2
* @param intensity 15
* @return list
*/
- (NSArray<MALonLatPoint*>*)kalmanFilterPath:(NSArray<MALonLatPoint*>*)originlist intensity:(int)intensity {
if (!originlist || originlist.count <= 2) {
return nil;
}
NSMutableArray<MALonLatPoint*>* kalmanFilterList = [NSMutableArray array];
[self initial];//
MALonLatPoint* point = nil;
MALonLatPoint* lastLoc = [[MALonLatPoint alloc] init];
lastLoc.lat = [originlist objectAtIndex:0].lat;
lastLoc.lon = [originlist objectAtIndex:0].lon;
[kalmanFilterList addObject:lastLoc];
for (int i = 1; i < originlist.count; i++) {
MALonLatPoint* curLoc = [originlist objectAtIndex:i];
point = [self kalmanFilterPoint:lastLoc curLoc:curLoc intensity:intensity];
if (point) {
[kalmanFilterList addObject:point];
lastLoc = point;
}
}
return kalmanFilterList;
}
/**
*
* @param lastLoc
* @param curLoc
* @param intensity 15
* @return
*/
- (MALonLatPoint*)kalmanFilterPoint:(MALonLatPoint*)lastLoc curLoc:(MALonLatPoint*)curLoc intensity:(int)intensity {
if (!lastLoc || !curLoc){
return nil;
}
if (pdelt_x == 0 || pdelt_y == 0 ){
[self initial];
}
MALonLatPoint* point = nil;
if (intensity < 1){
intensity = 1;
} else if (intensity > 5){
intensity = 5;
}
for (int j = 0; j < intensity; j++){
point = [self kalmanFilter:lastLoc.lon value_x:curLoc.lon oldValue_y:lastLoc.lat value_y:curLoc.lat];
curLoc = point;
}
return point;
}
/***********************************************************/
//
- (void)initial {
pdelt_x = 0.001;
pdelt_y = 0.001;
// mdelt_x = 0;
// mdelt_y = 0;
mdelt_x = 5.698402909980532E-4;
mdelt_y = 5.698402909980532E-4;
}
- (MALonLatPoint*)kalmanFilter:(double)oldValue_x value_x:(double)value_x oldValue_y:(double)oldValue_y value_y:(double)value_y{
lastLocation_x = oldValue_x;
currentLocation_x= value_x;
gauss_x = sqrt(pdelt_x * pdelt_x + mdelt_x * mdelt_x)+m_Q; //
kalmanGain_x = sqrt((gauss_x * gauss_x)/(gauss_x * gauss_x + pdelt_x * pdelt_x)) +m_R; //
estimate_x = kalmanGain_x * (currentLocation_x - lastLocation_x) + lastLocation_x; //
mdelt_x = sqrt((1-kalmanGain_x) * gauss_x *gauss_x); //
lastLocation_y = oldValue_y;
currentLocation_y = value_y;
gauss_y = sqrt(pdelt_y * pdelt_y + mdelt_y * mdelt_y)+m_Q; //
kalmanGain_y = sqrt((gauss_y * gauss_y)/(gauss_y * gauss_y + pdelt_y * pdelt_y)) +m_R; //
estimate_y = kalmanGain_y * (currentLocation_y - lastLocation_y) + lastLocation_y; //
mdelt_y = sqrt((1-kalmanGain_y) * gauss_y * gauss_y); //
MALonLatPoint *point = [[MALonLatPoint alloc] init];
point.lon = estimate_x;
point.lat = estimate_y;
return point;
}
/*************************************************************/
/****************************************************************/
- (NSArray<MALonLatPoint*>*)reducerVerticalThreshold:(NSArray<MALonLatPoint*>*)inPoints threshHold:(float)threshHold {
if(inPoints.count < 2) {
return inPoints;
}
NSMutableArray *ret = [NSMutableArray arrayWithCapacity:inPoints.count];
for(int i = 0; i < inPoints.count; ++i) {
MALonLatPoint *pre = ret.lastObject;
MALonLatPoint *cur = [inPoints objectAtIndex:i];
if (!pre || i == inPoints.count - 1) {
[ret addObject:[inPoints objectAtIndex:i]];
continue;
}
MALonLatPoint *next = [inPoints objectAtIndex:(i + 1)];
MAMapPoint curP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(cur.lat, cur.lon));
MAMapPoint prevP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(pre.lat, pre.lon));
MAMapPoint nextP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(next.lat, next.lon));
double distance = [self calculateDistanceFromPoint:curP lineBegin:prevP lineEnd:nextP];
if (distance >= threshHold) {
[ret addObject:cur];
}
}
return ret;
}
- (MALonLatPoint*)getLastLocation:(NSArray<MALonLatPoint*>*)oneGraspList {
if (!oneGraspList || oneGraspList.count == 0) {
return nil;
}
NSInteger locListSize = oneGraspList.count;
MALonLatPoint* lastLocation = [oneGraspList objectAtIndex:(locListSize - 1)];
return lastLocation;
}
/**
* 线线
* @param pt
* @param begin 线
* @param end 线
*
*/
- (double)calculateDistanceFromPoint:(MAMapPoint)pt
lineBegin:(MAMapPoint)begin
lineEnd:(MAMapPoint)end {
MAMapPoint mappedPoint;
double dx = begin.x - end.x;
double dy = begin.y - end.y;
if(fabs(dx) < 0.00000001 && fabs(dy) < 0.00000001 ) {
mappedPoint = begin;
} else {
double u = (pt.x - begin.x)*(begin.x - end.x) +
(pt.y - begin.y)*(begin.y - end.y);
u = u/((dx*dx)+(dy*dy));
mappedPoint.x = begin.x + u*dx;
mappedPoint.y = begin.y + u*dy;
}
return MAMetersBetweenMapPoints(pt, mappedPoint);
}
/************************************************************/
- (NSArray<MALonLatPoint*>*)reduceNoisePoint:(NSArray<MALonLatPoint*>*)inPoints threshHold:(float)threshHold {
if (!inPoints) {
return nil;
}
if (inPoints.count <= 2) {
return inPoints;
}
NSMutableArray<MALonLatPoint*>* ret = [NSMutableArray array];
for (int i = 0; i < inPoints.count; i++) {
MALonLatPoint* pre = [self getLastLocation:ret];
MALonLatPoint* cur = [inPoints objectAtIndex:i];
if (!pre || i == inPoints.count - 1) {
[ret addObject:cur];
continue;
}
MALonLatPoint* next = [inPoints objectAtIndex:(i + 1)];
MAMapPoint curP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(cur.lat, cur.lon));
MAMapPoint prevP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(pre.lat, pre.lon));
MAMapPoint nextP = MAMapPointForCoordinate(CLLocationCoordinate2DMake(next.lat, next.lon));
double distance = [self calculateDistanceFromPoint:curP lineBegin:prevP lineEnd:nextP];
if (distance < threshHold){
[ret addObject:cur];
}
}
return ret;
}
@end

View File

@ -0,0 +1,13 @@
//////////////////////////////////////////////////////////
// GENERATED BY FLUTTIFY. DO NOT EDIT IT.
//////////////////////////////////////////////////////////
#import "AmapMapFluttifyPlugin.h"
NS_ASSUME_NONNULL_BEGIN
@interface AmapMapFluttifyPlugin (SubHandlerCustom)
- (NSDictionary<NSString*, Handler>*) getSubHandlerCustom;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,777 @@
//////////////////////////////////////////////////////////
// GENERATED BY FLUTTIFY. DO NOT EDIT IT.
//////////////////////////////////////////////////////////
#import "SubHandlerCustom.h"
#import "PathSmooth/MASmoothPathTool.h"
#import <MAMapKit/MAMapKit.h>
// Dart, MethodChannel,
extern NSMutableDictionary<NSString*, NSObject*>* STACK;
// Dart
extern NSMutableDictionary<NSNumber*, NSObject*>* HEAP;
//
extern BOOL enableLog;
@implementation AmapMapFluttifyPlugin (SubHandlerCustom)
- (NSDictionary<NSString*, Handler>*) getSubHandlerCustom {
return @{
@"MAMapRectIsEmpty::MAMapRectIsEmpty": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// args
// struct arg
NSValue* rectValue = (NSValue*) args[@"rect"];
MAMapRect rect;
[rectValue getValue:&rect];
// ref
// print log
if (enableLog) {
NSLog(@"fluttify-objc: MAMapRectIsEmpty::MAMapRectIsEmpty(%@)", args[@"rect"]);
}
// invoke native method
BOOL result = MAMapRectIsEmpty(rect);
// result
// : Value
NSObject* __result__ = @(result);
methodResult(__result__);
},
@"MALonLatPoint::set_lat_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// args
// jsonable arg
double lat = [args[@"lat"] doubleValue];
// ref
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
ref.lat = lat;
methodResult(@"success");
}
methodResult(@"success");
},
@"MALonLatPoint::set_lon_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// args
// jsonable arg
double lon = [args[@"lon"] doubleValue];
// ref
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
ref.lon = lon;
methodResult(@"success");
}
methodResult(@"success");
},
@"MASmoothPathTool::set_intensity_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// args
// jsonable arg
int intensity = [args[@"intensity"] intValue];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
ref.intensity = intensity;
methodResult(@"success");
}
methodResult(@"success");
},
@"MASmoothPathTool::set_threshHold_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// args
// jsonable arg
float threshHold = [args[@"threshHold"] floatValue];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
ref.threshHold = threshHold;
methodResult(@"success");
}
methodResult(@"success");
},
@"MASmoothPathTool::set_noiseThreshhold_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// args
// jsonable arg
int noiseThreshhold = [args[@"noiseThreshhold"] intValue];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
ref.noiseThreshhold = noiseThreshhold;
methodResult(@"success");
}
methodResult(@"success");
},
@"MALonLatPoint::get_lat_batch": ^(NSObject <FlutterPluginRegistrar>* registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray* resultList = [NSMutableArray array];
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// ref object
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
double result = ref.lat;
// : Value
NSObject* __result__ = @(result);
[resultList addObject:__result__];
}
methodResult(resultList);
},
@"MALonLatPoint::get_lon_batch": ^(NSObject <FlutterPluginRegistrar>* registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray* resultList = [NSMutableArray array];
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// ref object
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
double result = ref.lon;
// : Value
NSObject* __result__ = @(result);
[resultList addObject:__result__];
}
methodResult(resultList);
},
@"MASmoothPathTool::get_intensity_batch": ^(NSObject <FlutterPluginRegistrar>* registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray* resultList = [NSMutableArray array];
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// ref object
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
int result = ref.intensity;
// : Value
NSObject* __result__ = @(result);
[resultList addObject:__result__];
}
methodResult(resultList);
},
@"MASmoothPathTool::get_threshHold_batch": ^(NSObject <FlutterPluginRegistrar>* registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray* resultList = [NSMutableArray array];
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// ref object
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
float result = ref.threshHold;
// : Value
NSObject* __result__ = @(result);
[resultList addObject:__result__];
}
methodResult(resultList);
},
@"MASmoothPathTool::get_noiseThreshhold_batch": ^(NSObject <FlutterPluginRegistrar>* registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray* resultList = [NSMutableArray array];
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// ref object
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
int result = ref.noiseThreshhold;
// : Value
NSObject* __result__ = @(result);
[resultList addObject:__result__];
}
methodResult(resultList);
},
@"MASmoothPathTool::pathOptimize": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// args
// list arg
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// print log
if (enableLog) {
NSLog(@"fluttify-objc: MASmoothPathTool@%@::pathOptimize(%@)", args[@"refId"], args[@"originlist"]);
}
// invoke native method
NSArray<MALonLatPoint*>* result = [ref pathOptimize: originlist];
// result
// :
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
for (int __i__ = 0; __i__ < result.count; __i__++) {
NSObject* object = [result objectAtIndex:__i__];
[__result__ addObject: object];
}
methodResult(__result__);
},
@"MASmoothPathTool::kalmanFilterPath": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// args
// list arg
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// print log
if (enableLog) {
NSLog(@"fluttify-objc: MASmoothPathTool@%@::kalmanFilterPath(%@)", args[@"refId"], args[@"originlist"]);
}
// invoke native method
NSArray<MALonLatPoint*>* result = [ref kalmanFilterPath: originlist];
// result
// :
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
for (int __i__ = 0; __i__ < result.count; __i__++) {
NSObject* object = [result objectAtIndex:__i__];
[__result__ addObject: object];
}
methodResult(__result__);
},
@"MASmoothPathTool::removeNoisePoint": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// args
// list arg
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// print log
if (enableLog) {
NSLog(@"fluttify-objc: MASmoothPathTool@%@::removeNoisePoint(%@)", args[@"refId"], args[@"originlist"]);
}
// invoke native method
NSArray<MALonLatPoint*>* result = [ref removeNoisePoint: originlist];
// result
// :
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
for (int __i__ = 0; __i__ < result.count; __i__++) {
NSObject* object = [result objectAtIndex:__i__];
[__result__ addObject: object];
}
methodResult(__result__);
},
@"MASmoothPathTool::kalmanFilterPoint_curLoc": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// args
// ref arg
MALonLatPoint* lastLoc = (MALonLatPoint*) args[@"lastLoc"];
// ref arg
MALonLatPoint* curLoc = (MALonLatPoint*) args[@"curLoc"];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// print log
if (enableLog) {
NSLog(@"fluttify-objc: MASmoothPathTool@%@::kalmanFilterPoint(%@, %@)", args[@"refId"], args[@"lastLoc"], args[@"curLoc"]);
}
// invoke native method
MALonLatPoint* result = [ref kalmanFilterPoint: lastLoc curLoc: curLoc];
// result
// return a ref
id __result__ = result;
methodResult(__result__);
},
@"MASmoothPathTool::reducerVerticalThreshold": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// args
// list arg
NSArray<MALonLatPoint*>* inPoints = (NSArray<MALonLatPoint*>*) args[@"inPoints"];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// print log
if (enableLog) {
NSLog(@"fluttify-objc: MASmoothPathTool@%@::reducerVerticalThreshold(%@)", args[@"refId"], args[@"inPoints"]);
}
// invoke native method
NSArray<MALonLatPoint*>* result = [ref reducerVerticalThreshold: inPoints];
// result
// :
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
for (int __i__ = 0; __i__ < result.count; __i__++) {
NSObject* object = [result objectAtIndex:__i__];
[__result__ addObject: object];
}
methodResult(__result__);
},
@"ObjectFactory::createMALonLatPoint": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"ObjectFactory::createMALonLatPoint");
}
MALonLatPoint* __this__;
if ([((NSDictionary<NSString*, id>*) args)[@"init"] boolValue]) {
__this__ = [[MALonLatPoint alloc] init];
} else {
__this__ = [MALonLatPoint alloc];
}
methodResult(__this__);
if (enableLog) NSLog(@"HEAP: %@", HEAP);
},
@"ObjectFactory::createMASmoothPathTool": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"ObjectFactory::createMASmoothPathTool");
}
MASmoothPathTool* __this__;
if ([((NSDictionary<NSString*, id>*) args)[@"init"] boolValue]) {
__this__ = [[MASmoothPathTool alloc] init];
} else {
__this__ = [MASmoothPathTool alloc];
}
methodResult(__this__);
if (enableLog) NSLog(@"HEAP: %@", HEAP);
},
@"RefClass::isKindOfMALonLatPoint": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
//
NSObject* __this__ = ((NSDictionary<NSString*, NSObject*>*) args)[@"__this__"];
BOOL isTargetType = [__this__ isKindOfClass:[MALonLatPoint class]];
methodResult(@(isTargetType));
},
@"RefClass::isKindOfMASmoothPathTool": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
//
NSObject* __this__ = ((NSDictionary<NSString*, NSObject*>*) args)[@"__this__"];
BOOL isTargetType = [__this__ isKindOfClass:[MASmoothPathTool class]];
methodResult(@(isTargetType));
},
@"ObjectFactory::create_batchMALonLatPoint": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray<NSObject*>* resultList = [NSMutableArray array];
NSNumber* length = (NSNumber*) ((NSDictionary<NSString*, NSObject*>*) argsBatch)[@"length"];
NSNumber* init = (NSNumber*) ((NSDictionary<NSString*, NSObject*>*) argsBatch)[@"init"];
for (int __i__ = 0; __i__ < [length integerValue]; __i__++) {
MALonLatPoint* __this__;
if ([init boolValue]) {
__this__ = [[MALonLatPoint alloc] init];
} else {
__this__ = [MALonLatPoint alloc];
}
[resultList addObject:__this__];
}
methodResult(resultList);
if (enableLog) NSLog(@"HEAP: %@", HEAP);
},
@"ObjectFactory::create_batchMASmoothPathTool": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray<NSObject*>* resultList = [NSMutableArray array];
NSNumber* length = (NSNumber*) ((NSDictionary<NSString*, NSObject*>*) argsBatch)[@"length"];
NSNumber* init = (NSNumber*) ((NSDictionary<NSString*, NSObject*>*) argsBatch)[@"init"];
for (int __i__ = 0; __i__ < [length integerValue]; __i__++) {
MASmoothPathTool* __this__;
if ([init boolValue]) {
__this__ = [[MASmoothPathTool alloc] init];
} else {
__this__ = [MASmoothPathTool alloc];
}
[resultList addObject:__this__];
}
methodResult(resultList);
if (enableLog) NSLog(@"HEAP: %@", HEAP);
},
@"MALonLatPoint::get_lat": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"MALonLatPoint::get_lat");
}
// ref object
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
// invoke native method
double result = ref.lat;
// : Value
NSObject* __result__ = @(result);
methodResult(__result__);
},
@"MALonLatPoint::get_lon": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"MALonLatPoint::get_lon");
}
// ref object
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
// invoke native method
double result = ref.lon;
// : Value
NSObject* __result__ = @(result);
methodResult(__result__);
},
@"MASmoothPathTool::get_intensity": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"MASmoothPathTool::get_intensity");
}
// ref object
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// invoke native method
int result = ref.intensity;
// : Value
NSObject* __result__ = @(result);
methodResult(__result__);
},
@"MASmoothPathTool::get_threshHold": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"MASmoothPathTool::get_threshHold");
}
// ref object
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// invoke native method
float result = ref.threshHold;
// : Value
NSObject* __result__ = @(result);
methodResult(__result__);
},
@"MASmoothPathTool::get_noiseThreshhold": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"MASmoothPathTool::get_noiseThreshhold");
}
// ref object
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// invoke native method
int result = ref.noiseThreshhold;
// : Value
NSObject* __result__ = @(result);
methodResult(__result__);
},
@"MASmoothPathTool::pathOptimize_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray* resultList = [NSMutableArray array];
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// args
// list arg
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// invoke native method
NSArray<MALonLatPoint*>* result = [ref pathOptimize: originlist];
// result
// :
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
for (int __i__ = 0; __i__ < result.count; __i__++) {
NSObject* object = [result objectAtIndex:__i__];
[__result__ addObject: object];
}
[resultList addObject:__result__];
}
methodResult(resultList);
},
@"MASmoothPathTool::kalmanFilterPath_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray* resultList = [NSMutableArray array];
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// args
// list arg
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// invoke native method
NSArray<MALonLatPoint*>* result = [ref kalmanFilterPath: originlist];
// result
// :
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
for (int __i__ = 0; __i__ < result.count; __i__++) {
NSObject* object = [result objectAtIndex:__i__];
[__result__ addObject: object];
}
[resultList addObject:__result__];
}
methodResult(resultList);
},
@"MASmoothPathTool::removeNoisePoint_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray* resultList = [NSMutableArray array];
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// args
// list arg
NSArray<MALonLatPoint*>* originlist = (NSArray<MALonLatPoint*>*) args[@"originlist"];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// invoke native method
NSArray<MALonLatPoint*>* result = [ref removeNoisePoint: originlist];
// result
// :
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
for (int __i__ = 0; __i__ < result.count; __i__++) {
NSObject* object = [result objectAtIndex:__i__];
[__result__ addObject: object];
}
[resultList addObject:__result__];
}
methodResult(resultList);
},
@"MASmoothPathTool::kalmanFilterPoint_curLoc_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray* resultList = [NSMutableArray array];
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// args
// ref arg
MALonLatPoint* lastLoc = (MALonLatPoint*) args[@"lastLoc"];
// ref arg
MALonLatPoint* curLoc = (MALonLatPoint*) args[@"curLoc"];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// invoke native method
MALonLatPoint* result = [ref kalmanFilterPoint: lastLoc curLoc: curLoc];
// result
// return a ref
id __result__ = result;
[resultList addObject:__result__];
}
methodResult(resultList);
},
@"MASmoothPathTool::reducerVerticalThreshold_batch": ^(NSObject <FlutterPluginRegistrar> * registrar, id argsBatch, FlutterResult methodResult) {
NSMutableArray* resultList = [NSMutableArray array];
for (int __i__ = 0; __i__ < ((NSArray<NSDictionary<NSString*, NSObject*>*>*) argsBatch).count; __i__++) {
NSDictionary<NSString*, id>* args = [((NSArray<NSDictionary<NSString*, id>*>*) argsBatch) objectAtIndex:__i__];
// args
// list arg
NSArray<MALonLatPoint*>* inPoints = (NSArray<MALonLatPoint*>*) args[@"inPoints"];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
// invoke native method
NSArray<MALonLatPoint*>* result = [ref reducerVerticalThreshold: inPoints];
// result
// :
NSMutableArray<NSObject*>* __result__ = [NSMutableArray array];
for (int __i__ = 0; __i__ < result.count; __i__++) {
NSObject* object = [result objectAtIndex:__i__];
[__result__ addObject: object];
}
[resultList addObject:__result__];
}
methodResult(resultList);
},
@"MALonLatPoint::set_lat": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"MALonLatPoint::set_lat");
}
// args
// jsonable arg
double lat = [args[@"lat"] doubleValue];
// ref
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
ref.lat = lat;
methodResult(@"success");
},
@"MALonLatPoint::set_lon": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"MALonLatPoint::set_lon");
}
// args
// jsonable arg
double lon = [args[@"lon"] doubleValue];
// ref
MALonLatPoint* ref = (MALonLatPoint*) args[@"__this__"];
ref.lon = lon;
methodResult(@"success");
},
@"MASmoothPathTool::set_intensity": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"MASmoothPathTool::set_intensity");
}
// args
// jsonable arg
int intensity = [args[@"intensity"] intValue];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
ref.intensity = intensity;
methodResult(@"success");
},
@"MASmoothPathTool::set_threshHold": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"MASmoothPathTool::set_threshHold");
}
// args
// jsonable arg
float threshHold = [args[@"threshHold"] floatValue];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
ref.threshHold = threshHold;
methodResult(@"success");
},
@"MASmoothPathTool::set_noiseThreshhold": ^(NSObject <FlutterPluginRegistrar> * registrar, id args, FlutterResult methodResult) {
// print log
if (enableLog) {
NSLog(@"MASmoothPathTool::set_noiseThreshhold");
}
// args
// jsonable arg
int noiseThreshhold = [args[@"noiseThreshhold"] intValue];
// ref
MASmoothPathTool* ref = (MASmoothPathTool*) args[@"__this__"];
ref.noiseThreshhold = noiseThreshhold;
methodResult(@"success");
},
};
}
@end