Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PointGraph<T>

位于相同点上的项目图表.

Type parameters

  • T

Hierarchy

  • PointGraph

Index

Constructors

constructor

Properties

graph

graph: {}

按 x 然后按 y 映射到点 id 的唯一点。即使在合并后,这将保持不变.

Type declaration

  • [x: number]: {}
    • [y: number]: number

index

index: {}

Index of points by id.

Type declaration

insertedCount

insertedCount: number

Number of points inserted

merged

merged: {}

Map of point ids which once existed but have been merged into another id due to close proximity.

Type declaration

  • [pointId: number]: number

values

values: T[]

List of values inserted at points.

Methods

forEachPoint

getElementAtPoint

getIdOfPoint

  • getIdOfPoint(p: IPoint): number
  • 在合并后获取点的 id.

    Parameters

    • p: IPoint

      Point to look up id.

    Returns number

insertValue

  • insertValue(value: T): number
  • 插入值.

    Parameters

    • value: T

      Value associated with this point.

    Returns number

    valueId of the inserted value.

insertValueIdAtPoint

  • insertValueIdAtPoint(valueId: number, p: IPoint): { existed: boolean; pointId: number }
  • 在点处插入值.

    Parameters

    • valueId: number
    • p: IPoint

      Point.

    Returns { existed: boolean; pointId: number }

    • existed: boolean
    • pointId: number

mergeNearestSinglePoints

  • mergeNearestSinglePoints(withinDistance: number): void
  • 查找只有一个关联值的所有点。然后,合并到此集合中最近的其他点. 插入值后调用此值.

    Parameters

    • withinDistance: number

    Returns void

mergePoints

  • mergePoints(withinDistance: number): void
  • 合并彼此之间给定距离内的点。插入值后调用此值.

    Parameters

    • withinDistance: number

      Distance to consider points equal.

    Returns void

reset

  • reset(): void
  • 将存储的点、图形、列表重置为初始状态.

    Returns void

Generated using TypeDoc