]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Revised native library loading for VTK 98/2898/1 release/1.39.0
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Mon, 13 May 2019 12:06:48 +0000 (15:06 +0300)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Mon, 13 May 2019 12:06:48 +0000 (15:06 +0300)
gitlab #2

Change-Id: If910a60f83ae69d3df81575262a69ac7ce2791c8

vtk/src/vtk/vtkJavaDep.java [new file with mode: 0644]
vtk/src/vtk/vtkObjectBase.java
vtk/src/vtk/vtkPanel.java

diff --git a/vtk/src/vtk/vtkJavaDep.java b/vtk/src/vtk/vtkJavaDep.java
new file mode 100644 (file)
index 0000000..ade1837
--- /dev/null
@@ -0,0 +1,119 @@
+package vtk;
+
+/**
+ * Utility class to load vtk native libraries.
+ * 
+ * @author luukkainen
+ *
+ */
+public class vtkJavaDep {
+         static String[] libs = new String[] {
+                         "vtksys",
+                         "vtkCommonCore",
+                     "vtkWrappingJava",
+                     "vtkCommonCoreJava",
+                     "vtkCommonMath",
+                     "vtkCommonMathJava",
+                     "vtkCommonSystem",
+                     "vtkCommonSystemJava",
+                     "vtkCommonMisc",
+                     "vtkCommonMiscJava",
+                     "vtkCommonTransforms",
+                     "vtkCommonTransformsJava",
+                     "vtkCommonDataModel",
+                     "vtkCommonDataModelJava",
+                     "vtkCommonColor",
+                     "vtkCommonColorJava",
+                     "vtkCommonExecutionModel",
+                     "vtkCommonExecutionModelJava",
+                     "vtkCommonComputationalGeometry",
+                     "vtkCommonComputationalGeometryJava",
+                     "vtkexpat",
+                     "vtkdoubleconversion",
+                     "vtkjpeg",
+                     "vtkzlib",
+                     "vtklz4",
+                     "vtklzma",
+                     "vtktiff",
+                     "vtkpng",
+                     "vtkexpat",
+                     "vtkhdf5",
+                     "vtkhdf5_hl",
+                     "vtkmetaio",
+                     "vtkpugixml",
+                     "vtksqlite",
+                     "vtkogg",
+                     "vtktheora",
+                     "vtkverdict",
+                     "vtkglew",
+                     "vtkproj",
+                     "vtkfreetype",
+                     
+                     "vtkImagingCore",
+                     "vtkImagingCoreJava",
+                     "vtkImagingMath",
+                     "vtkImagingMathJava",
+                     "vtkImagingFourier",
+                     "vtkImagingFourierJava",
+                     "vtkImagingSources",
+                     "vtkImagingSourcesJava",
+                     "vtkImagingHybrid",
+                     "vtkImagingHybridJava",
+                     "vtkImagingColor",
+                     "vtkImagingColorJava",
+                     "vtkImagingGeneral",
+                     "vtkImagingGeneralJava",
+                     
+                     "vtkFiltersCore",
+                     "vtkFiltersCoreJava",
+                     "vtkFiltersGeometry",
+                     "vtkFiltersGeometryJava",
+                     "vtkFiltersGeneral",
+                     "vtkFiltersGeneralJava",
+                     "vtkFiltersSources",
+                     "vtkFiltersSourcesJava",
+                     "vtkFiltersGeneric",
+                     "vtkFiltersGenericJava",
+                     "vtkFiltersStatistics",
+                     "vtkFiltersStatisticsJava",
+                     "vtkFiltersExtraction",
+                     "vtkFiltersExtractionJava",
+                     "vtkFiltersModeling",
+                     "vtkFiltersModelingJava",
+                     
+                     "vtkRenderingCore",
+                     "vtkRenderingCoreJava",
+                     "vtkRenderingOpenGL2",
+                     "vtkRenderingOpenGL2Java",
+                     "vtkRenderingVolume",
+                     "vtkRenderingVolumeJava",
+                     "vtkRenderingVolumeOpenGL2",
+                     "vtkRenderingVolumeOpenGL2Java",
+                     
+                     "vtkRenderingFreeType",
+                     "vtkRenderingFreeTypeJava",
+                     "vtkRenderingAnnotation",
+                     "vtkRenderingAnnotationJava",
+                     
+                     "vtkFiltersHybrid",
+                     "vtkFiltersHybridJava",
+                     
+                     "vtkInteractionStyle",
+                     "vtkInteractionStyleJava",
+                     "vtkInteractionWidgets",
+                     "vtkInteractionWidgetsJava",
+                     "vtkInteractionImage",
+                     "vtkInteractionImageJava",
+                     
+                     };
+         
+         
+         static {
+                 for (String lib : libs)
+                         System.loadLibrary(lib);
+         }
+         
+         static void load() {
+                 
+         }
+}
index 539aa966be433b597de6a4648fa08e2b99349494..5b88cd51664da62ab34e87904cff2e983601aecd 100644 (file)
@@ -44,6 +44,7 @@ public class vtkObjectBase
 
   public static vtk.vtkJavaMemoryManager JAVA_OBJECT_MANAGER = new vtk.vtkJavaMemoryManagerImpl();
   public vtkObjectBase() {
+         vtkJavaDep.load();
     this.vtkId = this.VTKInit();
     vtkObjectBase.JAVA_OBJECT_MANAGER.registerJavaObject(this.vtkId, this);
 }
