# Interface DynamicPathLinePluginController

plugin 的基本控制器

interface DynamicPathLinePluginController {
data?: DynamicPathLinePluginType.PluginData;
five: Five;
hooks: Subscribe<DynamicPathLinePluginType.EventMap>;
state: DynamicPathLinePluginType.State;
staticPrefix: string;
get config(): {
color: number;
lineCount: number;
lineWidth: number;
lineYOffset: number;
maxDistance: number;
particleCount: number;
range: number;
spacing: number;
speed: number;
subMeshColor: number;
subMeshHighlightWidth: number;
subMeshMaxOpacity: number;
subMeshOpacity: number;
subMeshSegmentInterval: number;
subMeshWidth: number;
waveAmp: number;
waveFreq: number;
};
absoluteUrl(url: string): string;
addPath(pathConfig: PathConfig): boolean;
appendTo?(wrapper: Element): void;
clearAllPaths(): void;
disable(options?: BaseOptions): void;
disablePath(pathId: string): boolean;
dispose(): void;
enable(options?: BaseOptions): void;
enablePath(pathId: string): boolean;
getCurrentState(): DynamicPathLinePluginType.State;
getPathConfig(pathId: string): PathConfig | undefined;
getPathIds(): string[];
hide(options?: BaseOptions): void;
hidePath(pathId: string): boolean;
highlightPath(pathId: string, highlight: boolean): void;
load(
serverData: DynamicPathLinePluginType.ServerData,
state?: DynamicPathLinePluginType.State,
): Promise<void>;
pause(): void;
play(fromStart?: boolean): void;
removePath(pathId: string): boolean;
reset(): void;
setState(
state: Partial<DynamicPathLinePluginType.State>,
options?: BaseOptions,
): void;
show(options?: BaseOptions): void;
showPath(pathId: string): boolean;
startPathAnimation(
pathId: string,
options?: { fromStart?: boolean; startPointIndex?: number },
): boolean;
stopPathAnimation(pathId: string, saveProgress?: boolean): boolean;
updateScreenProjection(pathId?: string): void;
}

#### Hierarchy (View Summary)

- Controller<
  DynamicPathLinePluginType.State,
  DynamicPathLinePluginType.EventMap,
  DynamicPathLinePluginType.ServerData,
  DynamicPathLinePluginType.PluginData,
  >
  - DynamicPathLinePluginController

- Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:54

##### Index

### Properties

data?
five
hooks
state
staticPrefix

### Accessors

config

### Methods

absoluteUrl
addPath
appendTo?
clearAllPaths
disable
disablePath
dispose
enable
enablePath
getCurrentState
getPathConfig
getPathIds
hide
hidePath
highlightPath
load
pause
play
removePath
reset
setState
show
showPath
startPathAnimation
stopPathAnimation
updateScreenProjection

## Properties

### `Optional` data

data?: DynamicPathLinePluginType.PluginData

当前使用的数据

Overrides BasePlugin.Controller.data

- Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:61

### five

five: Five

Inherited from Controller.five

- Defined in lib/plugins/BasePlugin/index.ts:68

### hooks

hooks: Subscribe<DynamicPathLinePluginType.EventMap> = ...

#### Description

插件事件钩子

Inherited from Controller.hooks

- Defined in lib/plugins/BasePlugin/index.ts:82

### state

state: DynamicPathLinePluginType.State

插件当前状态

Overrides Controller.state

- Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:64

### `Readonly` staticPrefix

staticPrefix: string = '//vr-image-4.realsee-cdn.cn'

Inherited from Controller.staticPrefix

- Defined in lib/plugins/BasePlugin/index.ts:84

## Accessors

### config

- get config(): {
  color: number;
  lineCount: number;
  lineWidth: number;
  lineYOffset: number;
  maxDistance: number;
  particleCount: number;
  range: number;
  spacing: number;
  speed: number;
  subMeshColor: number;
  subMeshHighlightWidth: number;
  subMeshMaxOpacity: number;
  subMeshOpacity: number;
  subMeshSegmentInterval: number;
  subMeshWidth: number;
  waveAmp: number;
  waveFreq: number;
  }

  #### Returns {
  color: number;
  lineCount: number;
  lineWidth: number;
  lineYOffset: number;
  maxDistance: number;
  particleCount: number;
  range: number;
  spacing: number;
  speed: number;
  subMeshColor: number;
  subMeshHighlightWidth: number;
  subMeshMaxOpacity: number;
  subMeshOpacity: number;
  subMeshSegmentInterval: number;
  subMeshWidth: number;
  waveAmp: number;
  waveFreq: number;
  }

  - ##### color: number

    线条颜色

  - ##### lineCount: number

    线条数量

  - ##### lineWidth: number

    线宽

  - ##### lineYOffset: number

    pathline Y 轴偏移（相对于 subMesh 向上偏移）

  - ##### maxDistance: number

    粒子最大飘散距离

  - ##### particleCount: number

    粒子数量

  - ##### range: number

    流光过渡范围（单位：米，默认 5.0）

  - ##### spacing: number

    线条间距

  - ##### speed: number

    流光速度（单位距离/秒，值越大速度越快）

  - ##### subMeshColor: number

    子网格底色

  - ##### subMeshHighlightWidth: number

    子网格流光高亮带宽度（单位：米，默认 1.5）

  - ##### subMeshMaxOpacity: number

    子网格最大透明度（流光中心的透明度，默认 1.0）

  - ##### subMeshOpacity: number

    子网格基础透明度（最小透明度）

  - ##### subMeshSegmentInterval: number

    子网格流光分段间隔（单位：米，默认 3.0）

  - ##### subMeshWidth: number

    子网格宽度

  - ##### waveAmp: number

    波动幅度

  - ##### waveFreq: number

    波动频率

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:69

