1. ClipTools

模型剖切工具

1.1. new ClipTools(geomap)

Param Type Description
geomap GeoMap

GeoMap对象

Example

var clipTool = new BOSGeo.ClipTools(geomap);

1.2. 属性

属性名 Type Default Description
handlerActive Boolean true

剖切激活状态

1.3. 方法

1.4. clipTools.clip()

开始剖切

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.clip();

1.5. clipTools.destroy()

清除剖切

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.destroy();

1.6. clipTools.clear()

清空剖切盒

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.clear();

1.7. clipTools.reset()

重置剖切

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.reset();

1.8. clipTools.addClippingPlane(model)

设置需要剖切的模型,给模型加剖切盒

Param Type Description
model Cesium3DTileset

3DTiles模型对象

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.addClippingPlane(model);

1.9. clipTools.addEventHandler()

添加监听

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.addEventHandler();

1.10. clipTools.getPickPlane(point) ⇒ Plane

计算pick平面的法向量

Returns : Plane -

法向量

Param Type Description
point Cartesian3

平面与球体切点

Example

var clipTool = new BOSGeo.ClipTools(geomap);
let plane = clipTool.getPickPlane(point);

1.11. clipTools.getProjection(vecA, vecB) ⇒ Number

求vecA(向量A)在vecB(向量B)上的投影长度

Param Type Description
vecA Cartesian3

向量A

vecB Cartesian3

向量B

Example

var clipTool = new BOSGeo.ClipTools(geomap);
let res = clipTool.getProjection(vecA, vecB);

1.12. clipTools.getBoxParams(center, distance)

获取包围盒参数

Param Type Description
center Object

中心点

distance Number

距离

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.getBoxParams(center, distance);

1.13. clipTools.addPlanePrimitive(plane, center, upAxis)

添加平面模型

Param Type Description
plane Entity

平面

center Cartesian3

中心

upAxis Cartesian3

轴向

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.addPlanePrimitive(plane, center, upAxis);

1.14. clipTools.createPlaneUpdateFunc(plane) ⇒ Entity

更新平面的中心

Returns : Entity -

plane平面

Param Type Description
plane Entity

平面

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.createPlaneUpdateFunc(plane);

1.15. clipTools.getClippingPlaneByAxis(axis)

根据axis获取剖切面

Param Type Description
axis Cartesian3

轴向

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.getClippingPlaneByAxis(axis);

1.16. clipTools.getEntityInitClippingPanelDistance()

获取模型包围盒大小

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.getEntityInitClippingPanelDistance();

1.17. clipTools.getEntityPosition()

获取到包围盒的中心

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.getEntityPosition();

1.18. clipTools.getRotationMatrix3(plane) ⇒ Matrix3

获取剖切对应的旋转矩阵

Returns : Matrix3 -

旋转矩阵

Param Type Description
plane Object

剖切对象

Example

var clipTool = new BOSGeo.ClipTools(geomap);
let matrix = clipTool.getRotationMatrix3(plane);

1.19. clipTools.getDistanceMatrix4(plane) ⇒ Matrix4

剖切面位移矩阵

Returns : Matrix4 -

位移矩阵

Param Type Description
plane Object

剖切面

Example

var clipTool = new BOSGeo.ClipTools(geomap);
let matrix = clipTool.getDistanceMatrix4(plane);

1.20. clipTools.getEntityMatrix() ⇒ Matrix4

获取当前选中模型的旋转矩阵

Returns : Matrix4 -

旋转矩阵


Example

var clipTool = new BOSGeo.ClipTools(geomap);
let matrix = clipTool.getEntityMatrix();

1.21. clipTools.getPickPlanePoint(ray, point, noraml) ⇒ Cartesian3

获取与选中平面的交点

Returns : Cartesian3 -

焦点

Param Type Description
ray Ray

提供的原点沿提供的方向无限延伸的射线

point Cartesian3

noraml Cartesian3

法线向量

Example

var clipTool = new BOSGeo.ClipTools(geomap);
let poi = clipTool.getPickPlanePoint(ray, point, noraml);

1.21.1. clipTools.removeEventHandler()

移除剖切监听

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.removeEventHandler();

1.22. clipTools.hide()

隐藏剖切区域

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.hide();

1.23. clipTools.show()

显示剖切盒

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.show();

1.24. clipTools.hideBox()

隐藏剖切盒

Example

var clipTool = new BOSGeo.ClipTools(geomap);
clipTool.hideBox();
版权所有@盈嘉互联(北京)科技有限公司 京ICP备15051988号-9 Copyright © 2022 all right reserved,powered by Gitbook该文件修订时间: 2022-07-19 11:34:25

results matching ""

    No results matching ""