import { GeoreferencedMap } from '@allmaps/annotation'; import { WarpedMap } from './WarpedMap.js'; import { AnimationOptions, AnimationInternalOptions, SpecificTriangulatedWarpedMapOptions, TriangulatedWarpedMapOptions, WarpedMapListOptions, WarpedMapOptions, TriangulatedWarpedMapWithoutGeoreferencedMapOptions } from '../shared/types.js'; import { GcpAndDistortions, DistortionMeasure, TransformationType } from '@allmaps/transform'; import { Gcp, Point, Ring, TypedPolygon } from '@allmaps/types'; import { TriangulationToUnique } from '@allmaps/triangulate'; import { Projection } from '@allmaps/project'; export declare const DEFAULT_SPECIFIC_TRIANGULATED_WARPED_MAP_OPTIONS: SpecificTriangulatedWarpedMapOptions; export declare function createTriangulatedWarpedMapFactory(): (mapId: string, georeferencedMap: GeoreferencedMap, listOptions?: Partial>, mapOptions?: Partial) => TriangulatedWarpedMap; type GcpTriangulation = { resourceResolution: number | undefined; gcpUniquePoints: GcpAndDistortions[]; uniquePointIndices: number[]; uniquePointIndexInterpolatedPolygon: TypedPolygon; uniquePointIndexInterpolatedSteinerPolygons: TypedPolygon[]; insideSteinerPolygonsTriangles: boolean[]; }; /** * Class for triangulated WarpedMaps. * * @param resourcePreviousResolution - Resolution (or 'distance') used during the previous triangulation of the resource mask * @param resourceResolution - Resolution (or 'distance') used during the triangulation of the resource mask, computed as the finest resource segment resulting from a resource-to-geo transformation of the horizontal and vertical midline of the resource bbox using the current transformation type * @param triangulateErrorCount - Number of time the triangulation has resulted in an error * @param projectedGcpPreviousTriangulation - Previous triangulation of the resource mask * @param projectedGcpTriangulation - Triangulation of the resource mask of a specific resource resolution, with unique points in resource and projected geospatial coordinates with distortions, and indices pointing to the triangles points and indices pointing to the triangulation-refined resource mask * @param resourceTrianglePoints - Triangle points of the triangles the triangulated resourceMask * @param projectedGeoPreviousTrianglePoints - The projectedGeoTrianglePoints of the previous transformation type, used during transformation transitions * @param projectedGeoTrianglePoints - The resourceTrianglePoints in projected geospatial coordinates * @param previousTrianglePointsDistortion - The trianglePointsDistortion of the previous transformation type, used during transformation transitions * @param trianglePointsDistortion - Distortion amount of the distortionMeasure at the projectedGeoTrianglePoints * @param projectedGeoPreviousTriangulationFullMask - The resource full mask refined by the previous triangulation, in projected geospatial coordinates * @param projectedGeoPreviousTriangulationMask - The resource mask refined by the previous triangulation, in projected geospatial coordinates * @param projectedGeoTriangulationMask - The resource mask refined by the triangulation, in projected geospatial coordinates * @param projectedGeoPreviousTriangulationAppliedMask - The resource applied mask refined by the previous triangulation, in projected geospatial coordinates * @param projectedGeoTriangulationAppliedMask - The resource applied mask refined by the triangulation, in projected geospatial coordinates */ export declare class TriangulatedWarpedMap extends WarpedMap { mapOptions: Partial; listOptions: Partial; georeferencedMapOptions: Partial; defaultOptions: TriangulatedWarpedMapOptions; options: TriangulatedWarpedMapOptions; previousResourceResolution: number | undefined; resourceResolution: number | undefined; triangulateErrorCount: number; projectedGcpPreviousTriangulation?: GcpTriangulation; projectedGcpTriangulation?: GcpTriangulation; protected resourceTriangulationCache: Map>; protected projectedGcpTriangulationCache: Map>>>>; resourceTrianglePoints: Point[]; projectedGeoPreviousTrianglePoints: Point[]; projectedGeoTrianglePoints: Point[]; previousTrianglePointsDistortion: number[]; trianglePointsDistortion: number[]; previousTrianglePointsInside: boolean[]; trianglePointsInside: boolean[]; projectedGeoPreviousTriangulationFullMask: Ring; projectedGeoTriangulationFullMask: Ring; projectedGeoPreviousTriangulationMask: Ring; projectedGeoTriangulationMask: Ring; projectedGeoPreviousTriangulationAppliedMask: Ring; projectedGeoTriangulationAppliedMask: Ring; /** * Creates an instance of a TriangulatedWarpedMap. * * @param mapId - ID of the map * @param georeferencedMap - Georeferenced map used to construct the WarpedMap * @param options - Options */ constructor(mapId: string, georeferencedMap: GeoreferencedMap, listOptions?: Partial>, mapOptions?: Partial); /** * Get default options */ static getDefaultOptions(): TriangulatedWarpedMapOptions; /** * Get default options without the options overwritten by the georeferenced map */ static getDefaultWithoutGeoreferencedMapOptions(): TriangulatedWarpedMapWithoutGeoreferencedMapOptions; /** * Set the defaultOptions */ setDefaultOptions(): void; /** * Set the list options * * @param listOptions - list options * @param animationOptions - Animation options */ setListOptions(listOptions?: Partial, animationOptions?: Partial): object; /** * Set the map-specific options * * @param mapOptions - Map-specific options * @param animationOptions - Animation options */ setMapOptions(mapOptions?: Partial, animationOptions?: Partial): object; /** * Set the map-specific options, and the list options * * @param mapOptions - Map-specific options * @param listOptions - list options * @param animationOptions - Animation options */ setMapAndListOptions(mapOptions?: Partial, listOptions?: Partial, animationOptions?: Partial): object; /** * Update the ground control points loaded from a georeferenced map to new ground control points. * * @param gcps - the new ground control points */ protected setGcps(gcps: Gcp[]): void; /** * Update the resource mask loaded from a georeferenced map to a new mask. * * @param resourceMask - the new mask */ protected setResourceMask(): void; /** * Set the distortionMeasure * * @param distortionMeasure - the disortion measure */ protected setDistortionMeasure(distortionMeasure?: DistortionMeasure): void; /** * Set the internal projection * * @param projection - the internal projection */ protected setInternalProjection(projection: Projection): void; /** * Set the projection * * @param projection - the projection */ protected setProjection(projection: Projection): void; /** * Reset previous transform properties to new ones (when completing an animation). */ resetPrevious(): void; /** * Mix previous transform properties with new ones (when changing an ongoing animation). * * @param t - animation progress */ mixPreviousAndNew(t: number): void; /** * Update the (previous and new) triangulation of the resourceMask. Use cache if available. */ private updateTriangulation; /** * Derive the (previous and new) resource and projectedGeo points from their corresponding triangulations. * * Also derive the (previous and new) triangulation-refined resource and projectedGeo mask */ private updateTrianglePoints; /** * Derive the (previous and new) distortions from their corresponding triangulations. */ private updateTrianglePointsDistortion; protected updateProjectedTransformerProperties(): void; protected clearProjectedTransformerCaches(): void; protected clearResourceTriangulationCaches(): void; protected clearProjectedTriangulationCaches(): void; } export {};