Skip to content

Commit

Permalink
Upgrading to Metashape 1.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jseinturier committed Jul 28, 2022
1 parent 70dee8c commit d4c62c7
Show file tree
Hide file tree
Showing 15 changed files with 662 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -5,7 +5,7 @@
<groupId>com.agisoft</groupId>
<artifactId>metashape</artifactId>
<packaging>jar</packaging>
<version>1.8.2</version>
<version>1.8.3</version>
<name>Metashape-java</name>
<url>http://maven.apache.org</url>

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/agisoft/metashape/CalibrationFormat.java
Expand Up @@ -20,6 +20,7 @@ public enum CalibrationFormat {
CalibrationFormatPix4D,
CalibrationFormatOpenCV,
CalibrationFormatPhotomod,
CalibrationFormatGrid;
CalibrationFormatGrid,
CalibrationFormatSTMap;
}

259 changes: 259 additions & 0 deletions 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<br>
* 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.<br>
* @param username Username.
*/
public void setUsername(String username) {
MetashapeJNI.CloudClient_setUsername(swigCPtr, this, username);
}

/**
* Get cloud account username.<br>
* @return Username.
*/
public String getUsername() {
return MetashapeJNI.CloudClient_getUsername(swigCPtr, this);
}

/**
* Set cloud account password.<br>
* @param password User password.
*/
public void setPassword(String password) {
MetashapeJNI.CloudClient_setPassword(swigCPtr, this, password);
}

/**
* Get cloud account password.<br>
* @return User password.
*/
public String getPassword() {
return MetashapeJNI.CloudClient_getPassword(swigCPtr, this);
}

/**
* Set client software id (optional).<br>
* @param client_id Client software id.
*/
public void setClientId(String client_id) {
MetashapeJNI.CloudClient_setClientId(swigCPtr, this, client_id);
}

/**
* Get client software id (optional).<br>
* @return Client software id.
*/
public String getClientId() {
return MetashapeJNI.CloudClient_getClientId(swigCPtr, this);
}

/**
* Set client software secret (optional).<br>
* @param client_secret Client software secret.
*/
public void setClientSecret(String client_secret) {
MetashapeJNI.CloudClient_setClientSecret(swigCPtr, this, client_secret);
}

/**
* Get client software secret (optional).<br>
* @return Client software secret.
*/
public String getClientSecret() {
return MetashapeJNI.CloudClient_getClientSecret(swigCPtr, this);
}

/**
* Upload project to the cloud.<br>
* @param document Project to upload.<br>
* @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.<br>
* @param document Project to download.<br>
* @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.<br>
* @param document Project to process.<br>
* @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.<br>
* @param document Project being processed.<br>
* @return Processing status.
*/
public CloudClient.ProcessingStatus getProcessingStatus(Document document) { return MetashapeJNI.CloudClient_getProcessingStatus(swigCPtr, this, Document.getCPtr(document), document); }

/**
* Cancel processing.<br>
* @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.<br>
* @return List of projects.
*/
public CloudClient.ProjectInfo[] getProjectList() { return MetashapeJNI.CloudClient_getProjectList(swigCPtr, this); }

public CloudClient() {
this(MetashapeJNI.new_CloudClient(), true);
}

}
16 changes: 16 additions & 0 deletions src/main/java/com/agisoft/metashape/MetashapeJNI.java
Expand Up @@ -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);
}
21 changes: 21 additions & 0 deletions 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;
}

0 comments on commit d4c62c7

Please sign in to comment.