S3MTilesLayer

new Cesium.S3MTilesLayer()

S3M(SuperMap 3D Model)图层类,通过该图层实现加载各类三维模型,包括倾斜摄影模型、BIM模型、点云数据、精细模型等。 通过Scene.addS3MTilesLayerByScp(url, options)的方式将S3MTileslayer添加到场景中。

Members

DataMaxValue : Number

获取数据的最大高度值或最大强度值。 对点云数据而言,该属性为高度值或强度值(默认为强度值);对其他三维数据而言,该属性为高度值。
Example:
//获取数据最大值
var dataMaxValue = S3MTilesLayer.DataMaxValue;

DataMinValue : Number

获取数据的最小高度值或最小强度值。 对点云数据而言,该属性为高度值或强度值(默认为强度值);对其他三维数据而言,该属性为高度值。
Example:
//获取数据最小值
var dataMinValue = S3MTilesLayer.DataMinValue;

HypsometricSetting : AnalysisRegionMode

获取或设置图层的分层设色表达。
Example:
//设置图层分层设色属性
var hypsometricSetting = new Cesium.HypsometricSetting();
hypsometricSetting.MinVisibleValue = 30;
hypsometricSetting.MaxVisibleValue = 150;
var colorTable = new Cesium.ColorTable();
colorTable.insert(150, new Cesium.Color(1, 0, 0));
colorTable.insert(30, new Cesium.Color(0, 0, 1));
hypsometricSetting.ColorTable= colorTable;
S3MTilesLayer.HypsometricSetting = {
hypsometricSetting : hypsometricSetting,
analysisMode: Cesium.HypsometricSettingEnum.AnalysisRegionMode.ARM_ALL
}
//获取图层分层设色属性
var hyp = S3MTilesLayer.HypsometricSetting ;

lodRangeScale : Number

获取或设置图层的lOD层级切换距离缩放系数。
获取或设置图层风格。
Example:
//获取图层风格
var style = S3MTilesLayer.style3D;
//设置图层风格
var style3D = new Cesium.Style3D();
var color = new Cesium.Color(1.0, 0.0, 0.0);
style3D.fillForeColor = color;
S3MTilesLayer.style3D = style3D;

visible : Boolean

获取或设置图层可见性。
Example:
//获取可见性
var isVisible = S3MTilesLayer.visible;
//设置不可见
S3MTilesLayer.visible = false;

Methods

addFlattenRegion(options)Boolean

添加压平面,用于压平模型表面。
Name Type Description
options Object 压平区域参数:
Name Type Description
position Array 指定压平区域位置信息。
name String 压平区域名称。
Returns:
成功返回true,失败返回false。
Example:
S3MTilesLayer.addFlattenRegion({
    position : [13.0500640714, 47.8279189759, 400.0,
                13.0500640714, 47.8230189759, 400.0,
                13.0530640714, 47.8260189759, 400.0,
                13.0538640714, 47.8230189759, 400.0,
                13.0538640714, 47.8279189759, 400.0],
       name : 'flatten2'});

clearCustomClipBox()

清除自定义裁剪面。
Example:
S3MTilesLayer.clearCustomClipBox();

getObjsColor()Object

获取对象颜色表。
Returns:
对象颜色表:Key为对象ID,Value为对象颜色。
Example:
var objectsColor = S3MTilesLayer.getObjectsColor();

getObjsVisible(id)Boolean

获得指定ID的对象可见性。
Name Type Description
id Number 指定的对象ID。
Returns:
对象是否可见。
Example:
var  id = 12;
S3MTilesLayer. getObjsVisible (id);

getSelection()Array

获取选择集。
Returns:
包含所有被选中对象的ID数组。
Example:
S3MTilesLayer. getSelection();
刷新图层

releaseSelection()

释放选择集。
Example:
S3MTilesLayer. releaseSelection();

removeAllFlattenRegion()

移除所有压平面。
Example:
S3MTilesLayer. removeAllFlattenRegion();

removeAllObjsColor()

移除所有对象的颜色。
Example:
S3MTilesLayer.removeAllObjsColor();

removeFlattenRegion(name)Boolean

移除指定名称的压平面。
Name Type Description
name String 待移除压平面的名称。
Returns:
移除成功返回true,失败返回false。
Example:
S3MTilesLayer. removeFlattenRegion(regionName);

removeObjsColor(ids)Boolean

移除指定ID对象列表的颜色。
Name Type Description
ids Array 要移除颜色的对象ID列表。
Returns:
移除成功返回true,否则返回false。
Example:
var  ids = [12, 22, 65, 98];
S3MTilesLayer.removeObjsColor(ids);

setCustomClipBox(options)Boolean

添加自定义裁剪面。
Name Type Description
options Object 裁剪面参数:
Name Type Description
dimensions Cartesian3 指定裁剪box的长宽高。
position Cartesian3 指定裁剪面位置。
clipMode String 指定裁剪模式。 裁剪模式包括以下几类:

clip_behind_any_plane:裁剪掉位于任何裁剪面后面的部分。

clip_behind_all_plane:裁剪掉位于所有裁剪面后面的部分。

only_keep_line:只保留裁剪线,裁剪掉其他部分。
Returns:
添加成功返回true,失败返回false。
Throws:
  • DeveloperError : options and options.dimensions and options.position are required.
Example:
var boxOptions = {
      dimensions : new Cesium.Cartesian3(10, 10, 10)
      position : Cesium.Cartesian3.fromDegrees(120, 40, 20),
      clipMode : "clip_behind_all_plane"
};
S3MTilesLayer.setCustomClipBox(boxOptions);

setObjsColor(ids, color)

设置对象颜色信息。
Name Type Description
ids Array 要设置颜色的对象ID列表。
color Color 要设置的颜色。
Example:
var color = new Cesium.Color(1.0, 0.0, 0.0, 1.0);
var  ids = [12, 22, 65, 98];
S3MTilesLayer.setObjectsColor(ids, color);

setObjsVisible(ids, visible)

设置对象可见性。
Name Type Description
ids Array 待设置可见性的对象ID数组。
visible Boolean 指定对象是否可见。
Example:
var ids = [12, 33, 44 , 65];
S3MTilesLayer. setObjsVisible (ids,false);

setSelection(ids)

设置选择集,即选中指定ID数组的对象。
Name Type Description
ids Array 待选中的对象ID数组。
Example:
var  ids = [12, 22, 65, 98];
S3MTilesLayer. setSelection(ids);