Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
It is possible to add an object that will be included in the callback to avoid creating too many closures.
Calling twice addEventListener with the same parameters results in the second call to be ignored,
only unique pairs callback / object are allowed, in order to avoid calling multiple times the same
thing.
The id of the inserted callback (actually an UUID).
Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
The id of the inserted callback (actually an UUID).
Asynchronously gets the download URL of the given file.
Such a call must be made when isRunning is false and the export procedure for the given file was successful.
Returns a promise.
The promise contains a valid URL when :
If this returns a valid URL, then a simple http GET request to this URL will return the content
of the export procedure.
A promise that contains the download URL to use to get the result of the file of the export procedure.
Asynchronous - Waits for the export procedure to compute the number of required files to fulfill the request.
After waiting for the promise, then getFileCount will get the number of files of the export procedure.
A promise.
Asynchronous - Waits for the export procedure to complete (be it successful, erroneous or cancelled).
If pResultOffset is undefined, the promise is signalled when all files are ready.
If pResultOffset is positive and inferior to the file count, the promise is signalled when
the given file is ready, but you may call asyncWaitForFileCount before.
When the export procedure is completed, the promise is resolved with the result of the export file procedure.
Optional pFileOffset: numberA promise.
Cancels the computation of the given file of the export process (if running).
If pFileOffset is undefined, then all the files of the export procedure are cancelled. If pFileOffset is set and in the range [0, getFileCount() - 1], then the given file export will be cancelled.
A ExportJobInterfaceSignal.ExportJobCancelled signal is emitted if the ExportJobInterface is running.
Optional pFileOffset: numbertrue if the ExportJobInterface was running and cancelled by the call, else false.
If the export is finished and successful, triggers the calculation of the download URL of the given file.
If the export is not finished or not successful, returns false.
If computeDownloadURL has already been called, returns false.
The URL is ready when the ExportJobInterfaceSignal.ExportJobURLReady event is fired and then getDownloadURL can be called.
The URL has a very short life span, so the download procedure from the browser should be started right after
ExportJobInterfaceSignal.ExportJobURLReady event is fired (and if successful).
true if the download URL computing is launched.
Gets rid of this object.
After this call, this object can no longer be used.
If the object is an InfiniteObjectDispatcherInterface, then the InfiniteObjectDispatcherInterfaceSignal.ObjectDisposed signal is emitted.
Further uses of the object (with the exception of isDisposed, getInfiniteObjectType and application id retrieval) will log a message with LogLevel.LL_UsingDisposedObject.
Gets the compression scheme of the export procedure of the given file.
Returns a string telling the compression scheme of the file inside the export procedure. An empty string means that the compression scheme is unknown.
The compression scheme of the export procedure.
Gets the final size of the export procedure of the given file.
Returns a number telling the final download size of the file inside the export procedure. A '-1' value means that the size is unknown.
The download size is the number of bytes that will be downloaded from the server, but since this
stream is compressed, getDownloadSize may be significantly lower than getFinalFileSize.
The download size of the export procedure.
Gets the download URL once ExportJobInterfaceSignal.ExportJobURLReady event is fired.
Returns a valid URL when :
If this returns a valid URL, then a simple http GET request to this URL will return the content
of the export procedure.
The download URL to use to get the result of the export procedure.
Gets the id that was set during the call to DataSessionInterface.export3D, DataSessionInterface.export2D, DataSessionInterface.exportSVG or setExportId.
The application id of the export request.
Gets the number of files that the export procedure will create.
Right after calling DataSessionInterface.export3D, the number of files is unknown, and getFileCount returns 0.
The correct number of files is available after ExportJobInterfaceSignal.ExportFileCountReady signal is fired.
The number of files the export procedure consists in.
Gets the final extension of the export procedure of the given file.
Returns a string telling the extension of the file inside the export procedure. An empty string means that the extension is unknown.
The file extension of the export procedure.
Gets the progress of the export procedure of the given file.
Returns a number in the [0,1] range telling the progress of the file inside the export procedure.
The progress of the export procedure.
Gets the state of the procedure for the given file.
The file state is an ExportState.
The state of the export procedure for the given file (or ExportState.ES_Invalid is the call is invalid).
Gets the file type that has been set by the export procedure for the given file.
The file type is not an extension, but a more generic info such as 'export2d', 'export3d', 'exportsvg.
The filename for the given file of the export procedure.
Gets the final file size of the export procedure of the given file.
This will be the size that will be reported by the operating system for the given file.
Returns a number telling the final file size of the file inside the export procedure. A '-1' value means that the size is unknown.
getFinalFileSize may be significantly greater that getDownloadSize depending on the file content.
The file size of the export procedure.
Tells the type of the given interface.
The type of the given interface.
Gets the last error of the export procedure.
If pFileOffset is undefined, this gets the first error in the files request. If pFileOffset is set and in the range [0, getFileCount() - 1], the error of the given file export procedure is returned.
Optional pFileOffset: numberThe last error (if any, or undefined if no error occurred).
Gets the output format that was set during the call to DataSessionInterface.export3D, DataSessionInterface.export2D or DataSessionInterface.exportSVG.
Modifying this array in place results in undefined behavior.
DO NOT modify this array.
Tells if the EventDispatcher has such a callback registered for the given event type.
true if such a listener is installed for the given type of event.
Tells if the ExportJobInterface has been cancelled for the given file.
This is generally the case after calling cancel when the ExportJobInterface is running.
If pFileOffset is set, this returns true if the given file is cancelled.
If pFileOffset is undefined, this returns if at least one file is cancelled.
Optional pFileOffset: numbertrue if the ExportJobInterface is cancelled.
Tells if this object has been gotten rid off.
true if dispose has been called on this object.
Tells if the the given file of the export procedure can be downloaded.
Returns true if the export procedure has successfully processed the given file.
true if the export procedure has successfully processed the given file.
Tells if the export procedure for the given file is running.
This is the case before ExportJobInterfaceSignal.ExportJobURLReady event is fired.
If pFileOffset is set, this tells of the export procedure is running for the given file.
If pFileOffset is undefined, this tells if any file export procedure is running.
Optional pFileOffset: numberThe file offset of the file to query, or undefined to tell if at least one file export procedure is running.
true if the export procedure is running.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
The listener function that gets removed.
The listener object that was used when addEventListener was called.
true if the callback was removed else false.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
The listener function that gets removed.
true if the callback was removed else false.
Removes a listener by its id.
If no such listener is found, then the function returns false and does nothing. You must use the return value of addEventListener to actually remove the listener.
true if the callback was removed else false.
The ExportJobInterface interface is used to ask for a 3D / 2D export of a set of data.
Such export request is performed by the 3djuump Infinite backend and the ExportJobInterface is used to monitor the progress of the 3D export procedure and retrieve the result.
The ExportJobInterface interfaces are created through the DataSessionInterface.export3D, DataSessionInterface.export2D or DataSessionInterface.exportSVG methods. The output format of the 3D export procedure is defined by an Export3DOutputFormatInterface interface that sets the 3D format to use for the export procedure and some properties to tailor the final output file(s). Indeed, the export procedure consists in a number of different files, the number of files is available when the ExportJobInterfaceSignal.ExportFileCountReady signal is fired (getFileCount).
Only WorkingSetInterface may be exported with some modifiers, individual geometric instance ids cannot be exported per se, they must be included in a WorkingSetInterface. The list of WorkingSetInterface to export is defined by an array of WorkingSet3DExportInterface or WorkingSet2DExportInterface.
The list of signals the ExportJobInterface may trigger is available in the ExportJobInterfaceSignal enumeration.
The export mechanism is triggered through the DataSessionInterface.export3D, DataSessionInterface.export2D or DataSessionInterface.exportSVG method. The export is not available right away, but the event ExportJobInterfaceSignal.ExportJobFinished is triggered when the result of the ExportJobInterface is available.
The result may then be downloaded after calling the computeDownloadURL function and when the event ExportJobInterfaceSignal.ExportJobURLReady is triggered. The getDownloadURL will then retrieve the URL to fetch with an http
GETrequest.Warning : there may be cases when the computeDownloadURL and getDownloadURL are not available such as when the export procedure is running, i.e. when isRunning returns true, or when the ExportJobInterface has been cancelled, i.e. when isCancelled returns true.
The download URL has a short life span, so make sure to download the actual data shortly after calling computeDownloadURL, or recall computeDownloadURL if getDownloadURL returns undefined.
An export procedure may be interrupted (cancelled) when the ExportJobInterface is fetching data and cancel is called. In such cases, the ExportJobInterfaceSignal.ExportJobCancelled signal is fired, and shortly after, ExportJobInterfaceSignal.ExportJobFinished signal is fired.
or asynchronously :
Please make sure the destination browser supports promises before using async calls.
Please note that the DataSessionInterface MUST NOT be closed before retrieving the final result, since closing the given DataSessionInterface will cancel the export procedure and get rid of the exported data.
See