diff --git a/README.md b/README.md index 92b63df..22b88c9 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ To import the library just add the following dependency to your maven project: ``` ### Standalone -The library can be used as a standalone by downloading the [metashape-1.8.2.jar](https://github.com/jseinturier/metashape-java-maven/releases/download/v1.8.2/metashape-1.8.2.jar) jar and integrating it to the classpath. +The library can be used as a standalone by downloading the [metashape-1.8.3.jar](https://github.com/jseinturier/metashape-java-maven/releases/download/v1.8.3/metashape-1.8.3.jar) jar and integrating it to the classpath. ## Usage The usage is strictly the same as the original distribution from Agisoft (underlying classes are not modified). diff --git a/pom.xml b/pom.xml index c5b2ccb..64d1b43 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.agisoft metashape jar - 1.8.2 + 1.8.3 Metashape-java http://maven.apache.org diff --git a/src/main/java/com/agisoft/metashape/CalibrationFormat.java b/src/main/java/com/agisoft/metashape/CalibrationFormat.java index 7a30a49..d0e76e0 100644 --- a/src/main/java/com/agisoft/metashape/CalibrationFormat.java +++ b/src/main/java/com/agisoft/metashape/CalibrationFormat.java @@ -20,6 +20,7 @@ public enum CalibrationFormat { CalibrationFormatPix4D, CalibrationFormatOpenCV, CalibrationFormatPhotomod, - CalibrationFormatGrid; + CalibrationFormatGrid, + CalibrationFormatSTMap; } diff --git a/src/main/java/com/agisoft/metashape/CloudClient.java b/src/main/java/com/agisoft/metashape/CloudClient.java new file mode 100644 index 0000000..ad23e7a --- /dev/null +++ b/src/main/java/com/agisoft/metashape/CloudClient.java @@ -0,0 +1,259 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.1 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package com.agisoft.metashape; + +import java.lang.AutoCloseable; +import java.util.Optional; +import java.util.Map; + +/** + * CloudClient class provides access to the Agisoft Cloud processing service and allows
+ * to create and manage cloud projects. + */ +public class CloudClient implements AutoCloseable { + private transient long swigCPtr; + protected transient boolean swigCMemOwn; + + protected CloudClient(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(CloudClient obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } + + @SuppressWarnings("deprecation") + protected void finalize() { + delete(); + } + + public synchronized void delete() { + if (swigCPtr != 0) { + if (swigCMemOwn) { + swigCMemOwn = false; + MetashapeJNI.delete_CloudClient(swigCPtr); + } + swigCPtr = 0; + } + } + + @Override + public void close() { + delete(); + } + + static public class ProcessingStatus { + + private String status; + private double progress; + private String error; + + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return this.status; + } + + public void setProgress(double progress) { + this.progress = progress; + } + + public double getProgress() { + return progress; + } + + public void setError(String error) { + this.error = error; + } + + public String getError() { + return this.error; + } + + } + + static public class ProjectInfo { + + private String project_id; + private String project_name; + private String creation_date; + private long project_size; + private long photos_size; + private boolean shared_with_me; + + public void setProjectId(String value) { + this.project_id = value; + } + + public String getProjectId() { + return project_id; + } + + public void setProjectName(String value) { + this.project_name = value; + } + + public String getProjectName() { + return project_name; + } + + public void setCreationDate(String value) { + this.creation_date = value; + } + + public String getCreationDate() { + return creation_date; + } + + public void setProjectSize(long value) { + this.project_size = value; + } + + public long getProjectSize() { + return project_size; + } + + public void setPhotosSize(long value) { + this.photos_size = value; + } + + public long getPhotosSize() { + return photos_size; + } + + public void setSharedWithMe(boolean value) { + this.shared_with_me = value; + } + + public boolean getSharedWithMe() { + return shared_with_me; + } + + } + + /** + * Set cloud account username.
+ * @param username Username. + */ + public void setUsername(String username) { + MetashapeJNI.CloudClient_setUsername(swigCPtr, this, username); + } + + /** + * Get cloud account username.
+ * @return Username. + */ + public String getUsername() { + return MetashapeJNI.CloudClient_getUsername(swigCPtr, this); + } + + /** + * Set cloud account password.
+ * @param password User password. + */ + public void setPassword(String password) { + MetashapeJNI.CloudClient_setPassword(swigCPtr, this, password); + } + + /** + * Get cloud account password.
+ * @return User password. + */ + public String getPassword() { + return MetashapeJNI.CloudClient_getPassword(swigCPtr, this); + } + + /** + * Set client software id (optional).
+ * @param client_id Client software id. + */ + public void setClientId(String client_id) { + MetashapeJNI.CloudClient_setClientId(swigCPtr, this, client_id); + } + + /** + * Get client software id (optional).
+ * @return Client software id. + */ + public String getClientId() { + return MetashapeJNI.CloudClient_getClientId(swigCPtr, this); + } + + /** + * Set client software secret (optional).
+ * @param client_secret Client software secret. + */ + public void setClientSecret(String client_secret) { + MetashapeJNI.CloudClient_setClientSecret(swigCPtr, this, client_secret); + } + + /** + * Get client software secret (optional).
+ * @return Client software secret. + */ + public String getClientSecret() { + return MetashapeJNI.CloudClient_getClientSecret(swigCPtr, this); + } + + /** + * Upload project to the cloud.
+ * @param document Project to upload.
+ * @param progress Progress callback. + */ + public void uploadProject(Document document, Progress progress) { + MetashapeJNI.CloudClient_uploadProject(swigCPtr, this, Document.getCPtr(document), document, progress); + } + + /** + * Download project from the cloud.
+ * @param document Project to download.
+ * @param progress Progress callback. + */ + public void downloadProject(Document document, Progress progress) { + MetashapeJNI.CloudClient_downloadProject(swigCPtr, this, Document.getCPtr(document), document, progress); + } + + /** + * Start processing in the cloud.
+ * @param document Project to process.
+ * @param tasks List of processing tasks to execute. + */ + public void processProject(Document document, NetworkTask[] tasks) { + MetashapeJNI.CloudClient_processProject(swigCPtr, this, Document.getCPtr(document), document, tasks); + } + + /** + * Get processing status.
+ * @param document Project being processed.
+ * @return Processing status. + */ + public CloudClient.ProcessingStatus getProcessingStatus(Document document) { return MetashapeJNI.CloudClient_getProcessingStatus(swigCPtr, this, Document.getCPtr(document), document); } + + /** + * Cancel processing.
+ * @param document Project to cancel. + */ + public void abortProcessing(Document document) { + MetashapeJNI.CloudClient_abortProcessing(swigCPtr, this, Document.getCPtr(document), document); + } + + /** + * Get list of projects in the cloud.
+ * @return List of projects. + */ + public CloudClient.ProjectInfo[] getProjectList() { return MetashapeJNI.CloudClient_getProjectList(swigCPtr, this); } + + public CloudClient() { + this(MetashapeJNI.new_CloudClient(), true); + } + +} diff --git a/src/main/java/com/agisoft/metashape/MetashapeJNI.java b/src/main/java/com/agisoft/metashape/MetashapeJNI.java index bc69d6e..86f493a 100644 --- a/src/main/java/com/agisoft/metashape/MetashapeJNI.java +++ b/src/main/java/com/agisoft/metashape/MetashapeJNI.java @@ -750,4 +750,20 @@ class MetashapeJNI { public final static native String NetworkClient_dumpBatches(long jarg1, NetworkClient jarg1_, int[] jarg2); public final static native void NetworkClient_loadBatches(long jarg1, NetworkClient jarg1_, String jarg2); public final static native void delete_NetworkClient(long jarg1); + public final static native void CloudClient_setUsername(long jarg1, CloudClient jarg1_, String jarg2); + public final static native String CloudClient_getUsername(long jarg1, CloudClient jarg1_); + public final static native void CloudClient_setPassword(long jarg1, CloudClient jarg1_, String jarg2); + public final static native String CloudClient_getPassword(long jarg1, CloudClient jarg1_); + public final static native void CloudClient_setClientId(long jarg1, CloudClient jarg1_, String jarg2); + public final static native String CloudClient_getClientId(long jarg1, CloudClient jarg1_); + public final static native void CloudClient_setClientSecret(long jarg1, CloudClient jarg1_, String jarg2); + public final static native String CloudClient_getClientSecret(long jarg1, CloudClient jarg1_); + public final static native void CloudClient_uploadProject(long jarg1, CloudClient jarg1_, long jarg2, Document jarg2_, Progress jarg3); + public final static native void CloudClient_downloadProject(long jarg1, CloudClient jarg1_, long jarg2, Document jarg2_, Progress jarg3); + public final static native void CloudClient_processProject(long jarg1, CloudClient jarg1_, long jarg2, Document jarg2_, NetworkTask[] jarg3); + public final static native CloudClient.ProcessingStatus CloudClient_getProcessingStatus(long jarg1, CloudClient jarg1_, long jarg2, Document jarg2_); + public final static native void CloudClient_abortProcessing(long jarg1, CloudClient jarg1_, long jarg2, Document jarg2_); + public final static native CloudClient.ProjectInfo[] CloudClient_getProjectList(long jarg1, CloudClient jarg1_); + public final static native long new_CloudClient(); + public final static native void delete_CloudClient(long jarg1); } diff --git a/src/main/java/com/agisoft/metashape/ServiceType.java b/src/main/java/com/agisoft/metashape/ServiceType.java new file mode 100644 index 0000000..b09c158 --- /dev/null +++ b/src/main/java/com/agisoft/metashape/ServiceType.java @@ -0,0 +1,21 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 4.0.1 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package com.agisoft.metashape; + +public enum ServiceType { + ServiceSketchfab, + ServiceMapbox, + Service4DMapper, + ServicePointscene, + ServiceMelown, + ServicePointbox, + ServicePicterra, + ServiceCesium; +} + diff --git a/src/main/java/com/agisoft/metashape/tasks/PublishData.java b/src/main/java/com/agisoft/metashape/tasks/PublishData.java new file mode 100644 index 0000000..905af1a --- /dev/null +++ b/src/main/java/com/agisoft/metashape/tasks/PublishData.java @@ -0,0 +1,350 @@ +package com.agisoft.metashape.tasks; + +import com.agisoft.metashape.*; + +/** + * Task class containing processing parameters. + */ +public class PublishData extends Task { + + public PublishData() { + super("PublishData"); + } + + /** + * Account name (Melown service). + */ + public void setAccount(String value) { + setParameter("account", (Object) value); + } + + /** + * Account name (Melown service). + */ + public String getAccount() { + return (String) getParameter("account"); + } + + /** + * Dataset description. + */ + public void setDescription(String value) { + setParameter("description", (Object) value); + } + + /** + * Dataset description. + */ + public String getDescription() { + return (String) getParameter("description"); + } + + /** + * Service hostname (4DMapper service). + */ + public void setHostname(String value) { + setParameter("hostname", (Object) value); + } + + /** + * Service hostname (4DMapper service). + */ + public String getHostname() { + return (String) getParameter("hostname"); + } + + /** + * Image compression parameters. + */ + public void setImageCompression(ImageCompression value) { + setParameter("image_compression", (Object) value); + } + + /** + * Image compression parameters. + */ + public ImageCompression getImageCompression() { + return (ImageCompression) getParameter("image_compression"); + } + + /** + * Mark dataset as draft (Sketchfab service). + */ + public void setIsDraft(boolean value) { + setParameter("is_draft", (Object) value); + } + + /** + * Mark dataset as draft (Sketchfab service). + */ + public boolean getIsDraft() { + return (boolean) getParameter("is_draft"); + } + + /** + * Set dataset access to private (Pointbox and Sketchfab services). + */ + public void setIsPrivate(boolean value) { + setParameter("is_private", (Object) value); + } + + /** + * Set dataset access to private (Pointbox and Sketchfab services). + */ + public boolean getIsPrivate() { + return (boolean) getParameter("is_private"); + } + + /** + * Set dataset access to protected (Pointbox service). + */ + public void setIsProtected(boolean value) { + setParameter("is_protected", (Object) value); + } + + /** + * Set dataset access to protected (Pointbox service). + */ + public boolean getIsProtected() { + return (boolean) getParameter("is_protected"); + } + + /** + * Maximum zoom level. Default: -1 + */ + public void setMaxZoomLevel(int value) { + setParameter("max_zoom_level", (Object) value); + } + + /** + * Maximum zoom level. Default: -1 + */ + public int getMaxZoomLevel() { + return (int) getParameter("max_zoom_level"); + } + + /** + * Minimum zoom level. Default: -1 + */ + public void setMinZoomLevel(int value) { + setParameter("min_zoom_level", (Object) value); + } + + /** + * Minimum zoom level. Default: -1 + */ + public int getMinZoomLevel() { + return (int) getParameter("min_zoom_level"); + } + + /** + * Account owner (Cesium and Mapbox services). + */ + public void setOwner(String value) { + setParameter("owner", (Object) value); + } + + /** + * Account owner (Cesium and Mapbox services). + */ + public String getOwner() { + return (String) getParameter("owner"); + } + + /** + * Account password (4DMapper, Melown, Pointscene and Sketchfab services). + */ + public void setPassword(String value) { + setParameter("password", (Object) value); + } + + /** + * Account password (4DMapper, Melown, Pointscene and Sketchfab services). + */ + public String getPassword() { + return (String) getParameter("password"); + } + + /** + * List of dense point classes to be exported. + */ + public void setPointClasses(int[] value) { + setParameter("point_classes", (Object) value); + } + + /** + * List of dense point classes to be exported. + */ + public int[] getPointClasses() { + return (int[]) getParameter("point_classes"); + } + + /** + * Output projection. + */ + public void setProjection(CoordinateSystem value) { + setParameter("projection", (Object) value); + } + + /** + * Output projection. + */ + public CoordinateSystem getProjection() { + return (CoordinateSystem) getParameter("projection"); + } + + /** + * Raster band transformation. Default: RasterTransformType.RasterTransformNone + */ + public void setRasterTransform(RasterTransformType value) { + setParameter("raster_transform", (Object) value); + } + + /** + * Raster band transformation. Default: RasterTransformType.RasterTransformNone + */ + public RasterTransformType getRasterTransform() { + return (RasterTransformType) getParameter("raster_transform"); + } + + /** + * Output resolution in meters. Default: 0.0 + */ + public void setResolution(double value) { + setParameter("resolution", (Object) value); + } + + /** + * Output resolution in meters. Default: 0.0 + */ + public double getResolution() { + return (double) getParameter("resolution"); + } + + /** + * Enables/disables export of camera track. + */ + public void setSaveCameraTrack(boolean value) { + setParameter("save_camera_track", (Object) value); + } + + /** + * Enables/disables export of camera track. + */ + public boolean getSaveCameraTrack() { + return (boolean) getParameter("save_camera_track"); + } + + /** + * Enables/disables export of point colors. + */ + public void setSavePointColors(boolean value) { + setParameter("save_point_colors", (Object) value); + } + + /** + * Enables/disables export of point colors. + */ + public boolean getSavePointColors() { + return (boolean) getParameter("save_point_colors"); + } + + /** + * Service to upload on. Default: ServiceType.ServiceSketchfab + */ + public void setService(ServiceType value) { + setParameter("service", (Object) value); + } + + /** + * Service to upload on. Default: ServiceType.ServiceSketchfab + */ + public ServiceType getService() { + return (ServiceType) getParameter("service"); + } + + /** + * Asset type to upload. Default: DataSource.PointCloudData + */ + public void setSourceData(DataSource value) { + setParameter("source_data", (Object) value); + } + + /** + * Asset type to upload. Default: DataSource.PointCloudData + */ + public DataSource getSourceData() { + return (DataSource) getParameter("source_data"); + } + + /** + * Dataset tags. + */ + public void setTags(String value) { + setParameter("tags", (Object) value); + } + + /** + * Dataset tags. + */ + public String getTags() { + return (String) getParameter("tags"); + } + + /** + * Tile size in pixels. Default: 256 + */ + public void setTileSize(int value) { + setParameter("tile_size", (Object) value); + } + + /** + * Tile size in pixels. Default: 256 + */ + public int getTileSize() { + return (int) getParameter("tile_size"); + } + + /** + * Dataset title. + */ + public void setTitle(String value) { + setParameter("title", (Object) value); + } + + /** + * Dataset title. + */ + public String getTitle() { + return (String) getParameter("title"); + } + + /** + * Account token (Cesium, Mapbox, Picterra, Pointbox and Sketchfab services). + */ + public void setToken(String value) { + setParameter("token", (Object) value); + } + + /** + * Account token (Cesium, Mapbox, Picterra, Pointbox and Sketchfab services). + */ + public String getToken() { + return (String) getParameter("token"); + } + + /** + * Account username (4DMapper, Melown and Pointscene services). + */ + public void setUsername(String value) { + setParameter("username", (Object) value); + } + + /** + * Account username (4DMapper, Melown and Pointscene services). + */ + public String getUsername() { + return (String) getParameter("username"); + } + +} diff --git a/src/main/resources/natives/linux/x64/libmetashape.so b/src/main/resources/natives/linux/x64/libmetashape.so index 061652f..a276fae 100644 --- a/src/main/resources/natives/linux/x64/libmetashape.so +++ b/src/main/resources/natives/linux/x64/libmetashape.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b686d021c70052ac8d3181da69e8675c3bdd7594040bbb9fbe38c3b90f2d9921 -size 90968224 +oid sha256:13ded9a9eb29857993709cb67b6d14e89168372fa12ab9de38e8b0211df74ee7 +size 91574656 diff --git a/src/main/resources/natives/macos/x64/libgmp.10.dylib b/src/main/resources/natives/macos/x64/libgmp.10.dylib index 0fa62f9..85b2b5c 100644 --- a/src/main/resources/natives/macos/x64/libgmp.10.dylib +++ b/src/main/resources/natives/macos/x64/libgmp.10.dylib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:81ec655f0684e452108a337cd6d58b63b7e31a29539472b65940be67877ac7b2 +oid sha256:0c461b14cfaa1251cea43cdfc8cdf9ee7e97ca96f970ea641a342d79d28d93c9 size 1225296 diff --git a/src/main/resources/natives/macos/x64/libmetashape.jnilib b/src/main/resources/natives/macos/x64/libmetashape.jnilib index c426499..e289e11 100644 --- a/src/main/resources/natives/macos/x64/libmetashape.jnilib +++ b/src/main/resources/natives/macos/x64/libmetashape.jnilib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3d176b304fa49995d707e5819268ee4c8ba2ded1aec855169e1c989ba99d60b8 -size 135584848 +oid sha256:37cf5abf03586a30e9f5654203d69594cbfe3ebea5bf266382e6e0ca062fce7b +size 136460992 diff --git a/src/main/resources/natives/macos/x64/libomp.dylib b/src/main/resources/natives/macos/x64/libomp.dylib index b4ea41d..c5d7d51 100644 --- a/src/main/resources/natives/macos/x64/libomp.dylib +++ b/src/main/resources/natives/macos/x64/libomp.dylib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:849da2e77b89835549464de4653314262e83ce9c38ab9478147f787115045123 +oid sha256:b7fb3e600449e0cb71e8f00134a1fc7f45a4f30fb973f00e32bc90c53a4340cf size 1316240 diff --git a/src/main/resources/natives/win/x32/libopenblas.dll b/src/main/resources/natives/win/x32/libopenblas.dll index 5aa8829..46f7365 100644 --- a/src/main/resources/natives/win/x32/libopenblas.dll +++ b/src/main/resources/natives/win/x32/libopenblas.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ac38bfa4446b91c334dadd2881f743acec10d4c426b986b4fd04d494433bd272 +oid sha256:8f7b6998e7686557741456b300fe9a03ad94a0e9aba5b0ae1a0436ab3102eb3c size 21420558 diff --git a/src/main/resources/natives/win/x32/metashape.dll b/src/main/resources/natives/win/x32/metashape.dll index 92b529a..e7b034a 100644 --- a/src/main/resources/natives/win/x32/metashape.dll +++ b/src/main/resources/natives/win/x32/metashape.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:07b477a88357b5fbe15be3468fa8cef7327eb384ad30d75700e1712d343219ad -size 74228224 +oid sha256:c56d35bb99210b9858306306417a36a45a8cea2e2afcac098c1aa86908a38327 +size 75306496 diff --git a/src/main/resources/natives/win/x64/libopenblas.dll b/src/main/resources/natives/win/x64/libopenblas.dll index addd7de..b9a442e 100644 --- a/src/main/resources/natives/win/x64/libopenblas.dll +++ b/src/main/resources/natives/win/x64/libopenblas.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:11ada238e66a02aa9c9d91f7873f9bfcbdc673dcd7eb4281d28865eb20a57032 +oid sha256:1ddc19deaecd236ba3842af378120cded886a98277a691ad2e96000b8afa31fe size 28769792 diff --git a/src/main/resources/natives/win/x64/metashape.dll b/src/main/resources/natives/win/x64/metashape.dll index 89104ab..c4d550f 100644 --- a/src/main/resources/natives/win/x64/metashape.dll +++ b/src/main/resources/natives/win/x64/metashape.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3aa97d132ce61e4fd0c7541cc5a2e2f5e01ff5307cf66c2eac1774347ccbd34d -size 92215808 +oid sha256:6739215ecef5e240060aa082fdc4b89e0f0e7201ae66620e65ff1f9006130fd3 +size 93483520