AltizureProjectMarker(APMOptions)

一个标记持有altizure项目的场景节点

new AltizureProjectMarker(APMOptions)

Parameters:
Name Type Description
APMOptions object

初始化选项

Properties
Name Type Attributes Description
earth Earth

标记附加的地球

projInfo object

altizure项目信息

patrolRoutes object <optional>

巡逻

position LngLatAlt

标记位置

orientation Quaternion <optional>

标记方向

scale object <optional>

标记刻度

Example

construction

 let altizureProjectMarkerOptions1 = {
   pid: '5a07f43f5d1dfe17d0c66bb7', // a project id
   // you can also specify the pose of the AltizureProjectMarker
   // position, orientation, scale
   pose: {
     position: {
       lng: ...,
       lat: ...,
       alt: ...
     },
     orientation: {x: ..., y: ..., z: ..., w: ...},
     // the expected orientation
     scale: {x: ..., y: ..., z: ...}
     // scale in x, y and z directions
   }
 }
 let altizureProjectMarkerOptions2 = {
   pid: '5a07f43f5d1dfe17d0c66bb7', // a project id
   // you can also specify the pose of the AltizureProjectMarker
   // position, orientation, scale
   position: {
     lng: ...,
     lat: ...,
     alt: ...
   },
   orientation: {x: ..., y: ..., z: ..., w: ...},
   // the expected orientation
   scale: {x: ..., y: ..., z: ...}
   // scale in x, y and z directions
 }

 // the pose defined in markerOptions.pose has higher priority
 let altizureProjectMarkerOptions3 = {
   pid: '5a07f43f5d1dfe17d0c66bb7', // a project id
   // you can also specify the pose of the AltizureProjectMarker
   // position, orientation, scale
   pose: {
     position: { // this position will be used
       lng: ...,
       lat: ...,
       alt: ...
     },
     orientation: {x: ..., y: ..., z: ..., w: ...}, // this orientation will be used
     // the expected orientation
   }
   // position, orientation, scale
   position: {
     lng: ...,
     lat: ...,
     alt: ...
   },
   orientation: {x: ..., y: ..., z: ..., w: ...},
   // the expected orientation
   scale: {x: ..., y: ..., z: ...} // this scale will be used
   // scale in x, y and z directions
 }
 // all three markerOptions are valid

 // use first markerOptions
 let altizureProjectMarkerOptions = altizureProjectMarkerOptions1
 altizureProjectMarkerOptions.autoScale = true // true means the max length of the base of bbox is 50 meters
 // altizureProjectMarkerOptions.autoScale = 200 // max length of the base of bbox is 200 meters
 sandbox.add('AltizureProjectMarker', altizureProjectMarkerOptions)

Extends

Members

autoScale

使用最大基本边的长度等于输入autoScale来更改比例 如果输入为真,则表示50。

Example

Set autoScale

 altizureProjectMarker.autoScale = true // the same as 50
 altizureProjectMarker.autoScale = 50 // the same as the line above
 // or other number
 altizureProjectMarker.autoScale = 1000

euler :object

Eular角度表示中的方向。 {x:绕X轴以弧度为单位的旋转角度,  y:弧度,  z:弧度,  顺序:旋转顺序,默认'XYZ'}。  用这个代替方向 如果你不熟悉数学。

Overrides:
See:
Example

Set orientation by Eular angles

 marker.euler = {x: Math.PI/6, y: Math.PI/4, z: Math.PI/3} // rotate around X-axis for 30 degree; Y for 45 degree; Z for 60 degree, in that order.
 marker.euler = {y: Math.PI/2} // rotate around Y-axis for 90 degree.

readonly geoCoverage

Project boundary

readonly ID :string

获取唯一的ID。

Inherited From:

interactable :bool

如果标记是可交互的,则设置。设置为true以响应鼠标事件。

Overrides:
Example

Set interactable

 marker.interactable = true // make this marker interactable
 marker.interactable = !marker.interactable // flip interactable status

name :string

一串名字。

Overrides:
Example

Set name

 marker.name = 'this marker' // set name as 'this marker'
 marker.name = marker.name + ' suffix' // extend the name

orientation :object

通过均匀四元数{x,y,z,w}设置旋转。 使用EULAR 相反,如果你不知道如何使用这个。

