S3MTilesLayer

new Cesium.S3MTilesLayer(options)

The S3M (Spatial 3D Model) layer class implements loading a three-dimensional slice cache through the layer, including a oblique photography model, a BIM model, a point cloud data, a fine model, vector data, symbols, and the like.

The published *.s3m format 3D service is added to the scene by Scene.addS3MTilesLayerByScp(url, options).
Name Type Description
options Object optional The parameter object has the following properties:
Name Type Default Description
gl WebGLRenderingContext optional Webgl context.
servers Array optional An array containing the server address.
urls Array optional An array containing the xml address.
position Array optional Layer insertion point position ([Longitude, Latitude, Height]).
name Array optional The layer name.
WaterEffectSet Object Water surface effect parameters.
urlType UrlType optional The entity data request form.
urlArguments String optional The parameters of the data service URL.
format Boolean optional Whether to support texture compression.
cacheEntityCount Number 0 optional The number of entities cached during LOD scheduling.
layerBounds Rectangle optional The extent of the layer.
tileSpliteType String 'LOCAL' optional Slice split type.
volumeObj Object optional The body renders the parameter object.
boundingSphereColc Array optional The root node boundingSphere.
MaxInstensity Number optional Maximum strength.
MinInstensity Number optional Minimum strength.
MaxHeight Number optional maximum height.
MinHeight Number optional Minimum height.
HorizontalLine Number optional 水平等高线。
fileType String optional File type (data type).
ProcessType String optional Processing method.
cullEnabled Boolean true optional Whether to eliminate the back side (default single-sided rendering, set to false for double-sided rendering).
Example:
//new S3MTilesLayer instance
var S3MTilesLayer = new S3MTilesLayer({
 gl : gl,
 servers : ["http://localhost:8090"],
 urls : ["http://localhost:8090/data/tile_001.xml","http://localhost:8090/data/tile_002.xml"],
 position : [10,20],
 name : ["S3MTilesLayer"]
});

Members

bloomEffect : Number

Get the floodlight effect.

bloomEnable : boolean

Get the floodlight effect on.

bReleaseColor : Number

Release the vertex color memory and restore the vertex color.

brightness : Number

Set the layer brightness value to adjust the color.

clearMemoryImmediately : Boolean

Whether to release the memory in time, the default value is false.

clipLineColor : Color

Gets or sets the color of the crop line when the BOX is trimmed on the S3M layer.

clipPlaneColor : Color

Get or set the color of the cropped section

ColorDictTableMode : Object

Set the color table mode.

contrast : Number

Set the layer contrast value to adjust the color.

cullEnabled : Boolean

Get or set single-sided rendering (default single-sided rendering, back culling).

dataMaxValue : Number

Get the maximum height or maximum intensity value of the data. For point cloud data, this attribute is a height or intensity value (the default is the intensity value); for other 3D data, this attribute is a height value.
Example:
//Get the data maximum
var dataMaxValue = S3MTilesLayer.DataMaxValue;

dataMinValue : Number

Get the minimum or minimum intensity value of the data. For point cloud data, this attribute is a height or intensity value (the default is the intensity value); for other 3D data, this attribute is a height value.
Example:
//Get the data minimum
var dataMinValue = S3MTilesLayer.DataMinValue;

effect : S3MPolylineEffect

Gets or sets the line style symbol of the S3M layer.

gamma : Number

Set the layer gamma value to adjust the color.

readonlygroupName : String

Get the name of the group where the layer is located

hasLight : Boolean

Gets or sets whether the layer has lighting effects turned on.

heading : Number

Gets or sets the camera's heading angle (in radians).

horizontalColor : Color

Gets or sets the horizontal line color.

horizontalline : Number

Gets or sets the horizontal line height.

hue : Number

Set the layer tonal value to adjust the color.

hypsometricSetting : Object

Gets or sets the layered color representation of the layer.
Example:
//Set layer layering properties
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
}
//Get layer layered color properties
var hyp = S3MTilesLayer.hypsometricSetting ;

readonlyid : Number

Get the layer id.

ignoreNormal : Boolean

