iMobile for iOS 10i 的Box裁剪

0 投票

参数值:length = 61.419754, width = 41.358025, height = 29.938272, boxClipPart = 1,使用【北京CBD】示例数据,在屏幕中心点裁剪。开始裁剪,没有效果。请问Box裁剪是这样完成的吗?如果有错误,该怎么实现功能呢?代码如下:

- (void)sceneAnalysisBoxClipInView:(UIView *)view withLength:(float)length width:(float)width height:(float)height part:(BoxClipPart)part {

    

    DLog(@"length = %f, width = %f, height = %f, boxClipPart = %d", length, width, height, part);

    

    Size2D *size = [[Size2D alloc] initWithWidth:length Height:width];

    Point3D position = [self.sceneControl.scene pixelToGlobe:self.sceneControl.center];

    GeoBox *box = [[GeoBox alloc] initWithPosition:position bottomSize:size height:height];

    

    Layer3D *layer3D = [self.sceneControl.scene.layers getLayerWithName:@"Building@CBD_new"];

    [layer3D clipByBox:box part:part];

    

    [self.sceneControl.scene refresh];

}

3月 26 分类:  25次浏览 | 用户: wangd (3 分)

1个回答

0 投票

您用的是官网上的10.01版本吗?另外position 的位置需要在模型上才能看到效果的

3月 27 用户: 周仕斌 名扬四海 (1,561 分)

官网下载的SuperMap iMobile 10i v10.0.1,代码打印Environment:

    NSLog(@"length = %f, width = %f, height = %f, boxClipPart = %d", length, width, height, part);

    NSLog(@"Environment Version = %@", [Environment getVersion]);

打印结果:

 length = 33.641975, width = 20.000000, height = 20.000000, boxClipPart = 1

Environment Version = Supermap_iMobile_iOS_9_1_0

请问这个对的吗?数据有没有关系呢?我用的SampleData里面北京CBD那份数据,如下:

BOOL opened = [self.sceneControl.scene openSceneWithUrl:@"192.168.1.111:8090/iserver/services/realspace-CBD" Name:@"CBD" Password:@"supermap"];

裁剪位置如下图,Position取屏幕中心点:Point3D position = [self.sceneControl.scene pixelToGlobe:self.view.center];

...