Overrides:
See:
Example

Set orientation

 marker.orientation = {x: 0, y: 0, z: 0, w: 1}

readonly photos

照片操作。

position :LngLatAlt

改变当前位置{lng,lat,alt}。

Overrides:
Example

Set position

 marker.position = {
   lng: 113.93977612840078,
   lat: 22.5364271949327,
   alt: 12.3
 }

readonly projInfo

项目信息。

scale :number

设置标记的比例。

Overrides:
Example

Set scale

 marker.scale = 2.0 // set scale to 2.0
 marker.scale = marker.scale * 2.0 // make it two times bigger

visible :bool

设置标记的可见性。

Overrides:
Example

Set visible

 marker.visible = false // make this marker invisible
 marker.visible = !marker.visible // flip visible status

readonly water

水务运作。

x :number

在x方向上设置标记的比例。

Overrides:
Example

Set scale x

 marker.x = 2.0 // set scale x to 2.0
 marker.x = marker.x * 2.0 // make it two times bigger in x direction

y :number

在y方向上设置标记的比例。

Overrides:
Example

Set scale y

 marker.y = 2.0 // set scale y to 2.0
 marker.y = marker.y * 2.0 // make it two times bigger in y direction

z :number

在z方向上设置标记的比例。

Overrides:
Example

Set scale z

 marker.z = 2.0 // set scale z to 2.0
 marker.z = marker.z * 2.0 // make it two times bigger in z direction

Methods

_detectOffset(srcImg, dstImg, options) → {promise}

通过搜索最佳匹配来检测从srcImg到dstImg的偏移量

Parameters:
Name Type Description
srcImg Object

这个AltizureProjectMarker的深度图

dstImg Object

掩码图像

options Object

其他选项

Returns:
promise

_generateImages(options) → {object}

生成用于偏移量检测的图像,以用于方法_detectOffset

Parameters:
Name Type Description
options object
Returns:
object

abstract animate(options)

传播的事件,正在渲染的新帧。

Parameters:
Name Type Description
options object
Overrides:

autoAdjustPolygons(boundaryPts, polygonMarkers, bufferMaxSize)

Automatically adjust polygonMarkers by obtaining their top and bottom from the depth map. The polygonMarkers must be ready

Parameters:
Name Type Default Description
boundaryPts Array.<LngLat>

lnglat点代表边界

polygonMarkers Array.<PolygonMarker>

要调整的多边形

bufferMaxSize number 512

深度图和掩模分辨率

deport() → {bool}

销毁树,并释放所有内存资源。但保持标记数据结构。

Returns:
bool

deportPhotos() → {bool}

Deport photos.

Returns:
bool

deportPhotos() → {bool}

Deport photos.

Returns:
bool

deportWater()

释放水占用的内存。

destruct()

析构函数。

Overrides:

detachControl()

分离并隐藏标记的控件小控件

Inherited From:
Example

Detach control

 marker.detachControl()

dim()

Un-highlight the marker. (hide the blue fence of the marker)

Inherited From:
Example

Un-highlight

 marker.dim()

disposeCurrentDisplay()

淡出当前的照片显示。

earthToObj() → {Matrix4}

从抽象的地球空间到Obj空间。

Returns:
Matrix4

earthToProject() → {Matrix4}

从抽象?地球空间项目持有人。

Returns:
Matrix4

getRegionVolume(polygonMarker) → {object|undefined}

获取由多边形标记的区域的{切割,填充,面积,曲面,refAltitude,最高,最低}。 多边形必须准备就绪

Parameters:
Name Type Description
polygonMarker PolygonMarker

指示感兴趣区域的多边形标记

Returns:
object | undefined
Example

get the measurement inside a polygon

 altizureProjectMarker.getRegoinVolume(polygonMarker, 0) // reference altitude is 0
 // input a polygonMarker and the reference altitude to
 // get the measured information, including
 // cut: how much is the volume we should dig to make the area flat at refAltitude
 // fill: how much is the volume we should fill to make the area flat at refAltitude
 // area: the area inside the boundary of polygonMarker
 // surface: the area of the surface inside the boundary of the polygonMarker
 // refAltitude: the cut and fill are calculated based on this altitude
 // highest: highest altitude in the region
 // lowest: lowest altitude in the region

importPhotos() → {promise}

