├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── github │ │ └── vmoglan │ │ └── pcljava │ │ ├── Normal.java │ │ ├── NormalCloud.java │ │ ├── NormalEstimation.java │ │ ├── Point.java │ │ ├── Point2d.java │ │ ├── Point3d.java │ │ ├── PointCloud.java │ │ ├── PointCloud3d.java │ │ ├── RandomSampleConsensus.java │ │ ├── SampleConsensus.java │ │ ├── SampleConsensusModel.java │ │ ├── SampleConsensusModelCone.java │ │ ├── SampleConsensusModelCylinder.java │ │ ├── SampleConsensusModelFromNormals.java │ │ ├── SampleConsensusModelLine.java │ │ ├── SampleConsensusModelPlane.java │ │ ├── SampleConsensusModelSphere.java │ │ ├── SampleConsensusModelStick.java │ │ ├── io │ │ ├── PointCloud3dReaderPcd.java │ │ ├── PointCloud3dReaderPly.java │ │ ├── PointCloud3dWriterPcd.java │ │ ├── PointCloud3dWriterPly.java │ │ ├── PointCloudReader.java │ │ └── PointCloudWriter.java │ │ ├── jni │ │ └── NativeObject.java │ │ └── visualization │ │ ├── Visualizer.java │ │ └── Visualizer3d.java └── native │ ├── .gitignore │ ├── SharedPointerWrapper.h │ ├── com_github_vmoglan_pcljava_Normal.cpp │ ├── com_github_vmoglan_pcljava_Normal.h │ ├── com_github_vmoglan_pcljava_NormalCloud.cpp │ ├── com_github_vmoglan_pcljava_NormalCloud.h │ ├── com_github_vmoglan_pcljava_NormalEstimation.cpp │ ├── com_github_vmoglan_pcljava_NormalEstimation.h │ ├── com_github_vmoglan_pcljava_Point2d.cpp │ ├── com_github_vmoglan_pcljava_Point2d.h │ ├── com_github_vmoglan_pcljava_Point3d.cpp │ ├── com_github_vmoglan_pcljava_Point3d.h │ ├── com_github_vmoglan_pcljava_PointCloud3d.cpp │ ├── com_github_vmoglan_pcljava_PointCloud3d.h │ ├── com_github_vmoglan_pcljava_RandomSampleConsensus.cpp │ ├── com_github_vmoglan_pcljava_RandomSampleConsensus.h │ ├── com_github_vmoglan_pcljava_SampleConsensus.cpp │ ├── com_github_vmoglan_pcljava_SampleConsensus.h │ ├── com_github_vmoglan_pcljava_SampleConsensusModel.cpp │ ├── com_github_vmoglan_pcljava_SampleConsensusModel.h │ ├── com_github_vmoglan_pcljava_SampleConsensusModelCone.cpp │ ├── com_github_vmoglan_pcljava_SampleConsensusModelCone.h │ ├── com_github_vmoglan_pcljava_SampleConsensusModelCylinder.cpp │ ├── com_github_vmoglan_pcljava_SampleConsensusModelCylinder.h │ ├── com_github_vmoglan_pcljava_SampleConsensusModelLine.cpp │ ├── com_github_vmoglan_pcljava_SampleConsensusModelLine.h │ ├── com_github_vmoglan_pcljava_SampleConsensusModelPlane.cpp │ ├── com_github_vmoglan_pcljava_SampleConsensusModelPlane.h │ ├── com_github_vmoglan_pcljava_SampleConsensusModelSphere.cpp │ ├── com_github_vmoglan_pcljava_SampleConsensusModelSphere.h │ ├── com_github_vmoglan_pcljava_SampleConsensusModelStick.cpp │ ├── com_github_vmoglan_pcljava_SampleConsensusModelStick.h │ ├── com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd.cpp │ ├── com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd.h │ ├── com_github_vmoglan_pcljava_io_PointCloud3dReaderPly.cpp │ ├── com_github_vmoglan_pcljava_io_PointCloud3dReaderPly.h │ ├── com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd.cpp │ ├── com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd.h │ ├── com_github_vmoglan_pcljava_io_PointCloud3dWriterPly.cpp │ ├── com_github_vmoglan_pcljava_io_PointCloud3dWriterPly.h │ ├── com_github_vmoglan_pcljava_visualization_Visualizer.cpp │ ├── com_github_vmoglan_pcljava_visualization_Visualizer.h │ ├── com_github_vmoglan_pcljava_visualization_Visualizer3d.cpp │ ├── com_github_vmoglan_pcljava_visualization_Visualizer3d.h │ └── handle.h └── test └── resources └── pcl-samples └── bunny.pcd /.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .classpath 3 | .project 4 | .settings/ 5 | 6 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 7 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 8 | 9 | # User-specific stuff 10 | .idea/**/workspace.xml 11 | .idea/**/tasks.xml 12 | .idea/**/usage.statistics.xml 13 | .idea/**/dictionaries 14 | .idea/**/shelf 15 | 16 | # Generated files 17 | .idea/**/contentModel.xml 18 | 19 | # Sensitive or high-churn files 20 | .idea/**/dataSources/ 21 | .idea/**/dataSources.ids 22 | .idea/**/dataSources.local.xml 23 | .idea/**/sqlDataSources.xml 24 | .idea/**/dynamic.xml 25 | .idea/**/uiDesigner.xml 26 | .idea/**/dbnavigator.xml 27 | 28 | # Gradle 29 | .idea/**/gradle.xml 30 | .idea/**/libraries 31 | 32 | # Gradle and Maven with auto-import 33 | # When using Gradle or Maven with auto-import, you should exclude module files, 34 | # since they will be recreated, and may cause churn. Uncomment if using 35 | # auto-import. 36 | .idea/artifacts 37 | .idea/compiler.xml 38 | .idea/jarRepositories.xml 39 | .idea/modules.xml 40 | .idea/*.iml 41 | .idea/modules 42 | *.iml 43 | *.ipr 44 | 45 | # Mongo Explorer plugin 46 | .idea/**/mongoSettings.xml 47 | 48 | # File-based project format 49 | *.iws 50 | 51 | # IntelliJ 52 | out/ 53 | .idea/ 54 | 55 | # mpeltonen/sbt-idea plugin 56 | .idea_modules/ 57 | 58 | # JIRA plugin 59 | atlassian-ide-plugin.xml 60 | 61 | # Cursive Clojure plugin 62 | .idea/replstate.xml 63 | 64 | # Crashlytics plugin (for Android Studio and IntelliJ) 65 | com_crashlytics_export_strings.xml 66 | crashlytics.properties 67 | crashlytics-build.properties 68 | fabric.properties 69 | 70 | # Editor-based Rest Client 71 | .idea/httpRequests 72 | 73 | # Android studio 3.1+ serialized cache file 74 | .idea/caches/build_file_checksums.ser 75 | 76 | # Mac 77 | .DS_Store 78 | 79 | # Maven 80 | target/ 81 | 82 | # CMake 83 | CMakeFiles/ 84 | CMakeCache.txt 85 | *.cmake 86 | Makefile 87 | native-project/ 88 | native-target/ 89 | 90 | # Visual Studio Code 91 | .vscode/ 92 | 93 | # Local History for Visual Studio Code 94 | .history/ -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.10) 2 | cmake_policy(SET CMP0048 "NEW") 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 6 | set(PCL_VERSION 1.11.1) 7 | 8 | project(pcljava VERSION ${PCL_VERSION}) 9 | set(TARGET_NAME "pcljava") 10 | 11 | find_package(JNI REQUIRED) 12 | if (JNI_FOUND) 13 | message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") 14 | message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}") 15 | else() 16 | message(FATAL_ERROR "JNI not found.") 17 | endif() 18 | 19 | find_package(PCL ${PCL_VERSION} REQUIRED) 20 | if (PCL_FOUND) 21 | message(STATUS "Point-Cloud Library version ${PCL_VERSION} was found.") 22 | else() 23 | message(FATAL_ERROR "Point-Cloud Library version ${PCL_VERSION} was not found.") 24 | endif() 25 | 26 | file( 27 | GLOB_RECURSE PCLJAVA_SRC 28 | "${CMAKE_SOURCE_DIR}/src/main/native/*.h" 29 | "${CMAKE_SOURCE_DIR}/src/main/native/*.cpp" 30 | ) 31 | 32 | link_directories(${PCL_LIBRARY_DIRS}) 33 | add_definitions(${PCL_DEFINITIONS}) 34 | 35 | add_library(${TARGET_NAME} SHARED "${PCLJAVA_SRC}") 36 | set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/native-target/") 37 | if (MSVC) 38 | set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/native-target/") 39 | set_target_properties(${TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/native-target/") 40 | endif (MSVC) 41 | 42 | target_include_directories(${TARGET_NAME} PUBLIC ${JNI_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS}) 43 | target_link_libraries( 44 | ${TARGET_NAME} 45 | ${PCL_LIBRARIES} 46 | ) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Vlad-Adrian Moglan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Point-Cloud Library Java 2 | 3 | ## ![Tag](https://img.shields.io/badge/maven-0.0.1--SNAPSHOT-yellow) 4 | 5 | The goal of this project is to make [Point-Cloud Library](https://github.com/PointCloudLibrary/pcl) (PCL) data-structures and algorithms available in Java projects via the Java Native Interface (JNI). Currently supported operating systems are Windows and Linux (64bit architecture only). 6 | 7 | ## Setup 8 | 9 | Point-Cloud Library version 1.11.1 as well as all of its dependencies need to be installed in order to use `pcljava`; these dependencies do **NOT** come packed with the artifacts associated with this project. 10 | 11 | - An [all-in-one PCL installer](https://github.com/PointCloudLibrary/pcl/releases/download/pcl-1.11.1/PCL-1.11.1-AllInOne-msvc2019-win64.exe) exists for Windows; once the installation is complete, the following directories must be added to the `PATH` environment variable: 12 | - `C:\Program Files\PCL 1.11.1\bin` 13 | - `C:\Program Files\PCL 1.11.1\3rdParty\VTK\bin` 14 | - `C:\Program Files\CMake\bin` 15 | - `C:\Program Files\PCL 1.11.1\3rdParty\Boost\lib` 16 | - `C:\Program Files\PCL 1.11.1\3rdParty\FLANN\bin` 17 | - `C:\Program Files\PCL 1.11.1\3rdParty\Qhull\bin` 18 | - `C:\Program Files\OpenNI2\Redist` 19 | - On Linux PCL can be built from source using [this guide](https://pcl-tutorials.readthedocs.io/en/latest/compiling_pcl_posix.html). 20 | 21 | ## Usage 22 | 23 | ### Project configuration 24 | 25 | To include the `pcljava` library in your project, your `pom.xml` must have the following configuration: 26 | 27 | ```xml 28 | 29 | 30 | github-pcljava 31 | Point-Cloud Library JNI Port Packages 32 | https://maven.pkg.github.com/vmoglan/pcljava 33 | 34 | 35 | ``` 36 | 37 | ```xml 38 | 39 | com.github.vmoglan 40 | pcljava 41 | 42 | 43 | ``` 44 | 45 | In addition to that, the `pom.xml` file must be configured to unpack the native dependencies — see the `` section in [this example](https://github.com/vmoglan/sphere-detection/blob/master/pom.xml). 46 | 47 | The native `pcljava` library must also be loaded in your project as such: 48 | 49 | ```java 50 | class Main { 51 | static { 52 | System.loadLibrary("pcljava"); 53 | } 54 | } 55 | ``` 56 | 57 | ### Examples 58 | 59 | - Instantiating a class for which memory is allocated in native code (_i.e._ a class extending `NativeObject`): 60 | 61 | ```java 62 | PointCloud3d cloud = new PointCloud3d(); // creating Java instance 63 | cloud.create(); // allocating memory in the native code 64 | 65 | // perform operations on cloud 66 | 67 | cloud.dispose(); // freeing the memory allocated in the native code 68 | ``` 69 | 70 | - Estimating the normal vectors of a three-dimensional point-cloud: 71 | 72 | ```java 73 | PointCloud3dReaderPly reader = new PointCloud3dReaderPly(); 74 | PointCloud3d cloud = reader.read("/path/to/cloud.ply"); 75 | 76 | NormalEstimation normalEstimation = new NormalEstimation(cloud, 0.03f); 77 | NormalCloud normals = normalEstimation.compute(); 78 | 79 | cloud.dispose(); 80 | normals.dispose(); 81 | ``` 82 | 83 | - [Sphere detection](https://github.com/vmoglan/sphere-detection) 84 | 85 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.github.vmoglan 5 | pcljava 6 | pcljava 7 | 0.0.1-SNAPSHOT 8 | JNI port of the Point-Cloud Library. 9 | jar 10 | 11 | 12 | 0.0.1-SNAPSHOT 13 | 1.11 14 | 1.11 15 | UTF-8 16 | UTF-8 17 | 18 | 19 | 20 | 21 | github-pcljava 22 | Point-Cloud Library JNI Port Packages 23 | https://maven.pkg.github.com/vmoglan/pcljava 24 | 25 | 26 | 27 | 28 | 29 | github-pcljava 30 | Point-Cloud Library JNI Port Packages 31 | https://maven.pkg.github.com/vmoglan/pcljava 32 | 33 | 34 | 35 | 36 | 37 | linux-x86_64 38 | 39 | 40 | 41 | Linux 42 | unix 43 | amd64 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.apache.maven.plugins 51 | maven-surefire-plugin 52 | 2.22.0 53 | 54 | once 55 | -Djava.library.path=target/natives/linux/x86_64 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | win32-x86_64 64 | 65 | 66 | 67 | windows 68 | amd64 69 | 70 | 71 | 72 | 73 | 74 | 75 | org.apache.maven.plugins 76 | maven-surefire-plugin 77 | 2.22.0 78 | 79 | once 80 | -Djava.library.path=target/natives/win32/x86_64 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | maven-compiler-plugin 92 | 3.7.0 93 | 94 | 11 95 | 11 96 | 97 | 98 | 99 | 100 | com.teamtter.mavennatives 101 | nativedependencies-maven-plugin 102 | 1.0.6 103 | 104 | 105 | unpacknatives 106 | generate-resources 107 | 108 | copy 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | org.junit.jupiter 119 | junit-jupiter-engine 120 | 5.2.0 121 | test 122 | 123 | 124 | 125 | org.junit.vintage 126 | junit-vintage-engine 127 | 5.2.0 128 | test 129 | 130 | 131 | 132 | commons-io 133 | commons-io 134 | 2.6 135 | 136 | 137 | 138 | com.github.vmoglan.pcljava 139 | natives 140 | 0.0.1-SNAPSHOT 141 | natives-all 142 | 143 | 144 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/Normal.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | import com.github.vmoglan.pcljava.jni.NativeObject; 4 | 5 | public class Normal extends NativeObject implements Point { 6 | @Override 7 | protected native void alloc(); 8 | 9 | @Override 10 | public native void dispose(); 11 | 12 | public native float getX(); 13 | 14 | public native void setX(float x); 15 | 16 | public native float getY(); 17 | 18 | public native void setY(float y); 19 | 20 | public native float getZ(); 21 | 22 | public native void setZ(float z); 23 | 24 | public native float getCurvature(); 25 | 26 | public void setComponents(float x, float y, float z) { 27 | setX(x); 28 | setY(y); 29 | setZ(z); 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "[" + getX() + ", " + getY() + ", " + getZ() + "]"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/NormalCloud.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | public class NormalCloud extends PointCloud { 4 | @Override 5 | protected native void alloc(); 6 | 7 | @Override 8 | public native void dispose(); 9 | 10 | @Override 11 | public Normal at(int i) { 12 | Normal normal = new Normal(); 13 | at(i, normal); 14 | return normal; 15 | } 16 | 17 | @Override 18 | protected native void at(int i, Normal point); 19 | 20 | @Override 21 | public native void add(Normal point); 22 | 23 | @Override 24 | public native void remove(Normal point); 25 | 26 | @Override 27 | public native void clear(); 28 | 29 | @Override 30 | public native int size(); 31 | 32 | @Override 33 | public native boolean isOrganized(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/NormalEstimation.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * NormalEstimation estimates local surface properties (surface normals and curvatures)at each 3D point. 5 | */ 6 | public class NormalEstimation { 7 | private PointCloud3d input; 8 | private NormalCloud output; 9 | private float radius; 10 | 11 | /** 12 | * @param cloud the point cloud data 13 | * @param radius the radius of the sphere bounding all of p_q's neighbors 14 | */ 15 | public NormalEstimation(PointCloud3d cloud, float radius) { 16 | this.input = cloud; 17 | this.radius = radius; 18 | this.output = new NormalCloud(); 19 | } 20 | 21 | public NormalCloud compute() { 22 | compute(input, radius, output); 23 | return output; 24 | } 25 | 26 | private native void compute(PointCloud3d input, float radius, NormalCloud output); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/Point.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * Marker interface used as a base for a generic point. 5 | */ 6 | public interface Point { } 7 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/Point2d.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | import com.github.vmoglan.pcljava.jni.NativeObject; 4 | 5 | /** 6 | * A 2D point structure representing Euclidean xy coordinates. 7 | */ 8 | public class Point2d extends NativeObject implements Point { 9 | @Override 10 | protected native void alloc(); 11 | 12 | @Override 13 | public native void dispose(); 14 | 15 | public final native float getX(); 16 | 17 | public final native void setX(float x); 18 | 19 | public final native float getY(); 20 | 21 | public final native void setY(float y); 22 | 23 | public final void setCoordinates(float x, float y) { 24 | setX(x); 25 | setY(y); 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return "[" + getX() + ", " + getY() + "]"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/Point3d.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | import com.github.vmoglan.pcljava.jni.NativeObject; 4 | 5 | /** 6 | * A point structure representing Euclidean xyz coordinates. 7 | */ 8 | public class Point3d extends NativeObject implements Point { 9 | @Override 10 | protected native void alloc(); 11 | 12 | @Override 13 | public native void dispose(); 14 | 15 | public final native float getX(); 16 | 17 | public native void setX(float x); 18 | 19 | public native float getY(); 20 | 21 | public native void setY(float y); 22 | 23 | public native float getZ(); 24 | 25 | public native void setZ(float z); 26 | 27 | public void setCoordinates(float x, float y, float z) { 28 | setX(x); 29 | setY(y); 30 | setZ(z); 31 | } 32 | 33 | public final native short getR(); 34 | 35 | public final native void setR(short r); 36 | 37 | public final native short getG(); 38 | 39 | public final native void setG(short g); 40 | 41 | public final native short getB(); 42 | 43 | public final native void setB(short b); 44 | 45 | public final native float getRGB(); 46 | 47 | public void setRGB(short r, short g, short b) { 48 | setR(r); 49 | setG(g); 50 | setB(b); 51 | } 52 | 53 | @Override 54 | public String toString() { 55 | return "[" + getX() + ", " + getY() + ", " + getZ() + "]"; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/PointCloud.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | import java.util.Iterator; 4 | 5 | import com.github.vmoglan.pcljava.jni.NativeObject; 6 | 7 | /** 8 | * PointCloud represents the base class in PCL for storing collections of points. 9 | */ 10 | public abstract class PointCloud extends NativeObject implements Iterable { 11 | @Override 12 | public final Iterator iterator() { 13 | Iterator iterator = new Iterator<>() { 14 | private int currentIndex = 0; 15 | 16 | @Override 17 | public boolean hasNext() { 18 | return currentIndex < size() && at(currentIndex) != null; 19 | } 20 | 21 | @Override 22 | public PointT next() { 23 | return at(currentIndex++); 24 | } 25 | 26 | @Override 27 | public void remove() { 28 | PointCloud.this.remove(at(currentIndex)); 29 | } 30 | }; 31 | 32 | return iterator; 33 | } 34 | 35 | /** 36 | * @param i the index of the point 37 | * @return the ith point in the cloud's vector 38 | */ 39 | public abstract PointT at(int i); 40 | 41 | /** 42 | * Stores the native address of the ith point in the cloud's vector within a point variable. 43 | * 44 | * @param i the index of the point 45 | * @param point the Java object to reference the native object 46 | */ 47 | protected abstract void at(int i, PointT point); 48 | 49 | public abstract void add(PointT point); 50 | 51 | public abstract void remove(PointT point); 52 | 53 | public abstract void clear(); 54 | 55 | public abstract int size(); 56 | 57 | public final boolean isEmpty() { return size() == 0; } 58 | 59 | public abstract boolean isOrganized(); 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/PointCloud3d.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * The class for storing an array of 3D RGB points. 5 | */ 6 | public final class PointCloud3d extends PointCloud { 7 | @Override 8 | protected native void alloc(); 9 | 10 | @Override 11 | public native void dispose(); 12 | 13 | @Override 14 | public Point3d at(int i) { 15 | Point3d point = new Point3d(); 16 | at(i, point); 17 | return point; 18 | } 19 | 20 | @Override 21 | protected native void at(int i, Point3d point); 22 | 23 | @Override 24 | public native void add(Point3d point); 25 | 26 | @Override 27 | public native void remove(Point3d point); 28 | 29 | @Override 30 | public native void clear(); 31 | 32 | @Override 33 | public native int size(); 34 | 35 | @Override 36 | public native boolean isOrganized(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/RandomSampleConsensus.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * RandomSampleConsensus represents an implementation of the RANSAC (RAndom SAmple Consensus) algorithm, as described in: 5 | * "Random Sample Consensus: A Paradigm for Model Fitting with Applications to Image Analysis and Automated Cartography", 6 | * Martin A. Fischler and Robert C. Bolles, Comm. Of the ACM 24: 381�395, June 1981. 7 | */ 8 | public class RandomSampleConsensus extends SampleConsensus { 9 | public RandomSampleConsensus(SampleConsensusModel model) { 10 | super(model); 11 | } 12 | 13 | @Override 14 | protected native void alloc(); 15 | 16 | @Override 17 | public native void dispose(); 18 | 19 | @Override 20 | public native boolean computeModel(int debugVerbosityLevel); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/SampleConsensus.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | import com.github.vmoglan.pcljava.jni.NativeObject; 4 | 5 | /** 6 | * SampleConsensus represents the base class. 7 | * All sample consensus methods must inherit from this class. 8 | */ 9 | public abstract class SampleConsensus extends NativeObject { 10 | SampleConsensusModel model; 11 | 12 | /** 13 | * @param model a sample consensus model 14 | */ 15 | public SampleConsensus(SampleConsensusModel model) { 16 | this.model = model; 17 | } 18 | 19 | @Override 20 | public void create() { 21 | if (getHandle() != 0) { 22 | dispose(); 23 | } 24 | 25 | alloc(); 26 | setSampleConsensusModel(model); 27 | } 28 | 29 | public SampleConsensusModel getSampleConsensusModel() { 30 | return model; 31 | } 32 | 33 | public void setSampleConsensusModel(SampleConsensusModel model) { 34 | this.model = model; 35 | nSetSampleConsensusModel(this.model); 36 | } 37 | 38 | private native void nSetSampleConsensusModel(SampleConsensusModel model); 39 | 40 | public native double getDistanceThreshold(); 41 | 42 | public native void setDistanceThreshold(double threshold); 43 | 44 | public native int getMaxIterations(); 45 | 46 | public native void setMaxIterations(int maxIterations); 47 | 48 | public native double getProbability(); 49 | 50 | public native void setProbability(double probability); 51 | 52 | public abstract boolean computeModel(int debugVerbosityLevel); 53 | 54 | public native boolean refineModel(double sigma, int maxIterations); 55 | 56 | /** 57 | * @return the best set of inliers found so far for this model. 58 | */ 59 | public PointCloud3d getInliers(PointCloud3d source) { 60 | PointCloud3d target = new PointCloud3d(); 61 | getInliers(source, target); 62 | return target; 63 | } 64 | 65 | private native void getInliers(PointCloud source, PointCloud target); 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/SampleConsensusModel.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | import com.github.vmoglan.pcljava.jni.NativeObject; 4 | 5 | /** 6 | * SampleConsensusModel represents the base model class. All sample consensus models must inherit from this class. 7 | */ 8 | public abstract class SampleConsensusModel extends NativeObject { 9 | private PointCloud3d input; 10 | 11 | public SampleConsensusModel(PointCloud3d cloud) { 12 | this.input = cloud; 13 | } 14 | 15 | @Override 16 | public void create() { 17 | if (getHandle() != 0) { 18 | dispose(); 19 | } 20 | 21 | alloc(); 22 | setInputCloud(input); 23 | } 24 | 25 | public native void setInputCloud(PointCloud3d cloud); 26 | 27 | /** 28 | * @return the size of a sample from which a model is computed. 29 | */ 30 | public native int getSampleSize(); 31 | 32 | /** 33 | * Compute the variance of the errors to the model from the internally estimated vector of distances. 34 | */ 35 | public native double computeVariance(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/SampleConsensusModelCone.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * SampleConsensusModelCone defines a model for 3D cone segmentation. 5 | * The model coefficients are defined as: 6 | * 7 | *
    8 | *
  • apex.x : the X coordinate of cone's apex
  • 9 | *
  • apex.y : the Y coordinate of cone's apex
  • 10 | *
  • apex.z : the Z coordinate of cone's apex
  • 11 | *
  • axis_direction.x : the X coordinate of the cone's axis direction
  • 12 | *
  • axis_direction.y : the Y coordinate of the cone's axis direction
  • 13 | *
  • axis_direction.z : the Z coordinate of the cone's axis direction
  • 14 | *
  • opening_angle : the cone's opening angle
  • 15 | *
