fcs-core-viewer 0.2.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.
Files changed (158) hide show
  1. package/fcs-core-viewer@types/Addins/CustomScript.d.ts +11 -0
  2. package/fcs-core-viewer@types/Addins/Index.d.ts +1 -0
  3. package/fcs-core-viewer@types/Api.d.ts +10 -0
  4. package/fcs-core-viewer@types/BackendEvents/BackendEvents.d.ts +218 -0
  5. package/fcs-core-viewer@types/BackendEvents/TaskExecutionResponse.d.ts +22 -0
  6. package/fcs-core-viewer@types/CloudViewer/CoreInterfaces.d.ts +12 -0
  7. package/fcs-core-viewer@types/CloudViewer/FcsViewer.d.ts +379 -0
  8. package/fcs-core-viewer@types/CloudViewer/Index.d.ts +1 -0
  9. package/fcs-core-viewer@types/CloudViewer/Settings/CameraSettings.d.ts +44 -0
  10. package/fcs-core-viewer@types/CloudViewer/Settings/Index.d.ts +11 -0
  11. package/fcs-core-viewer@types/CloudViewer/Settings/SelectionSettings.d.ts +78 -0
  12. package/fcs-core-viewer@types/CloudViewer/Settings/StyleSettings.d.ts +71 -0
  13. package/fcs-core-viewer@types/CloudViewer/Settings/VisibilitySettings.d.ts +19 -0
  14. package/fcs-core-viewer@types/CloudViewer/TypesFcs.d.ts +12 -0
  15. package/fcs-core-viewer@types/Common/CommsChannels/BackendClient.d.ts +47 -0
  16. package/fcs-core-viewer@types/Common/CommsChannels/Socket.d.ts +34 -0
  17. package/fcs-core-viewer@types/Common/Diagnostics/Exceptions.d.ts +26 -0
  18. package/fcs-core-viewer@types/Common/Diagnostics/StatusDialog.d.ts +72 -0
  19. package/fcs-core-viewer@types/Common/Diagnostics/WebLogger.d.ts +21 -0
  20. package/fcs-core-viewer@types/Common/Index.d.ts +6 -0
  21. package/fcs-core-viewer@types/Common/LocalStorage/localStorage.d.ts +2 -0
  22. package/fcs-core-viewer@types/Common/UIDGenerator/UIDGenerator.d.ts +15 -0
  23. package/fcs-core-viewer@types/Foundations/Index.d.ts +5 -0
  24. package/fcs-core-viewer@types/Foundations/VectorGeometry.d.ts +30 -0
  25. package/fcs-core-viewer@types/FrontendEvents/MenuEvents.d.ts +132 -0
  26. package/fcs-core-viewer@types/FrontendEvents/OptionsEvents.d.ts +21 -0
  27. package/fcs-core-viewer@types/FrontendEvents/SidebarEvents.d.ts +23 -0
  28. package/fcs-core-viewer@types/FrontendEvents/TopbarEvents.d.ts +124 -0
  29. package/fcs-core-viewer@types/FrontendEvents/TreeEvents.d.ts +47 -0
  30. package/fcs-core-viewer@types/FrontendEvents/UtilsEvents.d.ts +0 -0
  31. package/fcs-core-viewer@types/Loader/LoadEdge.d.ts +47 -0
  32. package/fcs-core-viewer@types/Loader/LoadSTEP.d.ts +68 -0
  33. package/fcs-core-viewer@types/Loader/LoadVertex.d.ts +41 -0
  34. package/fcs-core-viewer@types/Loader/Loader.d.ts +67 -0
  35. package/fcs-core-viewer@types/Loader/LoaderUtils.d.ts +234 -0
  36. package/fcs-core-viewer@types/Model/ActiveCloudDocument.d.ts +84 -0
  37. package/fcs-core-viewer@types/Model/DataManager.d.ts +0 -0
  38. package/fcs-core-viewer@types/Model/GeomWrapper.d.ts +0 -0
  39. package/fcs-core-viewer@types/Model/Index.d.ts +9 -0
  40. package/fcs-core-viewer@types/Model/MeshWrapper.d.ts +87 -0
  41. package/fcs-core-viewer@types/Model/SceneWrapper.d.ts +171 -0
  42. package/fcs-core-viewer@types/SelectionTools/Methods/SelectByBox.d.ts +0 -0
  43. package/fcs-core-viewer@types/SelectionTools/Methods/SelectByClick.d.ts +0 -0
  44. package/fcs-core-viewer@types/SelectionTools/Methods/SelectByID.d.ts +0 -0
  45. package/fcs-core-viewer@types/SelectionTools/Methods/UnselectByBox.d.ts +0 -0
  46. package/fcs-core-viewer@types/SelectionTools/Methods/UnselectByClick.d.ts +0 -0
  47. package/fcs-core-viewer@types/SelectionTools/SelectEntities/SelectEdge.d.ts +0 -0
  48. package/fcs-core-viewer@types/SelectionTools/SelectEntities/SelectFace.d.ts +0 -0
  49. package/fcs-core-viewer@types/SelectionTools/SelectEntities/SelectItem.d.ts +38 -0
  50. package/fcs-core-viewer@types/SelectionTools/SelectEntities/SelectVertex.d.ts +0 -0
  51. package/fcs-core-viewer@types/SelectionTools/Selection.d.ts +83 -0
  52. package/fcs-core-viewer@types/SelectionTools/SelectionEdge.d.ts +25 -0
  53. package/fcs-core-viewer@types/SelectionTools/SelectionEdgeByID.d.ts +29 -0
  54. package/fcs-core-viewer@types/SelectionTools/SelectionFace.d.ts +42 -0
  55. package/fcs-core-viewer@types/SelectionTools/SelectionFaceByID.d.ts +26 -0
  56. package/fcs-core-viewer@types/SelectionTools/SelectionTools/SelectionTools.d.ts +0 -0
  57. package/fcs-core-viewer@types/SelectionTools/SelectionUtils.d.ts +71 -0
  58. package/fcs-core-viewer@types/SelectionTools/SelectionValidation.d.ts +63 -0
  59. package/fcs-core-viewer@types/SelectionTools/SelectionVertex.d.ts +26 -0
  60. package/fcs-core-viewer@types/SelectionTools/SelectionVertexByID.d.ts +26 -0
  61. package/fcs-core-viewer@types/SelectionTools/UnselectEntities/UnselectActive.d.ts +12 -0
  62. package/fcs-core-viewer@types/SelectionTools/UnselectEntities/UnselectAll.d.ts +23 -0
  63. package/fcs-core-viewer@types/SelectionTools/UnselectEntities/UnselectEdge.d.ts +7 -0
  64. package/fcs-core-viewer@types/SelectionTools/UnselectEntities/UnselectFace.d.ts +7 -0
  65. package/fcs-core-viewer@types/SelectionTools/UnselectEntities/UnselectItem.d.ts +14 -0
  66. package/fcs-core-viewer@types/SelectionTools/UnselectEntities/UnselectVertex.d.ts +8 -0
  67. package/fcs-core-viewer@types/SelectionTools/Unselection.d.ts +81 -0
  68. package/fcs-core-viewer@types/StyleHandler/TreeStyle.d.ts +23 -0
  69. package/fcs-core-viewer@types/TaskHandler/Context/Context.d.ts +80 -0
  70. package/fcs-core-viewer@types/TaskHandler/Merge/Merge.d.ts +9 -0
  71. package/fcs-core-viewer@types/TaskHandler/Model/RequestHandler/CollaborationTool_req.d.ts +15 -0
  72. package/fcs-core-viewer@types/TaskHandler/Model/ResponseHandler/CollaborationTool_res.d.ts +11 -0
  73. package/fcs-core-viewer@types/TaskHandler/Options/Options.d.ts +31 -0
  74. package/fcs-core-viewer@types/TaskHandler/Output/Output.d.ts +14 -0
  75. package/fcs-core-viewer@types/TaskHandler/TaskHandler.d.ts +325 -0
  76. package/fcs-core-viewer@types/TaskHandler/TaskUtils.d.ts +54 -0
  77. package/fcs-core-viewer@types/TaskHandler/Topbar/Delete/Delete.d.ts +89 -0
  78. package/fcs-core-viewer@types/TaskHandler/Topbar/Display/Display.d.ts +31 -0
  79. package/fcs-core-viewer@types/TaskHandler/Topbar/Tools/Find.d.ts +86 -0
  80. package/fcs-core-viewer@types/TaskHandler/Topbar/Tools/Measurement.d.ts +26 -0
  81. package/fcs-core-viewer@types/TaskHandler/Topbar/Tools/Transformation.d.ts +35 -0
  82. package/fcs-core-viewer@types/TaskHandler/Topbar/View/CutView.d.ts +85 -0
  83. package/fcs-core-viewer@types/TaskHandler/Topbar/View/ExplodedView.d.ts +38 -0
  84. package/fcs-core-viewer@types/TaskHandler/Topbar/View/GeomVisualisation.d.ts +46 -0
  85. package/fcs-core-viewer@types/TaskHandler/Topbar/View/Rotate.d.ts +54 -0
  86. package/fcs-core-viewer@types/TaskHandler/Topbar/View/Screenshot.d.ts +41 -0
  87. package/fcs-core-viewer@types/TaskHandler/Topbar/View/Views.d.ts +22 -0
  88. package/fcs-core-viewer@types/TaskHandler/Tree/RequestHandler/AddContainer.d.ts +16 -0
  89. package/fcs-core-viewer@types/TaskHandler/Tree/RequestHandler/AddFile.d.ts +18 -0
  90. package/fcs-core-viewer@types/TaskHandler/Tree/RequestHandler/AddFolder.d.ts +16 -0
  91. package/fcs-core-viewer@types/TaskHandler/Tree/RequestHandler/ITaskDefinition.d.ts +5 -0
  92. package/fcs-core-viewer@types/TaskHandler/Tree/RequestHandler/Interactions.d.ts +47 -0
  93. package/fcs-core-viewer@types/TaskHandler/Tree/RequestHandler/RemoveFile.d.ts +6 -0
  94. package/fcs-core-viewer@types/TaskHandler/Tree/RequestHandler/Rename.d.ts +0 -0
  95. package/fcs-core-viewer@types/TaskHandler/Tree/RequestHandler.d.ts +0 -0
  96. package/fcs-core-viewer@types/TaskHandler/Tree/ResponseHandler/AddTreeItem.d.ts +14 -0
  97. package/fcs-core-viewer@types/TaskHandler/Tree/ResponseHandler/Interactions.d.ts +3 -0
  98. package/fcs-core-viewer@types/TaskHandler/Tree/ResponseHandler/RemoveTreeItem.d.ts +10 -0
  99. package/fcs-core-viewer@types/TaskHandler/Tree/ResponseHandler.d.ts +5 -0
  100. package/fcs-core-viewer@types/TaskHandler/Tree/Tree.d.ts +236 -0
  101. package/fcs-core-viewer@types/Tree/TreeStructure/TreeStructure.d.ts +68 -0
  102. package/fcs-core-viewer@types/Tree/TreeView/TreeCore.d.ts +175 -0
  103. package/fcs-core-viewer@types/Tree/TreeView/TreeCoreUtils.d.ts +82 -0
  104. package/fcs-core-viewer@types/UserInterface/EventListeners/EventListeners.d.ts +32 -0
  105. package/fcs-core-viewer@types/UserInterface/EventListeners/GeneralEvents.d.ts +0 -0
  106. package/fcs-core-viewer@types/UserInterface/EventListeners/MainMenuEvents.d.ts +0 -0
  107. package/fcs-core-viewer@types/UserInterface/EventListeners/ModelEvents.d.ts +13 -0
  108. package/fcs-core-viewer@types/UserInterface/EventListeners/OptionsMenuEvents.d.ts +0 -0
  109. package/fcs-core-viewer@types/UserInterface/EventListeners/SidebarMenuEvents.d.ts +0 -0
  110. package/fcs-core-viewer@types/UserInterface/EventListeners/TopbarMenuEvents.d.ts +0 -0
  111. package/fcs-core-viewer@types/UserInterface/EventListeners/TreeViewEvents.d.ts +15 -0
  112. package/fcs-core-viewer@types/UserInterface/UIComponents/MainMenu.d.ts +0 -0
  113. package/fcs-core-viewer@types/UserInterface/UIComponents/Model.d.ts +33 -0
  114. package/fcs-core-viewer@types/UserInterface/UIComponents/OptionsMenu.d.ts +0 -0
  115. package/fcs-core-viewer@types/UserInterface/UIComponents/SidebarMenu.d.ts +0 -0
  116. package/fcs-core-viewer@types/UserInterface/UIComponents/TopbarMenu.d.ts +0 -0
  117. package/fcs-core-viewer@types/UserInterface/UIComponents/TreeView.d.ts +52 -0
  118. package/fcs-core-viewer@types/UserInterface/UIComponents/UIComponents.d.ts +32 -0
  119. package/fcs-core-viewer@types/UserInterface/UIComponents.d.ts +44 -0
  120. package/fcs-core-viewer@types/UserInterface/UIDefinition.d.ts +37 -0
  121. package/fcs-core-viewer@types/UserInterface/UiApi/BaseComponents/FcsUiBaseComponent.d.ts +6 -0
  122. package/fcs-core-viewer@types/UserInterface/UiApi/BaseComponents/FcsUiFunctionGroup.d.ts +14 -0
  123. package/fcs-core-viewer@types/UserInterface/UiApi/BaseComponents/FcsUiInputCollector.d.ts +10 -0
  124. package/fcs-core-viewer@types/UserInterface/UiApi/BaseComponents/FcsUiPushButton.d.ts +8 -0
  125. package/fcs-core-viewer@types/UserInterface/UiApi/BaseComponents/FcsUiSlider.d.ts +3 -0
  126. package/fcs-core-viewer@types/UserInterface/UiApi/BaseComponents/FcsUiStatusBar.d.ts +27 -0
  127. package/fcs-core-viewer@types/UserInterface/UiApi/BaseComponents/FcsUiTreeView.d.ts +3 -0
  128. package/fcs-core-viewer@types/UserInterface/UiApi/CloudCAE.d.ts +48 -0
  129. package/fcs-core-viewer@types/UserInterface/UiApi/CloudCAEDummyActions.d.ts +10 -0
  130. package/fcs-core-viewer@types/UserInterface/UiApi/CloudCAEDummyAssets.d.ts +10 -0
  131. package/fcs-core-viewer@types/UserInterface/UiApi/ExclusiveComponents/FcsUiAdvancedHelp.d.ts +3 -0
  132. package/fcs-core-viewer@types/UserInterface/UiApi/ExclusiveComponents/FcsUiExclusiveComponent.d.ts +6 -0
  133. package/fcs-core-viewer@types/UserInterface/UiApi/MainComponents/FcsUiContextMenu.d.ts +3 -0
  134. package/fcs-core-viewer@types/UserInterface/UiApi/MainComponents/FcsUiDockPanel.d.ts +7 -0
  135. package/fcs-core-viewer@types/UserInterface/UiApi/MainComponents/FcsUiDockedQuickMenu.d.ts +10 -0
  136. package/fcs-core-viewer@types/UserInterface/UiApi/MainComponents/FcsUiDropButton.d.ts +5 -0
  137. package/fcs-core-viewer@types/UserInterface/UiApi/MainComponents/FcsUiHowerPanel.d.ts +3 -0
  138. package/fcs-core-viewer@types/UserInterface/UiApi/MainComponents/FcsUiMainComponent.d.ts +2 -0
  139. package/fcs-core-viewer@types/UserInterface/UiApi/MainComponents/FcsUiQuickOptionsMenu.d.ts +12 -0
  140. package/fcs-core-viewer@types/UserInterface/UiApi/Settings/FcsUiButtonStyle.d.ts +22 -0
  141. package/fcs-core-viewer@types/UserInterface/UiApi/Settings/FcsUiPositions.d.ts +20 -0
  142. package/fcs-core-viewer@types/UserInterface/UiApi/Settings/FcsUiSizing.d.ts +4 -0
  143. package/fcs-core-viewer@types/UserInterface/UiApi/Wrapper/FcsUiBinder.d.ts +6 -0
  144. package/fcs-core-viewer@types/UserInterface/UiApi/Wrapper/FcsUiDefinition.d.ts +8 -0
  145. package/fcs-core-viewer@types/ViewerEntities/AbstractEntities.d.ts +76 -0
  146. package/fcs-core-viewer@types/ViewerEntities/ContainerEntities.d.ts +27 -0
  147. package/fcs-core-viewer@types/ViewerEntities/Index.d.ts +11 -0
  148. package/fcs-core-viewer@types/ViewerEntities/VisibleEntities/AnnotationEntities.d.ts +79 -0
  149. package/fcs-core-viewer@types/ViewerEntities/VisibleEntities/CollaborationEntities.d.ts +125 -0
  150. package/fcs-core-viewer@types/ViewerEntities/VisibleEntities/GeometricEntities.d.ts +20 -0
  151. package/fcs-core-viewer@types/ViewerEntities/VisibleEntities/Index.d.ts +7 -0
  152. package/fcs-core-viewer@types/ViewerEntities/VisibleEntities/TemporaryEntities.d.ts +15 -0
  153. package/fcs-core-viewer@types/ViewerEntities/VisibleEntities/VisibleBaseEntities.d.ts +38 -0
  154. package/fcs-core-viewer@types/ViewerSetup.d.ts +5 -0
  155. package/fcs-core-viewer@types/Workspace/StyleHandler.d.ts +133 -0
  156. package/fcs-core-viewer@types/Workspace/ThreeJsExtensions.d.ts +47 -0
  157. package/fcs-core-viewer@types/Workspace/ViewerWrapper.d.ts +215 -0
  158. package/package.json +42 -0