导入altizure项目的照片。把它们放到this.photoHolder中

Returns:
promise

importWater() → {promise}

进口水的项目。把它放进这个水桶里

Returns:
promise

light()

Highlight the marker. (show the blue fence of the marker)

Inherited From:
Example

Highlight

 marker.light()

measureByPolygon(polygonMarker, refAltitude) → {Promise}

获取由多边形标记的区域的{cut,fill,area,refAltitude,highest,lowest}。 多边形可能只是构造一个。

Parameters:
Name Type Description
polygonMarker PolygonMarker
refAltitude number
Returns:
Promise
Example

get the measurement inside a polygon

 altizureProjectMarker.measureByPolygon(polygonMarker, 0)
   .then((result) => {
     // result: {cut, fill, area, refAltitude, highest, lowest}
     let measureInfo = result
   })

objToEarth() → {Matrix4}

从altizure obj空间到地球空间(抽象的,而不是米)

Returns:
Matrix4

objToScene() → {Matrix4}

从obj空间到场景根。

Returns:
Matrix4

off(eventType, handler)

从事件中取消注册处理程序。

Parameters:
Name Type Description
eventType string
handler function
Inherited From:
Example

Un-register interaction events

 marker.off('click')
 marker.off('mouseover')
 marker.off('mouseenter')
 marker.off('mouseleave')

on(eventType, handler)

用处理程序注册一个事件。 注意:一个事件只能有一个处理程序。

Parameters:
Name Type Description
eventType string

'click','mouseover','mouseenter','mouseleave'

handler function

事件处理器

Inherited From:
Example

Register interaction events

 marker.on('click', function (event) {
   console.log('click on marker ', marker, event)
 })
 marker.on('mouseover', function (event) {
   console.log('mouse over marker ', marker, event)
 })
 marker.on('mouseenter', function (event) {
   console.log('mouse enter marker ', marker, event)
 })
 marker.on('mouseleave', function (event) {
   console.log('mouse leave marker ', marker, event)
 })
 marker.interactable = true // the marker must be interactable for events to take effects

onContentInitialized()

当3D模型被下载并添加到场景中时的EventHandler。 使用marker.initialized.then(function(){})来处理这个事件。

orientationByHorizontalPoints(pts, flip) → {Quaternion}

从水平点得到重新定位的方向

Parameters:
Name Type Default Description
pts Array.<LngLatAlt>
flip bool false
Returns:
Quaternion
Inherited From:

pickDepthMap(lngLatArray) → {Array.<nubmer>}

获取此项目标记上点数组的高度值。

Parameters:
Name Type Description
lngLatArray Array.<LngLatAlt>

{lng,lat}对象的数组

Returns:
Array.<nubmer>
Example

Pick the depth from lng and lat

 let positions = [
   {lng: 107.30426318131709, lat: 35.65218367804628},
   {lng: 107.30425715131709, lat: 35.65218477804628},
   {lng: 107.30424679131709, lat: 35.65218677604628},
   {lng: 107.30423743131709, lat: 35.65218777304628}
 ]
 let heightsArray = altizureProjectMarker.pickDepthMap(positions)

sceneToObj() → {Matrix4}

从场景根到obj空间。

Returns:
Matrix4

sceneUpdated(options)

场景更新时触发。将传播到

Parameters:
Name Type Description
options any
Overrides:

setControlMode(mode)

设置控件Gizmo的模式

Parameters:
Name Type Description
mode string

控件gizmo'translate','rotate'的模式

Inherited From:
Example

Set the mode of the control

 marker.setControlMode('translate')
 marker.setControlMode('rotate')

shapeToEarth() → {Matrix4}

从shapeHolder-space到地球空间的变换矩阵

Returns:
Matrix4
Inherited From:

shapeToScene() → {Matrix4}

从shapeHolder-space到scene-root的变换矩阵

Returns:
Matrix4
Inherited From:

showControl(mode)

播放标记的{index}巡视路线

Parameters:
Name Type Description
mode string

控件gizmo的模式:'translate','rotate'

Inherited From:
Example

Show control

 marker.showControl('translate') // show control used for translate
 marker.showControl('rotate') // show control used for rotate

updateVisibility(options)

可视性更新时触发。将事件传播到智能树。

Parameters:
Name Type Description
options object
Overrides: