Constructor
new Glodon.Bimface.Plugins.Geometry.SplineCurve()
Methods
clampMode(option)
设置曲线贴地样式
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
| option | Object | 曲线的贴地样式, 默认为{mode: "Space"} Properties
|
clone()
复制该样条曲线对象
Returns:
| Type | Description |
|---|---|
| Glodon.Bimface.Plugins.Geometry.SplineCurve |
样条曲线对象 |
dispose()
销毁当前样条曲线对象
getColor()
获取曲线的颜色
Returns:
| Type | Description |
|---|---|
| Glodon.Web.Graphics.Color |
颜色 |
getPointByLength(length)
获取曲线上某距离处的点坐标
Parameters:
| Name | Type | Description |
|---|---|---|
| length | Number | 长度 (当length<0或length>curve.length时,返回为空) |
Returns:
| Type | Description |
|---|---|
| Object |
点对象 |
getPointByParameter(parameter)
获取曲线上某比例处的点坐标
Parameters:
| Name | Type | Description |
|---|---|---|
| parameter | Number | 曲线比例,取值范围[0,1] (当parameter<0或parameter>1时,返回为空) |
Returns:
| Type | Description |
|---|---|
| Object |
点对象 |
getPoints()
获取组成曲线的控制点列表
Returns:
| Type | Description |
|---|---|
| Array |
组成曲线的控制点列表 |
getStyle()
获取曲线样式
Returns:
| Type | Description |
|---|---|
| Object |
曲线样式 |
getTangentByLength(length)
获取曲线上某距离处的切向量
Parameters:
| Name | Type | Description |
|---|---|---|
| length | Number | 长度 (当length<0或length>curve.length时,返回为空) |
Returns:
| Type | Description |
|---|---|
| Object |
切向量 |
getTangentByParameter(parameter)
获取曲线上某比例处的切向量
Parameters:
| Name | Type | Description |
|---|---|---|
| parameter | Number | 曲线比例,取值范围[0,1] (当parameter<0或parameter>1时,返回为空) |
Returns:
| Type | Description |
|---|---|
| Object |
切向量 |
getType()
获取曲线类型
Returns:
| Type | Description |
|---|---|
| String |
曲线类型 (样条线为"spline",折线为"polyline") |
getWidth()
获取曲线宽度
Returns:
| Type | Description |
|---|---|
| Number |
曲线宽度 |
getWidthType()
获取宽度类型
Returns:
| Type | Description |
|---|---|
| String |
type 宽度类型,"DisplayWidth"为显示宽度,单位为pixel,"ActualWidth"为实际宽度,单位跟随场景单位。 |
projectToGround()
是否开启曲线贴地效果
Returns:
| Type | Description |
|---|---|
| Boolean |
是否开启贴地效果,默认为false,仅在加载DEM数据情况下有效 |
setColor(color)
设置曲线的颜色
Parameters:
| Name | Type | Description |
|---|---|---|
| color | Glodon.Web.Graphics.Color | 颜色 |
setMap(callback)
设置贴图
Parameters:
| Name | Type | Description |
|---|---|---|
| options.src | String | 贴图路径,必填 |
| options.scale | Number | 缩放比例,默认为1 |
| options.offset | Number | 贴图偏移,默认为0 |
| options.enableColorOverride | Boolean | 是否允许颜色覆盖,默认为false |
| callback | function | 贴图加载成功的回调函数 |
setStyle(style)
设置曲线样式
Parameters:
| Name | Type | Description |
|---|---|---|
| style | Object | 曲线样式(实线:{"lineType": "Continuous","lineStyle": null},虚线: {"lineType": "Dashed","lineStyle": {"dashLength": 100,"gapLength": 100}}) |
setType(type)
设置曲线类型
Parameters:
| Name | Type | Description |
|---|---|---|
| type | String | 曲线类型 (样条线为"spline",折线为"polyline") |
setWidth(width)
设置曲线宽度
Parameters:
| Name | Type | Description |
|---|---|---|
| width | Number | 曲线宽度 |
setWidthType(type)
设置宽度类型
Parameters:
| Name | Type | Description |
|---|---|---|
| type | String | 宽度类型,"DisplayWidth"为显示宽度,单位为pixel,曲线的显示宽度不会随着场景的缩放而变化;"ActualWidth"为实际宽度,单位跟随场景单位,曲线的显示宽度会随着场景的缩放而变化。默认为"DisplayWidth" |
stretch(intensty, parameter)
拉伸曲线
Parameters:
| Name | Type | Description |
|---|---|---|
| intensty | Number | 向上拉伸强度,默认值为0.5 |
| parameter | Number | 两点间线段的拉伸位置,默认值为0.5,取值范围(0,1),越小越靠近起点 |