index 6747f92417dd5f1c2abd6c82d1cb3331fcd83180..aaa340ed4b5bed846762350ada3a43c48543b96a 100644 (file)
@@ -36,110 +36,8 @@ public class vtkPanel extends Canvas implements MouseListener, MouseMotionListen
   protected int InteractionMode = 1;
   protected boolean rendering = false;
   
-  static String[] libs = new String[] {
-                 "vtksys",
-                 "vtkCommonCore",
-             "vtkWrappingJava",
-             "vtkCommonCoreJava",
-             "vtkCommonMath",
-             "vtkCommonMathJava",
-             "vtkCommonSystem",
-             "vtkCommonSystemJava",
-             "vtkCommonMisc",
-             "vtkCommonMiscJava",
-             "vtkCommonTransforms",
-             "vtkCommonTransformsJava",
-             "vtkCommonDataModel",
-             "vtkCommonDataModelJava",
-             "vtkCommonColor",
-             "vtkCommonColorJava",
-             "vtkCommonExecutionModel",
-             "vtkCommonExecutionModelJava",
-             "vtkCommonComputationalGeometry",
-             "vtkCommonComputationalGeometryJava",
-             "vtkexpat",
-             "vtkdoubleconversion",
-             "vtkjpeg",
-             "vtkzlib",
-             "vtklz4",
-             "vtklzma",
-             "vtktiff",
-             "vtkpng",
-             "vtkexpat",
-             "vtkhdf5",
-             "vtkhdf5_hl",
-             "vtkmetaio",
-             "vtkpugixml",
-             "vtksqlite",
-             "vtkogg",
-             "vtktheora",
-             "vtkverdict",
-             "vtkglew",
-             "vtkproj",
-             "vtkfreetype",
-             
-             "vtkImagingCore",
-             "vtkImagingCoreJava",
-             "vtkImagingMath",
-             "vtkImagingMathJava",
-             "vtkImagingFourier",
-             "vtkImagingFourierJava",
-             "vtkImagingSources",
-             "vtkImagingSourcesJava",
-             "vtkImagingHybrid",
-             "vtkImagingHybridJava",
-             "vtkImagingColor",
-             "vtkImagingColorJava",
-             "vtkImagingGeneral",
-             "vtkImagingGeneralJava",
-             
-             "vtkFiltersCore",
-             "vtkFiltersCoreJava",
-             "vtkFiltersGeometry",
-             "vtkFiltersGeometryJava",
-             "vtkFiltersGeneral",
-             "vtkFiltersGeneralJava",
-             "vtkFiltersSources",
-             "vtkFiltersSourcesJava",
-             "vtkFiltersGeneric",
-             "vtkFiltersGenericJava",
-             "vtkFiltersStatistics",
-             "vtkFiltersStatisticsJava",
-             "vtkFiltersExtraction",
-             "vtkFiltersExtractionJava",
-             "vtkFiltersModeling",
-             "vtkFiltersModelingJava",
-             
-             "vtkRenderingCore",
-             "vtkRenderingCoreJava",
-             "vtkRenderingOpenGL2",
-             "vtkRenderingOpenGL2Java",
-             "vtkRenderingVolume",
-             "vtkRenderingVolumeJava",
-             "vtkRenderingVolumeOpenGL2",
-             "vtkRenderingVolumeOpenGL2Java",
-             
-             "vtkRenderingFreeType",
-             "vtkRenderingFreeTypeJava",
-             "vtkRenderingAnnotation",
-             "vtkRenderingAnnotationJava",
-             
-             "vtkFiltersHybrid",
-             "vtkFiltersHybridJava",
-             
-             "vtkInteractionStyle",
-             "vtkInteractionStyleJava",
-             "vtkInteractionWidgets",
-             "vtkInteractionWidgetsJava",
-             "vtkInteractionImage",
-             "vtkInteractionImageJava",
-             
-             };
-  
-  
   static {
-         for (String lib : libs)
-                 System.loadLibrary(lib);
+        vtkJavaDep.load();
   }
 
   // Allow access to display lock() and unlock().
@@ -186,6 +84,7 @@ public class vtkPanel extends Canvas implements MouseListener, MouseMotionListen
   protected native int UnLock();
 
   public vtkPanel() {
+       
     rw.AddRenderer(ren);
     addMouseListener(this);
     addMouseMotionListener(this);