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).
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:
|
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
-
Get the floodlight effect.
-
Get the floodlight effect on.
-
Release the vertex color memory and restore the vertex color.
-
Set the layer brightness value to adjust the color.
-
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
-
Set the color table mode.
-
Set the layer contrast value to adjust the color.
-
Get or set single-sided rendering (default single-sided rendering, back culling).
-
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;
-
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;
-
Gets or sets the line style symbol of the S3M layer.
-
Set the layer gamma value to adjust the color.
-
Get the name of the group where the layer is located
-
Gets or sets whether the layer has lighting effects turned on.
-
Gets or sets the camera's heading angle (in radians).
-
horizontalColor : Color
-
Gets or sets the horizontal line color.
-
Gets or sets the horizontal line height.
-
Set the layer tonal value to adjust the color.
-
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 ;
-
Get the layer id.
-
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.
-
Get or set the indexedDB attribute information (IE browser does not support)
-
layerBounds : Rectangle
-
Gets or sets the layer extent.
-
Get or set the loading mode.
-
LoadingPriority : LoadingPriorityMode
-
Get or set the loading mode
-
Default Value:
Child_Priority : 1
-
Gets or sets the layer's LOD level switch distance scaling factor.
-
Gets or sets the maximum visible height of the layer.
-
Gets or sets the minimum visible height of the layer.
-
Set texture display mode (mix, replace)
-
Gets or sets whether the layer supports multiple selection.
-
Get the layer name
-
Get the encapsulation point cloud rendering parameter object pointCloudShading
-
Set the layer saturation value to adjust the color.
-
SelectColorType : SelctColorType
-
Get the display style of the selected object.
-
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.
-
Gets or sets whether the layer is optional.
-
Gets or sets the transparent selection filter threshold.
-
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
-
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.
-
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();
-
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.
-
Get or set layer visibility.
Example:
//Get visibility var isVisible = S3MTilesLayer.visible; //Settings are not visible S3MTilesLayer.visible = false;
-
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.
-
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.
-
Volume data name.
-
Gets or sets the layer wireframe mode.
Methods
-
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. -
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'});
-
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. -
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. -
Clear the custom crop faces.
Example:
S3MTilesLayer.clearCustomClipBox();
-
Clear the polygon object to crop the S3M layer.
-
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 the layer, free up memory, and release webgl resources
-
Border line does not disappear after setting fill mode
-
Get local object attribute information (scvd in indexedDB, which is not supported by IE browser).
Name Type Description id
Number index. -
Get the range of section clipping.
-
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. -
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);
-
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. -
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();
-
Get the visibility of the layer corresponding to the viewport.
Name Type Description index
Number index. Returns:
visible.Throws:
-
DeveloperError : The index value ranges from 0 to 3.
-
-
Get all the volume data names.
Returns:
An array of all volume data names. -
Refresh the layer.
-
Release the selection set.
Example:
S3MTilesLayer.releaseSelection();
-
Remove all excavation plane.
-
Remove all pressing planes.
Example:
S3MTilesLayer. removeAllFlattenRegion();
-
Remove all primitive operations.
-
Remove the color of all element settings.
-
Remove the stretch height of all settings.
-
Clear all object offsets.
-
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. -
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);
-
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. -
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. -
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. -
Clear the object offset based on the object ID list.
Name Type Description ids
Array A list of object IDs. -
Remove the specified name overlay area
Name Type Description name
String Overlay area name Returns:
Bool successfully returns true, failure returns false -
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. -
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 -
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); }
-
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);
-
-
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. -
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); }
-
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();
-
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. -
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. -
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. -
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. -
Set the object offset based on the object ID list.
Name Type Description ids
Array A list of object IDs. -
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);
-
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);
-
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);
-
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' });
-
Set the selection set for the selection of scene.pick.
Name Type Description id
Number Entity ID. -
Set the visibility of the layer corresponding to the viewport.
Name Type Description index
Number index. visible
Boolean Visibility. Throws:
-
DeveloperError : The index value ranges from 0 to 3.
-
-
Update all object visibility
Name Type Description visible
Boolean Is it visible? -
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. -
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? -
Update the rendering state.