mxcad_3d API 文档 / MxCAD3DObject
Class: MxCAD3DObject 
文档视图对象 一个文档视图对象对应一个Canvas视图和一个文档
Table of contents 
Constructors 
Methods 
- addModelTexture
- callEvent
- create
- displayDimension
- displaySymbolText
- enableCustomClipPlane
- enableDirLightSrc
- enableXClipPlane
- enableYClipPlane
- enableZClipPlane
- fitAllObjects
- getCtx
- getDocument
- getImp
- init
- off
- on
- removeAll
- removeModelTexture
- removeSelected
- setCubemapBackground
- setCustomClipPlaneDirection
- setCustomClipPlanePosition
- setCustomClipPlaneReverse
- setDisplayMode
- setGradientBgColor
- setManipulatorEnabled
- setProj
- setProjectionType
- setSelectedColor
- setSelectedMaterial
- setXClipPlaneReverse
- setXClipPlaneXPosition
- setYClipPlaneReverse
- setYClipPlaneYPosition
- setZClipPlaneReverse
- setZClipPlaneZPosition
- showCenterTrihedron
- update
- updateCanvasSize
Constructors 
constructor 
• new MxCAD3DObject()
Methods 
addModelTexture 
▸ addModelTexture(theFileName): void
为当前选中对象设置纹理贴图
Parameters 
| Name | Type | Description | 
|---|---|---|
| theFileName | string | 图片在文件系统中的完整路径 | 
Returns 
void
callEvent 
▸ callEvent(sEventName, param?): boolean
Parameters 
| Name | Type | 
|---|---|
| sEventName | string | 
| param? | any | 
Returns 
boolean
create 
▸ create(config): void
初始化当前文档视图对象
Parameters 
| Name | Type | Description | 
|---|---|---|
| config | MxCAD3DConfig | 初始化需要的相关配置,canvas可以是选择器字符串,也可以是canvas对象 | 
Returns 
void
displayDimension 
▸ displayDimension(theDimension): void
显示标注符号
Parameters 
| Name | Type | Description | 
|---|---|---|
| theDimension | Mx3dDimObject | 标注符号对象 | 
Returns 
void
displaySymbolText 
▸ displaySymbolText(theSymbol): void
显示文字符号
Parameters 
| Name | Type | Description | 
|---|---|---|
| theSymbol | Mx3dSymbolText | 文字符号对象 | 
Returns 
void
enableCustomClipPlane 
▸ enableCustomClipPlane(theToEnabled): void
开启/关闭用户自定义剖切面
Parameters 
| Name | Type | Description | 
|---|---|---|
| theToEnabled | boolean | 是否开启用户自定义剖切面 | 
Returns 
void
enableDirLightSrc 
▸ enableDirLightSrc(theToEnabled): void
Parameters 
| Name | Type | 
|---|---|
| theToEnabled | boolean | 
Returns 
void
enableXClipPlane 
▸ enableXClipPlane(theToEnabled): void
开启/关闭X轴剖切面
Parameters 
| Name | Type | Description | 
|---|---|---|
| theToEnabled | boolean | 是否开启X轴剖切面 | 
Returns 
void
enableYClipPlane 
▸ enableYClipPlane(theToEnabled): void
开启/关闭Y轴剖切面
Parameters 
| Name | Type | Description | 
|---|---|---|
| theToEnabled | boolean | 是否开启Y轴剖切面 | 
Returns 
void
enableZClipPlane 
▸ enableZClipPlane(theToEnabled): void
开启/关闭Z轴剖切面
Parameters 
| Name | Type | Description | 
|---|---|---|
| theToEnabled | boolean | 是否开启Z轴剖切面 | 
Returns 
void
fitAllObjects 
▸ fitAllObjects(theAuto): void
视图中的所有对象缩放至适应整个视图
Parameters 
| Name | Type | Description | 
|---|---|---|
| theAuto | boolean | 自动缩放 | 
Returns 
void
getCtx 
▸ getCtx(): any
Returns 
any
getDocument 
▸ getDocument(): Mx3dDbDocument
获取当前文档视图对象的文档
Returns 
返回文档对象
getImp 
▸ getImp(): any
Returns 
any
init 
▸ init(imp): void
Parameters 
| Name | Type | 
|---|---|
| imp | any | 
Returns 
void
off 
▸ off(name, fun?): void
Parameters 
| Name | Type | 
|---|---|
| name | string | 
| fun? | Function | 
Returns 
void
on 
▸ on(name, fun): void
Parameters 
| Name | Type | 
|---|---|
| name | "init" | 
| fun | () => void | 
Returns 
void
removeAll 
▸ removeAll(theUpdateView?): void
移除所有
Parameters 
| Name | Type | Default value | Description | 
|---|---|---|---|
| theUpdateView | boolean | true | 移除后是否立即更新视图 | 
Returns 
void
removeModelTexture 
▸ removeModelTexture(): void
移除当前选择对象的纹理贴图
Returns 
void
removeSelected 
▸ removeSelected(): void
移除选中
Returns 
void
setCubemapBackground 
▸ setCubemapBackground(theRight, theLeft, theTop, theBottom, theFront, theBack): void
Parameters 
| Name | Type | 
|---|---|
| theRight | string | 
| theLeft | string | 
| theTop | string | 
| theBottom | string | 
| theFront | string | 
| theBack | string | 
Returns 
void
setCustomClipPlaneDirection 
▸ setCustomClipPlaneDirection(x, y, z): void
设置用户自定义剖切面的法向
Parameters 
| Name | Type | Description | 
|---|---|---|
| x | number | 法向的x分量 | 
| y | number | 法向的y分量 | 
| z | number | 法向的z分量 | 
Returns 
void
setCustomClipPlanePosition 
▸ setCustomClipPlanePosition(thePosition): void
设置用户自定义剖切面的位置
Parameters 
| Name | Type | Description | 
|---|---|---|
| thePosition | number | 剖切平面相对于世界坐标系原点的位置 | 
Returns 
void
setCustomClipPlaneReverse 
▸ setCustomClipPlaneReverse(): void
翻转用户自定义剖切面
Returns 
void
setDisplayMode 
▸ setDisplayMode(theMode): void
设置当前的显示模式
Parameters 
| Name | Type | Description | 
|---|---|---|
| theMode | MxGlobalDisplayMode | 显示模式 | 
Returns 
void
setGradientBgColor 
▸ setGradientBgColor(theColor1, theColor2, theMethod): void
设置渐变背景色
Parameters 
| Name | Type | Description | 
|---|---|---|
| theColor1 | Mx3dGeColor | 颜色对象1 | 
| theColor2 | Mx3dGeColor | 颜色对象2 | 
| theMethod | MxGradientFillMethod | 渐变方式 | 
Returns 
void
setManipulatorEnabled 
▸ setManipulatorEnabled(isEnabled): void
Parameters 
| Name | Type | 
|---|---|
| isEnabled | boolean | 
Returns 
void
setProj 
▸ setProj(theOrientation, theIsYup): void
设置视图方向
Parameters 
| Name | Type | Description | 
|---|---|---|
| theOrientation | MxV3dTypeOfOrientation | 视图方向 | 
| theIsYup | boolean | 是否Y轴向上 | 
Returns 
void
setProjectionType 
▸ setProjectionType(theProjection): void
设置视图投影模式
Parameters 
| Name | Type | Description | 
|---|---|---|
| theProjection | MxCameraProjection | 投影模式 | 
Returns 
void
setSelectedColor 
▸ setSelectedColor(color): void
设置当前选中对象的颜色
Parameters 
| Name | Type | Description | 
|---|---|---|
| color | Mx3dGeColor | 颜色 | 
Returns 
void
setSelectedMaterial 
▸ setSelectedMaterial(material): void
设置选中对象的材质
Parameters 
| Name | Type | Description | 
|---|---|---|
| material | Mx3dGeMaterial | 材质 | 
Returns 
void
setXClipPlaneReverse 
▸ setXClipPlaneReverse(): void
翻转X轴剖切面
Returns 
void
setXClipPlaneXPosition 
▸ setXClipPlaneXPosition(thePosition): void
设置X轴剖切面的位置
Parameters 
| Name | Type | Description | 
|---|---|---|
| thePosition | number | 剖切平面相对于世界坐标系原点的位置 | 
Returns 
void
setYClipPlaneReverse 
▸ setYClipPlaneReverse(): void
翻转Y轴剖切面
Returns 
void
setYClipPlaneYPosition 
▸ setYClipPlaneYPosition(thePosition): void
设置Y轴剖切面的位置
Parameters 
| Name | Type | Description | 
|---|---|---|
| thePosition | number | 剖切平面相对于世界坐标系原点的位置 | 
Returns 
void
setZClipPlaneReverse 
▸ setZClipPlaneReverse(): void
翻转Z轴剖切面
Returns 
void
setZClipPlaneZPosition 
▸ setZClipPlaneZPosition(thePosition): void
设置Z轴剖切面的位置
Parameters 
| Name | Type | Description | 
|---|---|---|
| thePosition | number | 剖切平面相对于世界坐标系原点的位置 | 
Returns 
void
showCenterTrihedron 
▸ showCenterTrihedron(theToShow): void
显示中心坐标轴
Parameters 
| Name | Type | Description | 
|---|---|---|
| theToShow | boolean | true显示,false不显示 | 
Returns 
void
update 
▸ update(isUpAllData?, isRemoveAll?): void
更新显示
Parameters 
| Name | Type | Default value | Description | 
|---|---|---|---|
| isUpAllData | boolean | true | 是否更新所有数据 | 
| isRemoveAll | boolean | true | 是否首先移除所有数据 | 
Returns 
void
updateCanvasSize 
▸ updateCanvasSize(): void
Returns 
void