Gets or sets whether the normal is automatically calculated in the GPU. The default value is true. When the value is true, the normal is automatically calculated in the GPU, and the normals that come with the data are not used. When the value is false, the normal is not automatically calculated in the GPU, and the normals that come with the data are used.

indexedDBSetting : Object

Get or set the indexedDB attribute information (IE browser does not support)

layerBounds : Rectangle

Gets or sets the layer extent.

LoadingMode : Number

Get or set the loading mode.

LoadingPriority : LoadingPriorityMode

Get or set the loading mode
Default Value: Child_Priority : 1

lodRangeScale : Number

Gets or sets the layer's LOD level switch distance scaling factor.

maxVisibleAltitude : Number

Gets or sets the maximum visible height of the layer.

minVisibleAltitude : Number

Gets or sets the minimum visible height of the layer.

mixColorType : Number

Set texture display mode (mix, replace)

multiChoose : Boolean

Gets or sets whether the layer supports multiple selection.

readonlyname : String

Get the layer name

pointCloudShading : Object

Get the encapsulation point cloud rendering parameter object pointCloudShading

saturation : Number

Set the layer saturation value to adjust the color.

SelectColorType : SelctColorType

Get the display style of the selected object.

selectColorType : Number

Gets or sets the display style of the selected object, the model texture is mixed with the color display or the solid color is displayed.

selectedColor : Color

Gets or sets the highlight color of the selected layer.

selectedTranslate : Cartesian3

Gets or sets the offset position of the selected object.

selectEnabled : Boolean

Gets or sets whether the layer is optional.

selectionFiltrateByTransparency : Number

Gets or sets the transparent selection filter threshold.

shadowType : Number

Gets or sets the range type of the model in the layer that participates in displaying the shadow.

constantsilhouetteColor : Color

Set or get the edge outline color, default blue

constantsilhouetteSize : Number

Set or get the edge outline size, default 2, unit pixels
Default Value: 2.0

splitDirection : SplitDirection

Gets or sets the direction of the roller blind.

splitPosition : Number

Get or set the roller blind position.

style3D : Style3D

Get or set the layer style.
Example:
//Get layer style
var style = S3MTilesLayer.style3D;
//Set layer style
var style3D = new Cesium.Style3D();
var color = new Cesium.Color(1.0, 0.0, 0.0);
style3D.fillForeColor = color;
S3MTilesLayer.style3D = style3D;
//Refresh the layer after setting
S3MTilesLayer.refresh();

textureUVSpeed : Number

Get or set the motion speed of the model texture on the UV coordinates

themeStyle : Cesium3DTileStyle

Get or set the thematic map style, currently supports the overlay of the ground vector cache in the front end according to the ID set to fill the color and texture of the thematic map.

urlType : UrlType

Gets or sets the request form of the layer data.

visible : Boolean

Get or set layer visibility.
Example:
//Get visibility
var isVisible = S3MTilesLayer.visible;
//Settings are not visible
S3MTilesLayer.visible = false;

visibleDistanceMax : Number

Gets or sets the maximum visible distance value of this layer, in meters. This distance value is used for the distance filtering function, and the layer will not be visible when the distance between the camera and the layer is greater than the distance value.

visibleDistanceMin : Number

Gets or sets the minimum visible distance value for this layer, in meters. This distance value is used for the distance filtering function, and the layer will not be visible when the distance between the camera and the layer is less than the distance value.

volName : String

Volume data name.

wireFrameMode : Number

Gets or sets the layer wireframe mode.

Methods

addExcavationRegion(options)Boolean

Add the excavation plane.
Name Type Description
options Object Excavation area parameters:
Name Type Description
position Array Excavation area location information.
name String Excavation area name.
Returns:
Bool returns true if successful, and false returns if it fails.

addFlattenRegion(options)Boolean

Add a pressing plane to flatten the plane of the model.
Name Type Description
options Object Flattening area parameters:
Name Type Description
position Array Specify the flattening area position information.
name String Flatten the area name.
Returns:
Returns true if successful, false returns 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'});

AddImageArray(imgArray)

