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