@equinor/videx-map 1.14.2 → 1.14.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/EventHandler.d.ts +21 -21
  2. package/dist/ExplorationLayer.d.ts +38 -38
  3. package/dist/FaultlineModule.d.ts +51 -51
  4. package/dist/FieldModule.d.ts +113 -113
  5. package/dist/GeoJSONModule/GeoJSONModule.d.ts +47 -47
  6. package/dist/GeoJSONModule/constants.d.ts +13 -13
  7. package/dist/GeoJSONModule/index.d.ts +6 -6
  8. package/dist/GeoJSONModule/interfaces.d.ts +15 -15
  9. package/dist/GeoJSONModule/labels.d.ts +46 -46
  10. package/dist/GeoJSONModule/linestring.d.ts +55 -55
  11. package/dist/GeoJSONModule/multipolygon.d.ts +94 -94
  12. package/dist/GeoJSONModule/point.d.ts +26 -26
  13. package/dist/GeoJSONModule/polygon.d.ts +96 -96
  14. package/dist/GeoJSONModule/shader.d.ts +10 -10
  15. package/dist/ModuleInterface.d.ts +26 -26
  16. package/dist/OutlineModule.d.ts +81 -81
  17. package/dist/ResizeConfigInterface.d.ts +14 -14
  18. package/dist/WellboreModule.d.ts +126 -126
  19. package/dist/index.d.ts +8 -8
  20. package/dist/index.esm.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/index.umd.js +1 -1
  23. package/dist/pixiOverlayInterfaces.d.ts +16 -16
  24. package/dist/utils/ComparableArray.d.ts +60 -60
  25. package/dist/utils/LineDictionary.d.ts +89 -89
  26. package/dist/utils/LineInterpolator.d.ts +84 -84
  27. package/dist/utils/Log.d.ts +1 -1
  28. package/dist/utils/Mesh.d.ts +46 -46
  29. package/dist/utils/PointDictionary.d.ts +58 -58
  30. package/dist/utils/Radius.d.ts +2 -2
  31. package/dist/utils/Rect.d.ts +27 -27
  32. package/dist/utils/TriangleDictionary.d.ts +21 -21
  33. package/dist/utils/WellboreMesh.d.ts +51 -51
  34. package/dist/utils/centerOfMass.d.ts +8 -8
  35. package/dist/utils/fields/Highlighter.d.ts +33 -33
  36. package/dist/utils/fields/LabelManager.d.ts +62 -62
  37. package/dist/utils/fields/groupLabels.d.ts +5 -5
  38. package/dist/utils/fields/preprocessFields.d.ts +29 -29
  39. package/dist/utils/generateCircle.d.ts +10 -10
  40. package/dist/utils/linePoint.d.ts +27 -27
  41. package/dist/utils/lineReducer.d.ts +9 -9
  42. package/dist/utils/wellbores/AsyncLoop.d.ts +35 -35
  43. package/dist/utils/wellbores/Colors.d.ts +40 -40
  44. package/dist/utils/wellbores/Config.d.ts +80 -80
  45. package/dist/utils/wellbores/DataManager.d.ts +15 -15
  46. package/dist/utils/wellbores/Highlight.d.ts +18 -18
  47. package/dist/utils/wellbores/LabelType.d.ts +9 -9
  48. package/dist/utils/wellbores/Projector.d.ts +20 -20
  49. package/dist/utils/wellbores/RealtimeWellbore.d.ts +21 -21
  50. package/dist/utils/wellbores/Shader.d.ts +41 -41
  51. package/dist/utils/wellbores/data/Group.d.ts +48 -48
  52. package/dist/utils/wellbores/data/RootData.d.ts +29 -28
  53. package/dist/utils/wellbores/data/SourceData.d.ts +25 -25
  54. package/dist/utils/wellbores/data/WellboreData.d.ts +76 -76
  55. package/dist/utils/wellbores/data/WellboreEventData.d.ts +16 -16
  56. package/dist/utils/wellbores/data/details/Detail.d.ts +20 -20
  57. package/dist/utils/wellbores/data/details/DetailOptions.d.ts +7 -7
  58. package/dist/utils/wellbores/data/details/ShoeDetail.d.ts +14 -14
  59. package/dist/utils/wellbores/data/details/index.d.ts +11 -11
  60. package/dist/utils/wellbores/data/index.d.ts +6 -6
  61. package/dist/utils/wellbores/highlight-helper.d.ts +6 -6
  62. package/dist/utils/wellbores/intervals.d.ts +15 -15
  63. package/dist/utils/wellbores/labels/Label.d.ts +39 -39
  64. package/dist/utils/wellbores/labels/index.d.ts +2 -2
  65. package/dist/utils/wellbores/labels/label-helper.d.ts +3 -3
  66. package/dist/utils/wellbores/registries/CallbackRegistry.d.ts +23 -23
  67. package/dist/utils/wellbores/registries/ColorRegistry.d.ts +22 -22
  68. package/dist/utils/wellbores/registries/index.d.ts +2 -2
  69. package/package.json +16 -13