The S3M layer is rendered in volume using a set of texture images. The range of volume rendering needs to be set when rendering.
Name Type Description
imgArray Promise.<Image> Texture array.

addOverlayImage(options)Boolean

The S3M layer specifies the range overlay image.
Name Type Description
options Object The object has the following properties:
Name Type Description
name String The name of the specified range.
bounds Array An array of point sets for the specified range.
image Element Html image element for overlaying texture images.
Returns:
Bool returns true if successful, and false returns if it fails.

clearCustomClipBox()

Clear the custom crop faces.
Example:
S3MTilesLayer.clearCustomClipBox();

clearModifyRegions()

Clear the polygon object to crop the S3M layer.

datasetInfo()Promise.Array

Get the layer dataset name and the corresponding Id range (for multi-dataset generation cache).
Returns:
The array contains all dataset related information, and each dataset object contains the dataset name, the starting Id, and the ending Id.
Example:
var data =  layer.datasetInfo();
Cesium.when(data,function(dataSet){
       var length = dataSet.length;
       .......
        });

destroy()

Destroy the layer, free up memory, and release webgl resources

fillStyleChange()

Border line does not disappear after setting fill mode

getAttributesById(id)

Get local object attribute information (scvd in indexedDB, which is not supported by IE browser).
Name Type Description
id Number index.

getClipRegion()

Get the range of section clipping.

getLodRangeScale()Number

Get the layer's lOD level switching distance scaling factor.
Returns:
LOD level switching distance scaling factor.
Example:
var num = S3MTilesLayer.getLodRangeScale();

getObjsColor()Color

Obtain a color table of the corresponding primitive object according to the ID.
Returns:
Corresponds to the color of the ID.

getObjsVisible(id)Boolean

Get the object visibility of the specified ID.
Name Type Description
id Number The specified object ID.
Returns:
Whether the object is visible.
Example:
var id = 12;
S3MTilesLayer.getObjsVisible(id);

getPointCloudClassificationInfos()Array|promise

Get an array of point cloud classification information.
Returns:
PointCloudClassificationInfos An array of point cloud classification information, the first time the data is requested to return a promise.

getQueryParameter()Object

Get the attribute query parameters.
Returns:
Property query parameter object.

getSelection()AssociativeArray

Get the selection set.
Returns:
An array of relationships containing all selected IDs.
Example:
S3MTilesLayer.getSelection();

getVisibleInViewport(index)Boolean

Get the visibility of the layer corresponding to the viewport.
Name Type Description
index Number index.
Returns:
visible.
Throws:

getVolNames()Array

Get all the volume data names.
Returns:
An array of all volume data names.

refresh()

Refresh the layer.

releaseSelection()

Release the selection set.
Example:
S3MTilesLayer.releaseSelection();

removeAllExcavationRegion()

Remove all excavation plane.

removeAllFlattenRegion()

Remove all pressing planes.
Example:
S3MTilesLayer. removeAllFlattenRegion();

removeAllObjectsOperation()

Remove all primitive operations.

removeAllObjsColor()

Remove the color of all element settings.

removeAllObjsExtendHeight()

Remove the stretch height of all settings.

removeAllObjsOffset()

Clear all object offsets.

removeExcavationRegion(name)Boolean

Remove the excavation plane of the specified name.
Name Type Description
name String The name of the excavation plane.
Returns:
Bool returns true if successful, and false returns if it fails.

removeFlattenRegion(name)Boolean

Remove the press plane of the specified name.
Name Type Description
name String The name of the pressure plane to be removed.
Returns:
Returns true if the removal succeeds, false returns if it fails.
Example:
S3MTilesLayer. removeFlattenRegion(regionName);

removeObjectsOperation(ids)

Removes the specified element's operation (cropping or offset) based on the element ID list.
Name Type Description
ids Array A list of primitive IDs.

removeObjsColor(ids)

The color in which the corresponding primitive is set is removed according to the primitive ID list.
Name Type Description
ids Array A list of primitive IDs.

removeObjsExtendHeight(ids)

