Class: ModelExcavation

Glodon.CIMCube.Utils. ModelExcavation

模型开挖分析类,用于对3D模型进行开挖分析和可视化

new ModelExcavation(map [, options])

模型开挖分析构造函数
Parameters:
Name Type Argument Default Description
map Glodon.CIMCube CIMCube实例
options Object <optional>
{} 开挖分析配置参数
Properties
Name Type Argument Default Description
positions Array.<Glodon.CIMCube.Graphic.GeoPoint> <optional>
[] 开挖区域点数组,点由经纬度表示{lon:123.4,lat:45.6,height:100.0},需逆时针排列
depth Number <optional>
20.0 开挖深度,范围0-10000米
bottomTextureUrl String <optional>
底面纹理资源路径
facadeTextureUrl String <optional>
立面纹理资源路径,默认使用底面纹理
layers Array.<(Glodon.CIMCube.Layer.Tiles3DLayer|Glodon.CIMCube.Layer.GltfLayer)> <optional>
指定需要开挖的图层数组
Example
// 创建开挖分析
const excavation = new ModelExcavation(map, {
    positions: [
        {lon: 116.1, lat: 39.5, height: 100},
        {lon: 116.2, lat: 39.5, height: 100},
        {lon: 116.2, lat: 39.6, height: 100}
    ],
    depth: 50,
    bottomTextureUrl: "./textures/ground.jpg"
});

Members


bottomTextureUrl :String

底面纹理路径
Type:
  • String

depth :Number

开挖深度,单位为米
Type:
  • Number

facadeTextureUrl :String

立面纹理路径
Type:
  • String

<readonly> isActive :Boolean

开挖分析是否激活状态
Type:
  • Boolean

layers :Array.<(Glodon.CIMCube.Layer.Tiles3DLayer|Glodon.CIMCube.Layer.GltfLayer)>

开挖图层数组
Type:

positions :Array.<Glodon.CIMCube.Graphic.GeoPoint>

开挖区域点数组,点由经纬度表示{lon:123.4,lat:45.6,height:100.0}
Type:

<readonly> region :Array.<Array.<Glodon.CIMCube.Graphic.GeoPoint>>

开挖区域
Type:

Methods


clear()

清除开挖分析结果,释放相关资源
Returns:
Type
void
Example
// 清除分析结果
excavation.clear();

dispose()

销毁开挖分析实例,释放所有资源
Example
// 销毁开挖分析实例
excavation.dispose();

doAnalysis()

执行开挖分析
Returns:
Type
void
Example
// 开始分析
excavation.doAnalysis();

setBottomTexture(url)

设置底面纹理
Parameters:
Name Type Description
url String 底面纹理资源路径
Example
// 设置底面纹理
excavation.setBottomTexture("./textures/ground.jpg");

setDepth(depth)

设置开挖深度
Parameters:
Name Type Description
depth Number 深度,范围0-10000米
Example
// 设置开挖深度为50米
excavation.setDepth(50);

setFacadeTexture(url)

设置立面纹理
Parameters:
Name Type Description
url String 立面纹理资源路径
Example
// 设置立面纹理
excavation.setFacadeTexture("./textures/wall.jpg");

setPositions(positions)

设置开挖区域点数组
Parameters:
Name Type Description
positions Array.<Glodon.CIMCube.Graphic.GeoPoint> 开挖区域点数组,点由经纬度表示{lon:123.4,lat:45.6,height:100.0}
Example
// 设置开挖区域
excavation.setPositions([
    {lon: 116.1, lat: 39.5, height: 100},
    {lon: 116.2, lat: 39.5, height: 100},
    {lon: 116.2, lat: 39.6, height: 100}
]);