@buerli.io/core 0.10.0 → 0.12.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/CHANGELOG.md +5 -0
- package/README.md +12 -12
- package/build/cjs/geometry/ThreeGeometryCreator.js +320 -320
- package/build/cjs/geometry/index.js +17 -17
- package/build/cjs/graphic/filters.js +25 -25
- package/build/cjs/index.js +25 -25
- package/build/cjs/store/index.js +37 -37
- package/build/cjs/store/states/buerli.js +98 -98
- package/build/cjs/store/states/cad.js +47 -35
- package/build/cjs/store/states/drawing.js +49 -49
- package/build/cjs/store/states/geometry.js +137 -137
- package/build/cjs/store/states/graphic.js +112 -112
- package/build/cjs/store/states/interaction.js +55 -55
- package/build/cjs/store/states/message.js +25 -25
- package/build/cjs/store/states/plugin.js +115 -115
- package/build/cjs/store/states/selection.js +267 -267
- package/build/cjs/store/states/structure.js +250 -250
- package/build/cjs/store/store.js +9 -9
- package/build/cjs/store/subscribtion/selection.js +49 -49
- package/build/cjs/store/subscribtion/subscribeToDrawing.js +13 -13
- package/build/cjs/types/IGraphicPackage.js +46 -46
- package/build/cjs/types/IStructurePatch.js +2 -2
- package/build/cjs/types/IStructureTree.js +28 -28
- package/build/cjs/types/InteractionInfo.js +11 -11
- package/build/cjs/types/index.js +20 -20
- package/build/cjs/utils/Math.js +91 -91
- package/build/cjs/utils/Measure.js +576 -576
- package/build/cjs/utils/Timing.js +34 -34
- package/build/esm/geometry/ThreeGeometryCreator.js +291 -291
- package/build/esm/geometry/index.js +1 -1
- package/build/esm/graphic/filters.js +12 -12
- package/build/esm/index.js +9 -9
- package/build/esm/store/index.js +26 -26
- package/build/esm/store/states/buerli.js +92 -92
- package/build/esm/store/states/cad.js +42 -30
- package/build/esm/store/states/drawing.js +45 -45
- package/build/esm/store/states/geometry.js +109 -109
- package/build/esm/store/states/graphic.js +107 -107
- package/build/esm/store/states/interaction.js +50 -50
- package/build/esm/store/states/message.js +21 -21
- package/build/esm/store/states/plugin.js +109 -109
- package/build/esm/store/states/selection.js +261 -261
- package/build/esm/store/states/structure.js +219 -219
- package/build/esm/store/store.js +3 -3
- package/build/esm/store/subscribtion/selection.js +44 -44
- package/build/esm/store/subscribtion/subscribeToDrawing.js +9 -9
- package/build/esm/types/IGraphicPackage.js +43 -43
- package/build/esm/types/IStructurePatch.js +1 -1
- package/build/esm/types/IStructureTree.js +24 -24
- package/build/esm/types/InteractionInfo.js +6 -6
- package/build/esm/types/index.js +4 -4
- package/build/esm/utils/Math.js +65 -65
- package/build/esm/utils/Measure.js +550 -550
- package/build/esm/utils/Timing.js +31 -31
- package/build/types/geometry/ThreeGeometryCreator.d.ts +256 -256
- package/build/types/geometry/index.d.ts +1 -1
- package/build/types/graphic/filters.d.ts +11 -11
- package/build/types/index.d.ts +37 -37
- package/build/types/store/index.d.ts +16 -16
- package/build/types/store/states/buerli.d.ts +41 -41
- package/build/types/store/states/cad.d.ts +53 -42
- package/build/types/store/states/drawing.d.ts +45 -45
- package/build/types/store/states/geometry.d.ts +63 -63
- package/build/types/store/states/graphic.d.ts +22 -22
- package/build/types/store/states/interaction.d.ts +34 -34
- package/build/types/store/states/message.d.ts +30 -30
- package/build/types/store/states/plugin.d.ts +53 -53
- package/build/types/store/states/selection.d.ts +62 -62
- package/build/types/store/states/structure.d.ts +47 -47
- package/build/types/store/store.d.ts +2 -2
- package/build/types/store/subscribtion/selection.d.ts +7 -7
- package/build/types/store/subscribtion/subscribeToDrawing.d.ts +4 -4
- package/build/types/types/IGraphicPackage.d.ts +157 -155
- package/build/types/types/IStructurePatch.d.ts +6 -6
- package/build/types/types/IStructureTree.d.ts +80 -80
- package/build/types/types/InteractionInfo.d.ts +43 -43
- package/build/types/types/index.d.ts +4 -4
- package/build/types/utils/Math.d.ts +21 -21
- package/build/types/utils/Measure.d.ts +64 -64
- package/build/types/utils/Timing.d.ts +8 -8
- package/package.json +44 -44
package/build/types/index.d.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
export * from './store';
|
|
2
|
-
export * from './geometry';
|
|
3
|
-
export * from './types';
|
|
4
|
-
export * from './utils/Math';
|
|
5
|
-
export * from './utils/Measure';
|
|
6
|
-
export * from './utils/Timing';
|
|
7
|
-
export * from './store/subscribtion/subscribeToDrawing';
|
|
8
|
-
export * from './graphic/filters';
|
|
9
|
-
/**
|
|
10
|
-
* Because babel typescript tools can not handle the type definitions
|
|
11
|
-
* in an other way, they have to be re-exported as you can see in this code region.
|
|
12
|
-
*
|
|
13
|
-
* Please have a look at https://github.com/awv-informatik/buerli/pull/129 for more information.
|
|
14
|
-
*/
|
|
15
|
-
import { BuerliState as BS } from './store/states/buerli';
|
|
16
|
-
export declare type BuerliState = BS;
|
|
17
|
-
import { DrawingAPI as DrawingAPI1, DrawingID as DrawingID1, DrawingState as DrawingState1 } from './store/states/drawing';
|
|
18
|
-
export declare type DrawingID = DrawingID1;
|
|
19
|
-
export declare type DrawingState = DrawingState1;
|
|
20
|
-
export declare type DrawingAPI = DrawingAPI1;
|
|
21
|
-
import { GeometryConfig as GeometryConfig1, GeometryBounds as GeometryBounds1 } from './store/states/geometry';
|
|
22
|
-
export declare type GeometryConfig = GeometryConfig1;
|
|
23
|
-
export declare type GeometryBounds = GeometryBounds1;
|
|
24
|
-
import { Plugin as Plugin1, PluginDescription as PluginDescription1, PluginID as PluginID1, PluginState as PluginState1 } from './store/states/plugin';
|
|
25
|
-
export declare type Plugin = Plugin1;
|
|
26
|
-
export declare type PluginDescription<InternalState = any> = PluginDescription1<InternalState>;
|
|
27
|
-
export declare type PluginID = PluginID1;
|
|
28
|
-
export declare type PluginState<InternalState extends Record<any, any> = any> = PluginState1<InternalState>;
|
|
29
|
-
import { SeletedItemData, SelectedItem as SelectedItem1, SelectionFilter as SelectionFilter1, SelectionScope as SelectionScope1, Selector as Selector1, SelectorID as SelectorID1, CustomSelect as CustomSelect1 } from './store/states/selection';
|
|
30
|
-
export declare type SelectedItem<T extends SeletedItemData<any> = any> = SelectedItem1<T>;
|
|
31
|
-
export declare type SelectionFilter = SelectionFilter1;
|
|
32
|
-
export declare type SelectionScope = SelectionScope1;
|
|
33
|
-
export declare type Selector<T extends SeletedItemData<any> = any> = Selector1<T>;
|
|
34
|
-
export declare type SelectorID = SelectorID1;
|
|
35
|
-
export declare type CustomSelect = CustomSelect1;
|
|
36
|
-
import { Message as Message1 } from './store/states/message';
|
|
37
|
-
export declare type Message = Message1;
|
|
1
|
+
export * from './store';
|
|
2
|
+
export * from './geometry';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './utils/Math';
|
|
5
|
+
export * from './utils/Measure';
|
|
6
|
+
export * from './utils/Timing';
|
|
7
|
+
export * from './store/subscribtion/subscribeToDrawing';
|
|
8
|
+
export * from './graphic/filters';
|
|
9
|
+
/**
|
|
10
|
+
* Because babel typescript tools can not handle the type definitions
|
|
11
|
+
* in an other way, they have to be re-exported as you can see in this code region.
|
|
12
|
+
*
|
|
13
|
+
* Please have a look at https://github.com/awv-informatik/buerli/pull/129 for more information.
|
|
14
|
+
*/
|
|
15
|
+
import { BuerliState as BS } from './store/states/buerli';
|
|
16
|
+
export declare type BuerliState = BS;
|
|
17
|
+
import { DrawingAPI as DrawingAPI1, DrawingID as DrawingID1, DrawingState as DrawingState1 } from './store/states/drawing';
|
|
18
|
+
export declare type DrawingID = DrawingID1;
|
|
19
|
+
export declare type DrawingState = DrawingState1;
|
|
20
|
+
export declare type DrawingAPI = DrawingAPI1;
|
|
21
|
+
import { GeometryConfig as GeometryConfig1, GeometryBounds as GeometryBounds1 } from './store/states/geometry';
|
|
22
|
+
export declare type GeometryConfig = GeometryConfig1;
|
|
23
|
+
export declare type GeometryBounds = GeometryBounds1;
|
|
24
|
+
import { Plugin as Plugin1, PluginDescription as PluginDescription1, PluginID as PluginID1, PluginState as PluginState1 } from './store/states/plugin';
|
|
25
|
+
export declare type Plugin = Plugin1;
|
|
26
|
+
export declare type PluginDescription<InternalState = any> = PluginDescription1<InternalState>;
|
|
27
|
+
export declare type PluginID = PluginID1;
|
|
28
|
+
export declare type PluginState<InternalState extends Record<any, any> = any> = PluginState1<InternalState>;
|
|
29
|
+
import { SeletedItemData, SelectedItem as SelectedItem1, SelectionFilter as SelectionFilter1, SelectionScope as SelectionScope1, Selector as Selector1, SelectorID as SelectorID1, CustomSelect as CustomSelect1 } from './store/states/selection';
|
|
30
|
+
export declare type SelectedItem<T extends SeletedItemData<any> = any> = SelectedItem1<T>;
|
|
31
|
+
export declare type SelectionFilter = SelectionFilter1;
|
|
32
|
+
export declare type SelectionScope = SelectionScope1;
|
|
33
|
+
export declare type Selector<T extends SeletedItemData<any> = any> = Selector1<T>;
|
|
34
|
+
export declare type SelectorID = SelectorID1;
|
|
35
|
+
export declare type CustomSelect = CustomSelect1;
|
|
36
|
+
import { Message as Message1 } from './store/states/message';
|
|
37
|
+
export declare type Message = Message1;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { BuerliState } from './states/buerli';
|
|
2
|
-
import { DrawingID, DrawingState } from './states/drawing';
|
|
3
|
-
import { Message, MessageID } from './states/message';
|
|
4
|
-
import { PluginID, PluginState } from './states/plugin';
|
|
5
|
-
declare function getDrawing(id: DrawingID): DrawingState;
|
|
6
|
-
/**
|
|
7
|
-
* @returns PluginState or undefined if either drawing or plugin don't exist
|
|
8
|
-
*/
|
|
9
|
-
declare function getPlugin(drawingId: DrawingID, pluginId: PluginID): PluginState;
|
|
10
|
-
declare function init(options?: Partial<BuerliState['options']>): void;
|
|
11
|
-
declare function showMessage(message: Message): MessageID;
|
|
12
|
-
declare function updateMessage(id: MessageID, message: Message): void;
|
|
13
|
-
export { BuerliMessageScope } from './states/message';
|
|
14
|
-
export { BuerliScope, createGraphicItem } from './states/selection';
|
|
15
|
-
export { api } from './store';
|
|
16
|
-
export { getDrawing, getPlugin, init, showMessage, updateMessage };
|
|
1
|
+
import { BuerliState } from './states/buerli';
|
|
2
|
+
import { DrawingID, DrawingState } from './states/drawing';
|
|
3
|
+
import { Message, MessageID } from './states/message';
|
|
4
|
+
import { PluginID, PluginState } from './states/plugin';
|
|
5
|
+
declare function getDrawing(id: DrawingID): DrawingState;
|
|
6
|
+
/**
|
|
7
|
+
* @returns PluginState or undefined if either drawing or plugin don't exist
|
|
8
|
+
*/
|
|
9
|
+
declare function getPlugin(drawingId: DrawingID, pluginId: PluginID): PluginState;
|
|
10
|
+
declare function init(options?: Partial<BuerliState['options']>): void;
|
|
11
|
+
declare function showMessage(message: Message): MessageID;
|
|
12
|
+
declare function updateMessage(id: MessageID, message: Message): void;
|
|
13
|
+
export { BuerliMessageScope } from './states/message';
|
|
14
|
+
export { BuerliScope, createGraphicItem } from './states/selection';
|
|
15
|
+
export { api } from './store';
|
|
16
|
+
export { getDrawing, getPlugin, init, showMessage, updateMessage };
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { StateCreator } from 'zustand';
|
|
2
|
-
import { DrawingID, DrawingState } from './drawing';
|
|
3
|
-
import { GeometryConfig } from './geometry';
|
|
4
|
-
import { MessageState } from './message';
|
|
5
|
-
import { PluginDef, PluginImpl } from './plugin';
|
|
6
|
-
declare type GeneralApi = {
|
|
7
|
-
init(options?: Partial<BuerliState['options']>): void;
|
|
8
|
-
};
|
|
9
|
-
declare type DrawingManagementApi = {
|
|
10
|
-
createDrawing(name?: string): Promise<DrawingState>;
|
|
11
|
-
removeDrawing(id: DrawingID): void;
|
|
12
|
-
setActiveDrawing(id: DrawingID | null): void;
|
|
13
|
-
};
|
|
14
|
-
export declare type BuerliState = Readonly<{
|
|
15
|
-
initDone: boolean;
|
|
16
|
-
options: {
|
|
17
|
-
elements: any;
|
|
18
|
-
plugins: Record<string, PluginImpl>;
|
|
19
|
-
globalPlugins: PluginDef[];
|
|
20
|
-
theme: {
|
|
21
|
-
primary: string;
|
|
22
|
-
secondary: string;
|
|
23
|
-
dark: string;
|
|
24
|
-
highlightedGeom: string;
|
|
25
|
-
hoveredGeom: string;
|
|
26
|
-
};
|
|
27
|
-
config: {
|
|
28
|
-
geometry: GeometryConfig;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
drawing: {
|
|
32
|
-
ids: DrawingID[];
|
|
33
|
-
refs: Record<DrawingID, DrawingState>;
|
|
34
|
-
active: DrawingID | null;
|
|
35
|
-
};
|
|
36
|
-
api: GeneralApi & DrawingManagementApi;
|
|
37
|
-
}> & Readonly<MessageState>;
|
|
38
|
-
export declare const createState: StateCreator<BuerliState, [], [], BuerliState>;
|
|
39
|
-
export declare const generalApi: StateCreator<BuerliState, [], [], GeneralApi>;
|
|
40
|
-
export declare const drawingManagementApi: StateCreator<BuerliState, [], [], DrawingManagementApi>;
|
|
41
|
-
export {};
|
|
1
|
+
import { StateCreator } from 'zustand';
|
|
2
|
+
import { DrawingID, DrawingState } from './drawing';
|
|
3
|
+
import { GeometryConfig } from './geometry';
|
|
4
|
+
import { MessageState } from './message';
|
|
5
|
+
import { PluginDef, PluginImpl } from './plugin';
|
|
6
|
+
declare type GeneralApi = {
|
|
7
|
+
init(options?: Partial<BuerliState['options']>): void;
|
|
8
|
+
};
|
|
9
|
+
declare type DrawingManagementApi = {
|
|
10
|
+
createDrawing(name?: string): Promise<DrawingState>;
|
|
11
|
+
removeDrawing(id: DrawingID): void;
|
|
12
|
+
setActiveDrawing(id: DrawingID | null): void;
|
|
13
|
+
};
|
|
14
|
+
export declare type BuerliState = Readonly<{
|
|
15
|
+
initDone: boolean;
|
|
16
|
+
options: {
|
|
17
|
+
elements: any;
|
|
18
|
+
plugins: Record<string, PluginImpl>;
|
|
19
|
+
globalPlugins: PluginDef[];
|
|
20
|
+
theme: {
|
|
21
|
+
primary: string;
|
|
22
|
+
secondary: string;
|
|
23
|
+
dark: string;
|
|
24
|
+
highlightedGeom: string;
|
|
25
|
+
hoveredGeom: string;
|
|
26
|
+
};
|
|
27
|
+
config: {
|
|
28
|
+
geometry: GeometryConfig;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
drawing: {
|
|
32
|
+
ids: DrawingID[];
|
|
33
|
+
refs: Record<DrawingID, DrawingState>;
|
|
34
|
+
active: DrawingID | null;
|
|
35
|
+
};
|
|
36
|
+
api: GeneralApi & DrawingManagementApi;
|
|
37
|
+
}> & Readonly<MessageState>;
|
|
38
|
+
export declare const createState: StateCreator<BuerliState, [], [], BuerliState>;
|
|
39
|
+
export declare const generalApi: StateCreator<BuerliState, [], [], GeneralApi>;
|
|
40
|
+
export declare const drawingManagementApi: StateCreator<BuerliState, [], [], DrawingManagementApi>;
|
|
41
|
+
export {};
|
|
@@ -1,42 +1,53 @@
|
|
|
1
|
-
import { StoreApi } from 'zustand';
|
|
2
|
-
import { BuerliState } from './buerli';
|
|
3
|
-
import { DrawingState } from './drawing';
|
|
4
|
-
declare type States = {
|
|
5
|
-
current: number;
|
|
6
|
-
stack: string[];
|
|
7
|
-
captionMap: Record<string, {
|
|
8
|
-
stateName: string;
|
|
9
|
-
caption: string;
|
|
10
|
-
}>;
|
|
11
|
-
};
|
|
12
|
-
declare type Pending = {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
stamp: number;
|
|
16
|
-
args?: any;
|
|
17
|
-
promise?: Promise<any>;
|
|
18
|
-
};
|
|
19
|
-
export declare type CadData = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
|
|
1
|
+
import { StoreApi } from 'zustand';
|
|
2
|
+
import { BuerliState } from './buerli';
|
|
3
|
+
import { DrawingState } from './drawing';
|
|
4
|
+
declare type States = {
|
|
5
|
+
current: number;
|
|
6
|
+
stack: string[];
|
|
7
|
+
captionMap: Record<string, {
|
|
8
|
+
stateName: string;
|
|
9
|
+
caption: string;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
declare type Pending = {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
stamp: number;
|
|
16
|
+
args?: any;
|
|
17
|
+
promise?: Promise<any>;
|
|
18
|
+
};
|
|
19
|
+
export declare type CadData = {
|
|
20
|
+
connection: {
|
|
21
|
+
active: boolean;
|
|
22
|
+
connected: boolean;
|
|
23
|
+
};
|
|
24
|
+
states: States;
|
|
25
|
+
pending: Pending[];
|
|
26
|
+
};
|
|
27
|
+
export declare type CadApi = ReturnType<typeof cadApi>;
|
|
28
|
+
export declare const cadData: () => CadData;
|
|
29
|
+
export declare const cadApi: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>) => {
|
|
30
|
+
setStates: (current: number, stack: string[], captionMap: Record<string, {
|
|
31
|
+
stateName: string;
|
|
32
|
+
caption: string;
|
|
33
|
+
}>) => void;
|
|
34
|
+
setCaptionMap: (captionMap: Record<string, {
|
|
35
|
+
stateName: string;
|
|
36
|
+
caption: string;
|
|
37
|
+
}>) => void;
|
|
38
|
+
addPending: (name: string, options?: {
|
|
39
|
+
args?: any;
|
|
40
|
+
promise?: Promise<any>;
|
|
41
|
+
}) => string;
|
|
42
|
+
removePending: (id: string) => void;
|
|
43
|
+
setConnected: (connected: boolean) => void;
|
|
44
|
+
setActive: (active: boolean) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Clears the pending requests list.
|
|
47
|
+
*
|
|
48
|
+
* **This method is designed for interal usage only, please do not use it in user code!**
|
|
49
|
+
* **It will be removed in a future release!**
|
|
50
|
+
*/
|
|
51
|
+
clearPending: () => void;
|
|
52
|
+
};
|
|
53
|
+
export {};
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
/**!
|
|
2
|
-
* The Drawing manages all necessary data that belong to a model.
|
|
3
|
-
*
|
|
4
|
-
* On the one hand these are the structure and graphic data by which the
|
|
5
|
-
* CAD model is defined, on the other hand it administers additional data
|
|
6
|
-
* for the support with the client-sided development.
|
|
7
|
-
*
|
|
8
|
-
* @image /doc/assets/core/drawing.png
|
|
9
|
-
*/
|
|
10
|
-
import { StoreApi } from 'zustand';
|
|
11
|
-
import { BuerliState } from './buerli';
|
|
12
|
-
import { CadApi, CadData } from './cad';
|
|
13
|
-
import { GeometryApi, GeometryData } from './geometry';
|
|
14
|
-
import { GraphicApi, GraphicData } from './graphic';
|
|
15
|
-
import { InteractionApi, InteractionData } from './interaction';
|
|
16
|
-
import { PluginApi, PluginData } from './plugin';
|
|
17
|
-
import { SelectionApi, SelectionData } from './selection';
|
|
18
|
-
import { StructureApi, StructureData } from './structure';
|
|
19
|
-
export declare type DrawingID = string | number;
|
|
20
|
-
export declare type DrawingAPI = {
|
|
21
|
-
structure: StructureApi;
|
|
22
|
-
selection: SelectionApi;
|
|
23
|
-
interaction: InteractionApi;
|
|
24
|
-
plugin: PluginApi;
|
|
25
|
-
geometry: GeometryApi;
|
|
26
|
-
graphic: GraphicApi;
|
|
27
|
-
cad: CadApi;
|
|
28
|
-
reset: () => void;
|
|
29
|
-
};
|
|
30
|
-
declare type StateData = {
|
|
31
|
-
id: DrawingID;
|
|
32
|
-
name: string;
|
|
33
|
-
structure: StructureData;
|
|
34
|
-
geometry: GeometryData;
|
|
35
|
-
graphic: GraphicData;
|
|
36
|
-
selection: SelectionData;
|
|
37
|
-
interaction: InteractionData;
|
|
38
|
-
plugin: PluginData;
|
|
39
|
-
cad: CadData;
|
|
40
|
-
};
|
|
41
|
-
export declare type DrawingState = Readonly<StateData> & Readonly<{
|
|
42
|
-
api: DrawingAPI;
|
|
43
|
-
}>;
|
|
44
|
-
export declare const createDrawingState: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>, drawingNumber: number, name?: string) => DrawingState;
|
|
45
|
-
export {};
|
|
1
|
+
/**!
|
|
2
|
+
* The Drawing manages all necessary data that belong to a model.
|
|
3
|
+
*
|
|
4
|
+
* On the one hand these are the structure and graphic data by which the
|
|
5
|
+
* CAD model is defined, on the other hand it administers additional data
|
|
6
|
+
* for the support with the client-sided development.
|
|
7
|
+
*
|
|
8
|
+
* @image /doc/assets/core/drawing.png
|
|
9
|
+
*/
|
|
10
|
+
import { StoreApi } from 'zustand';
|
|
11
|
+
import { BuerliState } from './buerli';
|
|
12
|
+
import { CadApi, CadData } from './cad';
|
|
13
|
+
import { GeometryApi, GeometryData } from './geometry';
|
|
14
|
+
import { GraphicApi, GraphicData } from './graphic';
|
|
15
|
+
import { InteractionApi, InteractionData } from './interaction';
|
|
16
|
+
import { PluginApi, PluginData } from './plugin';
|
|
17
|
+
import { SelectionApi, SelectionData } from './selection';
|
|
18
|
+
import { StructureApi, StructureData } from './structure';
|
|
19
|
+
export declare type DrawingID = string | number;
|
|
20
|
+
export declare type DrawingAPI = {
|
|
21
|
+
structure: StructureApi;
|
|
22
|
+
selection: SelectionApi;
|
|
23
|
+
interaction: InteractionApi;
|
|
24
|
+
plugin: PluginApi;
|
|
25
|
+
geometry: GeometryApi;
|
|
26
|
+
graphic: GraphicApi;
|
|
27
|
+
cad: CadApi;
|
|
28
|
+
reset: () => void;
|
|
29
|
+
};
|
|
30
|
+
declare type StateData = {
|
|
31
|
+
id: DrawingID;
|
|
32
|
+
name: string;
|
|
33
|
+
structure: StructureData;
|
|
34
|
+
geometry: GeometryData;
|
|
35
|
+
graphic: GraphicData;
|
|
36
|
+
selection: SelectionData;
|
|
37
|
+
interaction: InteractionData;
|
|
38
|
+
plugin: PluginData;
|
|
39
|
+
cad: CadData;
|
|
40
|
+
};
|
|
41
|
+
export declare type DrawingState = Readonly<StateData> & Readonly<{
|
|
42
|
+
api: DrawingAPI;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const createDrawingState: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>, drawingNumber: number, name?: string) => DrawingState;
|
|
45
|
+
export {};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { StoreApi } from 'zustand';
|
|
3
|
-
import { ContainerGeometryT, GeometryElement } from '../../geometry/ThreeGeometryCreator';
|
|
4
|
-
import { ObjectID } from '../../types/IStructureTree';
|
|
5
|
-
import { BuerliState } from './buerli';
|
|
6
|
-
import { DrawingState } from './drawing';
|
|
7
|
-
export declare type GeometryBounds = {
|
|
8
|
-
center: THREE.Vector3;
|
|
9
|
-
radius: number;
|
|
10
|
-
max: THREE.Vector3;
|
|
11
|
-
min: THREE.Vector3;
|
|
12
|
-
};
|
|
13
|
-
declare type ElementConfig = {
|
|
14
|
-
hidden?: boolean;
|
|
15
|
-
color?: any;
|
|
16
|
-
opacity?: number;
|
|
17
|
-
};
|
|
18
|
-
export declare type GeometryConfig = {
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
meshes?: ElementConfig & {
|
|
21
|
-
wireframe?: boolean;
|
|
22
|
-
depthWrite?: boolean;
|
|
23
|
-
};
|
|
24
|
-
edges?: ElementConfig;
|
|
25
|
-
points?: ElementConfig;
|
|
26
|
-
};
|
|
27
|
-
export declare type GeometryData = {
|
|
28
|
-
cache: Record<ObjectID, // The id of the CADEntity
|
|
29
|
-
// The id of the CADEntity
|
|
30
|
-
ContainerGeometryT & {
|
|
31
|
-
/**
|
|
32
|
-
* The dirty stamp will be updated, as soon as a client side modification of the geometry will happen!
|
|
33
|
-
* Examples: 'setColor' or 'setOpacity'
|
|
34
|
-
*
|
|
35
|
-
* Can for example be used to trigger the render process for this container.
|
|
36
|
-
*/
|
|
37
|
-
dirtyStamp?: number;
|
|
38
|
-
}>;
|
|
39
|
-
stamp: number;
|
|
40
|
-
bounds: GeometryBounds;
|
|
41
|
-
config: {
|
|
42
|
-
product: Record<ObjectID, GeometryConfig>;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export declare type GeometryApi = ReturnType<typeof geometryApi>;
|
|
46
|
-
export declare const geometryData: () => GeometryData;
|
|
47
|
-
export declare const geometryApi: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>) => {
|
|
48
|
-
/**
|
|
49
|
-
* Updates the @see geometry.bounds depending on all products of the model.
|
|
50
|
-
* The update will only happen, if at least one solid of one product is available.
|
|
51
|
-
*/
|
|
52
|
-
updateBounds: () => void;
|
|
53
|
-
createGeometryIfNotCached: (containerId: ObjectID, color?: number[]) => ContainerGeometryT | undefined;
|
|
54
|
-
setColor: (containerId: ObjectID, r: number, g: number, b: number) => void;
|
|
55
|
-
setOpacity: (containerId: ObjectID, opacity: number) => void;
|
|
56
|
-
setConfig: (objId: ObjectID, config: Partial<GeometryConfig> | null) => void;
|
|
57
|
-
findDecorated: () => GeometryElement[];
|
|
58
|
-
filter: (cb: (elem: GeometryElement) => boolean, options?: {
|
|
59
|
-
onlyOne?: boolean;
|
|
60
|
-
containerId?: ObjectID;
|
|
61
|
-
}) => GeometryElement[];
|
|
62
|
-
};
|
|
63
|
-
export {};
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { StoreApi } from 'zustand';
|
|
3
|
+
import { ContainerGeometryT, GeometryElement } from '../../geometry/ThreeGeometryCreator';
|
|
4
|
+
import { ObjectID } from '../../types/IStructureTree';
|
|
5
|
+
import { BuerliState } from './buerli';
|
|
6
|
+
import { DrawingState } from './drawing';
|
|
7
|
+
export declare type GeometryBounds = {
|
|
8
|
+
center: THREE.Vector3;
|
|
9
|
+
radius: number;
|
|
10
|
+
max: THREE.Vector3;
|
|
11
|
+
min: THREE.Vector3;
|
|
12
|
+
};
|
|
13
|
+
declare type ElementConfig = {
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
color?: any;
|
|
16
|
+
opacity?: number;
|
|
17
|
+
};
|
|
18
|
+
export declare type GeometryConfig = {
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
meshes?: ElementConfig & {
|
|
21
|
+
wireframe?: boolean;
|
|
22
|
+
depthWrite?: boolean;
|
|
23
|
+
};
|
|
24
|
+
edges?: ElementConfig;
|
|
25
|
+
points?: ElementConfig;
|
|
26
|
+
};
|
|
27
|
+
export declare type GeometryData = {
|
|
28
|
+
cache: Record<ObjectID, // The id of the CADEntity
|
|
29
|
+
// The id of the CADEntity
|
|
30
|
+
ContainerGeometryT & {
|
|
31
|
+
/**
|
|
32
|
+
* The dirty stamp will be updated, as soon as a client side modification of the geometry will happen!
|
|
33
|
+
* Examples: 'setColor' or 'setOpacity'
|
|
34
|
+
*
|
|
35
|
+
* Can for example be used to trigger the render process for this container.
|
|
36
|
+
*/
|
|
37
|
+
dirtyStamp?: number;
|
|
38
|
+
}>;
|
|
39
|
+
stamp: number;
|
|
40
|
+
bounds: GeometryBounds;
|
|
41
|
+
config: {
|
|
42
|
+
product: Record<ObjectID, GeometryConfig>;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare type GeometryApi = ReturnType<typeof geometryApi>;
|
|
46
|
+
export declare const geometryData: () => GeometryData;
|
|
47
|
+
export declare const geometryApi: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>) => {
|
|
48
|
+
/**
|
|
49
|
+
* Updates the @see geometry.bounds depending on all products of the model.
|
|
50
|
+
* The update will only happen, if at least one solid of one product is available.
|
|
51
|
+
*/
|
|
52
|
+
updateBounds: () => void;
|
|
53
|
+
createGeometryIfNotCached: (containerId: ObjectID, color?: number[]) => ContainerGeometryT | undefined;
|
|
54
|
+
setColor: (containerId: ObjectID, r: number, g: number, b: number) => void;
|
|
55
|
+
setOpacity: (containerId: ObjectID, opacity: number) => void;
|
|
56
|
+
setConfig: (objId: ObjectID, config: Partial<GeometryConfig> | null) => void;
|
|
57
|
+
findDecorated: () => GeometryElement[];
|
|
58
|
+
filter: (cb: (elem: GeometryElement) => boolean, options?: {
|
|
59
|
+
onlyOne?: boolean;
|
|
60
|
+
containerId?: ObjectID;
|
|
61
|
+
}) => GeometryElement[];
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { StoreApi } from 'zustand';
|
|
2
|
-
import { IGraphicContainer, IGraphicElement, IGraphicPackage } from '../../types/IGraphicPackage';
|
|
3
|
-
import { ObjectID } from '../../types/IStructureTree';
|
|
4
|
-
import { BuerliState } from './buerli';
|
|
5
|
-
import { DrawingState } from './drawing';
|
|
6
|
-
export declare type GraphicData = {
|
|
7
|
-
containers: Record<number, IGraphicContainer>;
|
|
8
|
-
};
|
|
9
|
-
export declare type GraphicApi = ReturnType<typeof graphicApi>;
|
|
10
|
-
export declare const graphicData: () => GraphicData;
|
|
11
|
-
export declare const graphicApi: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>) => {
|
|
12
|
-
addPackages: (packages: IGraphicPackage[]) => void;
|
|
13
|
-
cleanupGraphicRecords: () => void;
|
|
14
|
-
filter: (cb: (elem: IGraphicElement) => boolean, options?: {
|
|
15
|
-
onlyOne?: boolean;
|
|
16
|
-
containerId?: ObjectID;
|
|
17
|
-
}) => {
|
|
18
|
-
elem: IGraphicElement;
|
|
19
|
-
containerId: ObjectID;
|
|
20
|
-
solidId: ObjectID;
|
|
21
|
-
}[];
|
|
22
|
-
};
|
|
1
|
+
import { StoreApi } from 'zustand';
|
|
2
|
+
import { IGraphicContainer, IGraphicElement, IGraphicPackage } from '../../types/IGraphicPackage';
|
|
3
|
+
import { ObjectID } from '../../types/IStructureTree';
|
|
4
|
+
import { BuerliState } from './buerli';
|
|
5
|
+
import { DrawingState } from './drawing';
|
|
6
|
+
export declare type GraphicData = {
|
|
7
|
+
containers: Record<number, IGraphicContainer>;
|
|
8
|
+
};
|
|
9
|
+
export declare type GraphicApi = ReturnType<typeof graphicApi>;
|
|
10
|
+
export declare const graphicData: () => GraphicData;
|
|
11
|
+
export declare const graphicApi: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>) => {
|
|
12
|
+
addPackages: (packages: IGraphicPackage[]) => void;
|
|
13
|
+
cleanupGraphicRecords: () => void;
|
|
14
|
+
filter: (cb: (elem: IGraphicElement) => boolean, options?: {
|
|
15
|
+
onlyOne?: boolean;
|
|
16
|
+
containerId?: ObjectID;
|
|
17
|
+
}) => {
|
|
18
|
+
elem: IGraphicElement;
|
|
19
|
+
containerId: ObjectID;
|
|
20
|
+
solidId: ObjectID;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { StoreApi } from 'zustand';
|
|
2
|
-
import { InteractionInfo } from '../../types';
|
|
3
|
-
import { BuerliState } from './buerli';
|
|
4
|
-
import { DrawingState } from './drawing';
|
|
5
|
-
export declare type InteractionData = {
|
|
6
|
-
hovered?: InteractionInfo | null;
|
|
7
|
-
selected?: InteractionInfo[];
|
|
8
|
-
};
|
|
9
|
-
export declare type InteractionApi = ReturnType<typeof interactionApi>;
|
|
10
|
-
export declare const interactionData: () => InteractionData;
|
|
11
|
-
export declare const interactionApi: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>) => {
|
|
12
|
-
/**
|
|
13
|
-
* Sets the hovered item in the store to the given item.
|
|
14
|
-
*
|
|
15
|
-
* @param item The item.
|
|
16
|
-
*/
|
|
17
|
-
setHovered: (item: InteractionInfo | null) => void;
|
|
18
|
-
/**
|
|
19
|
-
* Reset the 'selected' array to the given items.
|
|
20
|
-
*
|
|
21
|
-
* @param items The items.
|
|
22
|
-
*/
|
|
23
|
-
setSelected: (items: InteractionInfo[]) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Adds the given item to the 'selected' array if it is not yet selected.
|
|
26
|
-
* If the item is already selected, it will be removed from the 'selected' array.
|
|
27
|
-
*
|
|
28
|
-
* With 'multi' enabled, the already selected items will remain selected.
|
|
29
|
-
*
|
|
30
|
-
* @param item The item to select.
|
|
31
|
-
* @param multi Do multi select.
|
|
32
|
-
*/
|
|
33
|
-
select: (item: InteractionInfo, multi?: boolean) => void;
|
|
34
|
-
};
|
|
1
|
+
import { StoreApi } from 'zustand';
|
|
2
|
+
import { InteractionInfo } from '../../types';
|
|
3
|
+
import { BuerliState } from './buerli';
|
|
4
|
+
import { DrawingState } from './drawing';
|
|
5
|
+
export declare type InteractionData = {
|
|
6
|
+
hovered?: InteractionInfo | null;
|
|
7
|
+
selected?: InteractionInfo[];
|
|
8
|
+
};
|
|
9
|
+
export declare type InteractionApi = ReturnType<typeof interactionApi>;
|
|
10
|
+
export declare const interactionData: () => InteractionData;
|
|
11
|
+
export declare const interactionApi: (set: StoreApi<DrawingState>['setState'], get: StoreApi<DrawingState>['getState'], buerliApi: StoreApi<BuerliState>) => {
|
|
12
|
+
/**
|
|
13
|
+
* Sets the hovered item in the store to the given item.
|
|
14
|
+
*
|
|
15
|
+
* @param item The item.
|
|
16
|
+
*/
|
|
17
|
+
setHovered: (item: InteractionInfo | null) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Reset the 'selected' array to the given items.
|
|
20
|
+
*
|
|
21
|
+
* @param items The items.
|
|
22
|
+
*/
|
|
23
|
+
setSelected: (items: InteractionInfo[]) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Adds the given item to the 'selected' array if it is not yet selected.
|
|
26
|
+
* If the item is already selected, it will be removed from the 'selected' array.
|
|
27
|
+
*
|
|
28
|
+
* With 'multi' enabled, the already selected items will remain selected.
|
|
29
|
+
*
|
|
30
|
+
* @param item The item to select.
|
|
31
|
+
* @param multi Do multi select.
|
|
32
|
+
*/
|
|
33
|
+
select: (item: InteractionInfo, multi?: boolean) => void;
|
|
34
|
+
};
|