rt-graphic-component/components/packages/Section/common/Section.d.ts
joylink_zhaoerwei 352025daf8 计轴
2024-01-04 10:40:55 +08:00

66 lines
2.1 KiB
TypeScript

import { GraphicData, GraphicState, JlGraphic, JlGraphicTemplate, VectorText } from 'jl-graphic';
import { IPointData } from 'pixi.js';
import { SectionGraphic } from './SectionGraphic';
import { DevicePort, IRelatedRef } from 'src/common/common';
import { Turnout } from 'src/packages/Turnout/Turnout';
export interface ISectionData extends GraphicData {
code: string;
isCurve: boolean;
segmentsCount: number;
points: IPointData[];
sectionType: SectionType;
paRef?: IRelatedRef;
pbRef?: IRelatedRef;
axleCountings?: number[];
centralizedStations?: number[];
trackSectionId?: number;
clone(): ISectionData;
copyFrom(data: ISectionData): void;
eq(other: ISectionData): boolean;
}
export interface ISectionState extends GraphicState {
id: number;
occupied: boolean;
}
export declare enum SectionType {
Physical = 0,//物理区段
Logic = 1,//逻辑区段
TurnoutPhysical = 2,//道岔物理区段
Track = 4,//轨道区段
TrackLogic = 5
}
export interface SectionDisplayConfig {
lineColor: string;
occupiedColor: string;
lineWidth: number;
}
export declare class Section extends JlGraphic {
static Type: string;
lineGraphic: SectionGraphic;
labelGraphic: VectorText;
displayConfig: SectionDisplayConfig;
constructor();
setDisplayConfig(config: SectionDisplayConfig): void;
getVerticesList(): IPointData[];
getStartPoint(): IPointData;
getEndPoint(): IPointData;
doRepaint(): void;
get datas(): ISectionData;
get states(): ISectionState;
get linePoints(): IPointData[];
set linePoints(points: IPointData[]);
getConnectElement(port: DevicePort): {
g: Turnout | Section;
port: DevicePort;
} | undefined;
/** 获取拆分逻辑区段数据 */
getSplitPoints(count: number): IPointData[][];
buildRelation(): void;
saveRelations(): void;
loadRelations(): void;
}
export declare class SectionTemplate extends JlGraphicTemplate<Section> {
constructor(dataTemplate: ISectionData, stateTemplate?: ISectionState);
new(): Section;
}