<4-2>模型资源配置
# <4-2> 模型资源配置 接口:
## --- 地理城市建筑配置:
----------*配置地理城市建筑,包括查询,配置,激活建筑效果等;*
### ==4-2-a-1==:配置场景中的地理建筑资源

**接口方法名**:==STU_ConfigAllCityBuildAsset==
**参数说明:** 字符串格式
>i < name > 配置地理资源的编号,[可以通过附录3查询](doc:PiIXwpI9);
< isShow > 是否显示该地理资源;
< state > 该地理资源状态,默认0,可以不传此参数;
参数示例:
```
{
"data": [
{
"name": "areahangzhoushi_prefab",
"isShow": true,
"state": 0
},
{
"name": "areahangzhoushioutline_prefab",
"isShow": true,
"state": 0
},
{
"name": "areaxiaohejiedao_prefab",
"isShow": true,
"state": 0
},
{
"name": "tanghexincun_prefab",
"isShow": true,
"state": 0
}
]
}
```
>i 返回参数:
{
"method": "STU_ConfigAllCityBuildAsset",
"exception": null,
"data": "success"
}
---
### ==4-2-a-2==:进入 地理建筑模式
**接口方法名**:==STU_EnterCityBuildState==
**参数说明:** 字符串格式
>i <地理建筑编号 > 对应的地理建筑编号,可通过附录3查询编号;
参数示例:
```
{
"stringValue": "id-SDF3D33"
}
```
>i 返回参数:
{
"method": "STU_EnterCityBuildState",
"exception": null,
"data": "success"
}
---
### ==4-2-a-3==:退出 地理建筑模式
**接口方法名**:==STU_ExitCityBuildState==
**参数说明:**
>i 无参数
>i 返回参数:
{
"method": "STU_ExitCityBuildState",
"exception": null,
"data": "success"
}
---
### ==4-2-a-5==:查询地理建筑 属性信息
**接口方法名**:==STU_CheckCityBuild==
**参数说明:** 字符串格式
>i <地理建筑编号 > 对应的地理建筑编号,可通过附录3查询编号;
参数示例:
```
{
"stringValue": "id-SDF3D33"
}
```
>i 返回参数:
{
"method": "STU_CheckCityBuild",
"exception": null,
"data": "地理数据内容"
}
---
## --- 单体资源配置:
----------*根据数据,批量配置场景中的单体模型资源;*
|||||||
|-|-|-|-|-|-|
### ==4-2-b-1==:添加/更新场景中的单体模型
接口方法名**:==STU_AddModel==
**参数说明:**
>i< id > 三维单体资源的唯一id,自行生成设置,不要用特殊敏感字符,通过此id查询查询并激活相应标签;
< longitude > 经度;
< latitude > 纬度;
< height > 高度,单位米;
< scale > 标签缩放大小;
< rotation > 旋转方向;
< state > 单体模型的状态,默认0状态;
**< type > 单体资源编号:实例不同类型的单体资源,字符串参数;(==完整单体资源类型,见附录4==)**
|tzmbh70g30_xiaofang1|o9o7x1lj1w_jiuhu1|zox3j9h8vc_jingche2|s3qjqahnay_daba1|-|
|-|-|-|-|-|
|汽车1(消防车)|汽车2(救护车)|汽车3(警车)|汽车4(大巴车)|-|
|||||-|
**参数示例:**
```
{
"modeldata": [
{
"id": "测试0",
"type": "tag_c_3",
"state": 0,
"longitude": "113.25163907",
"latitude": "23.10045305",
"height": "1.18000",
"scale": 3.34056687,
"rotation": 0
},
{
"id": "测试1",
"type": "a3",
"longitude": "113.26795882",
"latitude": "23.09083306",
"height": "1000",
"scale": 2.722965
},
{
"id": "测试2",
"type": "tag_b_1",
"longitude": "113.28905848",
"latitude": "23.09863304",
"height": "1000",
"scale": 2.81722021,
"rotation": 0
},
{
"id": "测试3",
"type": "tag_b_2",
"longitude": "113.29045845",
"latitude": "23.08383306",
"height": "1000",
"scale": 3.19546986
},
{
"id": "测试4",
"type": "tag_d_1",
"longitude": "113.29735835",
"latitude": "23.07263306",
"height": "500",
"scale": 3.00138855
}
]
}
```
>i 返回参数:
{
"method": "STU_AddModel",
"exception": null,
"data": "success"
}
---
---
### ==4-2-b-2==:删除场景中的单体模型(按id删除)
接口方法名**:==STU_DeleteModelById==
**参数说明:** 字符串格式
>i< id > 按id参数删除单体模型(删除实例是id的一个单体模型)
**参数示例:**
```
{
"id": [
"id_0",
"id_1",
"id_2",
"id_3",
"id_4",
"id_5"
]
}
```
>i 返回参数:
{
"method": "STU_DeleteTagById",
"exception": null,
"data": "success"
}
---
### ==4-2-b-3==:删除场景中的单体模型(按type删除)
接口方法名**:==STU_DeleteModelByType==
**参数说明:** 字符串格式
>i< type > 按类型删除单体模型(删除按type类型实例的单体模型)
**参数示例:**
```
{
"type": [
"type_0",
"type_1",
"type_2",
"type_3",
"type_4",
"type_5"
]
}
```
>i 返回参数:
{
"method": "STU_DeleteTagByType",
"exception": null,
"data": "success"
}
---
### ==4-2-b-4==:删除场景中的所有单体模型
接口方法名**:==STU_DeleteAllModel==
>i 无参数,删除所有实例过的单体模型
>i 返回参数:
{
"method": "STU_DeleteTagByType",
"exception": null,
"data": "success"
}
---
---
### ==4-2-b-5==:根据单体id,查询单体模型信息
接口方法名**:==STU_CheckModel==
**参数说明:** 字符串格式
>i <单体id> 对应实例的单体建筑id
请求参数示例:
```
{
"stringValue": "id-SDF3D33"
}
```
>i 返回参数:
{
"method": "STU_MoveToModelById",
"exception": null,
"data": "success"
}
---
### ~~==4-2-b-6==:根据单体id,按轨迹路径移动单体模型~~
接口方法名**:==STU_ModelMovePath==
**参数说明:** 字符串格式
>i <单体id> 对应实例的单体建筑id
请求参数示例:
```
{
//待定
}
```
>i 返回参数: 移动动画结束后给回调
{
"method": "STU_ModelMovePath",
"exception": null,
"data": "success"
}
---
---
## --- 场景功能预制配置:
----------*通过三维引擎工具,模拟场景事件载体,导出参数,快速配置场景;*
### ~~==4-2-c-1==:快速配置场景状态~~
接口方法名**:==STU_FastCreatScene==
**参数说明:** 字符串格式
>i 开发中
---
## --- 自定义模型资源系统:
----------*支持动态载入自有FBX,OBJ,GLTF2,STL,PLY,3MF...等格式的数据模型;*
----------*独立工具编辑器,修改模型并标准化格式;*
### ~~==4-2-d-1==:动态载入自定义模型资源~~

接口方法名**:==STU_ImportCustomModel==
**参数说明:** 字符串格式
>i 开发中
---
### ==4-2-d-2==:查询已导入的自定义模型
### ==4-2-d-2==:删除已导入的自定义模型
### ==4-2-d-2==:创建自定义模型到场景中
### ==4-2-d-2==:删除场景中生成过的自定义模型
### ==4-2-b-3==:根据自定义模型id,镜头跳转到资源位置
---