@inweb/markup 25.7.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.
- package/LICENSE +20 -0
- package/README.md +7 -0
- package/dist/markup.js +13390 -0
- package/dist/markup.js.map +1 -0
- package/dist/markup.min.js +1 -0
- package/dist/markup.module.js +1838 -0
- package/dist/markup.module.js.map +1 -0
- package/lib/index.d.ts +12 -0
- package/lib/markup/IMarkup.d.ts +130 -0
- package/lib/markup/IMarkupArrow.d.ts +52 -0
- package/lib/markup/IMarkupCloud.d.ts +50 -0
- package/lib/markup/IMarkupColorable.d.ts +15 -0
- package/lib/markup/IMarkupEllipse.d.ts +50 -0
- package/lib/markup/IMarkupImage.d.ts +50 -0
- package/lib/markup/IMarkupLine.d.ts +43 -0
- package/lib/markup/IMarkupObject.d.ts +47 -0
- package/lib/markup/IMarkupRectangle.d.ts +50 -0
- package/lib/markup/IMarkupText.d.ts +40 -0
- package/lib/markup/IWorldTransform.d.ts +39 -0
- package/lib/markup/Konva/KonvaArrow.d.ts +46 -0
- package/lib/markup/Konva/KonvaCloud.d.ts +35 -0
- package/lib/markup/Konva/KonvaEllipse.d.ts +40 -0
- package/lib/markup/Konva/KonvaImage.d.ts +36 -0
- package/lib/markup/Konva/KonvaLine.d.ts +35 -0
- package/lib/markup/Konva/KonvaMarkup.d.ts +82 -0
- package/lib/markup/Konva/KonvaRectangle.d.ts +38 -0
- package/lib/markup/Konva/KonvaText.d.ts +37 -0
- package/lib/markup/Konva/MarkupColor.d.ts +38 -0
- package/package.json +40 -0
- package/src/index.ts +35 -0
- package/src/markup/IMarkup.ts +173 -0
- package/src/markup/IMarkupArrow.ts +69 -0
- package/src/markup/IMarkupCloud.ts +78 -0
- package/src/markup/IMarkupColorable.ts +39 -0
- package/src/markup/IMarkupEllipse.ts +78 -0
- package/src/markup/IMarkupImage.ts +78 -0
- package/src/markup/IMarkupLine.ts +70 -0
- package/src/markup/IMarkupObject.ts +78 -0
- package/src/markup/IMarkupRectangle.ts +78 -0
- package/src/markup/IMarkupText.ts +66 -0
- package/src/markup/IWorldTransform.ts +46 -0
- package/src/markup/Konva/KonvaArrow.ts +147 -0
- package/src/markup/Konva/KonvaCloud.ts +213 -0
- package/src/markup/Konva/KonvaEllipse.ts +150 -0
- package/src/markup/Konva/KonvaImage.ts +149 -0
- package/src/markup/Konva/KonvaLine.ts +136 -0
- package/src/markup/Konva/KonvaMarkup.ts +1264 -0
- package/src/markup/Konva/KonvaRectangle.ts +149 -0
- package/src/markup/Konva/KonvaText.ts +141 -0
- package/src/markup/Konva/MarkupColor.ts +82 -0
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@inweb/markup",
|
|
3
|
+
"version": "25.7.4",
|
|
4
|
+
"description": "JavaScript 2D markups",
|
|
5
|
+
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"author": "Open Design Alliance",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"opendesign",
|
|
10
|
+
"opencloud",
|
|
11
|
+
"inweb",
|
|
12
|
+
"markup"
|
|
13
|
+
],
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"main": "dist/markup.js",
|
|
16
|
+
"module": "dist/markup.module.js",
|
|
17
|
+
"types": "lib/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"lib/**/*.d.ts",
|
|
21
|
+
"src"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "rollup -c rollup.config.js",
|
|
25
|
+
"test": "karma start karma.conf.js",
|
|
26
|
+
"docs": "typedoc"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@inweb/eventemitter2": "~25.7.4",
|
|
30
|
+
"@inweb/viewer-core": "~25.7.4"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"canvas": "^2.11.2",
|
|
34
|
+
"konva": "^9.2.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"canvas": "^2.11.2",
|
|
38
|
+
"konva": "^9.2.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
export { IMarkup, MarkupMode } from "./markup/IMarkup";
|
|
25
|
+
export { IMarkupArrow } from "./markup/IMarkupArrow";
|
|
26
|
+
export { IMarkupCloud } from "./markup/IMarkupCloud";
|
|
27
|
+
export { IMarkupColorable } from "./markup/IMarkupColorable";
|
|
28
|
+
export { IMarkupEllipse } from "./markup/IMarkupEllipse";
|
|
29
|
+
export { IMarkupImage } from "./markup/IMarkupImage";
|
|
30
|
+
export { IMarkupLine, MarkupLineType } from "./markup/IMarkupLine";
|
|
31
|
+
export { IMarkupObject } from "./markup/IMarkupObject";
|
|
32
|
+
export { IMarkupRectangle } from "./markup/IMarkupRectangle";
|
|
33
|
+
export { IMarkupText } from "./markup/IMarkupText";
|
|
34
|
+
export { IWorldTransform } from "./markup/IWorldTransform";
|
|
35
|
+
export { KonvaMarkup as Markup } from "./markup/Konva/KonvaMarkup";
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
import { IEventEmitter } from "@inweb/eventemitter2";
|
|
25
|
+
import { IViewpoint } from "@inweb/viewer-core";
|
|
26
|
+
import { IWorldTransform } from "./IWorldTransform";
|
|
27
|
+
import { IMarkupObject } from "./IMarkupObject";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Defines type of markup object. For `VisualizeJS` markup only the `Line` and `Text` markup
|
|
31
|
+
* objects are supported.
|
|
32
|
+
*/
|
|
33
|
+
export enum MarkupMode {
|
|
34
|
+
SelectMarkup = "SelectMarkup",
|
|
35
|
+
Line = "Line",
|
|
36
|
+
Text = "Text",
|
|
37
|
+
Rectangle = "Rectangle",
|
|
38
|
+
Ellipse = "Ellipse",
|
|
39
|
+
Arrow = "Arrow",
|
|
40
|
+
Image = "Image",
|
|
41
|
+
Cloud = "Cloud",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 2D markup core interface.
|
|
46
|
+
*/
|
|
47
|
+
export interface IMarkup {
|
|
48
|
+
/**
|
|
49
|
+
* Line width of the markup objects. Default is 4.
|
|
50
|
+
*/
|
|
51
|
+
lineWidth: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Type of the markup line. Available types: `solid`, `dot`, `dash`. Default is `solid`.
|
|
55
|
+
*/
|
|
56
|
+
lineType: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Font size of the markup text. Default is 34 px.
|
|
60
|
+
*/
|
|
61
|
+
fontSize: number;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Start method to init Markup support for the Viewer instance.
|
|
65
|
+
*
|
|
66
|
+
* @param canvas -
|
|
67
|
+
* {@link https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement | HTMLCanvasElement}
|
|
68
|
+
* used to operate on.
|
|
69
|
+
* @param canvasEvents - List of `canvas` events that the markup should redirect to the `viewer`.
|
|
70
|
+
* @param viewer - `Viewer` instance viewer that receives `canvas` events.
|
|
71
|
+
* @param worldTransformer - Transformer of screen space into world space and vice versa. If
|
|
72
|
+
* a transformer is defined, viewpoint objects will be stored in world coordinates,
|
|
73
|
+
* otherwise in screen coordinates.
|
|
74
|
+
*/
|
|
75
|
+
initialize(
|
|
76
|
+
canvas: HTMLCanvasElement,
|
|
77
|
+
canvasEvents: string[],
|
|
78
|
+
viewer?: IEventEmitter,
|
|
79
|
+
worldTransformer?: IWorldTransform
|
|
80
|
+
): void;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Releases all resources allocated by this `Markup` instance. Call this method before
|
|
84
|
+
* release the `Markup` instance.
|
|
85
|
+
*/
|
|
86
|
+
dispose(): void;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Create markup overlay.
|
|
90
|
+
*/
|
|
91
|
+
syncOverlay(): void;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Clear markup overlay.
|
|
95
|
+
*/
|
|
96
|
+
clearOverlay(): void;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Set markup color.
|
|
100
|
+
*
|
|
101
|
+
* @param r - `Red` part of color.
|
|
102
|
+
* @param g - `Green` part of color.
|
|
103
|
+
* @param b - `Blue` part of color.
|
|
104
|
+
*/
|
|
105
|
+
setMarkupColor(r: number, g: number, b: number): void;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Get markup color.
|
|
109
|
+
*
|
|
110
|
+
* @returns Color with `RGB` values.
|
|
111
|
+
*/
|
|
112
|
+
getMarkupColor(): { r: number; g: number; b: number };
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Colorize all markup entities with the specified color.
|
|
116
|
+
*
|
|
117
|
+
* @param r - `Red` part of color.
|
|
118
|
+
* @param g - `Green` part of color.
|
|
119
|
+
* @param b - `Blue` part of color.
|
|
120
|
+
*/
|
|
121
|
+
colorizeAllMarkup(r: number, g: number, b: number): void;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Colorize all selected markup entities with the specified color.
|
|
125
|
+
*
|
|
126
|
+
* @param r - `Red` part of color.
|
|
127
|
+
* @param g - `Green` part of color.
|
|
128
|
+
* @param b - `Blue` part of color.
|
|
129
|
+
*/
|
|
130
|
+
colorizeSelectedMarkups(r: number, g: number, b: number): void;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Draw a viewpoint. To get a list of available model viewpoints, use the
|
|
134
|
+
*
|
|
135
|
+
* @param viewpoint - Viewpoint data.
|
|
136
|
+
*/
|
|
137
|
+
setViewpoint(viewpoint: IViewpoint): void;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Create a viewpoint.
|
|
141
|
+
*/
|
|
142
|
+
getViewpoint(): IViewpoint;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Create a Markup object.
|
|
146
|
+
*
|
|
147
|
+
* @param type - string identificator of Markup object type.
|
|
148
|
+
* @param params - Markup object parameters.
|
|
149
|
+
*/
|
|
150
|
+
createObject(type: string, params: any): IMarkupObject;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Get Markup objects.
|
|
154
|
+
*/
|
|
155
|
+
getObjects(): IMarkupObject[];
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Get selected Markup objects.
|
|
159
|
+
*/
|
|
160
|
+
getSelectedObjects(): IMarkupObject[];
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Select Markup objects.
|
|
164
|
+
*
|
|
165
|
+
* @param objects
|
|
166
|
+
*/
|
|
167
|
+
selectObjects(objects: IMarkupObject[]): void;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Clear Markup objects selection.
|
|
171
|
+
*/
|
|
172
|
+
clearSelected(): void;
|
|
173
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
import { IMarkupObject } from "./IMarkupObject";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Arrow Markup object
|
|
28
|
+
*/
|
|
29
|
+
export interface IMarkupArrow extends IMarkupObject {
|
|
30
|
+
/**
|
|
31
|
+
* Get points of current Arrow
|
|
32
|
+
*
|
|
33
|
+
* @returns {{ x: number; y: number }} array of points
|
|
34
|
+
*/
|
|
35
|
+
getPoints(): { x: number; y: number }[];
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Set points of the Arrow
|
|
39
|
+
*
|
|
40
|
+
* @param {{ x: number; y: number }} points - array of points
|
|
41
|
+
*/
|
|
42
|
+
setPoints(points: { x: number; y: number }[]);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get Start Point of the Arrow
|
|
46
|
+
*/
|
|
47
|
+
getStartPoint(): { x: number; y: number };
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Set Start point of the Arrow
|
|
51
|
+
*
|
|
52
|
+
* @param x - value of X coordinate
|
|
53
|
+
* @param y - value of Y coordinate
|
|
54
|
+
*/
|
|
55
|
+
setStartPoint(x: number, y: number);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get End point of the Arrow
|
|
59
|
+
*/
|
|
60
|
+
getEndPoint(): { x: number; y: number };
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Set End point of the Arrow
|
|
64
|
+
*
|
|
65
|
+
* @param x - value of X coordinate
|
|
66
|
+
* @param y - value of Y coordinate
|
|
67
|
+
*/
|
|
68
|
+
setEndPoint(x: number, y: number);
|
|
69
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
import { IMarkupObject } from "./IMarkupObject";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Cloud Markup object
|
|
28
|
+
*/
|
|
29
|
+
export interface IMarkupCloud extends IMarkupObject {
|
|
30
|
+
/**
|
|
31
|
+
* Get position of the Cloud
|
|
32
|
+
*/
|
|
33
|
+
getPosition(): { x: number; y: number };
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Set position of the Cloud
|
|
37
|
+
*
|
|
38
|
+
* @param x - value of X coordinate
|
|
39
|
+
* @param y - value of Y coordinate
|
|
40
|
+
*/
|
|
41
|
+
setPosition(x: number, y: number);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get width of the Cloud. Default value is 200
|
|
45
|
+
*/
|
|
46
|
+
getWidth(): number;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Set width of the Cloud
|
|
50
|
+
*
|
|
51
|
+
* @param w - value of width. Default value is 200
|
|
52
|
+
*/
|
|
53
|
+
setWidth(w: number);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get height of the Cloud. Default value is 200
|
|
57
|
+
*/
|
|
58
|
+
getHeigth(): number;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Set height of the Cloud
|
|
62
|
+
*
|
|
63
|
+
* @param h - value of height. Default value is 200
|
|
64
|
+
*/
|
|
65
|
+
setHeight(h: number);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get line width of the Cloud. Defailt value is 4
|
|
69
|
+
*/
|
|
70
|
+
getLineWidth(): number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Set line width of the Cloud
|
|
74
|
+
*
|
|
75
|
+
* @param size - value of width. Defailt value is 4
|
|
76
|
+
*/
|
|
77
|
+
setLineWidth(size: number);
|
|
78
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Markup Colorable
|
|
26
|
+
*/
|
|
27
|
+
export interface IMarkupColorable {
|
|
28
|
+
/**
|
|
29
|
+
* Get color of the Markup instance
|
|
30
|
+
*/
|
|
31
|
+
getColor(): string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Set color of the Markup instance
|
|
35
|
+
*
|
|
36
|
+
* @param hex - color in #hex format. Default: `#ff0000`
|
|
37
|
+
*/
|
|
38
|
+
setColor(hex: string): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
import { IMarkupObject } from "./IMarkupObject";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Ellipse Markup object
|
|
28
|
+
*/
|
|
29
|
+
export interface IMarkupEllipse extends IMarkupObject {
|
|
30
|
+
/**
|
|
31
|
+
* Get position of the Ellipse
|
|
32
|
+
*/
|
|
33
|
+
getPosition(): { x: number; y: number };
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Set position of the Ellipse
|
|
37
|
+
*
|
|
38
|
+
* @param x - value of X coordinate
|
|
39
|
+
* @param y - value of Y coordinate
|
|
40
|
+
*/
|
|
41
|
+
setPosition(x: number, y: number);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get X radius of the Ellipse
|
|
45
|
+
*/
|
|
46
|
+
getRadiusX(): number;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Set X radius of the Ellipse
|
|
50
|
+
*
|
|
51
|
+
* @param r - value of X radius of the Ellipse
|
|
52
|
+
*/
|
|
53
|
+
setRadiusX(r: number);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get Y radius of the Ellipse
|
|
57
|
+
*/
|
|
58
|
+
getRadiusY(): number;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Set Y radius of the Ellipse
|
|
62
|
+
*
|
|
63
|
+
* @param r - value of Y radius of the Ellipse
|
|
64
|
+
*/
|
|
65
|
+
setRadiusY(r: number);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get line width of the Ellipse. Defailt is 4
|
|
69
|
+
*/
|
|
70
|
+
getLineWidth(): number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Set line width of the Ellipse. Default is 4
|
|
74
|
+
*
|
|
75
|
+
* @param size - value of width
|
|
76
|
+
*/
|
|
77
|
+
setLineWidth(size: number);
|
|
78
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
import { IMarkupObject } from "./IMarkupObject";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Image Markup object
|
|
28
|
+
*/
|
|
29
|
+
export interface IMarkupImage extends IMarkupObject {
|
|
30
|
+
/**
|
|
31
|
+
* Get position of the Image
|
|
32
|
+
*/
|
|
33
|
+
getPosition(): { x: number; y: number };
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Set position of the Image
|
|
37
|
+
*
|
|
38
|
+
* @param x - value of X coordinate
|
|
39
|
+
* @param y - value of Y coordinate
|
|
40
|
+
*/
|
|
41
|
+
setPosition(x: number, y: number);
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get source of the Image. Provides base64 string
|
|
45
|
+
*/
|
|
46
|
+
getSrc(): string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Set source of the Image
|
|
50
|
+
*
|
|
51
|
+
* @param src - string in base64 format
|
|
52
|
+
*/
|
|
53
|
+
setSrc(src: string);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get width of the Image
|
|
57
|
+
*/
|
|
58
|
+
getWidth(): number;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Set width of the Image
|
|
62
|
+
*
|
|
63
|
+
* @param w - value of width. Height will be automatically updated according to ratio of the Image
|
|
64
|
+
*/
|
|
65
|
+
setWidth(w: number);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get height of the Image
|
|
69
|
+
*/
|
|
70
|
+
getHeight(): number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Set height of the Image
|
|
74
|
+
*
|
|
75
|
+
* @param h - value of height. Width will be automatically updated according to ratio of the Image
|
|
76
|
+
*/
|
|
77
|
+
setHeight(h: number);
|
|
78
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
import { IMarkupObject } from "./IMarkupObject";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Type of the markup line.
|
|
28
|
+
*/
|
|
29
|
+
export type MarkupLineType = "solid" | "dot" | "dash";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Line Markup object
|
|
33
|
+
*/
|
|
34
|
+
export interface IMarkupLine extends IMarkupObject {
|
|
35
|
+
/**
|
|
36
|
+
* Get points of the Line
|
|
37
|
+
*/
|
|
38
|
+
getPoints(): number[];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get Line width. Default value is 4
|
|
42
|
+
*/
|
|
43
|
+
getLineWidth(): number;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Set Line width. Default value is 4
|
|
47
|
+
*
|
|
48
|
+
* @param size - value of width
|
|
49
|
+
*/
|
|
50
|
+
setLineWidth(size: number);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get Type of the Line. Available values: `solid`, `dot`, `dash`. Default is `solid`
|
|
54
|
+
*/
|
|
55
|
+
getLineType(): string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Set Type of the Line. Available values: `solid`, `dot`, `dash`. Default is `solid`
|
|
59
|
+
*
|
|
60
|
+
* @param type
|
|
61
|
+
*/
|
|
62
|
+
setLineType(type: string);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Add points to the Line
|
|
66
|
+
*
|
|
67
|
+
* @param {{ x: number; y: number }} points array of points
|
|
68
|
+
*/
|
|
69
|
+
addPoints(points: [{ x: number; y: number }]);
|
|
70
|
+
}
|