import { Style } from 'ol/style.js'; import type { IBrainSerializable } from '../../tools/state/brain/decorators.js'; import type { Circle as CircleGeom, Geometry } from 'ol/geom.js'; import type Feature from 'ol/Feature.js'; import IGirafeContext from '../../tools/context/icontext.js'; export declare enum DrawingShape { Point = 0, Polyline = 1, Polygon = 2, Square = 3, Rectangle = 4, Disk = 5, FreehandPolyline = 6, FreehandPolygon = 7 } export type ArrowStyle = 'none' | 'start' | 'end' | 'both'; export type ArrowPosition = 'whole' | 'each' | 'mid'; export type LineStroke = 'full' | 'dash' | 'dot' | 'double'; export declare class DrawingState implements IBrainSerializable { isBrainSerializable: boolean; activeTool: DrawingShape | null; features: DrawingFeature[]; } export type SerializedFeature = { n: string; sc: string; sw: number; fc: string; ls: string; as: string; ap: string; nfz: number; mfz: number; f: string; g: object; dn: boolean; dm: boolean; nc: string; mc: string; s: boolean; t: DrawingShape; }; export default class DrawingFeature { private readonly _tool; private _name; private _nameColor; private _strokeColor; private _strokeWidth; private _fillColor; private _lineStroke; private _arrowStyle; private _arrowPosition; private _nameFontSize; private _measureFontSize; private _measureColor; private _font; private _displayName; private _displayMeasure; private _selected; geojson: object; id: string; onChange: (f: DrawingFeature) => void; private readonly drawingState; private readonly defaultDrawingConfig; constructor(tool: DrawingShape, drawingState: DrawingState, drawingConfig: any); get name(): string; set name(v: string); get strokeColor(): string; set strokeColor(v: string); get strokeWidth(): number; set strokeWidth(v: number); get lineStroke(): LineStroke; set lineStroke(v: LineStroke); get fillColor(): string; set fillColor(v: string); get arrowStyle(): ArrowStyle; set arrowStyle(v: ArrowStyle); get arrowPosition(): ArrowPosition; set arrowPosition(v: ArrowPosition); get nameFontSize(): number; set nameFontSize(v: number); get measureFontSize(): number; set measureFontSize(v: number); get font(): string; set font(v: string); get displayName(): boolean; set displayName(v: boolean); get displayMeasure(): boolean; set displayMeasure(v: boolean); get nameColor(): string; set nameColor(v: string); get measureColor(): string; set measureColor(v: string); get type(): DrawingShape; get selected(): boolean; set selected(v: boolean); addToState(): void; serialize(): SerializedFeature; getLengthText(length: number): string; getAreaText(area: number): string; getCoordText(coord: number[]): string; getAzimuthText(circle: CircleGeom): string; isPointOrPolyline(): boolean; getVertexStyle(activeNode?: boolean): Style; static deserialize(serializedFeature: SerializedFeature, context: IGirafeContext): DrawingFeature; static circleToPolygon(center: number[], radius: number, nbEdges?: number): number[][]; static geojsonFromOlFeature(olFeature: Feature, shapeType: DrawingShape): object; /** * Finds an name composed of the shape type and a number. * The number starts from how many shape of the same type type are already in the state +1. * Then checks if such candidate name already exists and increments if so. * @param geometryTypename * @returns */ private getDefaultName; }