16 | */ 17 | public class SampleConsensusModelCone extends SampleConsensusModel implements SampleConsensusModelFromNormals { 18 | public SampleConsensusModelCone(PointCloud3d cloud) { 19 | super(cloud); 20 | } 21 | 22 | @Override 23 | protected native void alloc(); 24 | 25 | @Override 26 | public native void dispose(); 27 | 28 | @Override 29 | public native double getNormalDistanceWeight(); 30 | 31 | @Override 32 | public native void setNormalDistanceWeight(double weight); 33 | 34 | @Override 35 | public NormalCloud getInputNormals() { 36 | NormalCloud normals = new NormalCloud(); 37 | getInputNormals(normals); 38 | return normals; 39 | } 40 | 41 | private native void getInputNormals(NormalCloud normals); 42 | 43 | @Override 44 | public native void setInputNormals(NormalCloud cloud); 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/SampleConsensusModelCylinder.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * SampleConsensusModelCylinder defines a model for 3D cylinder segmentation. 5 | * The model coefficients are defined as: 6 | * 7 | *
    8 | *
  • point_on_axis.x : the X coordinate of a point located on the cylinder axis
  • 9 | *
  • point_on_axis.y : the Y coordinate of a point located on the cylinder axis
  • 10 | *
  • point_on_axis.z : the Z coordinate of a point located on the cylinder axis
  • 11 | *
  • axis_direction.x : the X coordinate of the cylinder's axis direction
  • 12 | *
  • axis_direction.y : the Y coordinate of the cylinder's axis direction
  • 13 | *
  • axis_direction.z : the Z coordinate of the cylinder's axis direction
  • 14 | *
  • radius : the cylinder's radius
  • 15 | *
16 | */ 17 | public class SampleConsensusModelCylinder extends SampleConsensusModel implements SampleConsensusModelFromNormals { 18 | public SampleConsensusModelCylinder(PointCloud3d cloud) { 19 | super(cloud); 20 | } 21 | 22 | @Override 23 | protected native void alloc(); 24 | 25 | @Override 26 | public native void dispose(); 27 | 28 | @Override 29 | public native double getNormalDistanceWeight(); 30 | 31 | @Override 32 | public native void setNormalDistanceWeight(double weight); 33 | 34 | @Override 35 | public NormalCloud getInputNormals() { 36 | NormalCloud normals = new NormalCloud(); 37 | getInputNormals(normals); 38 | return normals; 39 | } 40 | 41 | private native void getInputNormals(NormalCloud normals); 42 | 43 | @Override 44 | public native void setInputNormals(NormalCloud cloud); 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/SampleConsensusModelFromNormals.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * SampleConsensusModelFromNormals represents the base model class for models that require the use of surface normals 5 | * for estimation. 6 | */ 7 | public interface SampleConsensusModelFromNormals { 8 | public double getNormalDistanceWeight(); 9 | 10 | public void setNormalDistanceWeight(double weight); 11 | 12 | public NormalCloud getInputNormals(); 13 | 14 | public void setInputNormals(NormalCloud cloud); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/SampleConsensusModelLine.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * SampleConsensusModelLine defines a model for 3D line segmentation. 5 | * 6 | * The model coefficients are defined as: 7 | * 8 | *
    9 | *
  • point_on_line.x : the X coordinate of a point on the line
  • 10 | *
  • point_on_line.y : the Y coordinate of a point on the line
  • 11 | *
  • point_on_line.z : the Z coordinate of a point on the line
  • 12 | *
  • line_direction.x : the X coordinate of a line's direction
  • 13 | *
  • line_direction.y : the Y coordinate of a line's direction
  • 14 | *
  • line_direction.z : the Z coordinate of a line's direction
  • 15 | *
16 | */ 17 | public class SampleConsensusModelLine extends SampleConsensusModel { 18 | public SampleConsensusModelLine(PointCloud3d cloud) { 19 | super(cloud); 20 | } 21 | 22 | @Override 23 | protected native void alloc(); 24 | 25 | @Override 26 | public native void dispose(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/SampleConsensusModelPlane.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * SampleConsensusModelPlane defines a model for 3D plane segmentation. 5 | * The model coefficients are defined as: 6 | * 7 | *
    8 | *
  • a : the X coordinate of the plane's normal (normalized)
  • 9 | *
  • b : the Y coordinate of the plane's normal (normalized)
  • 10 | *
  • c : the Z coordinate of the plane's normal (normalized)
  • 11 | *
  • d : the fourth Hessian component of the plane's equation
  • 12 | *
13 | */ 14 | public class SampleConsensusModelPlane extends SampleConsensusModel { 15 | public SampleConsensusModelPlane(PointCloud3d cloud) { 16 | super(cloud); 17 | } 18 | 19 | @Override 20 | protected native void alloc(); 21 | 22 | @Override 23 | public native void dispose(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/SampleConsensusModelSphere.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * SampleConsensusModelSphere defines a model for 3D sphere segmentation. 5 | * The model coefficients are defined as: 6 | * 7 | *
    8 | *
  • center.x : the X coordinate of the sphere's center
  • 9 | *
  • center.y : the Y coordinate of the sphere's center
  • 10 | *
  • center.z : the Z coordinate of the sphere's center
  • 11 | *
12 | */ 13 | public class SampleConsensusModelSphere extends SampleConsensusModel { 14 | public SampleConsensusModelSphere(PointCloud3d cloud) { 15 | super(cloud); 16 | } 17 | 18 | @Override 19 | protected native void alloc(); 20 | 21 | @Override 22 | public native void dispose(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/SampleConsensusModelStick.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava; 2 | 3 | /** 4 | * 5 | * SampleConsensusModelStick defines a model for 3D stick segmentation. 6 | * A stick is a line with an user given minimum/maximum width. The model coefficients are defined as: 7 | * 8 | *
    9 | *
  • point_on_line.x : the X coordinate of a point on the line
  • 10 | *
  • point_on_line.y : the Y coordinate of a point on the line
  • 11 | *
  • point_on_line.z : the Z coordinate of a point on the line
  • 12 | *
  • line_direction.x : the X coordinate of a line's direction
  • 13 | *
  • line_direction.y : the Y coordinate of a line's direction
  • 14 | *
  • line_direction.z : the Z coordinate of a line's direction
  • 15 | *
  • line_width : the width of the line 16 | *
17 | */ 18 | public class SampleConsensusModelStick extends SampleConsensusModel { 19 | public SampleConsensusModelStick(PointCloud3d cloud) { 20 | super(cloud); 21 | } 22 | 23 | @Override 24 | protected native void alloc(); 25 | 26 | @Override 27 | public native void dispose(); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/io/PointCloud3dReaderPcd.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava.io; 2 | 3 | import com.github.vmoglan.pcljava.Point3d; 4 | import com.github.vmoglan.pcljava.PointCloud3d; 5 | 6 | public class PointCloud3dReaderPcd extends PointCloudReader { 7 | @Override 8 | protected PointCloud3d createPointCloud() { 9 | return new PointCloud3d(); 10 | } 11 | 12 | protected final native void read(String path, PointCloud3d cloud); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/io/PointCloud3dReaderPly.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava.io; 2 | 3 | import com.github.vmoglan.pcljava.Point3d; 4 | import com.github.vmoglan.pcljava.PointCloud3d; 5 | 6 | public class PointCloud3dReaderPly extends PointCloudReader { 7 | @Override 8 | protected PointCloud3d createPointCloud() { 9 | return new PointCloud3d(); 10 | } 11 | 12 | protected final native void read(String path, PointCloud3d cloud); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/io/PointCloud3dWriterPcd.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava.io; 2 | 3 | import com.github.vmoglan.pcljava.Point3d; 4 | import com.github.vmoglan.pcljava.PointCloud; 5 | 6 | public class PointCloud3dWriterPcd implements PointCloudWriter { 7 | public native void write(PointCloud cloud, String path, boolean binaryMode); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/io/PointCloud3dWriterPly.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava.io; 2 | 3 | import com.github.vmoglan.pcljava.Point3d; 4 | import com.github.vmoglan.pcljava.PointCloud; 5 | 6 | public class PointCloud3dWriterPly implements PointCloudWriter { 7 | public native void write(PointCloud cloud, String path, boolean binaryMode); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/io/PointCloudReader.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava.io; 2 | 3 | import com.github.vmoglan.pcljava.Point; 4 | import com.github.vmoglan.pcljava.PointCloud; 5 | 6 | public abstract class PointCloudReader

> { 7 | public final T read(String path) { 8 | var cloud = createPointCloud(); 9 | cloud.create(); 10 | read(path, cloud); 11 | return cloud; 12 | } 13 | 14 | protected abstract T createPointCloud(); 15 | 16 | protected abstract void read(String path, T cloud); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/io/PointCloudWriter.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava.io; 2 | 3 | import com.github.vmoglan.pcljava.Point; 4 | import com.github.vmoglan.pcljava.PointCloud; 5 | 6 | public interface PointCloudWriter { 7 | void write(PointCloud cloud, String path, boolean binaryMode); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/jni/NativeObject.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava.jni; 2 | 3 | /** 4 | * Base for every class that features native methods. 5 | */ 6 | public abstract class NativeObject { 7 | private long handle; 8 | 9 | public NativeObject() { 10 | this.handle = 0; 11 | } 12 | 13 | /** 14 | * @return the memory address of the native object associated 15 | * with the Java instance. 16 | */ 17 | public long getHandle() { return handle; } 18 | 19 | public void create() { 20 | if (handle != 0) { 21 | dispose(); 22 | } 23 | 24 | alloc(); 25 | } 26 | 27 | /** 28 | * Allocates memory for a new object and assigns its memory address 29 | * to the handle field; meant to be implemented as a native method. 30 | */ 31 | protected abstract void alloc(); 32 | 33 | /* 34 | * Frees the memory at the address stored within the handle field; 35 | * meant to be implemented as a native method. 36 | */ 37 | public abstract void dispose(); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/visualization/Visualizer.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava.visualization; 2 | 3 | import com.github.vmoglan.pcljava.NormalCloud; 4 | import com.github.vmoglan.pcljava.Point; 5 | import com.github.vmoglan.pcljava.PointCloud; 6 | import com.github.vmoglan.pcljava.jni.NativeObject; 7 | 8 | public abstract class Visualizer extends NativeObject { 9 | @Override 10 | protected native void alloc(); 11 | 12 | @Override 13 | public native void dispose(); 14 | 15 | /** 16 | * Stop the interaction and close the visualizaton window. 17 | */ 18 | public native void close(); 19 | 20 | /** 21 | * @return true when the user tried to close the window. 22 | */ 23 | public native boolean wasStopped(); 24 | 25 | /** 26 | * Create a new viewport from (xMin,yMin) to (xMax,yMax). 27 | * 28 | * @param xMin the minimum X coordinate for the viewport (0.0 lesser or equal to 1.0) 29 | * @param yMin the minimum Y coordinate for the viewport (0.0 lesser or equal 1.0) 30 | * @param xMax the maximum X coordinate for the viewport (0.0 lesser or equal 1.0) 31 | * @param yMax the maximum Y coordinate for the viewport (0.0 lesser or equal 1.0) 32 | * @param viewport the id of the new viewport 33 | */ 34 | public native void createViewport(double xMin, double yMin, double xMax, double yMax, int viewport); 35 | 36 | /** 37 | * Calls the interactor and runs an internal loop. 38 | */ 39 | public native void spin(); 40 | 41 | /** 42 | * Calls the interactor and runs an internal loop. 43 | * 44 | * @param time How long (in ms) should the visualization loop be allowed to run. 45 | * @param forceRedraw if false it might return without doing anything if the interactor's framerate does not require a redraw yet. 46 | */ 47 | public native void spinOnce(int time, boolean forceRedraw); 48 | 49 | public native void setWindowName(String name); 50 | 51 | public native void setBackgroundColor(float r, float g, float b); 52 | 53 | /** 54 | * Adds point cloud to viewport. 55 | * 56 | * @param cloud the input cloud. 57 | * @param id is the id of the cloud 58 | * @param viewport is the viewport the cloud should be added to 59 | * @return true if the cloud has been succesfully added. 60 | */ 61 | public abstract boolean addPointCloud(PointCloud cloud, String id, int viewport); 62 | 63 | public native boolean removePointCloud(String id, int viewport); 64 | 65 | public native boolean removeAllPointClouds(int viewport); 66 | 67 | /** 68 | * Add the estimated surface normals of a Point Cloud to screen. 69 | * 70 | * @param cloud the input point cloud dataset containing the XYZ data 71 | * @param normals the input point cloud dataset containing the normal data 72 | * @param level display only every level'th point (default: 100) 73 | * @param scale the normal arrow scale (default: 0.02m) 74 | * @param id the point cloud object id (default: cloud) 75 | * @param viewport the view port where the Point Cloud should be added (default: all) 76 | * @return true if the cloud has been successfully added 77 | */ 78 | public abstract boolean addPointCloudNormals(PointCloud cloud, 79 | NormalCloud normals, 80 | int level, 81 | float scale, 82 | String id, 83 | int viewport); 84 | 85 | /** 86 | * Adds 3D axes describing a coordinate system to screen at 0,0,0. 87 | * 88 | * @param scale the scale of the axes (default: 1) 89 | * @param id the coordinate system id 90 | * @param viewport the view port where the 3D axes should be added (default: all) 91 | */ 92 | public native void addCoordinateSystem(double scale, String id, int viewport); 93 | 94 | /** 95 | * Adds 3D axes describing a coordinate system to screen at 0,0,0. 96 | * 97 | * @param scale the scale of the axes (default: 1) 98 | * @param x the X position of the axes 99 | * @param y the Y position of the axes 100 | * @param z the Z position of the axes 101 | * @param id the coordinate system id 102 | * @param viewport the view port where the 3D axes should be added (default: all) 103 | */ 104 | public native void addCoordinateSystem(double scale, float x, float y, float z, String id, int viewport); 105 | 106 | /** 107 | * Removes coordinate system from viewport. 108 | * 109 | * @param id is the id of the coordinate system 110 | * @param viewport the viewport to remove the coordinate system from. 111 | */ 112 | public native void removeCoordinateSystem(String id, int viewport); 113 | 114 | /** 115 | * Removes all existing 3D axes (coordinate systems). 116 | * 117 | * @param viewport view port where the 3D axes should be removed from (default: all) 118 | */ 119 | public native void removeAllCoordinateSystems(int viewport); 120 | 121 | /** 122 | * Add a text to screen. 123 | * 124 | * @param text the text to add 125 | * @param xPosition the X position on screen where the text should be added 126 | * @param yPosition the Y position on screen where the text should be added 127 | * @param id the text object id (default: equal to the "text" parameter) 128 | * @param viewport the view port (default: all) 129 | */ 130 | public native boolean addText(String text, int xPosition, int yPosition, String id, int viewport); 131 | 132 | /** 133 | * Add a text to screen. 134 | * 135 | * @param text the text to add 136 | * @param xPosition the X position on screen where the text should be added 137 | * @param yPosition the Y position on screen where the text should be added 138 | * @param r the red color value 139 | * @param g the green color value 140 | * @param b the blue color value 141 | * @param id the text object id (default: equal to the "text" parameter) 142 | * @param viewport the view port (default: all) 143 | */ 144 | public native boolean addText(String text, int xPosition, int yPosition, double r, double g, double b, String id, int viewport); 145 | 146 | /** 147 | * Add a text to screen. 148 | * 149 | * @param text the text to add 150 | * @param xPosition the X position on screen where the text should be added 151 | * @param yPosition the Y position on screen where the text should be added 152 | * @param fontSize the font size of the text 153 | * @param r the red color value 154 | * @param g the green color value 155 | * @param b the blue color value 156 | * @param id the text object id (default: equal to the "text" parameter) 157 | * @param viewport the view port (default: all) 158 | */ 159 | public native boolean addText(String text, 160 | int xPosition, 161 | int yPosition, 162 | int fontSize, 163 | double r, 164 | double g, 165 | double b, 166 | String id, 167 | int viewport); 168 | 169 | public native void setPointSize(int size, String id); 170 | 171 | /** 172 | * Initialize camera parameters with some default values. 173 | */ 174 | public native void initCameraParameters(); 175 | } 176 | -------------------------------------------------------------------------------- /src/main/java/com/github/vmoglan/pcljava/visualization/Visualizer3d.java: -------------------------------------------------------------------------------- 1 | package com.github.vmoglan.pcljava.visualization; 2 | 3 | import com.github.vmoglan.pcljava.NormalCloud; 4 | import com.github.vmoglan.pcljava.Point3d; 5 | import com.github.vmoglan.pcljava.PointCloud; 6 | 7 | public class Visualizer3d extends Visualizer { 8 | @Override 9 | public native boolean addPointCloud(PointCloud cloud, String id, int viewport); 10 | 11 | @Override 12 | public native boolean addPointCloudNormals(PointCloud cloud, 13 | NormalCloud normals, 14 | int level, 15 | float scale, 16 | String id, 17 | int viewport); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/native/.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ -------------------------------------------------------------------------------- /src/main/native/SharedPointerWrapper.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "handle.h" 5 | 6 | #ifndef _Included_SharedPointerWrapper 7 | #define _Included_SharedPointerWrapper 8 | 9 | /** 10 | * Using smart pointers associated with Java objects within JNI calls 11 | * does not work, since the memory they point to is freed at the end 12 | * of the call. This class is used for wrapping a smart pointer to 13 | * ensure that the memory pointed to is kept alive until it is disposed 14 | * within the Java code. 15 | */ 16 | template 17 | class SharedPointerWrapper 18 | { 19 | private: 20 | std::shared_ptr pointer; 21 | 22 | public: 23 | template 24 | explicit SharedPointerWrapper(ARGS... a) 25 | { 26 | this->pointer = std::make_shared(a...); 27 | } 28 | 29 | explicit SharedPointerWrapper(std::shared_ptr pointer) 30 | { 31 | this->pointer = pointer; 32 | } 33 | 34 | virtual ~SharedPointerWrapper() noexcept = default; 35 | 36 | void setPointer(std::shared_ptr pointer) 37 | { 38 | this.pointer = pointer; 39 | } 40 | 41 | /** 42 | * Sets this as the memory handle for a Java object. 43 | */ 44 | void instantiate(JNIEnv *env, jobject obj) 45 | { 46 | setHandle(env, obj, this); 47 | } 48 | 49 | /** 50 | * @return the pointer to this wrapper as a jlong. 51 | */ 52 | jlong instance() 53 | { 54 | return std::reinterpret_pointer_cast(this); 55 | } 56 | 57 | std::shared_ptr getPointer() const 58 | { 59 | return pointer; 60 | } 61 | 62 | /** 63 | * @param env The JNI environment. 64 | * @param javaInstance The Java object. 65 | * @return the smart pointer associated with a Java object within a JNI environment. 66 | */ 67 | static std::shared_ptr getPointer(JNIEnv *env, jobject javaInstance) 68 | { 69 | return getWrapper(env, javaInstance)->getPointer(); 70 | } 71 | 72 | /** 73 | * @param env The JNI environment. 74 | * @param javaInstance The Java object. 75 | * @return the pointer to the smart pointer wrapper associated with a Java object within a JNI environment. 76 | */ 77 | static SharedPointerWrapper *getWrapper(JNIEnv *env, jobject javaInstance) 78 | { 79 | return getHandle>(env, javaInstance); 80 | } 81 | 82 | /** 83 | * Frees the memory pointed to by the wrapped smart pointer. 84 | * 85 | * @param env The JNI environment. 86 | * @param javaInstance The Java object. 87 | */ 88 | static void dispose(JNIEnv *env, jobject javaInstance) 89 | { 90 | auto wrapper = getWrapper(env, javaInstance); 91 | delete wrapper; 92 | setHandle>(env, javaInstance, nullptr); 93 | } 94 | }; 95 | 96 | #endif -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_Normal.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_Normal.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | void Java_com_github_vmoglan_pcljava_Normal_alloc(JNIEnv *env, jobject obj) 7 | { 8 | auto normal = new pcl::Normal(); 9 | setHandle(env, obj, normal); 10 | } 11 | 12 | void Java_com_github_vmoglan_pcljava_Normal_dispose(JNIEnv *env, jobject obj) 13 | { 14 | pcl::Normal *normal = getHandle(env, obj); 15 | delete normal; 16 | setHandle(env, obj, nullptr); 17 | } 18 | 19 | jfloat Java_com_github_vmoglan_pcljava_Normal_getX(JNIEnv *env, jobject obj) 20 | { 21 | return getHandle(env, obj)->normal_x; 22 | } 23 | 24 | void Java_com_github_vmoglan_pcljava_Normal_setX(JNIEnv *env, jobject obj, jfloat x) 25 | { 26 | getHandle(env, obj)->normal_x = x; 27 | } 28 | 29 | jfloat Java_com_github_vmoglan_pcljava_Normal_getY(JNIEnv *env, jobject obj) 30 | { 31 | return getHandle(env, obj)->normal_y; 32 | } 33 | 34 | void Java_com_github_vmoglan_pcljava_Normal_setY(JNIEnv *env, jobject obj, jfloat y) 35 | { 36 | getHandle(env, obj)->normal_y = y; 37 | } 38 | 39 | jfloat Java_com_github_vmoglan_pcljava_Normal_getZ(JNIEnv *env, jobject obj) 40 | { 41 | return getHandle(env, obj)->normal_z; 42 | } 43 | 44 | void Java_com_github_vmoglan_pcljava_Normal_setZ(JNIEnv *env, jobject obj, jfloat z) 45 | { 46 | getHandle(env, obj)->normal_z = z; 47 | } 48 | 49 | jfloat Java_com_github_vmoglan_pcljava_Normal_getCurvature(JNIEnv *env, jobject obj) 50 | { 51 | return getHandle(env, obj)->curvature; 52 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_Normal.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_Normal */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_Normal 6 | #define _Included_com_github_vmoglan_pcljava_Normal 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_Normal 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Normal_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_Normal 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Normal_dispose(JNIEnv *, jobject); 23 | 24 | /* 25 | * Class: com_github_vmoglan_pcljava_Normal 26 | * Method: getX 27 | * Signature: ()F 28 | */ 29 | JNIEXPORT jfloat JNICALL Java_com_github_vmoglan_pcljava_Normal_getX(JNIEnv *, jobject); 30 | 31 | /* 32 | * Class: com_github_vmoglan_pcljava_Normal 33 | * Method: setX 34 | * Signature: (F)V 35 | */ 36 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Normal_setX(JNIEnv *, jobject, jfloat); 37 | 38 | /* 39 | * Class: com_github_vmoglan_pcljava_Normal 40 | * Method: getY 41 | * Signature: ()F 42 | */ 43 | JNIEXPORT jfloat JNICALL Java_com_github_vmoglan_pcljava_Normal_getY(JNIEnv *, jobject); 44 | 45 | /* 46 | * Class: com_github_vmoglan_pcljava_Normal 47 | * Method: setY 48 | * Signature: (F)V 49 | */ 50 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Normal_setY(JNIEnv *, jobject, jfloat); 51 | 52 | /* 53 | * Class: com_github_vmoglan_pcljava_Normal 54 | * Method: getZ 55 | * Signature: ()F 56 | */ 57 | JNIEXPORT jfloat JNICALL Java_com_github_vmoglan_pcljava_Normal_getZ(JNIEnv *, jobject); 58 | 59 | /* 60 | * Class: com_github_vmoglan_pcljava_Normal 61 | * Method: setZ 62 | * Signature: (F)V 63 | */ 64 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Normal_setZ(JNIEnv *, jobject, jfloat); 65 | 66 | /* 67 | * Class: com_github_vmoglan_pcljava_Normal 68 | * Method: getCurvature 69 | * Signature: ()F 70 | */ 71 | JNIEXPORT jfloat JNICALL Java_com_github_vmoglan_pcljava_Normal_getCurvature(JNIEnv *, jobject); 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | #endif 77 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_NormalCloud.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_NormalCloud.h" 2 | #include "SharedPointerWrapper.h" 3 | #include "handle.h" 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | using NormalCloud = pcl::PointCloud; 11 | 12 | void Java_com_github_vmoglan_pcljava_NormalCloud_alloc(JNIEnv *env, jobject obj) 13 | { 14 | auto wrapper = new SharedPointerWrapper(); 15 | wrapper->instantiate(env, obj); 16 | } 17 | 18 | void Java_com_github_vmoglan_pcljava_NormalCloud_dispose(JNIEnv *env, jobject obj) 19 | { 20 | SharedPointerWrapper::dispose(env, obj); 21 | } 22 | 23 | void Java_com_github_vmoglan_pcljava_NormalCloud_at(JNIEnv *env, jobject obj, jint i, jobject point) 24 | { 25 | NormalCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, obj); 26 | setHandle(env, point, &(cloud->at(i))); 27 | } 28 | 29 | void Java_com_github_vmoglan_pcljava_NormalCloud_add(JNIEnv *env, jobject obj, jobject point) 30 | { 31 | NormalCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, obj); 32 | cloud->push_back(*getHandle(env, point)); 33 | } 34 | 35 | void Java_com_github_vmoglan_pcljava_NormalCloud_remove(JNIEnv *env, jobject obj, jobject point) 36 | { 37 | throw std::runtime_error("Not yet implemented."); 38 | } 39 | 40 | void Java_com_github_vmoglan_pcljava_NormalCloud_clear(JNIEnv *env, jobject obj) 41 | { 42 | NormalCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, obj); 43 | 44 | cloud->clear(); 45 | } 46 | 47 | jint Java_com_github_vmoglan_pcljava_NormalCloud_size(JNIEnv *env, jobject obj) 48 | { 49 | NormalCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, obj); 50 | 51 | return cloud->size(); 52 | } 53 | 54 | jboolean Java_com_github_vmoglan_pcljava_NormalCloud_isOrganized(JNIEnv *env, jobject obj) 55 | { 56 | NormalCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, obj); 57 | bool isOrganized = cloud->isOrganized(); 58 | 59 | return isOrganized; 60 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_NormalCloud.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_NormalCloud */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_NormalCloud 6 | #define _Included_com_github_vmoglan_pcljava_NormalCloud 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_NormalCloud 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_NormalCloud_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_NormalCloud 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_NormalCloud_dispose(JNIEnv *, jobject); 23 | 24 | /* 25 | * Class: com_github_vmoglan_pcljava_NormalCloud 26 | * Method: at 27 | * Signature: (ILcom/github/vmoglan/pcljava/Normal;)V 28 | */ 29 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_NormalCloud_at(JNIEnv *, jobject, jint, jobject); 30 | 31 | /* 32 | * Class: com_github_vmoglan_pcljava_NormalCloud 33 | * Method: add 34 | * Signature: (Lcom/github/vmoglan/pcljava/Normal;)V 35 | */ 36 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_NormalCloud_add(JNIEnv *, jobject, jobject); 37 | 38 | /* 39 | * Class: com_github_vmoglan_pcljava_NormalCloud 40 | * Method: remove 41 | * Signature: (Lcom/github/vmoglan/pcljava/Normal;)V 42 | */ 43 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_NormalCloud_remove(JNIEnv *, jobject, jobject); 44 | 45 | /* 46 | * Class: com_github_vmoglan_pcljava_NormalCloud 47 | * Method: clear 48 | * Signature: ()V 49 | */ 50 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_NormalCloud_clear(JNIEnv *, jobject); 51 | 52 | /* 53 | * Class: com_github_vmoglan_pcljava_NormalCloud 54 | * Method: size 55 | * Signature: ()I 56 | */ 57 | JNIEXPORT jint JNICALL Java_com_github_vmoglan_pcljava_NormalCloud_size(JNIEnv *, jobject); 58 | 59 | /* 60 | * Class: com_github_vmoglan_pcljava_NormalCloud 61 | * Method: isOrganized 62 | * Signature: ()Z 63 | */ 64 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_NormalCloud_isOrganized(JNIEnv *, jobject); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | #endif 70 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_NormalEstimation.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_NormalEstimation.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | #include 6 | 7 | using PointCloud = pcl::PointCloud; 8 | using NormalEstimation = pcl::NormalEstimation; 9 | using KdTree = pcl::search::KdTree; 10 | 11 | void Java_com_github_vmoglan_pcljava_NormalEstimation_compute(JNIEnv *env, jobject obj, jobject input, jfloat radiusSearch, jobject output) 12 | { 13 | NormalEstimation normalEstimation; 14 | 15 | PointCloud::Ptr cloud(SharedPointerWrapper::getPointer(env, input)); 16 | normalEstimation.setInputCloud(cloud); 17 | 18 | KdTree::Ptr tree(new KdTree()); 19 | normalEstimation.setSearchMethod(tree); 20 | 21 | normalEstimation.setRadiusSearch(radiusSearch); 22 | 23 | auto wrapper = new SharedPointerWrapper>(); 24 | wrapper->instantiate(env, output); 25 | 26 | normalEstimation.compute(*wrapper->getPointer()); 27 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_NormalEstimation.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_NormalEstimation */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_NormalEstimation 6 | #define _Included_com_github_vmoglan_pcljava_NormalEstimation 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_NormalEstimation 12 | * Method: compute 13 | * Signature: (Lcom/github/vmoglan/pcljava/PointCloud3d;FLcom/github/vmoglan/pcljava/NormalCloud;)V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_NormalEstimation_compute(JNIEnv *, jobject, jobject, jfloat, jobject); 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | #endif 21 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_Point2d.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_Point2d.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | void Java_com_github_vmoglan_pcljava_Point2d_alloc(JNIEnv *env, jobject obj) 7 | { 8 | auto point = new pcl::PointXY(); 9 | setHandle(env, obj, point); 10 | } 11 | 12 | void Java_com_github_vmoglan_pcljava_Point2d_dispose(JNIEnv *env, jobject obj) 13 | { 14 | pcl::PointXY *point = getHandle(env, obj); 15 | delete point; 16 | setHandle(env, obj, nullptr); 17 | } 18 | 19 | jfloat Java_com_github_vmoglan_pcljava_Point2d_getX(JNIEnv *env, jobject obj) 20 | { 21 | return getHandle(env, obj)->x; 22 | } 23 | 24 | void Java_com_github_vmoglan_pcljava_Point2d_setX(JNIEnv *env, jobject obj, jfloat x) 25 | { 26 | getHandle(env, obj)->x = x; 27 | } 28 | 29 | jfloat Java_com_github_vmoglan_pcljava_Point2d_getY(JNIEnv *env, jobject obj) 30 | { 31 | return getHandle(env, obj)->y; 32 | } 33 | 34 | void Java_com_github_vmoglan_pcljava_Point2d_setY(JNIEnv *env, jobject obj, jfloat y) 35 | { 36 | getHandle(env, obj)->y = y; 37 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_Point2d.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_Point2d */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_Point2d 6 | #define _Included_com_github_vmoglan_pcljava_Point2d 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_Point2d 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point2d_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_Point2d 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point2d_dispose(JNIEnv *, jobject); 23 | 24 | /* 25 | * Class: com_github_vmoglan_pcljava_Point2d 26 | * Method: getX 27 | * Signature: ()F 28 | */ 29 | JNIEXPORT jfloat JNICALL Java_com_github_vmoglan_pcljava_Point2d_getX(JNIEnv *, jobject); 30 | 31 | /* 32 | * Class: com_github_vmoglan_pcljava_Point2d 33 | * Method: setX 34 | * Signature: (F)V 35 | */ 36 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point2d_setX(JNIEnv *, jobject, jfloat); 37 | 38 | /* 39 | * Class: com_github_vmoglan_pcljava_Point2d 40 | * Method: getY 41 | * Signature: ()F 42 | */ 43 | JNIEXPORT jfloat JNICALL Java_com_github_vmoglan_pcljava_Point2d_getY(JNIEnv *, jobject); 44 | 45 | /* 46 | * Class: com_github_vmoglan_pcljava_Point2d 47 | * Method: setY 48 | * Signature: (F)V 49 | */ 50 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point2d_setY(JNIEnv *, jobject, jfloat); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif 56 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_Point3d.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_Point3d.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | void Java_com_github_vmoglan_pcljava_Point3d_alloc(JNIEnv *env, jobject obj) 7 | { 8 | auto point = new pcl::PointXYZRGB(); 9 | setHandle(env, obj, point); 10 | } 11 | 12 | void Java_com_github_vmoglan_pcljava_Point3d_dispose(JNIEnv *env, jobject obj) 13 | { 14 | pcl::PointXYZRGB *point = getHandle(env, obj); 15 | delete point; 16 | setHandle(env, obj, nullptr); 17 | } 18 | 19 | jfloat Java_com_github_vmoglan_pcljava_Point3d_getX(JNIEnv *env, jobject obj) 20 | { 21 | return getHandle(env, obj)->x; 22 | } 23 | 24 | void Java_com_github_vmoglan_pcljava_Point3d_setX(JNIEnv *env, jobject obj, jfloat x) 25 | { 26 | getHandle(env, obj)->x = x; 27 | } 28 | 29 | jfloat Java_com_github_vmoglan_pcljava_Point3d_getY(JNIEnv *env, jobject obj) 30 | { 31 | return getHandle(env, obj)->y; 32 | } 33 | 34 | void Java_com_github_vmoglan_pcljava_Point3d_setY(JNIEnv *env, jobject obj, jfloat y) 35 | { 36 | getHandle(env, obj)->y = y; 37 | } 38 | 39 | jfloat Java_com_github_vmoglan_pcljava_Point3d_getZ(JNIEnv *env, jobject obj) 40 | { 41 | return getHandle(env, obj)->z; 42 | } 43 | 44 | void Java_com_github_vmoglan_pcljava_Point3d_setZ(JNIEnv *env, jobject obj, jfloat z) 45 | { 46 | getHandle(env, obj)->z = z; 47 | } 48 | 49 | jshort Java_com_github_vmoglan_pcljava_Point3d_getR(JNIEnv *env, jobject obj) 50 | { 51 | return getHandle(env, obj)->r; 52 | } 53 | 54 | void Java_com_github_vmoglan_pcljava_Point3d_setR(JNIEnv *env, jobject obj, jshort r) 55 | { 56 | getHandle(env, obj)->r = (uint8_t)r; 57 | } 58 | 59 | jshort Java_com_github_vmoglan_pcljava_Point3d_getG(JNIEnv *env, jobject obj) 60 | { 61 | return getHandle(env, obj)->g; 62 | } 63 | 64 | void Java_com_github_vmoglan_pcljava_Point3d_setG(JNIEnv *env, jobject obj, jshort g) 65 | { 66 | getHandle(env, obj)->g = (uint8_t)g; 67 | } 68 | 69 | jshort Java_com_github_vmoglan_pcljava_Point3d_getB(JNIEnv *env, jobject obj) 70 | { 71 | return getHandle(env, obj)->b; 72 | } 73 | 74 | void Java_com_github_vmoglan_pcljava_Point3d_setB(JNIEnv *env, jobject obj, jshort b) 75 | { 76 | getHandle(env, obj)->b = (uint8_t)b; 77 | } 78 | 79 | jfloat Java_com_github_vmoglan_pcljava_Point3d_getRGB(JNIEnv *env, jobject obj) 80 | { 81 | return getHandle(env, obj)->rgb; 82 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_Point3d.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_Point3d */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_Point3d 6 | #define _Included_com_github_vmoglan_pcljava_Point3d 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_Point3d 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point3d_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_Point3d 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point3d_dispose(JNIEnv *, jobject); 23 | 24 | /* 25 | * Class: com_github_vmoglan_pcljava_Point3d 26 | * Method: getX 27 | * Signature: ()F 28 | */ 29 | JNIEXPORT jfloat JNICALL Java_com_github_vmoglan_pcljava_Point3d_getX(JNIEnv *, jobject); 30 | 31 | /* 32 | * Class: com_github_vmoglan_pcljava_Point3d 33 | * Method: setX 34 | * Signature: (F)V 35 | */ 36 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point3d_setX(JNIEnv *, jobject, jfloat); 37 | 38 | /* 39 | * Class: com_github_vmoglan_pcljava_Point3d 40 | * Method: getY 41 | * Signature: ()F 42 | */ 43 | JNIEXPORT jfloat JNICALL Java_com_github_vmoglan_pcljava_Point3d_getY(JNIEnv *, jobject); 44 | 45 | /* 46 | * Class: com_github_vmoglan_pcljava_Point3d 47 | * Method: setY 48 | * Signature: (F)V 49 | */ 50 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point3d_setY(JNIEnv *, jobject, jfloat); 51 | 52 | /* 53 | * Class: com_github_vmoglan_pcljava_Point3d 54 | * Method: getZ 55 | * Signature: ()F 56 | */ 57 | JNIEXPORT jfloat JNICALL Java_com_github_vmoglan_pcljava_Point3d_getZ(JNIEnv *, jobject); 58 | 59 | /* 60 | * Class: com_github_vmoglan_pcljava_Point3d 61 | * Method: setZ 62 | * Signature: (F)V 63 | */ 64 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point3d_setZ(JNIEnv *, jobject, jfloat); 65 | 66 | /* 67 | * Class: com_github_vmoglan_pcljava_Point3d 68 | * Method: getR 69 | * Signature: ()S 70 | */ 71 | JNIEXPORT jshort JNICALL Java_com_github_vmoglan_pcljava_Point3d_getR(JNIEnv *, jobject); 72 | 73 | /* 74 | * Class: com_github_vmoglan_pcljava_Point3d 75 | * Method: setR 76 | * Signature: (S)V 77 | */ 78 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point3d_setR(JNIEnv *, jobject, jshort); 79 | 80 | /* 81 | * Class: com_github_vmoglan_pcljava_Point3d 82 | * Method: getG 83 | * Signature: ()S 84 | */ 85 | JNIEXPORT jshort JNICALL Java_com_github_vmoglan_pcljava_Point3d_getG(JNIEnv *, jobject); 86 | 87 | /* 88 | * Class: com_github_vmoglan_pcljava_Point3d 89 | * Method: setG 90 | * Signature: (S)V 91 | */ 92 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point3d_setG(JNIEnv *, jobject, jshort); 93 | 94 | /* 95 | * Class: com_github_vmoglan_pcljava_Point3d 96 | * Method: getB 97 | * Signature: ()S 98 | */ 99 | JNIEXPORT jshort JNICALL Java_com_github_vmoglan_pcljava_Point3d_getB(JNIEnv *, jobject); 100 | 101 | /* 102 | * Class: com_github_vmoglan_pcljava_Point3d 103 | * Method: setB 104 | * Signature: (S)V 105 | */ 106 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_Point3d_setB(JNIEnv *, jobject, jshort); 107 | 108 | /* 109 | * Class: com_github_vmoglan_pcljava_Point3d 110 | * Method: getRGB 111 | * Signature: ()F 112 | */ 113 | JNIEXPORT jfloat JNICALL Java_com_github_vmoglan_pcljava_Point3d_getRGB(JNIEnv *, jobject); 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | #endif 119 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_PointCloud3d.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_PointCloud3d.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | using PointCloud = pcl::PointCloud; 10 | 11 | void Java_com_github_vmoglan_pcljava_PointCloud3d_alloc(JNIEnv *env, jobject obj) 12 | { 13 | auto wrapper = new SharedPointerWrapper(); 14 | wrapper->instantiate(env, obj); 15 | } 16 | 17 | void Java_com_github_vmoglan_pcljava_PointCloud3d_dispose(JNIEnv *env, jobject obj) 18 | { 19 | SharedPointerWrapper::dispose(env, obj); 20 | } 21 | 22 | void Java_com_github_vmoglan_pcljava_PointCloud3d_at(JNIEnv *env, jobject obj, jint i, jobject point) 23 | { 24 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, obj); 25 | setHandle(env, point, &(cloud->at(i))); 26 | } 27 | 28 | void Java_com_github_vmoglan_pcljava_PointCloud3d_add(JNIEnv *env, jobject obj, jobject point) 29 | { 30 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, obj); 31 | cloud->push_back(*getHandle(env, point)); 32 | } 33 | 34 | void Java_com_github_vmoglan_pcljava_PointCloud3d_remove(JNIEnv *env, jobject obj, jobject point) 35 | { 36 | throw std::runtime_error("Not yet implemented."); 37 | } 38 | 39 | void Java_com_github_vmoglan_pcljava_PointCloud3d_clear(JNIEnv *env, jobject obj) 40 | { 41 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, obj); 42 | cloud->clear(); 43 | } 44 | 45 | jint Java_com_github_vmoglan_pcljava_PointCloud3d_size(JNIEnv *env, jobject obj) 46 | { 47 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, obj); 48 | return cloud->size(); 49 | } 50 | 51 | jboolean Java_com_github_vmoglan_pcljava_PointCloud3d_isOrganized(JNIEnv *env, jobject obj) 52 | { 53 | auto cloud = SharedPointerWrapper::getPointer(env, obj); 54 | bool isOrganized = cloud->isOrganized(); 55 | return isOrganized; 56 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_PointCloud3d.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_PointCloud3d */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_PointCloud3d 6 | #define _Included_com_github_vmoglan_pcljava_PointCloud3d 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_PointCloud3d 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_PointCloud3d_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_PointCloud3d 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_PointCloud3d_dispose(JNIEnv *, jobject); 23 | 24 | /* 25 | * Class: com_github_vmoglan_pcljava_PointCloud3d 26 | * Method: at 27 | * Signature: (ILcom/github/vmoglan/pcljava/Point3d;)V 28 | */ 29 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_PointCloud3d_at(JNIEnv *, jobject, jint, jobject); 30 | 31 | /* 32 | * Class: com_github_vmoglan_pcljava_PointCloud3d 33 | * Method: add 34 | * Signature: (Lcom/github/vmoglan/pcljava/Point3d;)V 35 | */ 36 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_PointCloud3d_add(JNIEnv *, jobject, jobject); 37 | 38 | /* 39 | * Class: com_github_vmoglan_pcljava_PointCloud3d 40 | * Method: remove 41 | * Signature: (Lcom/github/vmoglan/pcljava/Point3d;)V 42 | */ 43 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_PointCloud3d_remove(JNIEnv *, jobject, jobject); 44 | 45 | /* 46 | * Class: com_github_vmoglan_pcljava_PointCloud3d 47 | * Method: clear 48 | * Signature: ()V 49 | */ 50 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_PointCloud3d_clear(JNIEnv *, jobject); 51 | 52 | /* 53 | * Class: com_github_vmoglan_pcljava_PointCloud3d 54 | * Method: size 55 | * Signature: ()I 56 | */ 57 | JNIEXPORT jint JNICALL Java_com_github_vmoglan_pcljava_PointCloud3d_size(JNIEnv *, jobject); 58 | 59 | /* 60 | * Class: com_github_vmoglan_pcljava_PointCloud3d 61 | * Method: isOrganized 62 | * Signature: ()Z 63 | */ 64 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_PointCloud3d_isOrganized(JNIEnv *, jobject); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | #endif 70 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_RandomSampleConsensus.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_RandomSampleConsensus.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | using RandomSampleConsensus = pcl::RandomSampleConsensus; 7 | 8 | void Java_com_github_vmoglan_pcljava_RandomSampleConsensus_alloc(JNIEnv *env, jobject obj) 9 | { 10 | auto wrapper = new SharedPointerWrapper(nullptr); 11 | wrapper->instantiate(env, obj); 12 | } 13 | 14 | void Java_com_github_vmoglan_pcljava_RandomSampleConsensus_dispose(JNIEnv *env, jobject obj) 15 | { 16 | SharedPointerWrapper::dispose(env, obj); 17 | } 18 | 19 | jboolean Java_com_github_vmoglan_pcljava_RandomSampleConsensus_computeModel(JNIEnv *env, jobject obj, jint debugVerbosityLevel) 20 | { 21 | RandomSampleConsensus::Ptr ransac = SharedPointerWrapper::getPointer(env, obj); 22 | return ransac->computeModel(debugVerbosityLevel); 23 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_RandomSampleConsensus.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_RandomSampleConsensus */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_RandomSampleConsensus 6 | #define _Included_com_github_vmoglan_pcljava_RandomSampleConsensus 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_RandomSampleConsensus 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_RandomSampleConsensus_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_RandomSampleConsensus 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_RandomSampleConsensus_dispose(JNIEnv *, jobject); 23 | 24 | /* 25 | * Class: com_github_vmoglan_pcljava_RandomSampleConsensus 26 | * Method: computeModel 27 | * Signature: (I)Z 28 | */ 29 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_RandomSampleConsensus_computeModel(JNIEnv *, jobject, jint); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif 35 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensus.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_SampleConsensus.h" 2 | #include "handle.h" 3 | #include "SharedPointerWrapper.h" 4 | 5 | #include 6 | #include 7 | 8 | using SampleConsensus = pcl::SampleConsensus; 9 | using SampleConsensusModel = pcl::SampleConsensusModel; 10 | using PointCloud = pcl::PointCloud; 11 | 12 | void Java_com_github_vmoglan_pcljava_SampleConsensus_nSetSampleConsensusModel(JNIEnv *env, jobject obj, jobject modelJava) 13 | { 14 | SampleConsensus::Ptr sac = SharedPointerWrapper::getPointer(env, obj); 15 | SampleConsensusModel::Ptr model = SharedPointerWrapper::getPointer(env, modelJava); 16 | sac->setSampleConsensusModel(model); 17 | } 18 | 19 | jdouble Java_com_github_vmoglan_pcljava_SampleConsensus_getDistanceThreshold(JNIEnv *env, jobject obj) 20 | { 21 | SampleConsensus::Ptr sac = SharedPointerWrapper::getPointer(env, obj); 22 | return sac->getDistanceThreshold(); 23 | } 24 | 25 | void Java_com_github_vmoglan_pcljava_SampleConsensus_setDistanceThreshold(JNIEnv *env, jobject obj, jdouble threshold) 26 | { 27 | SampleConsensus::Ptr sac = SharedPointerWrapper::getPointer(env, obj); 28 | sac->setDistanceThreshold(threshold); 29 | } 30 | 31 | jint Java_com_github_vmoglan_pcljava_SampleConsensus_getMaxIterations(JNIEnv *env, jobject obj) 32 | { 33 | SampleConsensus::Ptr sac = SharedPointerWrapper::getPointer(env, obj); 34 | return sac->getMaxIterations(); 35 | } 36 | 37 | void Java_com_github_vmoglan_pcljava_SampleConsensus_setMaxIterations(JNIEnv *env, jobject obj, jint maxIterations) 38 | { 39 | SampleConsensus::Ptr sac = SharedPointerWrapper::getPointer(env, obj); 40 | sac->setMaxIterations(maxIterations); 41 | } 42 | 43 | jdouble Java_com_github_vmoglan_pcljava_SampleConsensus_getProbability(JNIEnv *env, jobject obj) 44 | { 45 | SampleConsensus::Ptr sac = SharedPointerWrapper::getPointer(env, obj); 46 | return sac->getProbability(); 47 | } 48 | 49 | void Java_com_github_vmoglan_pcljava_SampleConsensus_setProbability(JNIEnv *env, jobject obj, jdouble probability) 50 | { 51 | SampleConsensus::Ptr sac = SharedPointerWrapper::getPointer(env, obj); 52 | sac->setProbability(probability); 53 | } 54 | 55 | jboolean Java_com_github_vmoglan_pcljava_SampleConsensus_refineModel(JNIEnv *env, jobject obj, jdouble sigma, jint maxIterations) 56 | { 57 | SampleConsensus::Ptr sac = SharedPointerWrapper::getPointer(env, obj); 58 | return sac->refineModel(sigma, maxIterations); 59 | } 60 | 61 | void Java_com_github_vmoglan_pcljava_SampleConsensus_getInliers(JNIEnv *env, jobject obj, jobject sourceCloudJava, jobject targetCloudJava) 62 | { 63 | SampleConsensus::Ptr sac = SharedPointerWrapper::getPointer(env, obj); 64 | std::vector inliers; 65 | sac->getInliers(inliers); 66 | 67 | PointCloud::Ptr sourceCloud = SharedPointerWrapper::getPointer(env, sourceCloudJava); 68 | auto targetCloud = new SharedPointerWrapper(); 69 | targetCloud->instantiate(env, targetCloudJava); 70 | pcl::copyPointCloud(*sourceCloud, inliers, *targetCloud->getPointer()); 71 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensus.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_SampleConsensus */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_SampleConsensus 6 | #define _Included_com_github_vmoglan_pcljava_SampleConsensus 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | /* 12 | * Class: com_github_vmoglan_pcljava_SampleConsensus 13 | * Method: setSampleConsensusModel 14 | * Signature: (Lcom/github/vmoglan/pcljava/SampleConsensusModel;)V 15 | */ 16 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensus_nSetSampleConsensusModel(JNIEnv *, jobject, jobject); 17 | 18 | /* 19 | * Class: com_github_vmoglan_pcljava_SampleConsensus 20 | * Method: getDistanceThreshold 21 | * Signature: ()D 22 | */ 23 | JNIEXPORT jdouble JNICALL Java_com_github_vmoglan_pcljava_SampleConsensus_getDistanceThreshold(JNIEnv *, jobject); 24 | 25 | /* 26 | * Class: com_github_vmoglan_pcljava_SampleConsensus 27 | * Method: setDistanceThreshold 28 | * Signature: (D)V 29 | */ 30 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensus_setDistanceThreshold(JNIEnv *, jobject, jdouble); 31 | 32 | /* 33 | * Class: com_github_vmoglan_pcljava_SampleConsensus 34 | * Method: getMaxIterations 35 | * Signature: ()I 36 | */ 37 | JNIEXPORT jint JNICALL Java_com_github_vmoglan_pcljava_SampleConsensus_getMaxIterations(JNIEnv *, jobject); 38 | 39 | /* 40 | * Class: com_github_vmoglan_pcljava_SampleConsensus 41 | * Method: setMaxIterations 42 | * Signature: (I)V 43 | */ 44 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensus_setMaxIterations(JNIEnv *, jobject, jint); 45 | 46 | /* 47 | * Class: com_github_vmoglan_pcljava_SampleConsensus 48 | * Method: getProbability 49 | * Signature: ()D 50 | */ 51 | JNIEXPORT jdouble JNICALL Java_com_github_vmoglan_pcljava_SampleConsensus_getProbability(JNIEnv *, jobject); 52 | 53 | /* 54 | * Class: com_github_vmoglan_pcljava_SampleConsensus 55 | * Method: setProbability 56 | * Signature: (D)V 57 | */ 58 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensus_setProbability(JNIEnv *, jobject, jdouble); 59 | 60 | /* 61 | * Class: com_github_vmoglan_pcljava_SampleConsensus 62 | * Method: refineModel 63 | * Signature: (DI)Z 64 | */ 65 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_SampleConsensus_refineModel(JNIEnv *, jobject, jdouble, jint); 66 | 67 | /* 68 | * Class: com_github_vmoglan_pcljava_SampleConsensus 69 | * Method: getInliers 70 | * Signature: (Lcom/github/vmoglan/pcljava/PointCloud;Lcom/github/vmoglan/pcljava/PointCloud;)V 71 | */ 72 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensus_getInliers(JNIEnv *, jobject, jobject, jobject); 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #endif 78 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModel.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_SampleConsensusModel.h" 2 | 3 | #include "SharedPointerWrapper.h" 4 | 5 | #include 6 | #include 7 | 8 | using SampleConsensusModel = pcl::SampleConsensusModel; 9 | using PointCloud = pcl::PointCloud; 10 | 11 | void Java_com_github_vmoglan_pcljava_SampleConsensusModel_setInputCloud(JNIEnv *env, jobject obj, jobject cloudJava) 12 | { 13 | SampleConsensusModel::Ptr model = SharedPointerWrapper::getPointer(env, obj); 14 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, cloudJava); 15 | model->setInputCloud(cloud); 16 | } 17 | 18 | jint Java_com_github_vmoglan_pcljava_SampleConsensusModel_getSampleSize(JNIEnv *env, jobject obj) 19 | { 20 | SampleConsensusModel::Ptr model = SharedPointerWrapper::getPointer(env, obj); 21 | return model->getSampleSize(); 22 | } 23 | 24 | jdouble Java_com_github_vmoglan_pcljava_SampleConsensusModel_computeVariance(JNIEnv *env, jobject obj) 25 | { 26 | SampleConsensusModel::Ptr model = SharedPointerWrapper::getPointer(env, obj); 27 | return model->computeVariance(); 28 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModel.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_SampleConsensusModel */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_SampleConsensusModel 6 | #define _Included_com_github_vmoglan_pcljava_SampleConsensusModel 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_SampleConsensusModel 12 | * Method: setInputCloud 13 | * Signature: (Lcom/github/vmoglan/pcljava/PointCloud3d;)V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModel_setInputCloud(JNIEnv *, jobject, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_SampleConsensusModel 19 | * Method: getSampleSize 20 | * Signature: ()I 21 | */ 22 | JNIEXPORT jint JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModel_getSampleSize(JNIEnv *, jobject); 23 | 24 | /* 25 | * Class: com_github_vmoglan_pcljava_SampleConsensusModel 26 | * Method: computeVariance 27 | * Signature: ()D 28 | */ 29 | JNIEXPORT jdouble JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModel_computeVariance(JNIEnv *, jobject); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | #endif 35 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelCone.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_SampleConsensusModelCone.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | using PointCloud = pcl::PointCloud; 7 | using SampleConsensusModelCone = pcl::SampleConsensusModelCone; 8 | using NormalCloud = pcl::PointCloud; 9 | 10 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_alloc(JNIEnv *env, jobject obj) 11 | { 12 | PointCloud::Ptr cloud(new PointCloud()); 13 | auto wrapper = new SharedPointerWrapper(cloud); 14 | } 15 | 16 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_dispose(JNIEnv *env, jobject obj) 17 | { 18 | SharedPointerWrapper::dispose(env, obj); 19 | } 20 | 21 | jdouble Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_getNormalDistanceWeight(JNIEnv *env, jobject obj) 22 | { 23 | SampleConsensusModelCone::Ptr model = SharedPointerWrapper::getPointer(env, obj); 24 | return model->getNormalDistanceWeight(); 25 | } 26 | 27 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_setNormalDistanceWeight(JNIEnv *env, jobject obj, jdouble weight) 28 | { 29 | SampleConsensusModelCone::Ptr model = SharedPointerWrapper::getPointer(env, obj); 30 | model->setNormalDistanceWeight(weight); 31 | } 32 | 33 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_getInputNormals(JNIEnv *env, jobject obj, jobject normalsJava) 34 | { 35 | SampleConsensusModelCone::Ptr model = SharedPointerWrapper::getPointer(env, obj); 36 | auto normals = new SharedPointerWrapper(*model->getInputNormals()); 37 | normals->instantiate(env, normalsJava); 38 | } 39 | 40 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_setInputNormals(JNIEnv *env, jobject obj, jobject normalsJava) 41 | { 42 | SampleConsensusModelCone::Ptr model = SharedPointerWrapper::getPointer(env, obj); 43 | NormalCloud::Ptr normals = SharedPointerWrapper::getPointer(env, normalsJava); 44 | model->setInputNormals(normals); 45 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelCone.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_SampleConsensusModelCone */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_SampleConsensusModelCone 6 | #define _Included_com_github_vmoglan_pcljava_SampleConsensusModelCone 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCone 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCone 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_dispose(JNIEnv *, jobject); 23 | 24 | /* 25 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCone 26 | * Method: getNormalDistanceWeight 27 | * Signature: ()D 28 | */ 29 | JNIEXPORT jdouble JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_getNormalDistanceWeight(JNIEnv *, jobject); 30 | 31 | /* 32 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCone 33 | * Method: setNormalDistanceWeight 34 | * Signature: (D)V 35 | */ 36 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_setNormalDistanceWeight(JNIEnv *, jobject, jdouble); 37 | 38 | /* 39 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCone 40 | * Method: getInputNormals 41 | * Signature: (Lcom/github/vmoglan/pcljava/NormalCloud;)V 42 | */ 43 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_getInputNormals(JNIEnv *, jobject, jobject); 44 | 45 | /* 46 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCone 47 | * Method: setInputNormals 48 | * Signature: (Lcom/github/vmoglan/pcljava/NormalCloud;)V 49 | */ 50 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCone_setInputNormals(JNIEnv *, jobject, jobject); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif 56 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelCylinder.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_SampleConsensusModelCylinder.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | using PointCloud = pcl::PointCloud; 7 | using NormalCloud = pcl::PointCloud; 8 | using SampleConsensusModelCylinder = pcl::SampleConsensusModelCylinder; 9 | 10 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_alloc(JNIEnv *env, jobject obj) 11 | { 12 | PointCloud::Ptr cloud(new PointCloud()); 13 | auto wrapper = new SharedPointerWrapper(cloud); 14 | wrapper->instantiate(env, obj); 15 | } 16 | 17 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_dispose(JNIEnv *env, jobject obj) 18 | { 19 | SharedPointerWrapper::dispose(env, obj); 20 | } 21 | 22 | jdouble Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_getNormalDistanceWeight(JNIEnv *env, jobject obj) 23 | { 24 | SampleConsensusModelCylinder::Ptr model = SharedPointerWrapper::getPointer(env, obj); 25 | return model->getNormalDistanceWeight(); 26 | } 27 | 28 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_setNormalDistanceWeight(JNIEnv *env, jobject obj, jdouble weight) 29 | { 30 | SampleConsensusModelCylinder::Ptr model = SharedPointerWrapper::getPointer(env, obj); 31 | model->setNormalDistanceWeight(weight); 32 | } 33 | 34 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_getInputNormals(JNIEnv *env, jobject obj, jobject normalsJava) 35 | { 36 | SampleConsensusModelCylinder::Ptr model = SharedPointerWrapper::getPointer(env, obj); 37 | auto normals = new SharedPointerWrapper(*model->getInputNormals()); 38 | normals->instantiate(env, normalsJava); 39 | } 40 | 41 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_setInputNormals(JNIEnv *env, jobject obj, jobject normalsJava) 42 | { 43 | SampleConsensusModelCylinder::Ptr model = SharedPointerWrapper::getPointer(env, obj); 44 | NormalCloud::Ptr normals = SharedPointerWrapper::getPointer(env, normalsJava); 45 | model->setInputNormals(normals); 46 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelCylinder.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_SampleConsensusModelCylinder */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_SampleConsensusModelCylinder 6 | #define _Included_com_github_vmoglan_pcljava_SampleConsensusModelCylinder 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCylinder 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCylinder 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_dispose(JNIEnv *, jobject); 23 | 24 | /* 25 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCylinder 26 | * Method: getNormalDistanceWeight 27 | * Signature: ()D 28 | */ 29 | JNIEXPORT jdouble JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_getNormalDistanceWeight(JNIEnv *, jobject); 30 | 31 | /* 32 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCylinder 33 | * Method: setNormalDistanceWeight 34 | * Signature: (D)V 35 | */ 36 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_setNormalDistanceWeight(JNIEnv *, jobject, jdouble); 37 | 38 | /* 39 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCylinder 40 | * Method: getInputNormals 41 | * Signature: (Lcom/github/vmoglan/pcljava/NormalCloud;)V 42 | */ 43 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_getInputNormals(JNIEnv *, jobject, jobject); 44 | 45 | /* 46 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelCylinder 47 | * Method: setInputNormals 48 | * Signature: (Lcom/github/vmoglan/pcljava/NormalCloud;)V 49 | */ 50 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelCylinder_setInputNormals(JNIEnv *, jobject, jobject); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif 56 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelLine.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_SampleConsensusModelLine.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | using PointCloud = pcl::PointCloud; 7 | using SampleConsensusModelLine = pcl::SampleConsensusModelLine; 8 | 9 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelLine_alloc(JNIEnv *env, jobject obj) 10 | { 11 | PointCloud::Ptr cloud(new PointCloud()); 12 | auto wrapper = new SharedPointerWrapper(cloud); 13 | wrapper->instantiate(env, obj); 14 | } 15 | 16 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelLine_dispose(JNIEnv *env, jobject obj) 17 | { 18 | SharedPointerWrapper::dispose(env, obj); 19 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelLine.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_SampleConsensusModelLine */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_SampleConsensusModelLine 6 | #define _Included_com_github_vmoglan_pcljava_SampleConsensusModelLine 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelLine 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelLine_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelLine 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelLine_dispose(JNIEnv *, jobject); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelPlane.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_SampleConsensusModelPlane.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | using PointCloud = pcl::PointCloud; 7 | using SampleConsensusModelPlane = pcl::SampleConsensusModelPlane; 8 | 9 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelPlane_alloc(JNIEnv *env, jobject obj) 10 | { 11 | PointCloud::Ptr cloud(new PointCloud()); 12 | auto wrapper = new SharedPointerWrapper(cloud); 13 | wrapper->instantiate(env, obj); 14 | } 15 | 16 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelPlane_dispose(JNIEnv *env, jobject obj) 17 | { 18 | SharedPointerWrapper::dispose(env, obj); 19 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelPlane.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_SampleConsensusModelPlane */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_SampleConsensusModelPlane 6 | #define _Included_com_github_vmoglan_pcljava_SampleConsensusModelPlane 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelPlane 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelPlane_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelPlane 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelPlane_dispose(JNIEnv *, jobject); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelSphere.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_SampleConsensusModelSphere.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | using PointCloud = pcl::PointCloud; 7 | using SampleConsensusModelSphere = pcl::SampleConsensusModelSphere; 8 | 9 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelSphere_alloc(JNIEnv *env, jobject obj) 10 | { 11 | PointCloud::Ptr cloud(new PointCloud()); 12 | auto wrapper = new SharedPointerWrapper(cloud); 13 | wrapper->instantiate(env, obj); 14 | } 15 | 16 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelSphere_dispose(JNIEnv *env, jobject obj) 17 | { 18 | SharedPointerWrapper::dispose(env, obj); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelSphere.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_SampleConsensusModelSphere */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_SampleConsensusModelSphere 6 | #define _Included_com_github_vmoglan_pcljava_SampleConsensusModelSphere 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelSphere 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelSphere_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelSphere 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelSphere_dispose(JNIEnv *, jobject); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelStick.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_SampleConsensusModelStick.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | using PointCloud = pcl::PointCloud; 7 | using SampleConsensusModelStick = pcl::SampleConsensusModelStick; 8 | 9 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelStick_alloc(JNIEnv *env, jobject obj) 10 | { 11 | PointCloud::Ptr cloud(new pcl::PointCloud()); 12 | auto wrapper = new SharedPointerWrapper(cloud); 13 | wrapper->instantiate(env, obj); 14 | } 15 | 16 | void Java_com_github_vmoglan_pcljava_SampleConsensusModelStick_dispose(JNIEnv *env, jobject obj) 17 | { 18 | SharedPointerWrapper::dispose(env, obj); 19 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_SampleConsensusModelStick.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_SampleConsensusModelStick */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_SampleConsensusModelStick 6 | #define _Included_com_github_vmoglan_pcljava_SampleConsensusModelStick 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelStick 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelStick_alloc(JNIEnv *, jobject); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_SampleConsensusModelStick 19 | * Method: dispose 20 | * Signature: ()V 21 | */ 22 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_SampleConsensusModelStick_dispose(JNIEnv *, jobject); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using PointCloud = pcl::PointCloud; 10 | 11 | void Java_com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd_read(JNIEnv *env, jobject obj, jstring fileName, jobject cloudJava) 12 | { 13 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, cloudJava); 14 | const char *fileNameNative = env->GetStringUTFChars(fileName, JNI_FALSE); 15 | pcl::io::loadPCDFile(fileNameNative, *cloud); 16 | env->ReleaseStringUTFChars(fileName, fileNameNative); 17 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd 6 | #define _Included_com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd 12 | * Method: read 13 | * Signature: (Ljava/lang/String;Lcom/github/vmoglan/pcljava/PointCloud3d;)V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_io_PointCloud3dReaderPcd_read 16 | (JNIEnv *, jobject, jstring, jobject); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_io_PointCloud3dReaderPly.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_io_PointCloud3dReaderPly.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using PointCloud = pcl::PointCloud; 10 | 11 | void Java_com_github_vmoglan_pcljava_io_PointCloud3dReaderPly_read(JNIEnv *env, jobject obj, jstring fileName, jobject cloudJava) 12 | { 13 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, cloudJava); 14 | const char *fileNameNative = env->GetStringUTFChars(fileName, JNI_FALSE); 15 | pcl::io::loadPLYFile(fileNameNative, *cloud); 16 | env->ReleaseStringUTFChars(fileName, fileNameNative); 17 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_io_PointCloud3dReaderPly.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_io_PointCloud3dReaderPly */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_io_PointCloud3dReaderPly 6 | #define _Included_com_github_vmoglan_pcljava_io_PointCloud3dReaderPly 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_io_PointCloud3dReaderPly 12 | * Method: read 13 | * Signature: (Ljava/lang/String;Lcom/github/vmoglan/pcljava/PointCloud3d;)V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_io_PointCloud3dReaderPly_read 16 | (JNIEnv *, jobject, jstring, jobject); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using PointCloud = pcl::PointCloud; 10 | 11 | void Java_com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd_write(JNIEnv *env, jobject obj, jobject cloudJava, jstring fileName, jboolean binaryMode) 12 | { 13 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, cloudJava); 14 | const char *fileNameNative = env->GetStringUTFChars(fileName, JNI_FALSE); 15 | pcl::io::savePCDFile(fileNameNative, *cloud, (bool)binaryMode); 16 | env->ReleaseStringUTFChars(fileName, fileNameNative); 17 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd 6 | #define _Included_com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd 12 | * Method: write 13 | * Signature: (Lcom/github/vmoglan/pcljava/PointCloud3d;Ljava/lang/String;Z)V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_io_PointCloud3dWriterPcd_write 16 | (JNIEnv *, jobject, jobject, jstring, jboolean); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_io_PointCloud3dWriterPly.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_io_PointCloud3dWriterPly.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using PointCloud = pcl::PointCloud; 10 | 11 | void Java_com_github_vmoglan_pcljava_io_PointCloud3dWriterPly_write(JNIEnv *env, jobject obj, jobject cloudJava, jstring fileName, jboolean binaryMode) 12 | { 13 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, cloudJava); 14 | const char *fileNameNative = env->GetStringUTFChars(fileName, JNI_FALSE); 15 | pcl::io::savePLYFile(fileNameNative, *cloud, (bool)binaryMode); 16 | env->ReleaseStringUTFChars(fileName, fileNameNative); 17 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_io_PointCloud3dWriterPly.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_io_PointCloud3dWriterPly */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_io_PointCloud3dWriterPly 6 | #define _Included_com_github_vmoglan_pcljava_io_PointCloud3dWriterPly 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_io_PointCloud3dWriterPly 12 | * Method: write 13 | * Signature: (Lcom/github/vmoglan/pcljava/PointCloud3d;Ljava/lang/String;Z)V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_io_PointCloud3dWriterPly_write 16 | (JNIEnv *, jobject, jobject, jstring, jboolean); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_visualization_Visualizer.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_visualization_Visualizer.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | using Visualizer = pcl::visualization::PCLVisualizer; 7 | using PointCloud = pcl::PointCloud; 8 | using NormalCloud = pcl::PointCloud; 9 | 10 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_alloc(JNIEnv *env, jobject obj) 11 | { 12 | auto wrapper = new SharedPointerWrapper(); 13 | wrapper->instantiate(env, obj); 14 | } 15 | 16 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_dispose(JNIEnv *env, jobject obj) 17 | { 18 | SharedPointerWrapper::dispose(env, obj); 19 | } 20 | 21 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_close(JNIEnv *env, jobject obj) 22 | { 23 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 24 | visualizer->close(); 25 | } 26 | 27 | jboolean Java_com_github_vmoglan_pcljava_visualization_Visualizer_wasStopped(JNIEnv *env, jobject obj) 28 | { 29 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 30 | return visualizer->wasStopped(); 31 | } 32 | 33 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_createViewport(JNIEnv *env, 34 | jobject obj, 35 | jdouble xMin, 36 | jdouble yMin, 37 | jdouble xMax, 38 | jdouble yMax, 39 | jint viewport) 40 | { 41 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 42 | int viewportNative(viewport); 43 | visualizer->createViewPort(xMin, yMin, xMax, yMax, viewportNative); 44 | } 45 | 46 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_spin(JNIEnv *env, jobject obj) 47 | { 48 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 49 | visualizer->spin(); 50 | } 51 | 52 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_spinOnce(JNIEnv *env, jobject obj, jint time, jboolean forceRedraw) 53 | { 54 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 55 | visualizer->spinOnce(time, forceRedraw); 56 | } 57 | 58 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_setWindowName(JNIEnv *env, jobject obj, jstring name) 59 | { 60 | const char *nameNative = env->GetStringUTFChars(name, JNI_FALSE); 61 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 62 | visualizer->setWindowName(nameNative); 63 | 64 | env->ReleaseStringUTFChars(name, nameNative); 65 | } 66 | 67 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_setBackgroundColor(JNIEnv *env, jobject obj, jfloat r, jfloat g, jfloat b) 68 | { 69 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 70 | visualizer->setBackgroundColor(r, g, b); 71 | } 72 | 73 | jboolean Java_com_github_vmoglan_pcljava_visualization_Visualizer_removePointCloud(JNIEnv *env, jobject obj, jstring id, jint viewport) 74 | { 75 | const char *idNative = env->GetStringUTFChars(id, JNI_FALSE); 76 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 77 | bool isRemoved = visualizer->removePointCloud(idNative, viewport); 78 | 79 | env->ReleaseStringUTFChars(id, idNative); 80 | 81 | return isRemoved; 82 | } 83 | 84 | jboolean Java_com_github_vmoglan_pcljava_visualization_Visualizer_removeAllPointClouds(JNIEnv *env, jobject obj, jint viewport) 85 | { 86 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 87 | bool isRemoved = visualizer->removeAllPointClouds(viewport); 88 | return isRemoved; 89 | } 90 | 91 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_addCoordinateSystem__DLjava_lang_String_2I(JNIEnv *env, jobject obj, jdouble scale, jstring id, jint viewport) 92 | { 93 | const char *idNative = env->GetStringUTFChars(id, JNI_FALSE); 94 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 95 | visualizer->addCoordinateSystem(scale, idNative, viewport); 96 | 97 | env->ReleaseStringUTFChars(id, idNative); 98 | } 99 | 100 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_addCoordinateSystem__DFFFLjava_lang_String_2I(JNIEnv *env, 101 | jobject obj, 102 | jdouble scale, 103 | jfloat x, 104 | jfloat y, 105 | jfloat z, 106 | jstring id, 107 | jint viewport) 108 | { 109 | const char *idNative = env->GetStringUTFChars(id, JNI_FALSE); 110 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 111 | visualizer->addCoordinateSystem(scale, x, y, z, idNative, viewport); 112 | 113 | env->ReleaseStringUTFChars(id, idNative); 114 | } 115 | 116 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_removeCoordinateSystem(JNIEnv *env, jobject obj, jstring id, jint viewport) 117 | { 118 | const char *idNative = env->GetStringUTFChars(id, JNI_FALSE); 119 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 120 | visualizer->removeCoordinateSystem(idNative, viewport); 121 | 122 | env->ReleaseStringUTFChars(id, idNative); 123 | } 124 | 125 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_removeAllCoordinateSystems(JNIEnv *env, jobject obj, jint viewport) 126 | { 127 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 128 | visualizer->removeAllCoordinateSystems(viewport); 129 | } 130 | 131 | jboolean Java_com_github_vmoglan_pcljava_visualization_Visualizer_addText__Ljava_lang_String_2IILjava_lang_String_2I(JNIEnv *env, 132 | jobject obj, 133 | jstring text, 134 | jint xPosition, 135 | jint yPosition, 136 | jstring id, 137 | jint viewport) 138 | { 139 | const char *textNative = env->GetStringUTFChars(text, JNI_FALSE); 140 | const char *idNative = env->GetStringUTFChars(id, JNI_FALSE); 141 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 142 | bool added = visualizer->addText(textNative, xPosition, yPosition, idNative, viewport); 143 | 144 | env->ReleaseStringUTFChars(id, idNative); 145 | env->ReleaseStringUTFChars(text, textNative); 146 | 147 | return added; 148 | } 149 | 150 | jboolean Java_com_github_vmoglan_pcljava_visualization_Visualizer_addText__Ljava_lang_String_2IIDDDLjava_lang_String_2I(JNIEnv *env, 151 | jobject obj, 152 | jstring text, 153 | jint xPosition, 154 | jint yPosition, 155 | jdouble r, 156 | jdouble g, 157 | jdouble b, 158 | jstring id, 159 | jint viewport) 160 | { 161 | const char *textNative = env->GetStringUTFChars(text, JNI_FALSE); 162 | const char *idNative = env->GetStringUTFChars(id, JNI_FALSE); 163 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 164 | bool added = visualizer->addText(textNative, xPosition, yPosition, r, g, b, idNative, viewport); 165 | 166 | env->ReleaseStringUTFChars(id, idNative); 167 | env->ReleaseStringUTFChars(text, textNative); 168 | 169 | return added; 170 | } 171 | 172 | jboolean Java_com_github_vmoglan_pcljava_visualization_Visualizer_addText__Ljava_lang_String_2IIIDDDLjava_lang_String_2I(JNIEnv *env, 173 | jobject obj, 174 | jstring text, 175 | jint xPosition, 176 | jint yPosition, 177 | jint fontSize, 178 | jdouble r, 179 | jdouble g, 180 | jdouble b, 181 | jstring id, 182 | jint viewport) 183 | { 184 | const char *textNative = env->GetStringUTFChars(text, JNI_FALSE); 185 | const char *idNative = env->GetStringUTFChars(id, JNI_FALSE); 186 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 187 | bool added = visualizer->addText(textNative, xPosition, yPosition, fontSize, r, g, b, idNative, viewport); 188 | 189 | env->ReleaseStringUTFChars(id, idNative); 190 | env->ReleaseStringUTFChars(text, textNative); 191 | 192 | return added; 193 | } 194 | 195 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_setPointSize(JNIEnv *env, jobject obj, jint size, jstring id) 196 | { 197 | const char *idNative = env->GetStringUTFChars(id, JNI_FALSE); 198 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 199 | visualizer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, size, idNative); 200 | 201 | env->ReleaseStringUTFChars(id, idNative); 202 | } 203 | 204 | void Java_com_github_vmoglan_pcljava_visualization_Visualizer_initCameraParameters(JNIEnv *env, jobject obj) 205 | { 206 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 207 | visualizer->initCameraParameters(); 208 | } 209 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_visualization_Visualizer.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_visualization_Visualizer */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_visualization_Visualizer 6 | #define _Included_com_github_vmoglan_pcljava_visualization_Visualizer 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 12 | * Method: alloc 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_alloc 16 | (JNIEnv *, jobject); 17 | 18 | /* 19 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 20 | * Method: dispose 21 | * Signature: ()V 22 | */ 23 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_dispose 24 | (JNIEnv *, jobject); 25 | 26 | /* 27 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 28 | * Method: close 29 | * Signature: ()V 30 | */ 31 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_close 32 | (JNIEnv *, jobject); 33 | 34 | /* 35 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 36 | * Method: wasStopped 37 | * Signature: ()Z 38 | */ 39 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_wasStopped 40 | (JNIEnv *, jobject); 41 | 42 | /* 43 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 44 | * Method: createViewport 45 | * Signature: (DDDDI)V 46 | */ 47 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_createViewport 48 | (JNIEnv *, jobject, jdouble, jdouble, jdouble, jdouble, jint); 49 | 50 | /* 51 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 52 | * Method: spin 53 | * Signature: ()V 54 | */ 55 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_spin 56 | (JNIEnv *, jobject); 57 | 58 | /* 59 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 60 | * Method: spinOnce 61 | * Signature: (IZ)V 62 | */ 63 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_spinOnce 64 | (JNIEnv *, jobject, jint, jboolean); 65 | 66 | /* 67 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 68 | * Method: setWindowName 69 | * Signature: (Ljava/lang/String;)V 70 | */ 71 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_setWindowName 72 | (JNIEnv *, jobject, jstring); 73 | 74 | /* 75 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 76 | * Method: setBackgroundColor 77 | * Signature: (FFF)V 78 | */ 79 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_setBackgroundColor 80 | (JNIEnv *, jobject, jfloat, jfloat, jfloat); 81 | 82 | /* 83 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 84 | * Method: removePointCloud 85 | * Signature: (Ljava/lang/String;I)Z 86 | */ 87 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_removePointCloud 88 | (JNIEnv *, jobject, jstring, jint); 89 | 90 | /* 91 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 92 | * Method: removeAllPointClouds 93 | * Signature: (I)Z 94 | */ 95 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_removeAllPointClouds 96 | (JNIEnv *, jobject, jint); 97 | 98 | /* 99 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 100 | * Method: addCoordinateSystem 101 | * Signature: (DLjava/lang/String;I)V 102 | */ 103 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_addCoordinateSystem__DLjava_lang_String_2I 104 | (JNIEnv *, jobject, jdouble, jstring, jint); 105 | 106 | /* 107 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 108 | * Method: addCoordinateSystem 109 | * Signature: (DFFFLjava/lang/String;I)V 110 | */ 111 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_addCoordinateSystem__DFFFLjava_lang_String_2I 112 | (JNIEnv *, jobject, jdouble, jfloat, jfloat, jfloat, jstring, jint); 113 | 114 | /* 115 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 116 | * Method: removeCoordinateSystem 117 | * Signature: (Ljava/lang/String;I)V 118 | */ 119 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_removeCoordinateSystem 120 | (JNIEnv *, jobject, jstring, jint); 121 | 122 | /* 123 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 124 | * Method: removeAllCoordinateSystems 125 | * Signature: (I)V 126 | */ 127 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_removeAllCoordinateSystems 128 | (JNIEnv *, jobject, jint); 129 | 130 | /* 131 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 132 | * Method: addText 133 | * Signature: (Ljava/lang/String;IILjava/lang/String;I)Z 134 | */ 135 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_addText__Ljava_lang_String_2IILjava_lang_String_2I 136 | (JNIEnv *, jobject, jstring, jint, jint, jstring, jint); 137 | 138 | /* 139 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 140 | * Method: addText 141 | * Signature: (Ljava/lang/String;IIDDDLjava/lang/String;I)Z 142 | */ 143 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_addText__Ljava_lang_String_2IIDDDLjava_lang_String_2I 144 | (JNIEnv *, jobject, jstring, jint, jint, jdouble, jdouble, jdouble, jstring, jint); 145 | 146 | /* 147 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 148 | * Method: addText 149 | * Signature: (Ljava/lang/String;IIIDDDLjava/lang/String;I)Z 150 | */ 151 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_addText__Ljava_lang_String_2IIIDDDLjava_lang_String_2I 152 | (JNIEnv *, jobject, jstring, jint, jint, jint, jdouble, jdouble, jdouble, jstring, jint); 153 | 154 | /* 155 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 156 | * Method: setPointSize 157 | * Signature: (ILjava/lang/String;)V 158 | */ 159 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_setPointSize 160 | (JNIEnv *, jobject, jint, jstring); 161 | 162 | /* 163 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer 164 | * Method: initCameraParameters 165 | * Signature: ()V 166 | */ 167 | JNIEXPORT void JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer_initCameraParameters 168 | (JNIEnv *, jobject); 169 | 170 | #ifdef __cplusplus 171 | } 172 | #endif 173 | #endif 174 | -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_visualization_Visualizer3d.cpp: -------------------------------------------------------------------------------- 1 | #include "com_github_vmoglan_pcljava_visualization_Visualizer3d.h" 2 | #include "SharedPointerWrapper.h" 3 | 4 | #include 5 | 6 | using Visualizer = pcl::visualization::PCLVisualizer; 7 | using PointCloud = pcl::PointCloud; 8 | using NormalCloud = pcl::PointCloud; 9 | using ColorHandlerRGBField = pcl::visualization::PointCloudColorHandlerRGBField; 10 | 11 | jboolean Java_com_github_vmoglan_pcljava_visualization_Visualizer3d_addPointCloud(JNIEnv *env, 12 | jobject obj, 13 | jobject cloudJava, 14 | jstring id, 15 | jint viewport) 16 | { 17 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, cloudJava); 18 | ColorHandlerRGBField rgbField(cloud); 19 | const char *idNative = env->GetStringUTFChars(id, JNI_FALSE); 20 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 21 | bool isAdded = visualizer->addPointCloud(cloud, rgbField, idNative, viewport); 22 | 23 | env->ReleaseStringUTFChars(id, idNative); 24 | 25 | return isAdded; 26 | } 27 | 28 | jboolean Java_com_github_vmoglan_pcljava_visualization_Visualizer3d_addPointCloudNormals(JNIEnv *env, 29 | jobject obj, 30 | jobject cloudJava, 31 | jobject normalsJava, 32 | jint level, 33 | jfloat scale, 34 | jstring id, 35 | jint viewport) 36 | { 37 | PointCloud::Ptr cloud = SharedPointerWrapper::getPointer(env, cloudJava); 38 | NormalCloud::Ptr normals = SharedPointerWrapper::getPointer(env, normalsJava); 39 | const auto idNative = env->GetStringUTFChars(id, JNI_FALSE); 40 | Visualizer::Ptr visualizer = SharedPointerWrapper::getPointer(env, obj); 41 | bool isAdded = visualizer->addPointCloudNormals(cloud, normals, (int)level, (float)scale, idNative, (int)viewport); 42 | 43 | env->ReleaseStringUTFChars(id, idNative); 44 | 45 | return isAdded; 46 | } -------------------------------------------------------------------------------- /src/main/native/com_github_vmoglan_pcljava_visualization_Visualizer3d.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_github_vmoglan_pcljava_visualization_Visualizer3d */ 4 | 5 | #ifndef _Included_com_github_vmoglan_pcljava_visualization_Visualizer3d 6 | #define _Included_com_github_vmoglan_pcljava_visualization_Visualizer3d 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer3d 12 | * Method: addPointCloud 13 | * Signature: (Lcom/github/vmoglan/pcljava/PointCloud;Ljava/lang/String;I)Z 14 | */ 15 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer3d_addPointCloud(JNIEnv *, jobject, jobject, jstring, jint); 16 | 17 | /* 18 | * Class: com_github_vmoglan_pcljava_visualization_Visualizer3d 19 | * Method: addPointCloudNormals 20 | * Signature: (Lcom/github/vmoglan/pcljava/PointCloud;Lcom/github/vmoglan/pcljava/NormalCloud;IFLjava/lang/String;I)Z 21 | */ 22 | JNIEXPORT jboolean JNICALL Java_com_github_vmoglan_pcljava_visualization_Visualizer3d_addPointCloudNormals(JNIEnv *, jobject, jobject, jobject, jint, jfloat, jstring, jint); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /src/main/native/handle.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifndef _Included_Handle 4 | #define _Included_Handle 5 | 6 | inline jfieldID getHandleField(JNIEnv *env, jobject obj) 7 | { 8 | jclass javaClass = env->GetObjectClass(obj); 9 | 10 | return env->GetFieldID(javaClass, "handle", "J"); 11 | } 12 | 13 | template 14 | inline T *getHandle(JNIEnv *env, jobject obj) 15 | { 16 | jlong handle = env->GetLongField(obj, getHandleField(env, obj)); 17 | 18 | return reinterpret_cast(handle); 19 | } 20 | 21 | template 22 | inline void setHandle(JNIEnv *env, jobject obj, T *ptr) 23 | { 24 | jlong handle = reinterpret_cast(ptr); 25 | 26 | env->SetLongField(obj, getHandleField(env, obj), handle); 27 | } 28 | 29 | #endif -------------------------------------------------------------------------------- /src/test/resources/pcl-samples/bunny.pcd: -------------------------------------------------------------------------------- 1 | # .PCD v.5 - Point Cloud Data file format 2 | VERSION .5 3 | FIELDS x y z 4 | SIZE 4 4 4 5 | TYPE F F F 6 | COUNT 1 1 1 7 | WIDTH 397 8 | HEIGHT 1 9 | POINTS 397 10 | DATA ascii 11 | 0.0054216 0.11349 0.040749 12 | -0.0017447 0.11425 0.041273 13 | -0.010661 0.11338 0.040916 14 | 0.026422 0.11499 0.032623 15 | 0.024545 0.12284 0.024255 16 | 0.034137 0.11316 0.02507 17 | 0.02886 0.11773 0.027037 18 | 0.02675 0.12234 0.017605 19 | 0.03575 0.1123 0.019109 20 | 0.015982 0.12307 0.031279 21 | 0.0079813 0.12438 0.032798 22 | 0.018101 0.11674 0.035493 23 | 0.0086687 0.11758 0.037538 24 | 0.01808 0.12536 0.026132 25 | 0.0080861 0.12866 0.02619 26 | 0.02275 0.12146 0.029671 27 | -0.0018689 0.12456 0.033184 28 | -0.011168 0.12376 0.032519 29 | -0.0020063 0.11937 0.038104 30 | -0.01232 0.11816 0.037427 31 | -0.0016659 0.12879 0.026782 32 | -0.011971 0.12723 0.026219 33 | 0.016484 0.12828 0.01928 34 | 0.0070921 0.13103 0.018415 35 | 0.0014615 0.13134 0.017095 36 | -0.013821 0.12886 0.019265 37 | -0.01725 0.11202 0.040077 38 | -0.074556 0.13415 0.051046 39 | -0.065971 0.14396 0.04109 40 | -0.071925 0.14545 0.043266 41 | -0.06551 0.13624 0.042195 42 | -0.071112 0.13767 0.047518 43 | -0.079528 0.13416 0.051194 44 | -0.080421 0.14428 0.042793 45 | -0.082672 0.1378 0.046806 46 | -0.08813 0.13514 0.042222 47 | -0.066325 0.12347 0.050729 48 | -0.072399 0.12662 0.052364 49 | -0.066091 0.11973 0.050881 50 | -0.072012 0.11811 0.052295 51 | -0.062433 0.12627 0.043831 52 | -0.068326 0.12998 0.048875 53 | -0.063094 0.11811 0.044399 54 | -0.071301 0.11322 0.04841 55 | -0.080515 0.12741 0.052034 56 | -0.078179 0.1191 0.051116 57 | -0.085216 0.12609 0.049001 58 | -0.089538 0.12621 0.044589 59 | -0.082659 0.11661 0.04797 60 | -0.089536 0.11784 0.04457 61 | -0.0565 0.15248 0.030132 62 | -0.055517 0.15313 0.026915 63 | -0.03625 0.17198 0.00017688 64 | -0.03775 0.17198 0.00022189 65 | -0.03625 0.16935 0.00051958 66 | -0.033176 0.15711 0.0018682 67 | -0.051913 0.1545 0.011273 68 | -0.041707 0.16642 0.0030522 69 | -0.049468 0.16414 0.0041988 70 | -0.041892 0.15669 0.0054879 71 | -0.051224 0.15878 0.0080283 72 | -0.062417 0.15317 0.033161 73 | -0.07167 0.15319 0.033701 74 | -0.062543 0.15524 0.027405 75 | -0.07211 0.1555 0.027645 76 | -0.078663 0.15269 0.032268 77 | -0.081569 0.15374 0.026085 78 | -0.08725 0.1523 0.022135 79 | -0.05725 0.15568 0.010325 80 | -0.057888 0.1575 0.0073225 81 | -0.0885 0.15223 0.019215 82 | -0.056129 0.14616 0.03085 83 | -0.054705 0.13555 0.032127 84 | -0.054144 0.14714 0.026275 85 | -0.046625 0.13234 0.021909 86 | -0.05139 0.13694 0.025787 87 | -0.018278 0.12238 0.030773 88 | -0.021656 0.11643 0.035209 89 | -0.031921 0.11566 0.032851 90 | -0.021348 0.12421 0.024562 91 | -0.03241 0.12349 0.023293 92 | -0.024869 0.12094 0.028745 93 | -0.031747 0.12039 0.028229 94 | -0.052912 0.12686 0.034968 95 | -0.041672 0.11564 0.032998 96 | -0.052037 0.1168 0.034582 97 | -0.042495 0.12488 0.024082 98 | -0.047946 0.12736 0.028108 99 | -0.042421 0.12035 0.028633 100 | -0.047661 0.12024 0.028871 101 | -0.035964 0.1513 0.0005395 102 | -0.050598 0.1474 0.013881 103 | -0.046375 0.13293 0.018289 104 | -0.049125 0.13856 0.016269 105 | -0.042976 0.14915 0.0054003 106 | -0.047965 0.14659 0.0086783 107 | -0.022926 0.1263 0.018077 108 | -0.031583 0.1259 0.017804 109 | -0.041733 0.12796 0.01665 110 | -0.061482 0.14698 0.036168 111 | -0.071729 0.15026 0.038328 112 | -0.060526 0.1368 0.035999 113 | -0.082619 0.14823 0.035955 114 | -0.087824 0.14449 0.033779 115 | -0.089 0.13828 0.037774 116 | -0.085662 0.15095 0.028208 117 | -0.089601 0.14725 0.025869 118 | -0.090681 0.13748 0.02369 119 | -0.058722 0.12924 0.038992 120 | -0.060075 0.11512 0.037685 121 | -0.091812 0.12767 0.038703 122 | -0.091727 0.11657 0.039619 123 | -0.093164 0.12721 0.025211 124 | -0.093938 0.12067 0.024399 125 | -0.091583 0.14522 0.01986 126 | -0.090929 0.13667 0.019817 127 | -0.093094 0.11635 0.018959 128 | 0.024948 0.10286 0.041418 129 | 0.0336 0.092627 0.040463 130 | 0.02742 0.096386 0.043312 131 | 0.03392 0.086911 0.041034 132 | 0.028156 0.086837 0.045084 133 | 0.03381 0.078604 0.040854 134 | 0.028125 0.076874 0.045059 135 | 0.0145 0.093279 0.05088 136 | 0.0074817 0.09473 0.052315 137 | 0.017407 0.10535 0.043139 138 | 0.0079536 0.10633 0.042968 139 | 0.018511 0.097194 0.047253 140 | 0.0086436 0.099323 0.048079 141 | -0.0020197 0.095698 0.053906 142 | -0.011446 0.095169 0.053862 143 | -0.001875 0.10691 0.043455 144 | -0.011875 0.10688 0.043019 145 | -0.0017622 0.10071 0.046648 146 | -0.012498 0.10008 0.045916 147 | 0.016381 0.085894 0.051642 148 | 0.0081167 0.08691 0.055228 149 | 0.017644 0.076955 0.052372 150 | 0.008125 0.076853 0.055536 151 | 0.020575 0.088169 0.049006 152 | 0.022445 0.075721 0.049563 153 | -0.0017931 0.086849 0.056843 154 | -0.011943 0.086771 0.057009 155 | -0.0019567 0.076863 0.057803 156 | -0.011875 0.076964 0.057022 157 | 0.03325 0.067541 0.040033 158 | 0.028149 0.066829 0.042953 159 | 0.026761 0.057829 0.042588 160 | 0.023571 0.04746 0.040428 161 | 0.015832 0.067418 0.051639 162 | 0.0080431 0.066902 0.055006 163 | 0.013984 0.058886 0.050416 164 | 0.0080973 0.056888 0.05295 165 | 0.020566 0.065958 0.0483 166 | 0.018594 0.056539 0.047879 167 | 0.012875 0.052652 0.049689 168 | -0.0017852 0.066712 0.056503 169 | -0.011785 0.066885 0.055015 170 | -0.001875 0.056597 0.05441 171 | -0.01184 0.057054 0.052714 172 | -0.015688 0.052469 0.049615 173 | 0.0066154 0.04993 0.051259 174 | 0.018088 0.046655 0.043321 175 | 0.008841 0.045437 0.046623 176 | 0.017688 0.039719 0.043084 177 | 0.008125 0.039516 0.045374 178 | -0.0016111 0.049844 0.05172 179 | -0.01245 0.046773 0.050903 180 | -0.013851 0.039778 0.051036 181 | -0.0020294 0.044874 0.047587 182 | -0.011653 0.04686 0.048661 183 | -0.0018611 0.039606 0.047339 184 | -0.0091545 0.03958 0.049415 185 | 0.043661 0.094028 0.02252 186 | 0.034642 0.10473 0.031831 187 | 0.028343 0.1072 0.036339 188 | 0.036339 0.096552 0.034843 189 | 0.031733 0.099372 0.038505 190 | 0.036998 0.10668 0.026781 191 | 0.032875 0.11108 0.02959 192 | 0.040938 0.097132 0.026663 193 | 0.044153 0.086466 0.024241 194 | 0.05375 0.072221 0.020429 195 | 0.04516 0.076574 0.023594 196 | 0.038036 0.086663 0.035459 197 | 0.037861 0.076625 0.035658 198 | 0.042216 0.087237 0.028254 199 | 0.042355 0.076747 0.02858 200 | 0.043875 0.096228 0.015269 201 | 0.044375 0.096797 0.0086445 202 | 0.039545 0.1061 0.017655 203 | 0.042313 0.10009 0.017237 204 | 0.045406 0.087417 0.015604 205 | 0.055118 0.072639 0.017944 206 | 0.048722 0.07376 0.017434 207 | 0.045917 0.086298 0.0094211 208 | 0.019433 0.1096 0.039063 209 | 0.01097 0.11058 0.039648 210 | 0.046657 0.057153 0.031337 211 | 0.056079 0.066335 0.024122 212 | 0.048168 0.06701 0.026298 213 | 0.056055 0.057253 0.024902 214 | 0.051163 0.056662 0.029137 215 | 0.036914 0.067032 0.036122 216 | 0.033 0.06472 0.039903 217 | 0.038004 0.056507 0.033119 218 | 0.030629 0.054915 0.038484 219 | 0.041875 0.066383 0.028357 220 | 0.041434 0.06088 0.029632 221 | 0.044921 0.049904 0.031243 222 | 0.054635 0.050167 0.022044 223 | 0.04828 0.04737 0.025845 224 | 0.037973 0.048347 0.031456 225 | 0.028053 0.047061 0.035991 226 | 0.025595 0.040346 0.03415 227 | 0.038455 0.043509 0.028278 228 | 0.032031 0.043278 0.029253 229 | 0.036581 0.040335 0.025144 230 | 0.03019 0.039321 0.026847 231 | 0.059333 0.067891 0.017361 232 | 0.0465 0.071452 0.01971 233 | 0.059562 0.057747 0.01834 234 | 0.055636 0.049199 0.019173 235 | 0.0505 0.045064 0.019181 236 | 0.023 0.047803 0.039776 237 | 0.022389 0.03886 0.038795 238 | -0.019545 0.0939 0.052205 239 | -0.021462 0.10618 0.042059 240 | -0.031027 0.10395 0.041228 241 | -0.022521 0.097723 0.045194 242 | -0.031858 0.097026 0.043878 243 | -0.043262 0.10412 0.040891 244 | -0.052154 0.10404 0.040972 245 | -0.041875 0.096944 0.042424 246 | -0.051919 0.096967 0.043563 247 | -0.021489 0.086672 0.054767 248 | -0.027 0.083087 0.050284 249 | -0.02107 0.077249 0.054365 250 | -0.026011 0.089634 0.048981 251 | -0.031893 0.087035 0.044169 252 | -0.025625 0.074892 0.047102 253 | -0.03197 0.0769 0.042177 254 | -0.041824 0.086954 0.043295 255 | -0.051825 0.086844 0.044933 256 | -0.041918 0.076728 0.042564 257 | -0.051849 0.076877 0.042992 258 | -0.061339 0.10393 0.041164 259 | -0.072672 0.10976 0.044294 260 | -0.061784 0.096825 0.043327 261 | -0.070058 0.096203 0.041397 262 | -0.080439 0.11091 0.044343 263 | -0.061927 0.086724 0.04452 264 | -0.070344 0.087352 0.041908 265 | -0.06141 0.077489 0.042178 266 | -0.068579 0.080144 0.041024 267 | -0.019045 0.067732 0.052388 268 | -0.017742 0.058909 0.050809 269 | -0.023548 0.066382 0.045226 270 | -0.03399 0.067795 0.040929 271 | -0.02169 0.056549 0.045164 272 | -0.036111 0.060706 0.040407 273 | -0.041231 0.066951 0.041392 274 | -0.048588 0.070956 0.040357 275 | -0.0403 0.059465 0.040446 276 | -0.02192 0.044965 0.052258 277 | -0.029187 0.043585 0.051088 278 | -0.021919 0.039826 0.053521 279 | -0.030331 0.039749 0.052133 280 | -0.021998 0.049847 0.046725 281 | -0.031911 0.046848 0.045187 282 | -0.035276 0.039753 0.047529 283 | -0.042016 0.044823 0.041594 284 | -0.05194 0.044707 0.043498 285 | -0.041928 0.039327 0.043582 286 | -0.051857 0.039252 0.046212 287 | -0.059453 0.04424 0.042862 288 | -0.060765 0.039087 0.044363 289 | -0.024273 0.11038 0.039129 290 | -0.032379 0.10878 0.037952 291 | -0.041152 0.10853 0.037969 292 | -0.051698 0.10906 0.038258 293 | -0.062091 0.10877 0.038274 294 | -0.071655 0.10596 0.037516 295 | -0.074634 0.097746 0.038347 296 | -0.07912 0.10508 0.032308 297 | -0.080203 0.096758 0.033592 298 | -0.08378 0.10568 0.025985 299 | -0.087292 0.10314 0.020825 300 | -0.08521 0.097079 0.02781 301 | -0.088082 0.096456 0.022985 302 | -0.07516 0.08604 0.038816 303 | -0.064577 0.073455 0.03897 304 | -0.072279 0.076416 0.036413 305 | -0.076375 0.072563 0.02873 306 | -0.080031 0.087076 0.03429 307 | -0.078919 0.079371 0.032477 308 | -0.084834 0.086686 0.026974 309 | -0.087891 0.089233 0.022611 310 | -0.081048 0.077169 0.025829 311 | -0.086393 0.10784 0.018635 312 | -0.087672 0.10492 0.017264 313 | -0.089333 0.098483 0.01761 314 | -0.086375 0.083067 0.018607 315 | -0.089179 0.089186 0.018947 316 | -0.082879 0.076109 0.017794 317 | -0.0825 0.074674 0.0071175 318 | -0.026437 0.064141 0.039321 319 | -0.030035 0.06613 0.038942 320 | -0.026131 0.056531 0.038882 321 | -0.031664 0.056657 0.037742 322 | -0.045716 0.064541 0.039166 323 | -0.051959 0.066869 0.036733 324 | -0.042557 0.055545 0.039026 325 | -0.049406 0.056892 0.034344 326 | -0.0555 0.062391 0.029498 327 | -0.05375 0.058574 0.026313 328 | -0.03406 0.050137 0.038577 329 | -0.041741 0.04959 0.03929 330 | -0.050975 0.049435 0.036965 331 | -0.053 0.051065 0.029209 332 | -0.054145 0.054568 0.012257 333 | -0.055848 0.05417 0.0083272 334 | -0.054844 0.049295 0.011462 335 | -0.05615 0.050619 0.0092929 336 | -0.061451 0.068257 0.035376 337 | -0.069725 0.069958 0.032788 338 | -0.062823 0.063322 0.026886 339 | -0.071037 0.066787 0.025228 340 | -0.060857 0.060568 0.022643 341 | -0.067 0.061558 0.020109 342 | -0.0782 0.071279 0.021032 343 | -0.062116 0.045145 0.037802 344 | -0.065473 0.039513 0.037964 345 | -0.06725 0.03742 0.033413 346 | -0.072702 0.065008 0.018701 347 | -0.06145 0.059165 0.018731 348 | -0.0675 0.061479 0.019221 349 | -0.057411 0.054114 0.0038257 350 | -0.079222 0.070654 0.017735 351 | -0.062473 0.04468 0.01111 352 | -0.06725 0.042258 0.010414 353 | -0.066389 0.040515 0.01316 354 | -0.068359 0.038502 0.011958 355 | -0.061381 0.04748 0.007607 356 | -0.068559 0.043549 0.0081576 357 | -0.070929 0.03983 0.0085888 358 | -0.016625 0.18375 -0.019735 359 | -0.015198 0.17471 -0.018868 360 | -0.015944 0.16264 -0.0091037 361 | -0.015977 0.1607 -0.0088072 362 | -0.013251 0.16708 -0.015264 363 | -0.014292 0.16098 -0.011252 364 | -0.013986 0.184 -0.023739 365 | -0.011633 0.17699 -0.023349 366 | -0.0091029 0.16988 -0.021457 367 | -0.025562 0.18273 -0.0096247 368 | -0.02725 0.18254 -0.0094384 369 | -0.025736 0.17948 -0.0089653 370 | -0.031216 0.17589 -0.0051154 371 | -0.020399 0.1845 -0.014943 372 | -0.021339 0.17645 -0.014566 373 | -0.027125 0.17234 -0.010156 374 | -0.03939 0.1733 -0.0023575 375 | -0.022876 0.16406 -0.0078103 376 | -0.031597 0.16651 -0.0049292 377 | -0.0226 0.15912 -0.003799 378 | -0.030372 0.15767 -0.0012672 379 | -0.021158 0.16849 -0.012383 380 | -0.027 0.1712 -0.01022 381 | -0.041719 0.16813 -0.00074958 382 | -0.04825 0.16748 -0.00015191 383 | -0.03725 0.16147 -7.2628e-05 384 | -0.066429 0.15783 -0.0085673 385 | -0.071284 0.15839 -0.005998 386 | -0.065979 0.16288 -0.017792 387 | -0.071623 0.16384 -0.01576 388 | -0.066068 0.16051 -0.013567 389 | -0.073307 0.16049 -0.011832 390 | -0.077 0.16204 -0.019241 391 | -0.077179 0.15851 -0.01495 392 | -0.073691 0.17286 -0.037944 393 | -0.07755 0.17221 -0.039175 394 | -0.065921 0.16586 -0.025022 395 | -0.072095 0.16784 -0.024725 396 | -0.066 0.16808 -0.030916 397 | -0.073448 0.17051 -0.032045 398 | -0.07777 0.16434 -0.025938 399 | -0.077893 0.16039 -0.021299 400 | -0.078211 0.169 -0.034566 401 | -0.034667 0.15131 -0.00071029 402 | -0.066117 0.17353 -0.047453 403 | -0.071986 0.17612 -0.045384 404 | -0.06925 0.182 -0.055026 405 | -0.064992 0.17802 -0.054645 406 | -0.069935 0.17983 -0.051988 407 | -0.07793 0.17516 -0.0444 408 | --------------------------------------------------------------------------------