@@ -0,0 +1,11 @@
1
+ import { TaskUtils } from "../TaskHandler/TaskUtils";
2
+ /**
3
+ * Serves to host additional development functionalities.
4
+ */
5
+ export declare namespace Addins {
6
+ /**
7
+ * By registering addins we hook up event listeners and path them to the correct
8
+ * method defined in this class.
9
+ */
10
+ function registerAddins(taskUtils: TaskUtils): void;
11
+ }
@@ -0,0 +1 @@
1
+ export * from './CustomScript';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Contains all usable exports to build custom frontend applications
3
+ * that leverage the FCS Cloud Viewer and Editor.
4
+ */
5
+ export * from './Foundations/Index';
6
+ export * from './ViewerEntities/Index';
7
+ export * from './CloudViewer/Settings/Index';
8
+ export * from './Model/Index';
9
+ export * from './CloudViewer/Index';
10
+ export * from './Common/Index';
@@ -0,0 +1,218 @@
1
+ import { MeshWrapper } from '../Model/MeshWrapper';
2
+ import { SceneWrapper } from '../Model/SceneWrapper';
3
+ import { Appearance } from '../TaskHandler/Context/Context';
4
+ import { Loader } from '../Loader/Loader';
5
+ import { TreeOperations } from '../TaskHandler/Tree/Tree';
6
+ import { TreeView } from '../UserInterface/UIComponents/TreeView';
7
+ import { TaskUtils } from '../TaskHandler/TaskUtils';
8
+ import { CloudViewer } from '../CloudViewer/FcsViewer';
9
+ import { Translate } from '../TaskHandler/Topbar/Tools/Transformation';
10
+ import { Measurement } from '../TaskHandler/Topbar/Tools/Measurement';
11
+ import { Options } from '../TaskHandler/Options/Options';
12
+ import { TaskExecutionResponse } from './TaskExecutionResponse';
13
+ import { IBackendEvents } from '../CloudViewer/CoreInterfaces';
14
+ import { AddTreeItem } from '../TaskHandler/Tree/ResponseHandler/AddTreeItem';
15
+ /**
16
+ * This is the format of the backend received data.
17
+ */
18
+ interface BackendInstructions {
19
+ operation: string;
20
+ arguments: any;
21
+ finished?: boolean;
22
+ /**
23
+ * Task callback arguments
24
+ */
25
+ callback_guid_id?: string;
26
+ /**
27
+ * Optional addin arguments
28
+ */
29
+ addin_command?: string;
30
+ addin?: string;
31
+ on_finished_arguments?: {};
32
+ }
33
+ /**
34
+ * All events that were triggered by the backend.
35
+ * Normally, everything is first run by the backend to make sure if the
36
+ * changes can take affect in the model file. Once successful, it is returned
37
+ * back with sockets.
38
+ */
39
+ export declare class BackendEvents implements IBackendEvents {
40
+ licenseToken: string;
41
+ meshWrapper: MeshWrapper;
42
+ sceneWrapper: SceneWrapper;
43
+ appearance: Appearance;
44
+ loader: Loader;
45
+ treeView: TreeView;
46
+ treeOps: TreeOperations;
47
+ taskUtils: TaskUtils;
48
+ options: Options;
49
+ translate: Translate;
50
+ measurement: Measurement;
51
+ addTreeItem: AddTreeItem;
52
+ name: string;
53
+ tName: string;
54
+ operation: string;
55
+ stlPath: string;
56
+ stlPathStatic: string;
57
+ t2gPathStatic: string;
58
+ scene: any;
59
+ controls: any;
60
+ renderer: any;
61
+ currentCamera: any;
62
+ grEntityLabel: any;
63
+ requestArray: any[];
64
+ requestIndex: number;
65
+ response: any;
66
+ status: string;
67
+ backendInstructionData: {};
68
+ components: {};
69
+ wereListenersRegistered: boolean;
70
+ readonly operationToFunction: {
71
+ show_progress_tracker: any;
72
+ finish_progress_tracker: any;
73
+ show_status_message: any;
74
+ translate_two_points: any;
75
+ measure_distance: any;
76
+ WhatIs: any;
77
+ hide: any;
78
+ show: any;
79
+ hide_all: any;
80
+ show_all: any;
81
+ set_transparency: any;
82
+ center_view: any;
83
+ set_object_color: any;
84
+ refresh_viewer: any;
85
+ clear_document: any;
86
+ commit_to_document: any;
87
+ remove_from_document: any;
88
+ add_new_container: any;
89
+ add_new_container_under: any;
90
+ add_to_document: any;
91
+ add_to_document_under: any;
92
+ export_STEP_for_selection: any;
93
+ generic_callback_middleware: any;
94
+ };
95
+ /**
96
+ * Contains guid to backend service mappings.
97
+ */
98
+ attachedServices: {
99
+ [key: string]: CloudViewer.BackendService;
100
+ };
101
+ /**
102
+ * Contains all approved guids
103
+ */
104
+ registeredAddinGuids: string[];
105
+ /**
106
+ * Callback function GUIDs
107
+ */
108
+ guidCallbackDictionary: {
109
+ [key: string]: Function;
110
+ };
111
+ /**
112
+ * Constructor.
113
+ */
114
+ constructor(licenseToken: string, sceneWrapper: SceneWrapper, meshWrapper: MeshWrapper, loader: Loader, appearance: Appearance, treeView: TreeView, treeOperations: TreeOperations, taskUtilities: TaskUtils, options: Options, translate: Translate, measurement: Measurement, addTreeItem: AddTreeItem);
115
+ /**
116
+ * Saves the backend service and will be able to invoke the
117
+ * 'OnFinished' method on call back from backend service.
118
+ * @param service
119
+ * @param serviceMethod
120
+ */
121
+ attachService(service: CloudViewer.BackendService): void;
122
+ /**
123
+ * We pass in a function that will be called when the backend task finishes.
124
+ * We save this method in a dictionary where it will receive a GUID.
125
+ * When the method finishes it will search in the through the
126
+ * 'guidCallbackDictionary' to look if there are any methods that need to be run.
127
+ * @param callbackFn Method to be run after the task is finished
128
+ * @returns created Guid that will be used to identify the callback function
129
+ */
130
+ attachCallbackMethodToTask(callbackFn: Function): string;
131
+ /**
132
+ * Registers all available event listeners.
133
+ */
134
+ private _registerEventListeners;
135
+ /**
136
+ * Miutan egyszer elinditottuk a scheduler funkciot, while ciklussal menjunk vegig a array-en,
137
+ * melyet a backend-bol jovo request-ek folyamatosan toltenek fel feladatokkal.
138
+ * Ha i = N akkor kuldje a response-t.
139
+ * @returns Response from called backend method.
140
+ */
141
+ private scheduler;
142
+ /**
143
+ * Dummy placeholder method that serves as a generic middleware to all methods.
144
+ * @returns
145
+ */
146
+ private generic_callback_middleware;
147
+ /**
148
+ * Centers the view.
149
+ * @param data Does not matter, because it centers everything that's visible
150
+ */
151
+ private center_view;
152
+ /**
153
+ * Renders latest document (whatever was added/removed/modified)
154
+ */
155
+ private refresh_viewer;
156
+ /**
157
+ * Clears all entities in the document. Basically, a new empty document is open.
158
+ */
159
+ private clear_document;
160
+ /**
161
+ * This method is called both times when we are spawning the progress
162
+ * tracker or updating an existing one. To close down the progress tracker,
163
+ * we need to call a different method from the API, called `finish_progress_tracker`.
164
+ * @param data Contains 'progress_percentage' and 'current_process_name'
165
+ */
166
+ show_progress_tracker(instructions: BackendInstructions): Promise<TaskExecutionResponse>;
167
+ /**
168
+ * Stops the progress tracker and presents the exit status, unless
169
+ * immediate shutdown was requested.
170
+ * @param data Passes on an `exit_message`, `exit_status`, `immediate_shutdown`.
171
+ */
172
+ finish_progress_tracker(data: BackendInstructions): Promise<TaskExecutionResponse>;
173
+ /**
174
+ * If there was an already running progress dialog, it is reset.
175
+ * This is not ideal, but we really only want to keep a single instance
176
+ * of a pop-up status window.
177
+ * @param data
178
+ */
179
+ show_status_message(backendInstruction: BackendInstructions): Promise<TaskExecutionResponse>;
180
+ private remove_from_document;
181
+ /**
182
+ * Add empty file, folder or container to the viewer
183
+ * @param data
184
+ * @returns
185
+ */
186
+ private add_empty_item;
187
+ add_to_document(data: BackendInstructions): Promise<TaskExecutionResponse>;
188
+ set_object_color(data: BackendInstructions): Promise<TaskExecutionResponse>;
189
+ /**
190
+ * Sets the transparency of an object.
191
+ * @param instructions Contains ID and opacity
192
+ */
193
+ set_transparency(instructions: BackendInstructions): TaskExecutionResponse | "Finished: set_transparency";
194
+ /**
195
+ * Will set visibility toggle on for all passed in entity_ids.
196
+ * @param instructions Contains entity_ids only
197
+ */
198
+ private _show;
199
+ private _hide;
200
+ set_object_visibility(instructions: BackendInstructions): Promise<TaskExecutionResponse>;
201
+ /**
202
+ * Saves the currently active model's path, it will mark it as saveable.
203
+ * ToDo: For any other changes that were not committed to, we will need to
204
+ * disable the ability to export the model.
205
+ * @param instructions
206
+ * @returns 'Finished' message
207
+ */
208
+ commit_to_document(instructions: BackendInstructions): Promise<TaskExecutionResponse>;
209
+ /**
210
+ *
211
+ * @param instructions Contains exported STEP file path
212
+ */
213
+ private export_STEP_for_selection;
214
+ translate_two_points(data: BackendInstructions): Promise<TaskExecutionResponse>;
215
+ measure_distance(data: BackendInstructions): Promise<TaskExecutionResponse>;
216
+ WhatIs(data: BackendInstructions): Promise<TaskExecutionResponse>;
217
+ }
218
+ export {};
@@ -0,0 +1,22 @@
1
+ export declare enum TaskExecutionOutcome {
2
+ Successful = 0,
3
+ SuccessfulWithWarnings = 1,
4
+ FailureButCanContinue = 2,
5
+ CompleteFailure = 3
6
+ }
7
+ export declare class TaskExecutionResponse {
8
+ private _functionName;
9
+ private _executionOutcome;
10
+ private _errorMessage;
11
+ private _warningMessage;
12
+ constructor(functionName: string);
13
+ /**
14
+ * Uses the stack trace to create a default
15
+ * @returns A default execution response with successful outcome.
16
+ */
17
+ static ConstructDefaultResponse(): TaskExecutionResponse;
18
+ getOutcome(): TaskExecutionOutcome;
19
+ setOutcome(outcome: TaskExecutionOutcome): void;
20
+ setWarningMessage(_warningMessage: string): void;
21
+ setErrorMessage(errorMessages: string): void;
22
+ }
@@ -0,0 +1,12 @@
1
+ import { BackendManager } from "../Common/CommsChannels/BackendClient";
2
+ /**
3
+ * Core interfaces serve to declare types that are used in
4
+ * code that is not directly accessible via the API.
5
+ */
6
+ export interface ITaskUtilities {
7
+ setBackendManager(backendManager: BackendManager): void;
8
+ getDataFromSelected(): any | null;
9
+ }
10
+ export interface IBackendEvents {
11
+ attachCallbackMethodToTask(callbackFn: Function): string;
12
+ }
@@ -0,0 +1,379 @@
1
+ import { CameraOperationInput, SceneWrapper } from "./TypesFcs";
2
+ import { StyleSettings } from "./Settings/StyleSettings";
3
+ import { VisibilitySettings } from './Settings/VisibilitySettings';
4
+ import { CameraSettings } from "./Settings/CameraSettings";
5
+ import { AnnotationEntities } from "../ViewerEntities/VisibleEntities/AnnotationEntities";
6
+ import { AbstractEntities } from '../ViewerEntities/AbstractEntities';
7
+ import { ContainerEntities } from "../ViewerEntities/ContainerEntities";
8
+ import { TemporaryEntities } from '../ViewerEntities/VisibleEntities/TemporaryEntities';
9
+ /**
10
+ * Contains all control methods to the cloud viewer.
11
+ */
12
+ export declare namespace CloudViewer {
13
+ /**
14
+ * Engulf all settings to initialise a viewer.
15
+ */
16
+ class ViewerSettings {
17
+ /**
18
+ * Contains settings that are responsible for styling of the viewer.
19
+ */
20
+ viewerStyleSettings: StyleSettings.ViewerStyleSettings;
21
+ /**
22
+ * Contains settings that position the camera.
23
+ */
24
+ cameraInitialSettings: CameraSettings.Camera;
25
+ }
26
+ /**
27
+ * Constructor for generic 3D viewer.
28
+ */
29
+ class Generic3DViewer {
30
+ private _container;
31
+ private _authToken;
32
+ private _canvas;
33
+ private _initSettings;
34
+ private _viewerWrapper;
35
+ private _registeredAddinApplications;
36
+ private _backendManager;
37
+ private _activeSelectionFilter;
38
+ private _onSelectionEvent;
39
+ private _scene;
40
+ private _currentCamera;
41
+ private _renderer;
42
+ /**
43
+ * Constructor to instantiate viewer.
44
+ */
45
+ constructor(container: HTMLDivElement, initSettings?: ViewerSettings, licenseToken?: string, disallowSocketCallbacks?: boolean);
46
+ /**
47
+ * Constructs a top level item with geometric definition.
48
+ * @param itemId Unique ID of the item.
49
+ * @param itemName Name of the item.
50
+ * @param stlFileUrl Public download URL for STL file.
51
+ * @param t2gFileUrl Public download URL for T2G file.
52
+ */
53
+ addToDocument(itemId: number, itemName: string, stlFileUrl: string, t2gFileUrl?: string): Promise<void>;
54
+ /**
55
+ * Places an item with geometric definition under a specified already existing item.
56
+ * @param itemId Unique ID of the item.
57
+ * @param parentId Unique ID of the item's parent.
58
+ * @param itemName Name of the item.
59
+ * @param stlFileUrl Public download URL for STL file.
60
+ * @param t2gFileUrl Public download URL for T2G file.
61
+ */
62
+ addToDocumentUnder(itemId: number, parentId: number, itemName: string, stlFileUrl: string, t2gFileUrl?: string): Promise<void>;
63
+ /**
64
+ * Generates a unique id in the viewer
65
+ */
66
+ createUID(): number;
67
+ /**
68
+ * Inserts an HTML element inside the canvas.
69
+ */
70
+ addHtmlElementToCanvas(htmlElement: HTMLElement, posX: number, posY: number, posZ: number): void;
71
+ /**
72
+ * Assigns event handler to when a specific item is selected.
73
+ * @param itemVID Unique VID of the item
74
+ * @param onClickFunction Function we want to run if we click/select the tree item
75
+ */
76
+ addOnClickItemEvent(itemUID: number, onClickFunction: Function): void;
77
+ /**
78
+ * Removes an item from the tree view based on its ID.
79
+ * @param itemUID Unique identifier of tree item
80
+ */
81
+ removeFile(itemUID: number): void;
82
+ /**
83
+ * Removes a thread under the collaboration container.
84
+ * @param threadId
85
+ */
86
+ removeThread(threadId: number): void;
87
+ /**
88
+ * Places an (empty) file under the parent element
89
+ * Meg nem írtam meg az 'assign item to file' fuggvenyt. Igy a file nem ures, hanem automatikusan beleteszi a component-et
90
+ * @param itemName
91
+ * @param parentVID
92
+ */
93
+ addFile(itemName: string, parentId: number, itemType: string): void;
94
+ /**
95
+ * Places an empty folder under the parent element
96
+ * @param itemName
97
+ * @param parentVID
98
+ */
99
+ addFolder(itemName: string, parentUID: number, folderUID?: number): void;
100
+ /**
101
+ * Places an empty container at top-level in the model tree
102
+ * @param itemName
103
+ */
104
+ addContainer(itemName: string): number;
105
+ /**
106
+ * Creates a thread to pushpin association in the tree view.
107
+ * @param itemName
108
+ * @param parentId
109
+ * @param itemVID
110
+ * @returns The unique ID of the thread.
111
+ */
112
+ addThread(itemName: string, parentId: number, itemVID: number): number;
113
+ /**
114
+ * Method for forwarding commands with args.
115
+ * @param service
116
+ */
117
+ forwardCommandForService(service: BackendService, commandName: string, commandArgs: any): Promise<void>;
118
+ /**
119
+ * Method for forwarding commands with args.
120
+ * @param service
121
+ */
122
+ forwardCommandForServiceBlob(service: BackendService, commandName: string, commandFile: File, commandArgs: any): Promise<void>;
123
+ /**
124
+ * A custom application that requires a specific backend implementation.
125
+ * @param backendService
126
+ */
127
+ registerApplication(backendService: BackendService): Promise<void>;
128
+ /**
129
+ * Use this method to startup the viewer. If no backend service is registered.
130
+ */
131
+ startViewer(): Promise<void>;
132
+ /**
133
+ * Call this method to disconnect channels of the viewer to ALL services.
134
+ * The viewer itself will continue to display the 3D data if the user decides
135
+ * to keep it visible.
136
+ */
137
+ stopViewer(): boolean;
138
+ /**
139
+ * Assign method binding to canvas interaction events.
140
+ * @param listenerType Specify what listener type of event we want to add.
141
+ * @param method Assignable method on the event
142
+ */
143
+ addEventListener(listenerType: string, method: Function): void;
144
+ /**
145
+ * A temporary objects group serves to store temporary object that
146
+ * do not live persistently inside the document. This means whenever,
147
+ * we reopen the model's document, these objects do not persist.
148
+ * @returns
149
+ */
150
+ createTemporaryObjectsGroup(): TemporaryEntities.TemporaryGroup;
151
+ /**
152
+ * Get all selected items
153
+ * Ha nyomjuk a shif-et, a .selected benne marad a tree-ben es kijelolve marad a segment.
154
+ */
155
+ getCurrentlySelectedItems(): NodeListOf<Element>;
156
+ /**
157
+ * Private implementation of selection highlight color overried.
158
+ * @param color
159
+ */
160
+ private _setSelectionColor;
161
+ /**
162
+ * Sets selection.
163
+ * @param itemUUIDs All item UUIDs
164
+ */
165
+ setSelection(itemUUIDs: number[]): void;
166
+ /**
167
+ * Rerenders the scene.
168
+ */
169
+ refreshViewer(): void;
170
+ /**
171
+ * @returns SceneWrapper that contains the complete scene.
172
+ */
173
+ getSceneWrapper(): SceneWrapper;
174
+ /**
175
+ * Adjust camera distance from all visible objects.
176
+ */
177
+ adaptCameraZ(): void;
178
+ /**
179
+ * Fits the viewer boundaries to all visible content.
180
+ */
181
+ fitToContent(): void;
182
+ /**
183
+ * Takes a screenshot of the currently setup view. Removes background image
184
+ * and returns the URL string of the created PNG image.
185
+ */
186
+ takeScreenshot(): Promise<string>;
187
+ /**
188
+ * Aligns camera to focus on a point.
189
+ * @param cameraOperationInput [x, y, z]
190
+ */
191
+ alignViewToPoint(cameraOperationInput: CameraOperationInput): void;
192
+ /**
193
+ * Loads a model file to the viewer. Currently STEP and CBF files are supported.
194
+ * @param modelFile: Model file
195
+ * @param quietly: If set to true, then no progress dialog will appear
196
+ * @param callbackFn: When the model file loads this method gets called
197
+ */
198
+ loadModelFile(modelFile: File, quietly?: boolean, callbackFn?: Function): boolean;
199
+ /**
200
+ * The currently active Document with all its entities will be erased.
201
+ */
202
+ clearDocument(force?: boolean): void;
203
+ /**
204
+ * Disconnects viewer from all backend services. If the viewer is kept open the user may
205
+ * continue reviewing the 3D model without any API costs, however, computational
206
+ * functionalities will be disabled.
207
+ */
208
+ disconnectViewer(): void;
209
+ /**
210
+ * Removes currently active selection.
211
+ */
212
+ removeActiveSelection(): void;
213
+ /**
214
+ * Toggles the visibility for the existing entity.
215
+ * @param topVisibility Visibility option for different topological entities.
216
+ */
217
+ toggleTopologicalVisibility(topVisibility: VisibilitySettings.TopologyVisibility): void;
218
+ /**
219
+ * Returns my current camera's position and all required information
220
+ * that are required to restore the same view.
221
+ */
222
+ getMyCameraPosition(): CameraSettings.Camera;
223
+ /**
224
+ * Adjusts the current camera position to the passed in position.
225
+ */
226
+ setMyCameraPosition(cameraPosition: CameraSettings.Camera): boolean;
227
+ /**
228
+ * Allows to control whether the user can
229
+ * @param enable If true, the user is allowed to select from the viewer, else selection is locked.
230
+ */
231
+ enableSelection(enable: boolean): void;
232
+ /**
233
+ * By setting a selection filter, we can restrict the user to only select
234
+ * entities that are
235
+ * @param filter Filter that contains the logic for selection.
236
+ */
237
+ setSelectionFilter(filter?: AbstractEntities.SelectionFilter): void;
238
+ /**
239
+ * Sets the callback function to be called when selection occurs.
240
+ * @param {function} onSelectionEvent - The function to be called on selection.
241
+ * @param {Array} onSelectionEvent.entities - The selected entities.
242
+ * @returns {void}
243
+ */
244
+ setOnSelectionEvent(onSelectionEvent: () => any): void;
245
+ /**
246
+ * Makes all existing objects visible in the 3D space.
247
+ */
248
+ showAll(): void;
249
+ /**
250
+ * Hides all existing objects that live in the 3D space.
251
+ */
252
+ hideAll(): void;
253
+ /**
254
+ * Toggles ON visibility for the item identified by its UUID.
255
+ * @param itemUUID UUIDs of items we want to show
256
+ */
257
+ showItems(itemUUIDs: number[]): void;
258
+ /**
259
+ * Toggles OFF visibility for the item identified by its UUID.
260
+ * @param itemUUIDs UUIDs of items we want to hide
261
+ */
262
+ hideItems(itemUUIDs: number[]): void;
263
+ /**
264
+ * Shows only selected items
265
+ */
266
+ showOnlySelectedItems(): void;
267
+ /**
268
+ * Makes a component visible based on its ID.
269
+ * @param componentID unique identifier of object in tree
270
+ */
271
+ showComponent(componentID: string): void;
272
+ /**
273
+ * Adds an AnnotationElement to the scene
274
+ * @param annotation Annotation element
275
+ * @param temoraryGroup Temporary group that will store the annotation
276
+ */
277
+ addAnnotation(annotation: AnnotationEntities.AnnotationElement, temoraryGroup: TemporaryEntities.TemporaryGroup): void;
278
+ /**
279
+ * Functions required for manipulating the model tree
280
+ */
281
+ getTreeCore(): ContainerEntities.ModelTreeStructure;
282
+ /**
283
+ * The returned JSON contains detailed hierarchical informations
284
+ * how the model is setup.
285
+ * @returns Objects listed in tree.
286
+ */
287
+ getModelTreeStructure(): any;
288
+ /**
289
+ * Getter for all geometric object definitions that were added to the model.
290
+ * @returns ALL geometric object definitions
291
+ */
292
+ getComponents(): {};
293
+ /**
294
+ * Kiszamolja a modell komponenseit alkoto face-ek midPointjait
295
+ * @returns List of unique face IDs.
296
+ */
297
+ getFaceUIDs(): any[];
298
+ /**
299
+ * Beszinezi a face-eket
300
+ */
301
+ setFaceColor(color: any[], faceUIDs: any[]): void;
302
+ /**
303
+ * Sets the transparency of an object available in the model tree.
304
+ * @param itemUUID Unique identifier.
305
+ * @param transparency Value defined between 0 and 1, where 1 means hidden completely.
306
+ */
307
+ setTransparency(itemUUID: number, transparency: number): void;
308
+ /**
309
+ * Sets the visible geometry color to a defined RGB color code.
310
+ * @param itemUUID Unique item identifier
311
+ * @param red Red component, between 0 and 255
312
+ * @param green Green component, between 0 and 255
313
+ * @param blue Blue component, between 0 and 255
314
+ */
315
+ setColor(itemUUID: number, red: number, green: number, blue: number): void;
316
+ /**
317
+ * Returns the VID number for the given UUID. VID numbers are important
318
+ * for the browser application only and are required for input selection
319
+ * in the background logic. Users and the backend, however, both only operate
320
+ * within the scope of UUIDs.
321
+ * @param uuid Unique identifier as assigned by the document.
322
+ */
323
+ private _getViewerIdFromDocId;
324
+ /**
325
+ * Method that is called when a different
326
+ */
327
+ private _onModifiedSelectionFilter;
328
+ }
329
+ /**
330
+ * This interface serves to enforce the format of creating a frontend checkpoints
331
+ * that requires the backend server.
332
+ */
333
+ abstract class BackendService {
334
+ /**
335
+ * Viewer instance associated with backend service.
336
+ */
337
+ viewerInstance: CloudViewer.Generic3DViewer;
338
+ /**
339
+ * Viewer instance setter
340
+ * @param viewerInstance Viewer instance we want our frontend app to attach to
341
+ */
342
+ setViewerInstance(viewerInstance: CloudViewer.Generic3DViewer): void;
343
+ /**
344
+ * Forward the command to the backend service.
345
+ * @param commandName
346
+ * @param args Custom arguments the backend service expects
347
+ */
348
+ protected forwardCommand(commandName: string, args: any): void;
349
+ /**
350
+ * Forward the command to the backend service with input file.
351
+ * @param commandName
352
+ * @param blob
353
+ * @param args
354
+ */
355
+ protected forwardCommandWithBlob(commandName: string, blob: File, args: any): void;
356
+ /**
357
+ * Returns array of functions that are called
358
+ * when backend service finishes.
359
+ */
360
+ abstract getOnFinishedEvents(): {
361
+ [key: string]: Function;
362
+ };
363
+ /**
364
+ * Getter for plugin GUID.
365
+ * The plugin Guid represents the entry point file's name.
366
+ * For example, if plugin guid is '1234-5678', then on the backend
367
+ * server a local copy of '1234-5678' folder will be created with a
368
+ * 1234-5678.py entry point file.
369
+ */
370
+ abstract getServiceGuid(): string;
371
+ /**
372
+ * Getter for plugin name.
373
+ * Based on the `getServiceGuid` example above, the entry point file that has
374
+ * the 'BackendService' is located. Inside this file the `BackendService's`
375
+ * implementation class has this name.
376
+ */
377
+ abstract getServiceClassName(): string;
378
+ }
379
+ }
@@ -0,0 +1 @@
1
+ export * from './FcsViewer';