Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MxDrawObject

引入mxdraw库不会挂载MxDrawObject 只能在以下特定函数中获取

function

MxFun.createMxObject中callback回调参数mxDraw的构造类

function

MxFun.getCurrentDraw 方法返回值的构造类

Hierarchy

Index

Constructors

Properties

Methods

Constructors

Properties

_mxdrawObj: MxDrawObjectType
children: (Node<any, any> | MxDrawObject)[] = []

它的子节点集合

events: {}

Type declaration

parent: null | Node<any, any> | MxDrawObject = null

它的父节点

renderer: WebGLRenderer
instance
rootLayer: Layer

Methods

  • addControlsEvent(type: string, call: ((event: any) => number), isFront?: boolean): number
  • 添加鼠标键盘响应事件.

    example
    // mousedown,touchstart,mouseup,mousemove,touchend,touchmove
    //事件返回0,事件会继续传递,返回1事件不再被后续程序处理.
    mxobj.addControlsEvent("touchstart",(event)=>{
    return 0;
    })

    Parameters

    • type: string
    • call: ((event: any) => number)
        • (event: any): number
        • Parameters

          • event: any

          Returns number

    • isFront: boolean = false

    Returns number

  • addEvent(eventNaem: keyof RendererEventsType | "loadComplete" | "render" | "addResizeEvent" | "initObject" | "openFileComplete" | "saveFileComplete" | "uiSetLayerData" | "viewchange" | "MxEntitySelectChange" | "objectGripEdit" | "whetherEditTheGripPoint" | "databaseModify", fun: (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | ((resize: Function) => void) | (() => void) | ((iResult: number) => void) | ((iResult: number, sServerResult: string) => void) | ((layerList: { color?: string; colorValue?: number; id: number; isState?: boolean; name: string; off?: number; zerolayer?: number }[]) => void) | (() => void) | ((ids: number[]) => void) | ((entity: MxDbEntity) => void) | ((entity: MxDbEntity) => void) | (() => void)): void
  • 控件对象的事件监听

    example
    Mx.MxFun.getCurrentDraw().addEvent("addResizeEvent", ()=> {})
    Mx.MxFun.getCurrentDraw().addEvent("viewchange", ()=> {})
    图纸加载完成
    Mx.MxFun.getCurrentDraw().addEvent("loadComplete", ()=> {})
    视区重绘事件.
    Mx.MxFun.getCurrentDraw().addEvent("render", (renderer)=> {})
    视区大小被修改事件.,viewsize={viewWidth:viewWidth,viewHeight:viewHeight}
    Mx.MxFun.getCurrentDraw().addEvent("viewsizechange", (viewsize)=> {})
    实体选择状态发生改变的事件.
    Mx.MxFun.getCurrentDraw().addEvent("MxEntitySelectChange", (aryId:Array<number>)=> {})

    Parameters

    • eventNaem: keyof RendererEventsType | "loadComplete" | "render" | "addResizeEvent" | "initObject" | "openFileComplete" | "saveFileComplete" | "uiSetLayerData" | "viewchange" | "MxEntitySelectChange" | "objectGripEdit" | "whetherEditTheGripPoint" | "databaseModify"

      事件名称

    • fun: (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | ((resize: Function) => void) | (() => void) | ((iResult: number) => void) | ((iResult: number, sServerResult: string) => void) | ((layerList: { color?: string; colorValue?: number; id: number; isState?: boolean; name: string; off?: number; zerolayer?: number }[]) => void) | (() => void) | ((ids: number[]) => void) | ((entity: MxDbEntity) => void) | ((entity: MxDbEntity) => void) | (() => void)

      回调函数

    Returns void

    void

  • addMxCADCurrentSelect(id: number): void
  • 把MxCAD对象添加到当前选择中.

    example

    Parameters

    • id: number

    Returns void

    void

  • addMxCurrentSelect(id: number): void
  • 把mxdraw对象添加到当前选择集中

    example

    Parameters

    • id: number

    Returns void

    void

  • 添加一个自定义实体到图上。

    example

    Parameters

    Returns number

    number 返回对象的id.

  • addObject(obj: Object3D, isAddToSelect?: boolean): void
  • 添加THREE.Object3D对象到当前场景

    example
    Mx.MxFun.getCurrentDraw().addObject(new THREE.Object3D(), false)
    

    Parameters

    • obj: Object3D

      THREE.Object3D

    • isAddToSelect: boolean = true

      默认值为true 是否把对象添加选择对象集中,调用 getIntersectObjects可以找到

    Returns void

    void

  • addViewObject(obj: Object3D): void
  • 添加THREE.Object3D对象到视区场景,对象坐标系是窗口视区坐标系。0,0点在左下角.

    example
    Mx.MxFun.getCurrentDraw().addViewObject(new THREE.Object3D())
    

    Parameters

    • obj: Object3D

      THREE.Object3D

    Returns void

    void

  • cadCoord2Doc(x: number, y: number, z: number): Vector3
  • CAD坐标到文档坐标. 默认情况下,cad等于doc,当前m_isCorrectLargeCoordinates为true时,doc变成了把cad图纸修改到小范围坐标系下的坐标。

    example

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Vector3

    number

  • cadCoord2Doc2(pt: Vector3): Vector3
  • Parameters

    • pt: Vector3

    Returns Vector3

  • clearAllObject(): any
  • 清除图上所有数据

    example

    Returns any

  • clearMxCurrentSelect(): boolean
  • 清除当前所有选择

    example

    Returns boolean

    void

  • closeWebSocket(): any
  • 在MxCAD模式下,关闭与服务器的socket连接 。

    example

    Returns any

  • createCanvasImageData(fn: ((imageData: string) => void), param?: object): void
  • 通知Three.js生成ImgeData显示I数据.

    example
    Mx.MxFun.getCurrentDraw().createCanvasImageData((imageData)=> {
    console.log(imageData)
    })

    Parameters

    • fn: ((imageData: string) => void)

      回调函数或者imageData

        • (imageData: string): void
        • Parameters

          • imageData: string

          Returns void

    • Optional param: object

      函数载荷

    Returns void

    void

  • docCoord2Cad(x: number, y: number, z: number): Vector3
  • 文档坐标坐标到CAD. 默认情况下,cad等于doc,当前m_isCorrectLargeCoordinates为true时,doc变成了把cad图纸修改到小范围坐标系下的坐标。

    example

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Vector3

    number

  • docCoord2Cad2(pt: Vector3): Vector3
  • Parameters

    • pt: Vector3

    Returns Vector3

  • docCoord2Screen(x: number, y: number): Vector3
  • DWG文档坐标到屏幕坐标

    example

    Parameters

    • x: number
    • y: number

    Returns Vector3

    number

  • docCoord2World(x: number, y: number, z: number): Vector3
  • DWG文档坐标到ThreeJS坐标

    example

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Vector3

    number

  • docCoord2World2(pt: Vector3): Vector3
  • DWG文档坐标到ThreeJS坐标

    example

    Parameters

    • pt: Vector3

    Returns Vector3

    THREE.Vector3

  • docCoordLong2Screen(l: number): number
  • DWG文档坐标长度到屏幕坐标长度

    example

    Parameters

    • l: number

    Returns number

    number

  • docCoordLong2World(l: number): number
  • DWG文档坐标长度到ThreeJS坐标长度

    example

    Parameters

    • l: number

    Returns number

    number

  • emit<Key>(event: number | Key, ...data: Parameters<MxDrawEvents[Key]>): void
  • 发布

    Type Parameters

    • Key extends keyof RendererEventsType | "loadComplete" | "render" | "addResizeEvent" | "initObject" | "openFileComplete" | "saveFileComplete" | "uiSetLayerData" | "viewchange" | "MxEntitySelectChange" | "objectGripEdit" | "whetherEditTheGripPoint" | "databaseModify"

    Parameters

    • event: number | Key

      — 事件名称

    • Rest ...data: Parameters<MxDrawEvents[Key]>

      — 载荷

    Returns void

  • enablePan(isEnable: boolean): void
  • 启用或禁用鼠标移动视区

    example

    Parameters

    • isEnable: boolean

      是否启用

    Returns void

  • enableViewControls(isEnable: boolean): void
  • 禁用或启用视区的移动,放大,缩小等操作.

    example
    
    

    Parameters

    • isEnable: boolean

    Returns void

  • enableZoom(isEnable: boolean): void
  • 启用或禁用鼠标中键滚动缩放视区

    example

    Parameters

    • isEnable: boolean

      是否启用

    Returns void

  • eraseAllMxEntity(): void
  • 删除所有的MxEntity

    example

    Returns void

  • eraseMxEntity(id: number): boolean
  • 删除MxEntity

    example

    Parameters

    • id: number

      实体id.

    Returns boolean

  • findMxEntityAtPoint(ptMouse: Vector3, isDocCoord?: boolean, retWordDrawXDataCall?: ((id: number, data: any) => void)): MxDbEntity[]
  • 查找某点位置处的用户自绘对象.

    example

    Parameters

    • ptMouse: Vector3

      查找的点位 THREE.Vector3,默认是文档坐标

    • Optional isDocCoord: boolean
    • Optional retWordDrawXDataCall: ((id: number, data: any) => void)
        • (id: number, data: any): void
        • Parameters

          • id: number
          • data: any

          Returns void

    Returns MxDbEntity[]

    MxDbEntity[] 返回用户自绘对象数组

  • getAllLayoutName(): string[]
  • 得到所有布局名

    example

    Returns string[]

  • 得到所有用户自绘对象.

    example

    Returns MxDbEntity[]

    MxDbEntity[] 返回用户自绘对象数组

  • getCamera(): Camera
  • 获取Three.js相机对象

    Returns Camera

    THREE.Camera

  • getCanvas(): HTMLCanvasElement
  • 获取Canvas对象.

    Returns HTMLCanvasElement

    HTMLCanvasElement

  • getDtabaseJsonString(): string
  • 得到数据库Json字符串数据.

    example

    Returns string

  • getFullDisplayRange(): object
  • 得到全部显示所有图形所需要的显示的范围 ,Three.js的坐标系。world坐标。

    example
    Mx.MxFun.getCurrentDraw().getFullDisplayRange()
    

    Returns object

  • getId(): number
  • 返回对象的ID.

    example

    Returns number

  • getIntersectObjects(ptMouse: Vector2): Intersection[]
  • 获取某屏幕点下的绘制对象,ptMouse是.,

    example
    Mx.MxFun.getCurrentDraw().getIntersectObjects(new THREE.Vector2(2, 3))
    

    Parameters

    • ptMouse: Vector2

      THREE.Vector2 屏幕坐标

    Returns Intersection[]

    THREE.Intersection[]

  • getMxCADCurrentSelect(): number[]
  • 得到图上当前选择的MxCAD对象.

    example

    Returns number[]

    Array 返回对象的id数组.

  • getMxCurrentSelect(): number[]
  • 得到图上当前选择的对象.

    example

    Returns number[]

    Array 返回对象的id数组.

  • 得到当前图形数据库对象

    example
    
    

    Returns MxDbDatabase

  • 通过id获取绘制的对象.

    example

    Parameters

    • id: number

      返回对象的id

    Returns MxDbEntity

    MxDbEntity

  • getMxObjectImplement(): any
  • 得执行的内部MxObject对象.

    example

    Returns any

  • getNodeByProperty<V>(name: string, value: V): undefined | Node<any, any> | MxDrawObject
  • 根据属性名称找到对应的Node节点

    example
    new Node().getNodeByProperty("id", "23548")
    

    Type Parameters

    • V = any

    Parameters

    • name: string

      属性名称

    • value: V

      属性值

    Returns undefined | Node<any, any> | MxDrawObject

  • getNodesByProperty<V>(name: string, value: V): (Node<any, any> | MxDrawObject)[]
  • 根据属性名称找到对应的Node节点

    example
    new Node().getNodeByProperty("id", "23548")
    

    Type Parameters

    • V = any

    Parameters

    • name: string

      属性名称

    • value: V

      属性值

    Returns (Node<any, any> | MxDrawObject)[]

  • getOrbitControls(): OrbitControls
  • 得到Three.js的 OrbitControls对象.

    example
    
    

    Returns OrbitControls

  • getRenderer(): WebGLRenderer
  • 获取Three renderer渲染器

    Returns WebGLRenderer

    THREE.WebGLRenderer

  • getScene(): Scene
  • 获取Three.js绘图场景

    Returns Scene

    THREE.Scene

  • getSysVar(sName: string): any
  • 得到系统变量

    example

    Parameters

    • sName: string

    Returns any

  • getViewAngle(): number
  • 得到视区的旋转角度

    example

    Returns number

  • getViewCenterDocCoord(): Vector3
  • 得到视区中心的文档坐标.

    example

    Returns Vector3

  • getViewColor(): number
  • 返回视区背景色,

    example
    
    

    Returns number

    void

  • getViewDocCoord(): { pt1: Vector3; pt2: Vector3; pt3: Vector3; pt4: Vector3 }
  • 返回当前视区的显示范围,cad坐标。

    Returns { pt1: Vector3; pt2: Vector3; pt3: Vector3; pt4: Vector3 }

    • pt1: Vector3
    • pt2: Vector3
    • pt3: Vector3
    • pt4: Vector3
  • getViewHeight(): number
  • 得到对象画布的高度,单位屏幕像素

    example
    Mx.MxFun.getCurrentDraw().getViewHeight()
    

    Returns number

    number

  • getViewWidth(): number
  • 得到对象画布的宽度,单位屏幕像素

    example
    Mx.MxFun.getCurrentDraw().getViewWidth()
    

    Returns number

    number

  • gotoLayout(layout: string): void
  • 跳转另一个布局页面.

    example

    Parameters

    • layout: string

    Returns void

  • initMxCpp(mcppObjectImp: any): void
  • 初始cpp对象.

    example

    Parameters

    • mcppObjectImp: any

    Returns void

  • initRendererParam(param: object): void
  • 初始WebGL Renderer的创建参数,该函数在MxFun.createMxObject函数调用时,调用。

    example
    mxObj.initRendererParam({preserveDrawingBuffer: true})

    Parameters

    • param: object

    Returns void

    void

  • initZoomW(pt1Doc: Vector3, pt2Doc: Vector3): void
  • 初始化控件默认加载后,显示视区范围,默认使用图纸转换时的显示范围。。

    example
    Mx.MxFun.getCurrentDraw().initZoomW(new THREE.Vector3(0,10,10), new THREE.Vector3(3,8,20))

    Parameters

    • pt1Doc: Vector3
    • pt2Doc: Vector3

    Returns void

    void

  • isMxCAD(): boolean
  • 是否是CppMxCAD模式运行.

    example

    Returns boolean

  • isWebgl2(): boolean
  • 当前是否支持 opengles3

    example

    Returns boolean

  • isWhiteViewColor(): boolean
  • 当前是否为白色白背景色

    example

    Returns boolean

  • loadMxEntityFromJson(dataString: string | object, aryPreloadSVG?: null | string[]): Promise<boolean>
  • 从json字符串恢复MxEntity

    example

    Parameters

    • dataString: string | object

      json字符串.

    • aryPreloadSVG: null | string[] = null

    Returns Promise<boolean>

  • makeCurrent(): void
  • 把该控件对象,设置成当前控件.

    example

    Returns void

  • newFile(ptin1: number | Vector3, ptin2: number | Vector3, x2?: number, y2?: number): boolean
  • 新建图纸.

    example

    Parameters

    • ptin1: number | Vector3
    • ptin2: number | Vector3
    • Optional x2: number
    • Optional y2: number

    Returns boolean

  • off(event: keyof RendererEventsType | "loadComplete" | "render" | "addResizeEvent" | "initObject" | "openFileComplete" | "saveFileComplete" | "uiSetLayerData" | "viewchange" | "MxEntitySelectChange" | "objectGripEdit" | "whetherEditTheGripPoint" | "databaseModify", callback: (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | ((resize: Function) => void) | (() => void) | ((iResult: number) => void) | ((iResult: number, sServerResult: string) => void) | ((layerList: { color?: string; colorValue?: number; id: number; isState?: boolean; name: string; off?: number; zerolayer?: number }[]) => void) | (() => void) | ((ids: number[]) => void) | ((entity: MxDbEntity) => void) | ((entity: MxDbEntity) => void) | (() => void)): boolean
  • 销毁事件

    Parameters

    • event: keyof RendererEventsType | "loadComplete" | "render" | "addResizeEvent" | "initObject" | "openFileComplete" | "saveFileComplete" | "uiSetLayerData" | "viewchange" | "MxEntitySelectChange" | "objectGripEdit" | "whetherEditTheGripPoint" | "databaseModify"
    • callback: (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | ((resize: Function) => void) | (() => void) | ((iResult: number) => void) | ((iResult: number, sServerResult: string) => void) | ((layerList: { color?: string; colorValue?: number; id: number; isState?: boolean; name: string; off?: number; zerolayer?: number }[]) => void) | (() => void) | ((ids: number[]) => void) | ((entity: MxDbEntity) => void) | ((entity: MxDbEntity) => void) | (() => void)

    Returns boolean

  • on(event: keyof RendererEventsType | "loadComplete" | "render" | "addResizeEvent" | "initObject" | "openFileComplete" | "saveFileComplete" | "uiSetLayerData" | "viewchange" | "MxEntitySelectChange" | "objectGripEdit" | "whetherEditTheGripPoint" | "databaseModify", callback: (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | ((resize: Function) => void) | (() => void) | ((iResult: number) => void) | ((iResult: number, sServerResult: string) => void) | ((layerList: { color?: string; colorValue?: number; id: number; isState?: boolean; name: string; off?: number; zerolayer?: number }[]) => void) | (() => void) | ((ids: number[]) => void) | ((entity: MxDbEntity) => void) | ((entity: MxDbEntity) => void) | (() => void)): void
  • 订阅

    Parameters

    • event: keyof RendererEventsType | "loadComplete" | "render" | "addResizeEvent" | "initObject" | "openFileComplete" | "saveFileComplete" | "uiSetLayerData" | "viewchange" | "MxEntitySelectChange" | "objectGripEdit" | "whetherEditTheGripPoint" | "databaseModify"
    • callback: (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | ((resize: Function) => void) | (() => void) | ((iResult: number) => void) | ((iResult: number, sServerResult: string) => void) | ((layerList: { color?: string; colorValue?: number; id: number; isState?: boolean; name: string; off?: number; zerolayer?: number }[]) => void) | (() => void) | ((ids: number[]) => void) | ((entity: MxDbEntity) => void) | ((entity: MxDbEntity) => void) | (() => void)

    Returns void

  • removeEventFuction(eventNaem: keyof RendererEventsType | "loadComplete" | "render" | "addResizeEvent" | "initObject" | "openFileComplete" | "saveFileComplete" | "uiSetLayerData" | "viewchange" | "MxEntitySelectChange" | "objectGripEdit" | "whetherEditTheGripPoint" | "databaseModify", fun: (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | ((resize: Function) => void) | (() => void) | ((iResult: number) => void) | ((iResult: number, sServerResult: string) => void) | ((layerList: { color?: string; colorValue?: number; id: number; isState?: boolean; name: string; off?: number; zerolayer?: number }[]) => void) | (() => void) | ((ids: number[]) => void) | ((entity: MxDbEntity) => void) | ((entity: MxDbEntity) => void) | (() => void)): boolean
  • 移除事件函数。

    example
    
    

    Parameters

    • eventNaem: keyof RendererEventsType | "loadComplete" | "render" | "addResizeEvent" | "initObject" | "openFileComplete" | "saveFileComplete" | "uiSetLayerData" | "viewchange" | "MxEntitySelectChange" | "objectGripEdit" | "whetherEditTheGripPoint" | "databaseModify"
    • fun: (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | (() => void) | ((resize: Function) => void) | (() => void) | ((iResult: number) => void) | ((iResult: number, sServerResult: string) => void) | ((layerList: { color?: string; colorValue?: number; id: number; isState?: boolean; name: string; off?: number; zerolayer?: number }[]) => void) | (() => void) | ((ids: number[]) => void) | ((entity: MxDbEntity) => void) | ((entity: MxDbEntity) => void) | (() => void)

    Returns boolean

    boolean

  • removeObject(obj: Object3D, isRemoveSelectObject?: boolean): void
  • 删除addObject函数添加的THREE.Object3D对象

    example
    Mx.MxFun.getCurrentDraw().removeObject(new THREE.Object3D(), false)
    

    Parameters

    • obj: Object3D

      THREE.Object3D

    • isRemoveSelectObject: boolean = true

      默认值为true 删除选择集中的对象

    Returns void

    void

  • removeViewObject(obj: Object3D): void
  • 移除安视图坐标绘制的对象.

    example

    Parameters

    • obj: Object3D

      对象.

    Returns void

  • resetRenderer(): any
  • 重新计数Renderer状态, this.renderer.info.reset();

    example
    
    

    Returns any

  • resetThreeJSControls(): void
  • 重新设置ThreeJS Controls状态.

    example

    Returns void

  • saveMxEntityToJson(isSaveToDWG?: boolean): string
  • 保存所有MxEntity的数据到json字符串.

    example

    Parameters

    • Optional isSaveToDWG: boolean

    Returns string

    json字符串

  • saveMxEntityToObject(isSaveToDWG?: boolean): object
  • 保存所有MxEntity的数据到js对象.

    example

    Parameters

    • Optional isSaveToDWG: boolean

    Returns object

    js对象

  • screenCoord2Doc(x: number, y: number): Vector3
  • 屏幕坐标到DWG文档坐标

    example

    Parameters

    • x: number
    • y: number

    Returns Vector3

    THREE.Vector3

  • screenCoord2World(x: number, y: number, z?: number): Vector3
  • 屏幕坐标到ThreeJS坐标

    example

    Parameters

    • x: number
    • y: number
    • Optional z: number

    Returns Vector3

    THREE.Vector3

  • screenCoordLong2Doc(l: number): number
  • 屏幕坐标长度到DWG文档坐标长度

    example

    Parameters

    • l: number

    Returns number

    number

  • screenCoordLong2World(l: number): number
  • 屏幕坐标长度到ThreeJS坐标长度

    example

    Parameters

    • l: number

    Returns number

    number

  • INI设置

    example
    Mx.MxFun.getCurrentDraw().setIniset(options: { EnableOsnapFunction: true })

    Parameters

    Returns void

    void

  • setMouseMiddlePan(iPan: number | boolean): void
  • setMouseMiddlePan函数与setViewMovementMethod一样,为了兼容老程序暂没删除,将来会删除

    Parameters

    • iPan: number | boolean

    Returns void

  • setMouseRightRotate(isRotate?: boolean): void
  • 设置鼠标按下是否旋视区

    example
    Mx.MxFun.getCurrentDraw().setMouseRightRotate(false)
    

    Parameters

    • isRotate: boolean = true

      是否旋视区

    Returns void

    void

  • setPointMultipleSelect(isMultipleSelect?: boolean): void
  • 设置点选支持多选,默认不支持。

    example

    Parameters

    • isMultipleSelect: boolean = true

    Returns void

  • setRequestHeader(val: string): any
  • 设置服务器发送文件请求时,需要带的参数.注意:带参数后,可能会出现跨域访问失败

    example
    ``` mxobj.setRequestHeader("{'data':'value1'}");
    

    Parameters

    • val: string

    Returns any

  • setSize(width: number, height: number): void
  • 设置视区背景色,

    example
    Mx.MxFun.getCurrentDraw().setSize(0xFFFFFF)
    

    Parameters

    • width: number

      宽度

    • height: number

      宽度

    Returns void

    void

  • setSysVar(sName: string, val: any): void
  • 设置系统变量

    example

    Parameters

    • sName: string
    • val: any

    Returns void

  • setViewAngle(ang: number): void
  • 设置视区的旋转角度

    example

    Parameters

    • ang: number

    Returns void

  • setViewColor(color: number): void
  • 设置视区背景色,

    example
    Mx.MxFun.getCurrentDraw().setViewColor(0xFFFFFF)
    

    Parameters

    • color: number

      如0xFFFFFF 白色

    Returns void

    void

  • setViewMovementMethod(iMethod: number | boolean): void
  • 设置鼠标中键移动视区。

    example

    Parameters

    • iMethod: number | boolean

      设置是否可以鼠标中键移动视区,iMethod= true,iMethod=1 iMethod = 0,中键不移动视区,左键移动 iMethod = 1,中键移动视区,左键不移动 iMethod = 2,中键移动视区,左键移动视区

    Returns void

  • setZoomSpeed(zoomSpeed: number): number
  • 设置鼠标中键的滚动的缩放比例,在PC上,默认值4,手机上默认值,1.5 返回之前设置值。

    example
    
    

    Parameters

    • zoomSpeed: number

    Returns number

  • stopAllLoading(): void
  • 停止当前加载

    example
    
    

    Returns void

  • toSmallcoord(pt: Vector3): Vector3
  • Parameters

    • pt: Vector3

    Returns Vector3

  • toSmallcoord2(x: number, y: number, z?: number): Vector3
  • Parameters

    • x: number
    • y: number
    • z: number = 0

    Returns Vector3

  • 遍历它的所有子节点包括孙子节点,直到它包含的节点全部遍历完成并都执行传入的方法

    Parameters

    Returns void

  • traverseParent<V>(callback: ((node: V) => boolean | void)): void
  • 让它的父节点依次冒泡执行传入的方法的方法

    Type Parameters

    Parameters

    • callback: ((node: V) => boolean | void)

      回调函数,第一个参数是父节点, callback的返回值为false 将停止继续传递

        • (node: V): boolean | void
        • Parameters

          • node: V

          Returns boolean | void

    Returns void

  • updateCanvasSize(): void
  • 画布大小,自动修改到它父亲div大小。

    example

    Returns void

  • updateDisplay(): void
  • 通知Three.js更新显示

    Returns void

    void

  • worldCoord2Doc(x: number, y: number, z: number): Vector3
  • ThreeJS坐标到DWG文档坐标

    example

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Vector3

    number

  • worldCoord2Doc2(pt: Vector3): Vector3
  • ThreeJS坐标到DWG文档坐标

    example

    Parameters

    • pt: Vector3

    Returns Vector3

    THREE.Vector3

  • worldCoord2Screen(x: number, y: number, z: number): Vector3
  • ThreeJS坐标到屏幕坐标,屏幕坐标的Y轴向下。坐标原点在左上角.

    example

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Vector3

    THREE.Vector3

  • worldCoordLong2Doc(l: number): number
  • ThreeJS坐标长度到DWG文档坐标长度

    example

    Parameters

    • l: number

    Returns number

    number

  • worldCoordLong2Screen(l: number): number
  • ThreeJS坐标长度到屏幕坐标长度

    example

    Parameters

    • l: number

    Returns number

    number

  • zoomCenter(dCenX: number, dCenY: number): void
  • 把当前显示范围移到指定的位置,dCenX,dCenY是DWG图纸坐标。

    example
    Mx.MxFun.getCurrentDraw().zoomCenter(new THREE.Vector3(0,10,10), new THREE.Vector3(3,8,20))
    

    Parameters

    • dCenX: number
    • dCenY: number

    Returns void

    void

  • zoomInitialStates(): void
  • 把视区显示范围恢复到初始显示范围.

    Returns void

    void

  • zoomScale(scale: number): void
  • 缩放当前显示范围,它是相对于当前显示范围进行缩放

    example
    Mx.MxFun.getCurrentDraw().zoomScale(0.8)
    

    Parameters

    • scale: number

      scale缩放比例

    Returns void

    void

  • zoomW(minPt: Vector3, maxPt: Vector3, isWorld?: boolean): void
  • 把当前显示范围移到指定的显示范围

    example
    Mx.MxFun.getCurrentDraw().zoomW(new THREE.Vector3(0,10,10), new THREE.Vector3(3,8,20), true)
    

    Parameters

    • minPt: Vector3

      坐标1 THREE.Vector3

    • maxPt: Vector3

      坐标2 THREE.Vector3

    • Optional isWorld: boolean

      默认为felse DWG图纸坐标,设置为true是THREEJS坐标

    Returns void

    void