83 lines
2.2 KiB
TypeScript
83 lines
2.2 KiB
TypeScript
import { JlGraphic } from './JlGraphic';
|
|
/**
|
|
* 图形关系数据
|
|
*/
|
|
export declare class GraphicRelationParam {
|
|
g: JlGraphic;
|
|
param: any;
|
|
constructor(g: JlGraphic, param?: any);
|
|
isTheGraphic(g: JlGraphic): boolean;
|
|
getGraphic<G extends JlGraphic>(): G;
|
|
getParam<P>(): P;
|
|
equals(other: GraphicRelationParam): boolean;
|
|
}
|
|
/**
|
|
* 图形关系
|
|
*/
|
|
export declare class GraphicRelation {
|
|
rp1: GraphicRelationParam;
|
|
rp2: GraphicRelationParam;
|
|
constructor(rp1: GraphicRelationParam, rp2: GraphicRelationParam);
|
|
contains(g: JlGraphic): boolean;
|
|
/**
|
|
* 获取给定图形的关系参数
|
|
* @param g
|
|
* @returns
|
|
*/
|
|
getRelationParam(g: JlGraphic): GraphicRelationParam;
|
|
/**
|
|
* 获取关联的另一个图形的关系参数
|
|
* @param g
|
|
* @returns
|
|
*/
|
|
getOtherRelationParam(g: JlGraphic): GraphicRelationParam;
|
|
/**
|
|
* 获取关联的另一个图形对象
|
|
* @param g
|
|
* @returns graphic
|
|
*/
|
|
getOtherGraphic<G extends JlGraphic>(g: JlGraphic): G;
|
|
equals(orp1: GraphicRelationParam, orp2: GraphicRelationParam): boolean;
|
|
isEqualOther(other: GraphicRelation): boolean;
|
|
}
|
|
/**
|
|
* 图形关系管理
|
|
*/
|
|
export declare class RelationManage {
|
|
relations: GraphicRelation[];
|
|
isContainsRelation(rp1: GraphicRelationParam, rp2: GraphicRelationParam): boolean;
|
|
addRelation(rp1: GraphicRelationParam | JlGraphic, rp2: GraphicRelationParam | JlGraphic): void;
|
|
/**
|
|
* 获取图形的所有关系
|
|
* @param g
|
|
* @returns
|
|
*/
|
|
getRelationsOfGraphic(g: JlGraphic): GraphicRelation[];
|
|
/**
|
|
* 获取指定图形的指定关系图形类型的所有关系
|
|
* @param g 指定图形
|
|
* @param type 关联图形的类型
|
|
* @returns
|
|
*/
|
|
getRelationsOfGraphicAndOtherType(g: JlGraphic, type: string): GraphicRelation[];
|
|
/**
|
|
* 删除关系
|
|
* @param relation
|
|
*/
|
|
private deleteRelation;
|
|
/**
|
|
* 删除指定图形的所有关系
|
|
* @param g
|
|
*/
|
|
deleteRelationOfGraphic(g: JlGraphic): void;
|
|
/**
|
|
* 删除指定图形的所有关系
|
|
* @param g
|
|
*/
|
|
deleteRelationOfGraphicAndOtherType(g: JlGraphic, type: string): void;
|
|
/**
|
|
* 清空
|
|
*/
|
|
clear(): void;
|
|
}
|