## Methods

### absoluteUrl

- absoluteUrl(url: string): string

  #### Parameters

  - url: string

  #### Returns string

  #### Description

  获取静态资源的url

  Inherited from Controller.absoluteUrl

  - Defined in lib/plugins/BasePlugin/index.ts:135

### addPath

- addPath(pathConfig: PathConfig): boolean

  添加路径

  #### Parameters

  - pathConfig: PathConfig

  #### Returns boolean

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:162

### `Optional` appendTo

- appendTo?(wrapper: Element): void

  插件自身DOM添加到父容器

  #### Parameters

  - wrapper: Element

    Element元素

  #### Returns void

  Inherited from Controller.appendTo

  - Defined in lib/plugins/BasePlugin/index.ts:113

### clearAllPaths

- clearAllPaths(): void

  清空所有路径

  #### Returns void

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:371

### disable

- disable(options?: BaseOptions): void

  禁用插件

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.disable

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1239

### disablePath

- disablePath(pathId: string): boolean

  禁用路径

  #### Parameters

  - pathId: string

  #### Returns boolean

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:305

### dispose

- dispose(): void

  销毁插件

  #### Returns void

  Overrides Controller.dispose

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1486

### enable

- enable(options?: BaseOptions): void

  启用插件

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.enable

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1229

### enablePath

- enablePath(pathId: string): boolean

  启用路径

  #### Parameters

  - pathId: string

  #### Returns boolean

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:290

### getCurrentState

- getCurrentState(): DynamicPathLinePluginType.State

  获取当前的插件状态，如果当初插件内存在需要通过动画变更的 state 值，则通过此方法可以得到中间状态

  #### Returns DynamicPathLinePluginType.State

  Inherited from Controller.getCurrentState

  - Defined in lib/plugins/BasePlugin/index.ts:105

### getPathConfig

- getPathConfig(pathId: string): PathConfig | undefined

  获取路径配置

  #### Parameters

  - pathId: string

  #### Returns PathConfig | undefined

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:363

### getPathIds

- getPathIds(): string[]

  获取所有路径ID

  #### Returns string[]

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:356

### hide

- hide(options?: BaseOptions): void

  隐藏插件

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.hide

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1262

### hidePath

- hidePath(pathId: string): boolean

  隐藏路径

  #### Parameters

  - pathId: string

  #### Returns boolean

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:338

### highlightPath

- highlightPath(pathId: string, highlight: boolean): void

  #### Parameters

  - pathId: string
  - highlight: boolean

  #### Returns void

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1376

### load

- load(
  serverData: DynamicPathLinePluginType.ServerData,
  state?: DynamicPathLinePluginType.State,
  ): Promise<void>

  加载服务端数据

  #### Parameters

  - serverData: DynamicPathLinePluginType.ServerData
  - `Optional` state: DynamicPathLinePluginType.State

  #### Returns Promise<void>

  Overrides Controller.load

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:129

### pause

- pause(): void

  暂停动画

  #### Returns void

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1302

### play

- play(fromStart?: boolean): void

  播放动画

  #### Parameters

  - fromStart: boolean = false

  #### Returns void

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1291

### removePath

- removePath(pathId: string): boolean

  移除路径

  #### Parameters

  - pathId: string

  #### Returns boolean

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:262

### reset

- reset(): void

  重置动画状态（不自动开始播放）

  #### Returns void

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1313

### setState

- setState(
  state: Partial<DynamicPathLinePluginType.State>,
  options?: BaseOptions,
  ): void

  设置状态

  #### Parameters

  - state: Partial<DynamicPathLinePluginType.State>
  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.setState

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1275

### show

- show(options?: BaseOptions): void

  显示插件

  #### Parameters

  - `Optional` options: BaseOptions

  #### Returns void

  Overrides Controller.show

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1249

### showPath

- showPath(pathId: string): boolean

  显示路径

  #### Parameters

  - pathId: string

  #### Returns boolean

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:320

### startPathAnimation

- startPathAnimation(
  pathId: string,
  options?: { fromStart?: boolean; startPointIndex?: number },
  ): boolean

  启动指定路径的动画

  #### Parameters

  - pathId: string

    路径ID

  - `Optional` options: { fromStart?: boolean; startPointIndex?: number }

    配置选项

  #### Returns boolean

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1092

### stopPathAnimation

- stopPathAnimation(pathId: string, saveProgress?: boolean): boolean

  停止指定路径的动画

  #### Parameters

  - pathId: string
  - saveProgress: boolean = false

  #### Returns boolean

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1181

### updateScreenProjection

- updateScreenProjection(pathId?: string): void

  更新指定路径的屏幕空间投影优化

  #### Parameters

  - `Optional` pathId: string

    路径ID，如果不提供则更新所有路径

  #### Returns void

  - Defined in lib/plugins/DynamicPathLinePlugin/Controller.ts:1420