The stretch height at which the object is set is removed according to the element ID list.
Name Type Description
ids Array A list of primitive IDs.

removeObjsOffset(ids)

Clear the object offset based on the object ID list.
Name Type Description
ids Array A list of object IDs.

removeOverlayImage(name)Boolean

Remove the specified name overlay area
Name Type Description
name String Overlay area name
Returns:
Bool successfully returns true, failure returns false

SetBound3D(left, bottom, right, top, minHeight, maxHeight)

Set a bounding box for the layer. The model in the box area has a volume rendering effect, and the out-of-area model remains as it is.
Name Type Description
left Number The longitude of the left side of the bounding box, in degrees.
bottom Number The latitude below the bounding box, the degree is the range.
right Number The longitude of the right side of the bounding box, in degrees.
top Number The latitude above the bounding box, in degrees.
minHeight Number The minimum height of the bounding box, in meters.
maxHeight Number The maximum height of the bounding box, in meters.

setCategoriesVisible(categories, mode)

Hide display objects based on W-bit eigenvalues
Name Type Description
categories Array.<Number> | Number Array of feature values, or eigenvalues
mode CategoryVisibleMode Hide, show, reset

setClipSection(firstPoint, secondPoint, thirdPoint, renderClipSection)

Set the clipping plane
Name Type Description
firstPoint Cartesian3 Draw the first point of the clipping plane.
secondPoint Cartesian3 Draw the second point of the clipping plane.
thirdPoint Cartesian3 Draw the third point of the clipping plane.
renderClipSection Boolean Draw a cropped section.
Example:
var p1 =  new Cesium.Cartesian3(-8787.4,2084.7,7021.04335128);
 var p2 =  new Cesium.Cartesian3(-8786.3,2081.8,7024.90146083);
 var p3 =  new Cesium.Cartesian3(-8783.2,2086.8,7021.04335128);
 for(var i = 0;i < layers.length;i++){
    layers[i].setClipSection(p1,p2,p3,true);
  }

setCustomClipBox(options)Boolean

Add a custom clipping plane.
Name Type Description
options Object Cutting surface parameters:
Name Type Description
dimensions Cartesian3 Specifies the length, width, and height of the crop box.
position Cartesian3 Specify the position of the clipping plane.
clipMode String Specify the crop mode. The crop mode includes the following categories:

clip_behind_any_plane:Crop the part that is behind any clipping plane.

clip_behind_all_plane:Crop the portion that is behind all clipping plane.

only_keep_line:Only the crop line is retained and the other parts are cropped.
Returns:
The success returns true, and the failure returns 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);

setCustomClipCross(options)

Set the area cropping parameters.
Name Type Description
options Object The parameter object contains the following properties:
Name Type Description
position Cartesian3 optional Center point position coordinates.
dimensions Cartesian2 optional The width and height of the crop area, in meters.
heading Number optional The angle of rotation of the cropped surface around the Z axis, in degrees.
pitch Number optional The angle of rotation of the cropped surface around the X axis, in degrees.
roll Number optional The angle of rotation of the cropped surface around the Y axis, in degrees.
extrudeDistance Number optional The stretching distance of the center point of the cropping area, in meters.

setCustomClipPlane(firstPoint, secondPoint, thirdPoint, clipPlaneMode)

Profile analysis.
Name Type Description
firstPoint Cartesian3 Draw the first point of the profile.
secondPoint Cartesian3 Draw the second point of the profile.
thirdPoint Cartesian3 Draw the third point of the profile.
clipPlaneMode ClipSectionMode Crop section mode.
Example:
var p1 =  new Cesium.Cartesian3(-8787.4,2084.7,7021.04335128);
 var p2 =  new Cesium.Cartesian3(-8786.3,2081.8,7024.90146083);
 var p3 =  new Cesium.Cartesian3(-8783.2,2086.8,7021.04335128);
 for(var i = 0;i < layers.length;i++){
    layers[i].setCustomClipPlane(p1,p2,p3,ClipPlaneMode.NONE);
  }

setLodRangeScale(lodrange)

