Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IFloorplanView

a 2d floorplan view coordinate: x axis points to right and y points to up unit: meter

Hierarchy

Index

Properties

activeTool: undefined | ITool

the actionve ITool

camera: OrthographicCamera

the camera used by the view

commandManager: CommandManager
defaultLayer: floorplan
document: YWDocument

the document which is shown by the view

dragControls: default

the drag controls

eventManager: EventManager
font: Font

the font used to draw room name and other text contents

name: string

name of the view

orbitControls: OrbitControls

the orbitControls which is used to control the scene

scene: Scene

the threejs scene of the view

selectionManager?: SelectionManager
triangulator: default

Methods

  • addAfterRender(key: string, func: () => void): void
  • add a singleshot callback executed after next frame rendered

    Parameters

    • key: string

      a unique key to avoid adding duplicate callback

    • func: () => void
        • (): void
        • Returns void

    Returns void

  • addBeforeRender(key: string, func: () => void): void
  • add a singleshot callback executed before next frame rendered

    Parameters

    • key: string

      a unique key to avoid adding duplicate callback

    • func: () => void
        • (): void
        • Returns void

    Returns void

  • addEventObj(obj: Object3D<Event>): void
  • register an obj with onclick callback

    Parameters

    • obj: Object3D<Event>

    Returns void

  • calculateZoom(box: Box3, vp?: Vector4): { center: Vector3; zoom: number }
  • caculate appropriate camera zoom/position

    Parameters

    • box: Box3
    • Optional vp: Vector4

      viewport, {@link viewport()} by default

    Returns { center: Vector3; zoom: number }

    • center: Vector3
    • zoom: number
  • flyTo(position: Vector3, zoom: number, duration: number, completed?: () => void, interpolator?: AnimInterpolator): void
  • move the camera to the specified {@link position} and {@link zoom} in {@link duration}

    Parameters

    • position: Vector3
    • zoom: number
    • duration: number
    • Optional completed: () => void
        • (): void
        • Returns void

    • Optional interpolator: AnimInterpolator

    Returns void

  • focusOn(box: Box3): void
  • a shortcut of flyTo, fly to the center of the box and calculate zoom automatically

    Parameters

    • box: Box3

    Returns void

  • getContentBox(): undefined | Box3
  • get the axis aligned bounding box of the content, undefined if the package is empty

    Returns undefined | Box3

  • hideAll(): void
  • hide the default objects in the scene

    Returns void

  • intersects(mouse: Vector2): Intersection<Object3D<Event>>[]
  • execute a ray casting from the mouse position on the screen and along the normal of the screen

    Parameters

    • mouse: Vector2

    Returns Intersection<Object3D<Event>>[]

  • popTool(): undefined | ITool
  • pop up the current tool and return it. it will be suspended and the caller should decide whether to dispose it

    Returns undefined | ITool

  • pushTool(tool: ITool): void
  • push a new ITool and set it as the activeTool, the previous tool will be suspended and the new tooll will be resumed

    Parameters

    Returns void

  • removeEventObj(obj: Object3D<Event>): void
  • unregister an obj with onclick callback

    Parameters

    • obj: Object3D<Event>

    Returns void

  • resume(): any
  • resume the view

    Returns any

  • screen position to world position

    Parameters

    Returns V2d

  • 设置户型图中的某种元素是否可见

    Parameters

    Returns void

  • showAll(): void
  • show the default objects in the scene

    Returns void

  • suspend(): any
  • suspend the view

    Returns any

  • toMousePos(worldPos: Vector3): Vector2
  • world position to screen position

    Parameters

    • worldPos: Vector3

    Returns Vector2

  • toNDC(mouse: V2d): undefined | V2d
  • mouse position to NDC

    Parameters

    Returns undefined | V2d

    normalized device coordinates (NDC)---X and Y components should be between -1 and 1

  • viewport(): Vector4
  • get the viewport of the renderer, ususally it is (0, 0, canvas.clientWidth, canvas.clientHeigh)

    Returns Vector4

Generated using TypeDoc