Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BlockSet

块状模型组

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new BlockSet(shapes: Shape[], lowPerformance?: boolean, tag?: string, renderStroke?: boolean): BlockSet
  • 块状模型组通用类

    example
    // 以使用svg生成Shape对象为例, 首先将svg解析为Shape对象
    const shapes = await SvgUtils.parseSVG(
      <svg url>,
      [0.02, 0, 0, 0, 0, -0.02, 0, 0, 0, 0, 0, 0, -40, 40, 0, 1], // 对齐矩阵
    );
    // 用每个shape生成对应的block
    const blocks = new Block(shapes);
    // 绑定block
    stage.bindElement(blocks);

    Parameters

    • shapes: Shape[]

      块状模型基础图形组

    • Default value lowPerformance: boolean = false
    • Default value tag: string = ""
    • Default value renderStroke: boolean = true

    Returns BlockSet

Properties

blocks

blocks: Block[]

Methods

dispose

  • dispose(): void
  • Returns void

load

  • load(shapes: Shape[], lowPerformance?: boolean, renderStroke?: boolean): Promise<void>
  • Parameters

    • shapes: Shape[]
    • Default value lowPerformance: boolean = false
    • Default value renderStroke: boolean = true

    Returns Promise<void>

resize

  • resize(width: number, height: number): void
  • Parameters

    • width: number
    • height: number

    Returns void

update

  • update(): ElementFrameContext
  • Returns ElementFrameContext