aurea-eden 1.25.1 → 1.26.0
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 +0 -0
- package/README.md +300 -95
- package/dist/bpmn-diagram.es.js +37516 -25040
- package/dist/bpmn-diagram.umd.js +13 -5790
- package/package.json +17 -8
- package/.gitattributes +0 -2
- package/.github/workflows/static.yml +0 -43
- package/CHANGELOG.md +0 -60
- package/README_.md +0 -174
- package/assets/3diagram_logo.png +0 -0
- package/assets/aurea-eden-logo.jpeg +0 -0
- package/assets/favicon/about.txt +0 -6
- package/assets/favicon/android-chrome-192x192.png +0 -0
- package/assets/favicon/android-chrome-512x512.png +0 -0
- package/assets/favicon/apple-touch-icon.png +0 -0
- package/assets/favicon/favicon-16x16.png +0 -0
- package/assets/favicon/favicon-32x32.png +0 -0
- package/assets/favicon/favicon.ico +0 -0
- package/assets/favicon/site.webmanifest +0 -1
- package/assets/threejs_camera.jpg.webp +0 -0
- package/assets/threejs_camera3.jpg.webp +0 -0
- package/assets/threejs_cameras.webp +0 -0
- package/assets/threejs_cameras2.webp +0 -0
- package/assets/threejs_objects.webp +0 -0
- package/assets/threejs_scene.webp +0 -0
- package/assets/threejs_scene_graph.webp +0 -0
- package/favicon.ico +0 -0
- package/index.html +0 -34
- package/index.js +0 -153
- package/lib/connectors/Connector.js +0 -47
- package/lib/diagrams/Diagram.js +0 -710
- package/lib/diagrams/DiagramConstants.js +0 -22
- package/lib/elements/Element.js +0 -860
- package/lib/materials/BarMaterial.js +0 -17
- package/lib/materials/DiagramEditMaterial.js +0 -28
- package/lib/notations/BpmnDiagram.js +0 -861
- package/lib/shapes/Shape.js +0 -23
- package/lib/shapes/bar/ValueBarConstants.js +0 -34
- package/lib/shapes/bar/ValueBarShape.js +0 -52
- package/lib/shapes/basic/BasicShapeConstants.js +0 -23
- package/lib/shapes/basic/BoxShape.js +0 -12
- package/lib/shapes/basic/CircleShape.js +0 -55
- package/lib/shapes/basic/DiamondShape.js +0 -169
- package/lib/shapes/basic/RoundedRectangleShape.js +0 -180
- package/lib/shapes/connector/ConnectorConstants.js +0 -7
- package/lib/shapes/connector/RoundedCornerOrthogonalConnectorShape.js +0 -229
- package/lib/shapes/icon/IconConstants.js +0 -7
- package/lib/shapes/icon/IconShape.js +0 -92
- package/lib/shapes/icon/bpmn/activities/ad-hoc-marker.svg +0 -50
- package/lib/shapes/icon/bpmn/activities/business-rule.svg +0 -92
- package/lib/shapes/icon/bpmn/activities/compensation-marker.svg +0 -50
- package/lib/shapes/icon/bpmn/activities/loop-marker.svg +0 -50
- package/lib/shapes/icon/bpmn/activities/manual.svg +0 -51
- package/lib/shapes/icon/bpmn/activities/parallel-mi-marker.svg +0 -70
- package/lib/shapes/icon/bpmn/activities/receive.svg +0 -77
- package/lib/shapes/icon/bpmn/activities/script.svg +0 -54
- package/lib/shapes/icon/bpmn/activities/send.svg +0 -86
- package/lib/shapes/icon/bpmn/activities/sequential-mi-marker.svg +0 -70
- package/lib/shapes/icon/bpmn/activities/service.svg +0 -58
- package/lib/shapes/icon/bpmn/activities/sub-process-marker.svg +0 -51
- package/lib/shapes/icon/bpmn/activities/user.svg +0 -50
- package/lib/shapes/icon/bpmn/events/compensation.svg +0 -47
- package/lib/shapes/icon/bpmn/events/conditional.svg +0 -47
- package/lib/shapes/icon/bpmn/events/error.svg +0 -47
- package/lib/shapes/icon/bpmn/events/escalation.svg +0 -47
- package/lib/shapes/icon/bpmn/events/intermediate-compensation.svg +0 -53
- package/lib/shapes/icon/bpmn/events/intermediate-conditional.svg +0 -53
- package/lib/shapes/icon/bpmn/events/intermediate-escalation.svg +0 -53
- package/lib/shapes/icon/bpmn/events/intermediate-link-catch.svg +0 -53
- package/lib/shapes/icon/bpmn/events/intermediate-link-throw.svg +0 -53
- package/lib/shapes/icon/bpmn/events/intermediate-receive.svg +0 -53
- package/lib/shapes/icon/bpmn/events/intermediate-send.svg +0 -69
- package/lib/shapes/icon/bpmn/events/intermediate-signal-catch.svg +0 -53
- package/lib/shapes/icon/bpmn/events/intermediate-signal-throw.svg +0 -53
- package/lib/shapes/icon/bpmn/events/intermediate-timer.svg +0 -107
- package/lib/shapes/icon/bpmn/events/intermediate.svg +0 -49
- package/lib/shapes/icon/bpmn/events/message-end.svg +0 -54
- package/lib/shapes/icon/bpmn/events/message-start.svg +0 -41
- package/lib/shapes/icon/bpmn/events/signal-end.svg +0 -47
- package/lib/shapes/icon/bpmn/events/signal-start.svg +0 -47
- package/lib/shapes/icon/bpmn/events/terminate.svg +0 -49
- package/lib/shapes/icon/bpmn/events/timer.svg +0 -104
- package/lib/shapes/icon/bpmn/gateways/complex.svg +0 -61
- package/lib/shapes/icon/bpmn/gateways/event-based.svg +0 -68
- package/lib/shapes/icon/bpmn/gateways/exclusive.svg +0 -57
- package/lib/shapes/icon/bpmn/gateways/inclusive.svg +0 -57
- package/lib/shapes/icon/bpmn/gateways/parallel.svg +0 -56
- package/lib/shapes/icon/decorators.svg +0 -262
- package/lib/shapes/icon/hexagon.svg +0 -5
- package/lib/shapes/text/Roboto_Regular.json +0 -5610
- package/lib/shapes/text/TextShape.js +0 -29
- package/lib/shapes/text/fonts/Roboto.zip +0 -0
- package/vite.config.js +0 -15
package/lib/shapes/Shape.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
|
|
3
|
-
class Shape {
|
|
4
|
-
constructor(geometry, material) {
|
|
5
|
-
this.geometry = geometry;
|
|
6
|
-
this.material = material;
|
|
7
|
-
|
|
8
|
-
this.width = this.getSize().x;
|
|
9
|
-
this.height = this.getSize().y;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
getSize() {
|
|
13
|
-
// Get the size of the geometry
|
|
14
|
-
var size = new THREE.Vector3();
|
|
15
|
-
this.geometry.computeBoundingBox();
|
|
16
|
-
this.geometry.boundingBox.getSize(size);
|
|
17
|
-
|
|
18
|
-
return size;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { Shape };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
|
|
3
|
-
export const ExtrusionParameters = {
|
|
4
|
-
steps: 2,
|
|
5
|
-
depth: 5, // 200,
|
|
6
|
-
bevelEnabled: true,
|
|
7
|
-
bevelThickness: .025, // 1,
|
|
8
|
-
bevelSize: .075, // 3,
|
|
9
|
-
bevelOffset: 0,
|
|
10
|
-
bevelSegments: 1
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
// Bar colors ( Material colors: https://www.materialui.co/colors )
|
|
14
|
-
export const ColorPalette = [
|
|
15
|
-
new THREE.Color( 0xf44336 ), // red
|
|
16
|
-
new THREE.Color( 0xE91E63 ), // pink
|
|
17
|
-
new THREE.Color( 0x9C27B0 ), // purple
|
|
18
|
-
new THREE.Color( 0x673AB7 ), // deep purple
|
|
19
|
-
new THREE.Color( 0x3F51B5 ), // indigo
|
|
20
|
-
new THREE.Color( 0x2196F3 ), // blue
|
|
21
|
-
new THREE.Color( 0x03A9F4 ), // light blue
|
|
22
|
-
new THREE.Color( 0x00BCD4 ), // cyan
|
|
23
|
-
new THREE.Color( 0x009688 ), // teal
|
|
24
|
-
new THREE.Color( 0x4CAF50 ), // green
|
|
25
|
-
new THREE.Color( 0x8BC34A ), // light green
|
|
26
|
-
new THREE.Color( 0xCDDC39 ), // lime
|
|
27
|
-
new THREE.Color( 0xFFEB3B ), // yellow
|
|
28
|
-
new THREE.Color( 0xFFC107 ), // amber
|
|
29
|
-
new THREE.Color( 0xFF9800 ), // orange
|
|
30
|
-
new THREE.Color( 0xFF5722 ), // deep orange
|
|
31
|
-
new THREE.Color( 0x795548 ), // brown
|
|
32
|
-
new THREE.Color( 0x9E9E9E ), // grey
|
|
33
|
-
new THREE.Color( 0x607D8B ) // blue grey
|
|
34
|
-
];
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { Shape } from '../Shape.js';
|
|
3
|
-
import { BarMaterial } from '../../materials/BarMaterial.js';
|
|
4
|
-
import { ExtrusionParameters, ColorPalette } from './ValueBarConstants.js';
|
|
5
|
-
|
|
6
|
-
class ValueBarShape extends Shape {
|
|
7
|
-
constructor(shape, height, color) {
|
|
8
|
-
if (!(shape instanceof THREE.Shape)) {
|
|
9
|
-
throw new TypeError('shape must be an instance of THREE.Shape');
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Use color if provided, otherwise pick a random color from the palette
|
|
13
|
-
const barColor = color !== undefined ? color : ColorPalette[Math.floor(Math.random() * ColorPalette.length)];
|
|
14
|
-
// Use height if provided, otherwise pick a random height
|
|
15
|
-
const barHeight = height !== undefined ? height : Math.floor(Math.random() * 10) + 1;
|
|
16
|
-
// Extrusion parameters
|
|
17
|
-
const extrusionParameters = { ...ExtrusionParameters, depth: barHeight };
|
|
18
|
-
|
|
19
|
-
var barGeometry = new THREE.ExtrudeGeometry( shape, extrusionParameters );
|
|
20
|
-
|
|
21
|
-
// Construct the shape
|
|
22
|
-
super(barGeometry, new BarMaterial(barColor));
|
|
23
|
-
|
|
24
|
-
// this.barHeight = barHeight;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// draw(ctx, x, y, width) {
|
|
28
|
-
// ctx.fillRect(x, y - this.barHeight, width, this.barHeight);
|
|
29
|
-
// }
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
class ValueBarChart {
|
|
33
|
-
constructor(bars) {
|
|
34
|
-
this.bars = bars;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
draw(ctx, x, y, barWidth, barSpacing) {
|
|
38
|
-
this.bars.forEach((bar, index) => {
|
|
39
|
-
const barShape = new ValueBarShape(bar.height);
|
|
40
|
-
barShape.draw(ctx, x + index * (barWidth + barSpacing), y, barWidth);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export { ValueBarShape, ValueBarChart };
|
|
46
|
-
|
|
47
|
-
// Example usage:
|
|
48
|
-
// const canvas = document.getElementById('myCanvas');
|
|
49
|
-
// const ctx = canvas.getContext('2d');
|
|
50
|
-
// const bars = [{ height: 100 }, { height: 150 }, { height: 200 }];
|
|
51
|
-
// const barChart = new BarChart(bars);
|
|
52
|
-
// barChart.draw(ctx, 10, 300, 50, 10);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const RoundedRectangleDimensions = {
|
|
2
|
-
ACTIVITY_HORIZONTAL_SIZE: 100,
|
|
3
|
-
ACTIVITY_VERTICAL_SIZE: 80,
|
|
4
|
-
ACTIVITY_CORNER_RADIUS: 10,
|
|
5
|
-
ACTIVITY_LINE_WIDTH: 1,
|
|
6
|
-
ACTIVITY_TEXT_SIZE: 8,
|
|
7
|
-
ACTIVITY_TEXT_ELEVATION: 3
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const CircleDimensions = {
|
|
11
|
-
EVENT_RADIUS: 18,
|
|
12
|
-
START_EVENT_LINE_WIDTH: 1,
|
|
13
|
-
END_EVENT_LINE_WIDTH: 2.4,
|
|
14
|
-
EVENT_TEXT_SIZE: 7,
|
|
15
|
-
EVENT_TEXT_ELEVATION: 3
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const DiamondDimensions = {
|
|
19
|
-
GATEWAY_DIAGONAL: 48,
|
|
20
|
-
GATEWAY_LINE_WIDTH: 1,
|
|
21
|
-
GATEWAY_TEXT_SIZE: 7,
|
|
22
|
-
GATEWAY_TEXT_ELEVATION: 3
|
|
23
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { Shape } from '../Shape.js';
|
|
3
|
-
import { DiagramEditMaterial } from '../../materials/DiagramEditMaterial.js';
|
|
4
|
-
|
|
5
|
-
class BoxShape extends Shape {
|
|
6
|
-
constructor() {
|
|
7
|
-
const color = 0x0000ff;
|
|
8
|
-
super(new THREE.BoxGeometry(1, 1, 1), new DiagramEditMaterial(color));
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { BoxShape };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { Shape } from '../Shape.js';
|
|
3
|
-
import { DiagramEditMaterial } from '../../materials/DiagramEditMaterial.js';
|
|
4
|
-
import { CircleDimensions } from './BasicShapeConstants.js';
|
|
5
|
-
import { ExtrusionParameters, Colors } from '../../diagrams/DiagramConstants.js';
|
|
6
|
-
|
|
7
|
-
class CircleShape extends Shape {
|
|
8
|
-
constructor(lineWidth = CircleDimensions.START_EVENT_LINE_WIDTH) {
|
|
9
|
-
|
|
10
|
-
const eventRadius = CircleDimensions.EVENT_RADIUS;
|
|
11
|
-
const color = Colors.ELEMENT_STROKE;
|
|
12
|
-
const extrusionParameters = ExtrusionParameters;
|
|
13
|
-
|
|
14
|
-
function circle( ctx, radius ) {
|
|
15
|
-
const centerX = 0;
|
|
16
|
-
const centerY = 0;
|
|
17
|
-
var controlPointDistance = radius * 0.552284749831 // (4/3)*tan(pi/2n) for n=4 points
|
|
18
|
-
ctx.moveTo( centerX, centerY - radius );
|
|
19
|
-
ctx.bezierCurveTo( centerX + controlPointDistance, centerY - radius,
|
|
20
|
-
centerX + radius, centerY - controlPointDistance,
|
|
21
|
-
centerX + radius, centerY );
|
|
22
|
-
ctx.bezierCurveTo( centerX + radius, centerY + controlPointDistance,
|
|
23
|
-
centerX + controlPointDistance, centerY + radius,
|
|
24
|
-
centerX, centerY + radius );
|
|
25
|
-
ctx.bezierCurveTo( centerX - controlPointDistance, centerY + radius,
|
|
26
|
-
centerX - radius, centerY + controlPointDistance,
|
|
27
|
-
centerX - radius, centerY );
|
|
28
|
-
ctx.bezierCurveTo( centerX - radius, centerY - controlPointDistance,
|
|
29
|
-
centerX - controlPointDistance, centerY - radius,
|
|
30
|
-
centerX, centerY - radius );
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Prepare event mesh
|
|
34
|
-
var eventShape = new THREE.Shape();
|
|
35
|
-
circle( eventShape, eventRadius );
|
|
36
|
-
const outerShape = eventShape.clone(); // Create a deep copy of the outer shape to save it for later use without holes
|
|
37
|
-
var eventHole = new THREE.Path();
|
|
38
|
-
circle( eventHole, eventRadius - lineWidth );
|
|
39
|
-
eventShape.holes.push( eventHole );
|
|
40
|
-
|
|
41
|
-
var eventGeometry = new THREE.ExtrudeGeometry( eventShape, extrusionParameters );
|
|
42
|
-
|
|
43
|
-
// Construct the shape
|
|
44
|
-
super( eventGeometry, new DiagramEditMaterial( color ) );
|
|
45
|
-
|
|
46
|
-
this.outerShape = outerShape;
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
getOuterShape() {
|
|
51
|
-
return this.outerShape;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { CircleShape };
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { Shape } from '../Shape.js';
|
|
3
|
-
import { DiagramEditMaterial } from '../../materials/DiagramEditMaterial.js';
|
|
4
|
-
import { DiamondDimensions } from './BasicShapeConstants.js';
|
|
5
|
-
import { ExtrusionParameters, Colors } from '../../diagrams/DiagramConstants.js';
|
|
6
|
-
|
|
7
|
-
class DiamondShape extends Shape {
|
|
8
|
-
constructor() {
|
|
9
|
-
|
|
10
|
-
const diagonal = DiamondDimensions.GATEWAY_DIAGONAL;
|
|
11
|
-
const lineWidth = DiamondDimensions.GATEWAY_LINE_WIDTH;
|
|
12
|
-
const color = Colors.ELEMENT_STROKE;
|
|
13
|
-
const extrusionParameters = ExtrusionParameters;
|
|
14
|
-
|
|
15
|
-
function diamond( ctx, verticalSize, horizontalSize ) {
|
|
16
|
-
const centerX = 0;
|
|
17
|
-
const centerY = 0;
|
|
18
|
-
// (!) Specify your points in counterclockwise winding order.
|
|
19
|
-
ctx.moveTo( centerX - verticalSize / 2, centerY );
|
|
20
|
-
ctx.lineTo( centerX, centerY - verticalSize / 2 );
|
|
21
|
-
ctx.lineTo( centerX + horizontalSize / 2 , centerY);
|
|
22
|
-
ctx.lineTo( centerX, centerY + verticalSize / 2 );
|
|
23
|
-
ctx.lineTo( centerX - horizontalSize / 2, centerY );
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Prepare gateway mesh
|
|
27
|
-
var gatewayShape = new THREE.Shape();
|
|
28
|
-
diamond( gatewayShape, diagonal, diagonal);
|
|
29
|
-
const outerShape = gatewayShape.clone(); // Save the outer shape for later use
|
|
30
|
-
var gatewayHole = new THREE.Path();
|
|
31
|
-
diamond( gatewayHole, diagonal - ( lineWidth * Math.sqrt(2) * 2 ), diagonal - ( lineWidth * Math.sqrt(2) * 2 ) );
|
|
32
|
-
gatewayShape.holes.push(gatewayHole);
|
|
33
|
-
|
|
34
|
-
var gatewayGeometry = new THREE.ExtrudeGeometry( gatewayShape, extrusionParameters );
|
|
35
|
-
|
|
36
|
-
// Construct the shape
|
|
37
|
-
super(gatewayGeometry, new DiagramEditMaterial(color));
|
|
38
|
-
|
|
39
|
-
this.outerShape = outerShape;
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
getOuterShape() {
|
|
44
|
-
return this.outerShape;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export { DiamondShape };
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//GATEWAY shape
|
|
58
|
-
// function Gateway( diagram, centerX, centerY, lineWidth, type, text ) {
|
|
59
|
-
|
|
60
|
-
// var diagonal = 120;
|
|
61
|
-
|
|
62
|
-
// this.centerX = centerX;
|
|
63
|
-
// this.centerY = centerY;
|
|
64
|
-
// this.lineWidth = lineWidth;
|
|
65
|
-
// this.verticalSize = diagonal;
|
|
66
|
-
// this.horizontalSize = diagonal;
|
|
67
|
-
// this.selected = false;
|
|
68
|
-
// var decorations = [];
|
|
69
|
-
// this.decorations = decorations;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// function diamond( ctx, centerX, centerY, verticalSize, horizontalSize ) {
|
|
73
|
-
// // (!) Specify your points in counterclockwise winding order.
|
|
74
|
-
// ctx.moveTo( centerX - Math.round( verticalSize / 2 ), centerY );
|
|
75
|
-
// ctx.lineTo( centerX, centerY - Math.round( verticalSize / 2 ) );
|
|
76
|
-
// ctx.lineTo( centerX + Math.round( horizontalSize / 2 ), centerY);
|
|
77
|
-
// ctx.lineTo( centerX, centerY + Math.round( verticalSize / 2 ) );
|
|
78
|
-
// ctx.lineTo( centerX - Math.round( horizontalSize / 2 ), centerY );
|
|
79
|
-
// }
|
|
80
|
-
|
|
81
|
-
// // prepare gateway mesh
|
|
82
|
-
// var gatewayMesh;
|
|
83
|
-
// var gatewayShape = new THREE.Shape();
|
|
84
|
-
// diamond( gatewayShape, centerX, centerY, diagonal, diagonal );
|
|
85
|
-
// var gatewayHole = new THREE.Path();
|
|
86
|
-
// diamond( gatewayHole, centerX, centerY, diagonal - ( lineWidth * Math.sqrt(2) * 2 ),
|
|
87
|
-
// diagonal - ( lineWidth * Math.sqrt(2) * 2 ) );
|
|
88
|
-
// gatewayShape.holes.push(gatewayHole);
|
|
89
|
-
// // var gatewayGeometry = new THREE.ShapeGeometry(gatewayShape);
|
|
90
|
-
|
|
91
|
-
// var extrudeSettings = {
|
|
92
|
-
// steps: 2,
|
|
93
|
-
// amount: 4,
|
|
94
|
-
// bevelEnabled: true,
|
|
95
|
-
// bevelThickness: .5,
|
|
96
|
-
// bevelSize: 1,
|
|
97
|
-
// bevelSegments: 4
|
|
98
|
-
// };
|
|
99
|
-
// var gatewayGeometry = new THREE.ExtrudeGeometry( gatewayShape, extrudeSettings );
|
|
100
|
-
|
|
101
|
-
// gatewayMesh = new THREE.Mesh( gatewayGeometry, elementMaterial );
|
|
102
|
-
// this.mesh = gatewayMesh;
|
|
103
|
-
|
|
104
|
-
// // fill gateway with symbol
|
|
105
|
-
// switch (type) {
|
|
106
|
-
// case CONST_GATEWAY_TYPES.EXCLUSIVE:
|
|
107
|
-
// decorations[ 0 ] = new Text( diagram, centerX, centerY, "X", 50, 0 );
|
|
108
|
-
// console.log("CONST_GATEWAY_TYPES.EXCLUSIVE");
|
|
109
|
-
// break;
|
|
110
|
-
// case CONST_GATEWAY_TYPES.EVENT_BASED:
|
|
111
|
-
// decorations[ 0 ] = new Text( diagram, centerX - 2, centerY - 27, ".", 70, 0 );
|
|
112
|
-
// console.log("CONST_GATEWAY_TYPES.EVENT_BASED");
|
|
113
|
-
// break;
|
|
114
|
-
// case CONST_GATEWAY_TYPES.PARALLEL:
|
|
115
|
-
// decorations[ 0 ] = new Text( diagram, centerX - 2, centerY, "+", 70, 0 );
|
|
116
|
-
// console.log("CONST_GATEWAY_TYPES.PARALLEL");
|
|
117
|
-
// break;
|
|
118
|
-
// case CONST_GATEWAY_TYPES.INCLUSIVE:
|
|
119
|
-
// decorations[ 0 ] = new Text( diagram, centerX - 2, centerY - 27, ".", 70, 0 );
|
|
120
|
-
// console.log("CONST_GATEWAY_TYPES.INCLUSIVE");
|
|
121
|
-
// break;
|
|
122
|
-
// case CONST_GATEWAY_TYPES.COMPLEX:
|
|
123
|
-
// decorations[ 0 ] = new Text( diagram, centerX - 2, centerY - 27, ".", 70, 0 );
|
|
124
|
-
// console.log("CONST_GATEWAY_TYPES.COMPLEX");
|
|
125
|
-
// break;
|
|
126
|
-
// case CONST_GATEWAY_TYPES.EXCLUSIVE_EVENT_BASED:
|
|
127
|
-
// decorations[ 0 ] = new Text( diagram, centerX - 2, centerY - 27, ".", 70, 0 );
|
|
128
|
-
// console.log("CONST_GATEWAY_TYPES.EXCLUSIVE_EVENT_BASED");
|
|
129
|
-
// break;
|
|
130
|
-
// case CONST_GATEWAY_TYPES.PARALLEL_EVENT_BASED:
|
|
131
|
-
// decorations[ 0 ] = new Text( diagram, centerX - 2, centerY - 27, ".", 70, 0 );
|
|
132
|
-
// console.log("CONST_GATEWAY_TYPES.PARALLEL_EVENT_BASED");
|
|
133
|
-
// break;
|
|
134
|
-
// }
|
|
135
|
-
|
|
136
|
-
// // add gateway background
|
|
137
|
-
// var backgroundShape = new THREE.Shape();
|
|
138
|
-
// diamond( backgroundShape, centerX, centerY, diagonal, diagonal );
|
|
139
|
-
// decorations[ 1 ] = new Background( backgroundShape, -1 );
|
|
140
|
-
|
|
141
|
-
// this.select = function() {
|
|
142
|
-
// this.selected = true;
|
|
143
|
-
// this.mesh.material = selectedMaterial;
|
|
144
|
-
// // select decorations (loop)
|
|
145
|
-
// // for ( i = 0; i < decorations.length; i++ ) {
|
|
146
|
-
// // this.decorations[ i ].mesh.material = selectedMaterial;
|
|
147
|
-
// // }
|
|
148
|
-
// }
|
|
149
|
-
|
|
150
|
-
// this.deselect = function() {
|
|
151
|
-
// this.selected = false;
|
|
152
|
-
// this.mesh.material = elementMaterial;
|
|
153
|
-
// //deselect decorations (loop)
|
|
154
|
-
// // for ( i = 0; i < decorations.length; i++ ) {
|
|
155
|
-
// // decorations[ i ].mesh.material = elementMaterial;
|
|
156
|
-
// // }
|
|
157
|
-
// }
|
|
158
|
-
|
|
159
|
-
// this.getDecorations = function() {
|
|
160
|
-
// return decorations;
|
|
161
|
-
// }
|
|
162
|
-
|
|
163
|
-
// this.showParameter = function( value, color ) {
|
|
164
|
-
// };
|
|
165
|
-
|
|
166
|
-
// this.hideParameter = function() {
|
|
167
|
-
// }
|
|
168
|
-
|
|
169
|
-
// }
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { Shape } from '../Shape.js';
|
|
3
|
-
import { DiagramEditMaterial } from '../../materials/DiagramEditMaterial.js';
|
|
4
|
-
import { RoundedRectangleDimensions } from './BasicShapeConstants.js';
|
|
5
|
-
import { ExtrusionParameters, Colors } from '../../diagrams/DiagramConstants.js';
|
|
6
|
-
|
|
7
|
-
class RoundedRectangleShape extends Shape {
|
|
8
|
-
constructor() {
|
|
9
|
-
|
|
10
|
-
const horizontalSize = RoundedRectangleDimensions.ACTIVITY_HORIZONTAL_SIZE;
|
|
11
|
-
const verticalSize = RoundedRectangleDimensions.ACTIVITY_VERTICAL_SIZE;
|
|
12
|
-
const lineWidth = RoundedRectangleDimensions.ACTIVITY_LINE_WIDTH;
|
|
13
|
-
const cornerRadius = RoundedRectangleDimensions.ACTIVITY_CORNER_RADIUS;
|
|
14
|
-
// Calculate the outer and inner radius of the rounded rectangle based on the corner radius and line width
|
|
15
|
-
const outerRadius = cornerRadius;
|
|
16
|
-
const innerRadius = cornerRadius - lineWidth;
|
|
17
|
-
const color = Colors.ELEMENT_STROKE;
|
|
18
|
-
const extrusionParameters = ExtrusionParameters;
|
|
19
|
-
|
|
20
|
-
function roundedRect( ctx, width, height, radius ) {
|
|
21
|
-
const centerX = 0;
|
|
22
|
-
const centerY = 0;
|
|
23
|
-
var x = centerX - ( width / 2 );
|
|
24
|
-
var y = centerY - ( height / 2 );
|
|
25
|
-
ctx.moveTo( x + radius, y );
|
|
26
|
-
ctx.lineTo( x + width - radius, y );
|
|
27
|
-
ctx.quadraticCurveTo( x + width, y, x + width, y + radius );
|
|
28
|
-
ctx.lineTo( x + width, y + height - radius );
|
|
29
|
-
ctx.quadraticCurveTo( x + width, y + height, x + width - radius, y + height );
|
|
30
|
-
ctx.lineTo( x + radius, y + height );
|
|
31
|
-
ctx.quadraticCurveTo( x, y + height, x, y + height - radius );
|
|
32
|
-
ctx.lineTo( x, y + radius );
|
|
33
|
-
ctx.quadraticCurveTo( x, y, x + radius, y );
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var activityShape = new THREE.Shape();
|
|
37
|
-
roundedRect(activityShape, horizontalSize, verticalSize, outerRadius);
|
|
38
|
-
const outerShape = activityShape.clone(); // Create a deep copy of the outer shape to save it for later use without holes
|
|
39
|
-
var activityHole = new THREE.Path();
|
|
40
|
-
roundedRect(activityHole, horizontalSize - (2 * lineWidth), verticalSize - (2 * lineWidth), innerRadius);
|
|
41
|
-
activityShape.holes.push(activityHole);
|
|
42
|
-
|
|
43
|
-
var activityGeometry = new THREE.ExtrudeGeometry(activityShape, extrusionParameters);
|
|
44
|
-
|
|
45
|
-
// Construct the shape
|
|
46
|
-
super(activityGeometry, new DiagramEditMaterial(color));
|
|
47
|
-
|
|
48
|
-
this.outerShape = outerShape;
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
getOuterShape() {
|
|
53
|
-
return this.outerShape;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export { RoundedRectangleShape };
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// import * as TWEEN from '@tweenjs/tween.js';
|
|
63
|
-
// import * as THREE from '../../../../../../../../home/robert/.cache/typescript/5.7/node_modules/@types/three';
|
|
64
|
-
// import { elementMaterial, Text, Background, Bar, selectedMaterial } from '../../bpmnElements';
|
|
65
|
-
|
|
66
|
-
// //ACTIVITY shape
|
|
67
|
-
// function Activity( diagram, centerX, centerY, lineWidth, text ) {
|
|
68
|
-
|
|
69
|
-
// this.centerX = centerX;
|
|
70
|
-
// this.centerY = centerY;
|
|
71
|
-
// this.lineWidth = lineWidth;
|
|
72
|
-
// this.text = text;
|
|
73
|
-
// var decorations = [];
|
|
74
|
-
// this.decorations = decorations;
|
|
75
|
-
|
|
76
|
-
// var horizontalSize = 350;
|
|
77
|
-
// var verticalSize = 200;
|
|
78
|
-
// var outerRadius = 27;
|
|
79
|
-
// var innerRadius = 21;
|
|
80
|
-
|
|
81
|
-
// this.selected = false;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
// function roundedRect( ctx, centerX, centerY, width, height, radius ) {
|
|
85
|
-
// var x = Math.round( centerX - ( width / 2 ) );
|
|
86
|
-
// var y = Math.round( centerY - ( height / 2 ) );
|
|
87
|
-
// ctx.moveTo( x + radius, y );
|
|
88
|
-
// ctx.lineTo( x + width - radius, y );
|
|
89
|
-
// ctx.quadraticCurveTo( x + width, y, x + width, y + radius );
|
|
90
|
-
// ctx.lineTo( x + width, y + height - radius );
|
|
91
|
-
// ctx.quadraticCurveTo( x + width, y + height, x + width - radius, y + height );
|
|
92
|
-
// ctx.lineTo( x + radius, y + height );
|
|
93
|
-
// ctx.quadraticCurveTo( x, y + height, x, y + height - radius );
|
|
94
|
-
// ctx.lineTo( x, y + radius );
|
|
95
|
-
// ctx.quadraticCurveTo( x, y, x + radius, y );
|
|
96
|
-
// }
|
|
97
|
-
|
|
98
|
-
// var activityMesh;
|
|
99
|
-
|
|
100
|
-
// // prepare activity mesh
|
|
101
|
-
// var activityShape = new THREE.Shape();
|
|
102
|
-
// roundedRect( activityShape, centerX, centerY, horizontalSize, verticalSize, outerRadius );
|
|
103
|
-
// var activityHole = new THREE.Path();
|
|
104
|
-
// roundedRect( activityHole, centerX, centerY, horizontalSize - ( 2 * lineWidth ), verticalSize - ( 2 * lineWidth ), innerRadius );
|
|
105
|
-
// activityShape.holes.push( activityHole );
|
|
106
|
-
// // var activityGeometry = new THREE.ShapeGeometry( activityShape );
|
|
107
|
-
|
|
108
|
-
// var extrudeSettings = {
|
|
109
|
-
// steps: 2,
|
|
110
|
-
// amount: 4,
|
|
111
|
-
// bevelEnabled: true,
|
|
112
|
-
// bevelThickness: .5,
|
|
113
|
-
// bevelSize: 1,
|
|
114
|
-
// bevelSegments: 4
|
|
115
|
-
// };
|
|
116
|
-
// var activityGeometry = new THREE.ExtrudeGeometry( activityShape, extrudeSettings );
|
|
117
|
-
|
|
118
|
-
// activityMesh = new THREE.Mesh ( activityGeometry, elementMaterial );
|
|
119
|
-
|
|
120
|
-
// this.mesh = activityMesh;
|
|
121
|
-
|
|
122
|
-
// // add activity name (text)
|
|
123
|
-
// decorations[ 0 ] = new Text( diagram, centerX, centerY, text, 30, 0 );
|
|
124
|
-
|
|
125
|
-
// // add activity background
|
|
126
|
-
// var backgroundShape = new THREE.Shape();
|
|
127
|
-
// roundedRect( backgroundShape, centerX, centerY, horizontalSize, verticalSize, outerRadius );
|
|
128
|
-
// decorations[ 1 ] = new Background( backgroundShape, -1 );
|
|
129
|
-
|
|
130
|
-
// // add activity bar
|
|
131
|
-
// var barShape = new THREE.Shape();
|
|
132
|
-
// roundedRect( barShape, centerX, centerY, horizontalSize, verticalSize, outerRadius );
|
|
133
|
-
// decorations[ 2 ] = new Bar( barShape );
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
// this.select = function() {
|
|
137
|
-
// this.selected = true;
|
|
138
|
-
// this.mesh.material = selectedMaterial;
|
|
139
|
-
// // select decorations (loop)
|
|
140
|
-
// // for ( i = 0; i < decorations.length; i++ ) {
|
|
141
|
-
// // this.decorations[ i ].mesh.material = selectedMaterial;
|
|
142
|
-
// // }
|
|
143
|
-
// }
|
|
144
|
-
|
|
145
|
-
// this.deselect = function() {
|
|
146
|
-
// this.selected = false;
|
|
147
|
-
// activityMesh.material = elementMaterial;
|
|
148
|
-
// //deselect decorations
|
|
149
|
-
// // for ( i = 0; i < decorations.length; i++ ) {
|
|
150
|
-
// // decorations[ i ].mesh.material = elementMaterial;
|
|
151
|
-
// // }
|
|
152
|
-
// }
|
|
153
|
-
|
|
154
|
-
// this.getDecorations = function() {
|
|
155
|
-
// return decorations;
|
|
156
|
-
// }
|
|
157
|
-
|
|
158
|
-
// this.showParameter = function( value, color ) {
|
|
159
|
-
|
|
160
|
-
// decorations[ 2 ].mesh.scale.z = 0;
|
|
161
|
-
// decorations[ 2 ].mesh.visible = true;
|
|
162
|
-
// decorations[ 2 ].mesh.material.color.set( color );
|
|
163
|
-
|
|
164
|
-
// //animate bars
|
|
165
|
-
// var from = { scale: 0 };
|
|
166
|
-
// var to = { scale: value/100 };
|
|
167
|
-
// var tween = new TWEEN.Tween( from )
|
|
168
|
-
// .to ( to, 500 )
|
|
169
|
-
// .onUpdate( function () {
|
|
170
|
-
// decorations[ 2 ].mesh.scale.z = from.scale;
|
|
171
|
-
// } )
|
|
172
|
-
// .start();
|
|
173
|
-
|
|
174
|
-
// };
|
|
175
|
-
|
|
176
|
-
// this.hideParameter = function() {
|
|
177
|
-
// this.decorations[ 2 ].mesh.visible = false;
|
|
178
|
-
// }
|
|
179
|
-
|
|
180
|
-
// }
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export const ConnectorDimensions = {
|
|
2
|
-
CONNECTOR_LINE_WIDTH: 1, // .1, // (4 / 40),
|
|
3
|
-
CONNECTOR_OUTER_RADIUS: 10, // .625, // (25 / 40),
|
|
4
|
-
CONNECTOR_INNER_RADIUS: 8.5, // .525, // (21 / 40),
|
|
5
|
-
CONNECTOR_ARROWHEAD_WIDTH: 6, // .375, // (15 / 40),
|
|
6
|
-
CONNECTOR_ARROWHEAD_LENGTH: 14, // .875 // (35 / 90),
|
|
7
|
-
};
|