Set the layer's lOD level to switch the distance scaling factor.
Name Type Description
lodrange Number lOD level switching distance scaling factor.
Example:
S3MTilesLayer.setLodRangeScale();

setModifyRegions(regions, mode)

Crops the S3M layer based on the polygon object.
Name Type Description
regions Array An array of polygons.
mode mode Crop mode, which sets the inner or outer extent of a cropped polygon object. The internal range is cropped when the value is CLIP_INSIDE, and the outer range is cropped when the value is CLIP_OUTSIDE.

setObjectsOperationByID(ids, operationType)

Performs a functional operation on the specified ID object.
Name Type Description
ids Array A list of object IDs.
operationType Number The type of function operation, the value is CLIP, which is effective for the cropping function.

setObjsColor(ids, color)

Set the color of the corresponding element according to the element IDS list.
Name Type Description
ids Array A list of primitive IDs.
color Color The color of the primitive.

setObjsExtendHeight(ids, height)

Sets the stretch height of the object based on the IDS list.
Name Type Description
ids Array A list of primitive IDs.
height Number The object stretch height value.

setObjsOffset(ids)

Set the object offset based on the object ID list.
Name Type Description
ids Array A list of object IDs.

setObjsVisible(ids, isVisible)

According to the element ID list, the visibility of the corresponding element is set, and the other elements of the layer are mutually exclusive.
Name Type Description
ids Array A list of primitive IDs.
isVisible Boolean Is it visible?
Example:
//Set the element whose layer id is 1, and all the other elements are not visible.
layer.setObjsVisible([1],true);
//Set the hiding of the element ID = 1, and all the remaining elements are visible.
layer.setObjsVisible([1],false);

setOnlyObjsVisible(ids, isVisible)

According to the element ID list, set the visibility of the corresponding element (manual setting). If ids is empty, isVisible sets the visibility of all layers.
Name Type Description
ids Array A list of primitive IDs.
isVisible Boolean Is it visible?
Example:
//The primitives with ids 1 and 2 are invisible, and the visible states of the remaining primitives are unchanged.
layer.setOnlyObjsVisible([1,2],false);
//Set the primitives with ids 1 and 2 to be visible, and the visible states of the remaining primitives remain unchanged.
layer.setOnlyObjsVisible([1,2],true);

setPolygonoffset(factor, units)

Set the polygon offset.
Name Type Description
factor Number Offset slope factor, default is 0.
units Number Offset unit, default is 0.
Example:
layer.setPolygonoffset(-1,-1);

setQueryParameter(options)

Set the attribute query parameters.
Name Type Description
options Object The object has the following properties:
Name Type Default Description
url String optional Data service url.
dataSourceName String optional The name of the datasource.
dataSetName String optional The name of the dataset.
isMerge Boolean optional Whether the layer is a merged dataset, and if so, does not specify a dataset name.
hasGeometry Boolean false optional The attribute query returns whether the result contains geometric information.
Example:
layer.setQueryParameter({
                    url: 'localhost:8090/services/realspace/services/xxx/rest/data',
                    dataSourceName: 'xxx',
                    dataSetName: 'xxx'
});

setSelection(id)

Set the selection set for the selection of scene.pick.
Name Type Description
id Number Entity ID.

setVisibleInViewport(index, visible)

Set the visibility of the layer corresponding to the viewport.
Name Type Description
index Number index.
visible Boolean Visibility.
Throws:

updateAllObjsVisible(visible)

Update all object visibility
Name Type Description
visible Boolean Is it visible?

updateObjsColor(ids)

Iterate through all the primitives and update the corresponding primitive color according to the ID list.
Name Type Description
ids AssociativeArray An array of the relationship between the element ID list and the color.

updateObjsVisible(ids, visible)

Iterate through all the primitives, update the corresponding primitive visibility according to the ID list, and mutually exclude the visible relationship. If [1, 2] is set to visible, the remaining elements are not visible if [1, 2] is set to be invisible. Then the remaining elements are visible.
Name Type Description
ids AssociativeArray An array of the relationship between the element ID list and the color.
visible Boolean Is it visible?

updateRenderState()

Update the rendering state.