@@ -1,89 +1,89 @@
1
- import Vector2 from '@equinor/videx-vector2';
2
- /** Collection of coordinates defining geometry of a line segment. */
3
- interface Geometry {
4
- /** X-component of start position. */
5
- x1: number;
6
- /** Y-component of start position. */
7
- y1: number;
8
- /** X-component of end position. */
9
- x2: number;
10
- /** Y-component of end position. */
11
- y2: number;
12
- }
13
- /** Definition of a single line segment. */
14
- interface LineSegment {
15
- /** ID of parent line. */
16
- lineID: number;
17
- /** Geometry of line segment. */
18
- geometry: Geometry;
19
- }
20
- interface Line<T> {
21
- id: number;
22
- value: T;
23
- segments: LineSegment[];
24
- }
25
- /** Dictionary for segmenting lines and finding closest entries. */
26
- export default class LineDictionary<T> {
27
- gridsize: number;
28
- /** Map with collection of segment IDs. */
29
- tiles: Map<string, LineSegment[]>;
30
- /** IDs of lines mapped to values. */
31
- lineValues: Map<number, Line<T>>;
32
- /** User provided function to test if a line is active or not */
33
- testActiveFunction: (value: T) => boolean;
34
- /** Used to assign lineID */
35
- private lineSeq;
36
- /**
37
- * Constructs a new line dictionary with segmentation based on given decimal.
38
- * @param decimals Defines size of tiles. For example, decimals = 2, would assign
39
- * both [12, 23] and [19, 21] to a single tile [10, 20]. Decimals also defines
40
- * maximum search distance. For decimals equals 2, only lines within 10 units will
41
- * be returned. (Default: 0)
42
- */
43
- constructor(gridsize?: number, testActive?: (value: T) => boolean);
44
- /**
45
- * Maps a line up to a given value
46
- * @param points Collection of points on line
47
- * @param value Value to return for line
48
- * @param id Optionally associate an id with this entry
49
- */
50
- add(points: Vector2[], value: T, id?: number): Line<T>;
51
- /**
52
- * Add a line segment to the dictionary by start and end position.
53
- * @param x1 X-component of start position
54
- * @param y1 Y-component of start position
55
- * @param x2 X-component of end position
56
- * @param y2 Y-component of end position
57
- * @param lineID ID of the line which the segment should belong to
58
- * @private
59
- */
60
- addSegment(x1: number, y1: number, x2: number, y2: number, line: Line<T>): void;
61
- /**
62
- * Find the closest line to the given coordinates and return its value.
63
- * @param target Reference position to evaluate
64
- * @param maxDist Max distance relative to decimals. Given a decimal value of 2, a maxDist of 1 will return lines within a distance of 0.01 units.
65
- * @returns Value assigned the line
66
- */
67
- getClosest(target: Vector2, maxDist?: number): T;
68
- /**
69
- * Find the closest lines to the given coordinates and return their value.
70
- * @param target Reference position to evaluate
71
- * @param epsilon Allowed distance between overlapping segments
72
- * @param maxDist Maximum distance in grid cells.
73
- * @param filter Function for filtering points based on minimum
74
- * @returns Values assigned the lines
75
- */
76
- getAllClosest(target: Vector2, epsilon?: number, maxDist?: number, filter?: (min: T, d: T) => boolean): T[];
77
- isActive(line: Line<T>): boolean;
78
- /**
79
- * Get unique line segments within a 3 by 3 grid.
80
- * @private
81
- * @param x X position of point
82
- * @param y Y position of point
83
- * @returns Collection of segments within boundaries
84
- */
85
- getSegmentsOn3Grid(target: Vector2): Set<LineSegment>;
86
- /** Clear line dictionary to prepare for new data. */
87
- clear(filter?: (value: T, id: number) => boolean): void;
88
- }
89
- export {};
1
+ import Vector2 from '@equinor/videx-vector2';
2
+ /** Collection of coordinates defining geometry of a line segment. */
3
+ interface Geometry {
4
+ /** X-component of start position. */
5
+ x1: number;
6
+ /** Y-component of start position. */
7
+ y1: number;
8
+ /** X-component of end position. */
9
+ x2: number;
10
+ /** Y-component of end position. */
11
+ y2: number;
12
+ }
13
+ /** Definition of a single line segment. */
14
+ interface LineSegment {
15
+ /** ID of parent line. */
16
+ lineID: number;
17
+ /** Geometry of line segment. */
18
+ geometry: Geometry;
19
+ }
20
+ interface Line<T> {
21
+ id: number;
22
+ value: T;
23
+ segments: LineSegment[];
24
+ }
25
+ /** Dictionary for segmenting lines and finding closest entries. */
26
+ export default class LineDictionary<T> {
27
+ gridsize: number;
28
+ /** Map with collection of segment IDs. */
29
+ tiles: Map<string, LineSegment[]>;
30
+ /** IDs of lines mapped to values. */
31
+ lineValues: Map<number, Line<T>>;
32
+ /** User provided function to test if a line is active or not */
33
+ testActiveFunction: (value: T) => boolean;
34
+ /** Used to assign lineID */
35
+ private lineSeq;
36
+ /**
37
+ * Constructs a new line dictionary with segmentation based on given decimal.
38
+ * @param decimals Defines size of tiles. For example, decimals = 2, would assign
39
+ * both [12, 23] and [19, 21] to a single tile [10, 20]. Decimals also defines
40
+ * maximum search distance. For decimals equals 2, only lines within 10 units will
41
+ * be returned. (Default: 0)
42
+ */
43
+ constructor(gridsize?: number, testActive?: (value: T) => boolean);
44
+ /**
45
+ * Maps a line up to a given value
46
+ * @param points Collection of points on line
47
+ * @param value Value to return for line
48
+ * @param id Optionally associate an id with this entry
49
+ */
50
+ add(points: Vector2[], value: T, id?: number): Line<T>;
51
+ /**
52
+ * Add a line segment to the dictionary by start and end position.
53
+ * @param x1 X-component of start position
54
+ * @param y1 Y-component of start position
55
+ * @param x2 X-component of end position
56
+ * @param y2 Y-component of end position
57
+ * @param lineID ID of the line which the segment should belong to
58
+ * @private
59
+ */
60
+ addSegment(x1: number, y1: number, x2: number, y2: number, line: Line<T>): void;
61
+ /**
62
+ * Find the closest line to the given coordinates and return its value.
63
+ * @param target Reference position to evaluate
64
+ * @param maxDist Max distance relative to decimals. Given a decimal value of 2, a maxDist of 1 will return lines within a distance of 0.01 units.
65
+ * @returns Value assigned the line
66
+ */
67
+ getClosest(target: Vector2, maxDist?: number): T;
68
+ /**
69
+ * Find the closest lines to the given coordinates and return their value.
70
+ * @param target Reference position to evaluate
71
+ * @param epsilon Allowed distance between overlapping segments
72
+ * @param maxDist Maximum distance in grid cells.
73
+ * @param filter Function for filtering points based on minimum
74
+ * @returns Values assigned the lines
75
+ */
76
+ getAllClosest(target: Vector2, epsilon?: number, maxDist?: number, filter?: (min: T, d: T) => boolean): T[];
77
+ isActive(line: Line<T>): boolean;
78
+ /**
79
+ * Get unique line segments within a 3 by 3 grid.
80
+ * @private
81
+ * @param x X position of point
82
+ * @param y Y position of point
83
+ * @returns Collection of segments within boundaries
84
+ */
85
+ getSegmentsOn3Grid(target: Vector2): Set<LineSegment>;
86
+ /** Clear line dictionary to prepare for new data. */
87
+ clear(filter?: (value: T, id: number) => boolean): void;
88
+ }
89
+ export {};
@@ -1,84 +1,84 @@
1
- import Vector2 from '@equinor/videx-vector2';
2
- /** Path used by the interpolator. */
3
- interface PathPoint {
4
- /** Point along the line. */
5
- point: Vector2;
6
- /** Normalized direction towards next point. */
7
- direction: Vector2;
8
- /** Distance to point along line. */
9
- distance: number;
10
- /** Relative distance to point along line. */
11
- relative: number;
12
- }
13
- /** Point in returned segment. */
14
- export interface SegmentPoint {
15
- /** Point along line. */
16
- position: Vector2;
17
- /** Normalized direction towards next point. */
18
- direction: Vector2;
19
- /** Distance to point along line. */
20
- distance: number;
21
- }
22
- /** Interpolator for finding points and subsegments on a line defined by a collection of Vector2 or 2D vectors. */
23
- export declare class LineInterpolator {
24
- /** Amount of provided points. */
25
- amount: number;
26
- /** Length of line. */
27
- length: number;
28
- /** True if line is an approximation of a single point. */
29
- singlePoint: boolean;
30
- /** Collection of points along line with distances. */
31
- path: PathPoint[];
32
- /**
33
- * Construct line interpolator from a collection of points
34
- * @param points Collection of points as Vector2
35
- */
36
- constructor(points: Vector2[], radius: number);
37
- /**
38
- * Get point at relative position.
39
- * @param relative Relative position along the line between 0 and 1
40
- * @returns Point at relative position
41
- */
42
- GetPoint(relative: number): SegmentPoint;
43
- /**
44
- * Get section at relative position.
45
- * @param relativeStart Relative position along the line between 0 and 1
46
- * @param relativeEnd Relative position along the line between 0 and 1
47
- * @returns Relative section along the line
48
- */
49
- GetSection(relativeStart: number, relativeEnd: number): SegmentPoint[];
50
- /**
51
- * Get closest point below provided relative position along the line.
52
- * Utilizes divide-and-conquer algorithm to speed up search.
53
- * @param relative Relative position along the line between 0 and 1
54
- * @returns Index of closest point below relative
55
- */
56
- GetClosestPointBelow(relative: number): number;
57
- /**
58
- * Get point with given distance from the start in world space.
59
- * @param distance Real distance from the start
60
- * @returns Point at given distance from start
61
- */
62
- GetPointFromStart(distance: number): SegmentPoint;
63
- /**
64
- * Get point with given distance from the end in world space.
65
- * @param distance Real distance from the end
66
- * @returns Point at given distance from end
67
- */
68
- GetPointFromEnd(distance: number): SegmentPoint;
69
- /**
70
- * Get collection of equally space points with given width in real distance.
71
- * @param relative Start of range
72
- * @param width Width of range in real distance
73
- * @param resolution Amount of points within range
74
- * @returns Collection of equally spaced points within range
75
- */
76
- GetRangeFromStart(relative: number, width: number, resolution?: number): SegmentPoint[];
77
- /**
78
- * Get direction towards next point.
79
- * @param idx Index of point
80
- * @returns Direction as vector
81
- */
82
- GetDirection(points: Vector2[], idx: number): Vector2;
83
- }
84
- export {};
1
+ import Vector2 from '@equinor/videx-vector2';
2
+ /** Path used by the interpolator. */
3
+ interface PathPoint {
4
+ /** Point along the line. */
5
+ point: Vector2;
6
+ /** Normalized direction towards next point. */
7
+ direction: Vector2;
8
+ /** Distance to point along line. */
9
+ distance: number;
10
+ /** Relative distance to point along line. */
11
+ relative: number;
12
+ }
13
+ /** Point in returned segment. */
14
+ export interface SegmentPoint {
15
+ /** Point along line. */
16
+ position: Vector2;
17
+ /** Normalized direction towards next point. */
18
+ direction: Vector2;
19
+ /** Distance to point along line. */
20
+ distance: number;
21
+ }
22
+ /** Interpolator for finding points and subsegments on a line defined by a collection of Vector2 or 2D vectors. */
23
+ export declare class LineInterpolator {
24
+ /** Amount of provided points. */
25
+ amount: number;
26
+ /** Length of line. */
27
+ length: number;
28
+ /** True if line is an approximation of a single point. */
29
+ singlePoint: boolean;
30
+ /** Collection of points along line with distances. */
31
+ path: PathPoint[];
32
+ /**
33
+ * Construct line interpolator from a collection of points
34
+ * @param points Collection of points as Vector2
35
+ */
36
+ constructor(points: Vector2[], radius: number);
37
+ /**
38
+ * Get point at relative position.
39
+ * @param relative Relative position along the line between 0 and 1
40
+ * @returns Point at relative position
41
+ */
42
+ GetPoint(relative: number): SegmentPoint;
43
+ /**
44
+ * Get section at relative position.
45
+ * @param relativeStart Relative position along the line between 0 and 1
46
+ * @param relativeEnd Relative position along the line between 0 and 1
47
+ * @returns Relative section along the line
48
+ */
49
+ GetSection(relativeStart: number, relativeEnd: number): SegmentPoint[];
50
+ /**
51
+ * Get closest point below provided relative position along the line.
52
+ * Utilizes divide-and-conquer algorithm to speed up search.
53
+ * @param relative Relative position along the line between 0 and 1
54
+ * @returns Index of closest point below relative
55
+ */
56
+ GetClosestPointBelow(relative: number): number;
57
+ /**
58
+ * Get point with given distance from the start in world space.
59
+ * @param distance Real distance from the start
60
+ * @returns Point at given distance from start
61
+ */
62
+ GetPointFromStart(distance: number): SegmentPoint;
63
+ /**
64
+ * Get point with given distance from the end in world space.
65
+ * @param distance Real distance from the end
66
+ * @returns Point at given distance from end
67
+ */
68
+ GetPointFromEnd(distance: number): SegmentPoint;
69
+ /**
70
+ * Get collection of equally space points with given width in real distance.
71
+ * @param relative Start of range
72
+ * @param width Width of range in real distance
73
+ * @param resolution Amount of points within range
74
+ * @returns Collection of equally spaced points within range
75
+ */
76
+ GetRangeFromStart(relative: number, width: number, resolution?: number): SegmentPoint[];
77
+ /**
78
+ * Get direction towards next point.
79
+ * @param idx Index of point
80
+ * @returns Direction as vector
81
+ */
82
+ GetDirection(points: Vector2[], idx: number): Vector2;
83
+ }
84
+ export {};
@@ -1 +1 @@
1
- export default function log(text: string): void;
1
+ export default function log(text: string): void;
@@ -1,46 +1,46 @@
1
- import Vector2 from '@equinor/videx-vector2';
2
- import * as PIXI from 'pixi.js';
3
- import { VectorLike } from '@equinor/videx-linear-algebra';
4
- import { SegmentPoint } from './LineInterpolator';
5
- export interface WellboreSegmentData {
6
- vertices: number[];
7
- triangles: number[];
8
- vertexData: number[];
9
- extraData: number[];
10
- }
11
- export interface MeshData {
12
- vertices: number[];
13
- triangles: number[];
14
- }
15
- export interface MeshNormalData extends MeshData {
16
- normals: number[];
17
- }
18
- export default class Mesh {
19
- /**
20
- * Create mesh for a line.
21
- * @param points Collection of points used to construct mesh
22
- * @param thickness Thickness of line
23
- * @param type 0: Normal, 1: Interval, 2: Tick
24
- * @returns Vertex and triangulation for mesh
25
- */
26
- static WellboreSegment(points: SegmentPoint[], thickness: number, type: number): WellboreSegmentData;
27
- static SimpleLine: (points: VectorLike[], thickness?: number) => MeshNormalData;
28
- /**
29
- * Create mesh for a polygon.
30
- * @param points Collection of points used to construct mesh
31
- * @returns Vertex and triangulation for mesh
32
- */
33
- static Polygon: (points: Vector2[]) => MeshData;
34
- static PolygonOutline: (points: VectorLike[], thickness?: number) => MeshNormalData;
35
- /**
36
- * Create a simple pixi mesh from vertices, triangles and shaders. Vertices are named 'inputVerts' in shader.
37
- * @param vertices Vertices belonging to mesh
38
- * @param triangles Triangulation of mesh
39
- * @param vertexShader Vertex shader as string
40
- * @param fragmentShader Fragment shader as string
41
- * @param uniforms Collection of uniforms
42
- * @param normals UV data
43
- * @returns Created pixi mesh
44
- */
45
- static from(vertices: number[], triangles: number[], vertexShader: string, fragmentShader: string, uniforms?: object, normals?: number[]): PIXI.Mesh;
46
- }
1
+ import Vector2 from '@equinor/videx-vector2';
2
+ import * as PIXI from 'pixi.js';
3
+ import { VectorLike } from '@equinor/videx-linear-algebra';
4
+ import { SegmentPoint } from './LineInterpolator';
5
+ export interface WellboreSegmentData {
6
+ vertices: number[];
7
+ triangles: number[];
8
+ vertexData: number[];
9
+ extraData: number[];
10
+ }
11
+ export interface MeshData {
12
+ vertices: number[];
13
+ triangles: number[];
14
+ }
15
+ export interface MeshNormalData extends MeshData {
16
+ normals: number[];
17
+ }
18
+ export default class Mesh {
19
+ /**
20
+ * Create mesh for a line.
21
+ * @param points Collection of points used to construct mesh
22
+ * @param thickness Thickness of line
23
+ * @param type 0: Normal, 1: Interval, 2: Tick
24
+ * @returns Vertex and triangulation for mesh
25
+ */
26
+ static WellboreSegment(points: SegmentPoint[], thickness: number, type: number): WellboreSegmentData;
27
+ static SimpleLine: (points: VectorLike[], thickness?: number) => MeshNormalData;
28
+ /**
29
+ * Create mesh for a polygon.
30
+ * @param points Collection of points used to construct mesh
31
+ * @returns Vertex and triangulation for mesh
32
+ */
33
+ static Polygon: (points: Vector2[]) => MeshData;
34
+ static PolygonOutline: (points: VectorLike[], thickness?: number) => MeshNormalData;
35
+ /**
36
+ * Create a simple pixi mesh from vertices, triangles and shaders. Vertices are named 'inputVerts' in shader.
37
+ * @param vertices Vertices belonging to mesh
38
+ * @param triangles Triangulation of mesh
39
+ * @param vertexShader Vertex shader as string
40
+ * @param fragmentShader Fragment shader as string
41
+ * @param uniforms Collection of uniforms
42
+ * @param normals UV data
43
+ * @returns Created pixi mesh
44
+ */
45
+ static from(vertices: number[], triangles: number[], vertexShader: string, fragmentShader: string, uniforms?: object, normals?: number[]): PIXI.Mesh;
46
+ }
@@ -1,58 +1,58 @@
1
- import Vector2 from '@equinor/videx-vector2';
2
- /** Interface of a single point. */
3
- interface Point<T> {
4
- /** Value stored in point. */
5
- val: T;
6
- /** Position of points. */
7
- pos: Vector2;
8
- /** ID of point. */
9
- id: number;
10
- }
11
- /** Dictionary for points. Also manages overlapping. */
12
- export default class PointDictionary<T> {
13
- /** Threshold to define overlapping. */
14
- distThreshold: number;
15
- /** gridSize of data segmentation. */
16
- gridSize: number;
17
- /** Radius of points. */
18
- radius: number;
19
- /** Mapping tile coordinates, on format 'x.y', to submap of points. */
20
- tiles: Map<string, Map<number, Point<T>>>;
21
- /** Mapping point IDs to values. */
22
- pointValues: Map<number, Point<T>>;
23
- /** User provided function to test if a line is active or not */
24
- testActiveFunction: (value: T) => boolean;
25
- /** Used to assign PointID */
26
- private pointSeq;
27
- /**
28
- * Constructs a new point dictionary.
29
- * @param distThreshold Threshold for what is considered overlapping
30
- * @param gridSize grid cell size used for segmentation
31
- */
32
- constructor(distThreshold: number, gridSize: number, radius: number, testActive?: (value: T) => boolean);
33
- /**
34
- * Add a single point to the dictionary.
35
- * @param pos Position of point
36
- * @param val Value stored within points
37
- * @returns ID of newly added point
38
- */
39
- add(pos: Vector2, val: T): number;
40
- private getKeys;
41
- isActive(point: Point<T>): boolean;
42
- getKey(position: Vector2): string;
43
- /**
44
- * Get overlapping points, if any.
45
- * @param pos Target position
46
- * @returns Overlapping point
47
- */
48
- getOverlapping(pos: Vector2): Point<T>;
49
- /**
50
- * Get closest point under coordinates defined by radius.
51
- * @param pos Target position
52
- * @returns Closest point
53
- */
54
- getClosestUnder(pos: Vector2, radius?: number): Point<T>;
55
- /** Clear point dictionary to prepare for new data. */
56
- clear(filter?: (value: T, id: number) => boolean): void;
57
- }
58
- export {};
1
+ import Vector2 from '@equinor/videx-vector2';
2
+ /** Interface of a single point. */
3
+ interface Point<T> {
4
+ /** Value stored in point. */
5
+ val: T;
6
+ /** Position of points. */
7
+ pos: Vector2;
8
+ /** ID of point. */
9
+ id: number;
10
+ }
11
+ /** Dictionary for points. Also manages overlapping. */
12
+ export default class PointDictionary<T> {
13
+ /** Threshold to define overlapping. */
14
+ distThreshold: number;
15
+ /** gridSize of data segmentation. */
16
+ gridSize: number;
17
+ /** Radius of points. */
18
+ radius: number;
19
+ /** Mapping tile coordinates, on format 'x.y', to submap of points. */
20
+ tiles: Map<string, Map<number, Point<T>>>;
21
+ /** Mapping point IDs to values. */
22
+ pointValues: Map<number, Point<T>>;
23
+ /** User provided function to test if a line is active or not */
24
+ testActiveFunction: (value: T) => boolean;
25
+ /** Used to assign PointID */
26
+ private pointSeq;
27
+ /**
28
+ * Constructs a new point dictionary.
29
+ * @param distThreshold Threshold for what is considered overlapping
30
+ * @param gridSize grid cell size used for segmentation
31
+ */
32
+ constructor(distThreshold: number, gridSize: number, radius: number, testActive?: (value: T) => boolean);
33
+ /**
34
+ * Add a single point to the dictionary.
35
+ * @param pos Position of point
36
+ * @param val Value stored within points
37
+ * @returns ID of newly added point
38
+ */
39
+ add(pos: Vector2, val: T): number;
40
+ private getKeys;
41
+ isActive(point: Point<T>): boolean;
42
+ getKey(position: Vector2): string;
43
+ /**
44
+ * Get overlapping points, if any.
45
+ * @param pos Target position
46
+ * @returns Overlapping point
47
+ */
48
+ getOverlapping(pos: Vector2): Point<T>;
49
+ /**
50
+ * Get closest point under coordinates defined by radius.
51
+ * @param pos Target position
52
+ * @returns Closest point
53
+ */
54
+ getClosestUnder(pos: Vector2, radius?: number): Point<T>;
55
+ /** Clear point dictionary to prepare for new data. */
56
+ clear(filter?: (value: T, id: number) => boolean): void;
57
+ }
58
+ export {};
@@ -1,2 +1,2 @@
1
- import { ResizeConfig } from '../ResizeConfigInterface';
2
- export declare function getRadius(zoom: number, { min, max }: ResizeConfig): number;
1
+ import { ResizeConfig } from '../ResizeConfigInterface';
2
+ export declare function getRadius(zoom: number, { min, max }: ResizeConfig): number;
@@ -1,27 +1,27 @@
1
- import Vector2 from '@equinor/videx-vector2';
2
- import { VectorLike } from '@equinor/videx-linear-algebra';
3
- export default class Rect {
4
- lowerLeft: Vector2;
5
- width: number;
6
- height: number;
7
- rotation: number;
8
- constructor(lowerLeft: Vector2, width: number, height: number, rotation: number);
9
- /**
10
- * Check if a point is inside.
11
- * @param vector Vector to evaluate
12
- * @returns True if point is inside rectangle
13
- */
14
- isInside(vector: VectorLike): boolean;
15
- /**
16
- * Check if a point is inside.
17
- * @param x X position to evaluate
18
- * @param y Y position to evaluate
19
- * @returns True if point is inside rectangle
20
- */
21
- isInside(x: number, y: number): boolean;
22
- /**
23
- * Transforms position from world space to local space.
24
- * @param position
25
- */
26
- inverseTransformPoint(x: number, y: number): Vector2;
27
- }
1
+ import Vector2 from '@equinor/videx-vector2';
2
+ import { VectorLike } from '@equinor/videx-linear-algebra';
3
+ export default class Rect {
4
+ lowerLeft: Vector2;
5
+ width: number;
6
+ height: number;
7
+ rotation: number;
8
+ constructor(lowerLeft: Vector2, width: number, height: number, rotation: number);
9
+ /**
10
+ * Check if a point is inside.
11
+ * @param vector Vector to evaluate
12
+ * @returns True if point is inside rectangle
13
+ */
14
+ isInside(vector: VectorLike): boolean;
15
+ /**
16
+ * Check if a point is inside.
17
+ * @param x X position to evaluate
18
+ * @param y Y position to evaluate
19
+ * @returns True if point is inside rectangle
20
+ */
21
+ isInside(x: number, y: number): boolean;
22
+ /**
23
+ * Transforms position from world space to local space.
24
+ * @param position
25
+ */
26
+ inverseTransformPoint(x: number, y: number): Vector2;
27
+ }