Commit 8f566823 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'java-wrap-ignore-unwrappable-classes'

90419c65 Java: remove `-sourcepath` arguments
3d197c62 Java: vtkRenderWindowPanel needs vtkCanvas
43649332 Java: follow Python
8fc39d6a Common/Core: fix source file property settings
f182a669 vtkWrapJava: make empty files for unwrappable classes
e813774f vtkOpenGLGL2PSHelperImpl: also don't wrap in Python
237c0934 vtkOpenGLBufferObject: include missing <string> header
57839e24

 vtkJavaUtil: support converting constant arrays to Java
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Acked-by: Brad King's avatarBrad King <brad.king@kitware.com>
Acked-by: David Gobbi's avatarDavid Gobbi <david.gobbi@gmail.com>
Merge-request: !3587
parents b932eff5 90419c65
......@@ -79,14 +79,13 @@ $<$<BOOL:$<TARGET_PROPERTY:${TARGET},INCLUDE_DIRECTORIES>>:
# For each class
FOREACH(FILE ${SOURCES})
# should we wrap the file?
get_source_file_property(TMP_WRAP_EXCLUDE ${FILE} WRAP_EXCLUDE)
get_source_file_property(TMP_WRAP_EXCLUDE_PYTHON ${FILE} WRAP_EXCLUDE_PYTHON)
# some wrapped files need to be compiled as objective C++
get_source_file_property(TMP_WRAP_OBJC ${FILE} WRAP_JAVA_OBJC)
# if we should wrap it
IF (NOT TMP_WRAP_EXCLUDE)
IF (NOT TMP_WRAP_EXCLUDE_PYTHON)
# what is the filename without the extension
GET_FILENAME_COMPONENT(TMP_FILENAME ${FILE} NAME_WE)
......
......@@ -100,7 +100,7 @@ foreach (HDR_FILE ${VTK_SMP_HEADERS_TO_CONFIG})
list(APPEND VTK_SMP_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${HDR_FILE})
endforeach()
list(APPEND VTK_SMP_HEADERS vtkSMPTools.h vtkSMPThreadLocalObject.h)
list(APPEND VTK_SMP_HEADERS vtkSMPThreadLocalObject.h)
#-------------------------------------------------------------------------------
# Generate the vtkTypeList_Create macros:
......@@ -631,8 +631,8 @@ set_source_files_properties(
vtkABI.h
vtkAOSDataArrayTemplate.txx
vtkArrayIteratorTemplateInstantiate.cxx
vtkAtomic.h
vtkAutoInit.h
vtkDataArrayPrivate.txx
vtkIOStream.cxx
vtkIOStreamFwd.h
vtkLargeInteger.cxx
......@@ -650,6 +650,8 @@ set_source_files_properties(
vtkWeakPointerBase.cxx
vtkWin32Header.h
vtkWrappingHints.h
${VTK_SMP_SOURCES}
${VTK_SMP_HEADERS}
PROPERTIES WRAP_EXCLUDE_PYTHON 1
)
......
......@@ -12,6 +12,13 @@ set_source_files_properties(
WRAP_EXCLUDE
)
set_source_files_properties(
vtkOpenGLGL2PSHelperImpl.h
vtkOpenGLGL2PSHelperImpl.cxx
PROPERTIES
WRAP_EXCLUDE_PYTHON 1
)
vtk_module_library(${vtk-module} ${Module_SRCS})
include(vtkOpenGL)
......
......@@ -16,6 +16,7 @@
#include "vtkRenderingOpenGL2Module.h" // for export macro
#include "vtkObject.h"
#include <string> // used for std::string
#include <vector> // used for method args
class vtkCellArray;
......
......@@ -207,7 +207,6 @@ if(vtkRenderingCore_ENABLED)
endif()
set(VTK_JAVA_DEPENDENCIES ${VTK_JAVA_DEPENDENCIES}
AxesActor
vtkRenderWindowPanel
)
endif()
......@@ -215,6 +214,11 @@ if(vtkInteractionWidgets_ENABLED)
set(VTK_JAVA_DEPENDENCIES ${VTK_JAVA_DEPENDENCIES}
vtkCanvas
)
if (vtkRenderingCore_ENABLED)
list(APPEND VTK_JAVA_DEPENDENCIES
vtkRenderWindowPanel)
endif ()
endif()
if(vtkRenderingCore_ENABLED AND vtkIOImage_ENABLED)
......@@ -349,7 +353,6 @@ add_custom_command(
-source ${VTK_JAVA_SOURCE_VERSION}
-target ${VTK_JAVA_TARGET_VERSION}
-classpath ${JAVA_COMPILATION_CLASSPATH}
-sourcepath ${VTK_SOURCE_DIR}/Wrapping/Java/
-d ${VTK_BINARY_DIR}/java
@${VTK_BINARY_DIR}/java/javac_stamp.rsp
COMMAND ${CMAKE_COMMAND} -E touch ${VTK_BINARY_DIR}/java/javac_stamp.txt
......@@ -385,7 +388,6 @@ if(BUILD_TESTING)
-classpath ${VTK_JAR_PATH}/vtk.jar${SEPARATOR}${VTK_BINARY_DIR}/Wrapping/Java
-source ${VTK_JAVA_SOURCE_VERSION}
-target ${VTK_JAVA_TARGET_VERSION}
-sourcepath ${VTK_SOURCE_DIR}/Wrapping/Java
-d ${VTK_BINARY_DIR}/Wrapping/Java
${VTK_JAVA_TESTS}
COMMAND ${CMAKE_COMMAND} -E touch ${VTK_BINARY_DIR}/java/javac_tests_stamp.txt
......
......@@ -48,7 +48,7 @@ JNIEXPORT void *vtkJavaGetPointerFromObject(JNIEnv *env, jobject obj)
return obj ? (void*)(size_t)vtkJavaGetId(env, obj) : 0;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfDoubleFromDouble(JNIEnv *env, double *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfDoubleFromDouble(JNIEnv *env, const double *ptr, int size)
{
jdoubleArray ret;
int i;
......@@ -73,7 +73,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfDoubleFromDouble(JNIEnv *env, double *ptr, i
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfDoubleFromFloat(JNIEnv *env, float *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfDoubleFromFloat(JNIEnv *env, const float *ptr, int size)
{
jdoubleArray ret;
int i;
......@@ -98,7 +98,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfDoubleFromFloat(JNIEnv *env, float *ptr, int
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromInt(JNIEnv *env, int *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromInt(JNIEnv *env, const int *ptr, int size)
{
jintArray ret;
int i;
......@@ -123,7 +123,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromInt(JNIEnv *env, int *ptr, int size)
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromIdType(JNIEnv *env, vtkIdType *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromIdType(JNIEnv *env, const vtkIdType *ptr, int size)
{
jintArray ret;
int i;
......@@ -148,7 +148,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromIdType(JNIEnv *env, vtkIdType *ptr, i
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromLongLong(JNIEnv *env, long long *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromLongLong(JNIEnv *env, const long long *ptr, int size)
{
jintArray ret;
int i;
......@@ -173,7 +173,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromLongLong(JNIEnv *env, long long *ptr,
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromSignedChar(JNIEnv *env, signed char *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromSignedChar(JNIEnv *env, const signed char *ptr, int size)
{
jintArray ret;
int i;
......@@ -198,7 +198,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromSignedChar(JNIEnv *env, signed char *
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfFloatFromFloat(JNIEnv *env, float *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfFloatFromFloat(JNIEnv *env, const float *ptr, int size)
{
jfloatArray ret;
int i;
......@@ -223,7 +223,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfFloatFromFloat(JNIEnv *env, float *ptr, int
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfShortFromShort(JNIEnv *env, short *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfShortFromShort(JNIEnv *env, const short *ptr, int size)
{
jshortArray ret;
int i;
......@@ -248,7 +248,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfShortFromShort(JNIEnv *env, short *ptr, int
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfByteFromUnsignedChar(JNIEnv *env, unsigned char *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfByteFromUnsignedChar(JNIEnv *env, const unsigned char *ptr, int size)
{
jbyteArray ret;
int i;
......@@ -273,7 +273,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfByteFromUnsignedChar(JNIEnv *env, unsigned c
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfLongFromLong(JNIEnv *env, long *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfLongFromLong(JNIEnv *env, const long *ptr, int size)
{
cout.flush();
jlongArray ret;
......@@ -299,7 +299,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfLongFromLong(JNIEnv *env, long *ptr, int siz
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedLongFromUnsignedLong(JNIEnv *env,unsigned long *ptr,int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedLongFromUnsignedLong(JNIEnv *env, const unsigned long *ptr,int size)
{
cout.flush();
jlongArray ret;
......@@ -325,7 +325,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedLongFromUnsignedLong(JNIEnv *env,uns
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedShortFromUnsignedShort(JNIEnv *env,unsigned short *ptr,int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedShortFromUnsignedShort(JNIEnv *env, const unsigned short *ptr,int size)
{
cout.flush();
jshortArray ret;
......@@ -351,7 +351,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedShortFromUnsignedShort(JNIEnv *env,u
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedCharFromUnsignedChar(JNIEnv *env,unsigned char *ptr,int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedCharFromUnsignedChar(JNIEnv *env, const unsigned char *ptr,int size)
{
cout.flush();
jbyteArray ret;
......@@ -377,7 +377,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedCharFromUnsignedChar(JNIEnv *env,uns
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedIntFromUnsignedInt(JNIEnv *env,unsigned int *ptr,int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedIntFromUnsignedInt(JNIEnv *env, const unsigned int *ptr,int size)
{
cout.flush();
jintArray ret;
......@@ -403,7 +403,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfUnsignedIntFromUnsignedInt(JNIEnv *env,unsig
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfCharFromChar(JNIEnv *env, char *ptr, int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfCharFromChar(JNIEnv *env, const char *ptr, int size)
{
cout.flush();
jcharArray ret;
......@@ -429,7 +429,7 @@ JNIEXPORT jarray vtkJavaMakeJArrayOfCharFromChar(JNIEnv *env, char *ptr, int siz
return ret;
}
JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromBool(JNIEnv *env, bool *ptr,int size)
JNIEXPORT jarray vtkJavaMakeJArrayOfIntFromBool(JNIEnv *env, const bool *ptr,int size)
{
cout.flush();
jintArray ret;
......
......@@ -31,24 +31,24 @@ extern VTKWRAPPINGJAVA_EXPORT bool vtkJavaUTFToString(JNIEnv *env, jstring in, s
extern VTKWRAPPINGJAVA_EXPORT jstring vtkJavaMakeJavaString(JNIEnv *env, const char *in);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfFloatFromFloat(JNIEnv *env,
float *arr, int size);
const float *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfDoubleFromFloat(JNIEnv *env,
float *arr, int size);
const float *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfDoubleFromDouble(JNIEnv *env,
double *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfShortFromShort(JNIEnv *env, short *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfIntFromInt(JNIEnv *env, int *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfIntFromIdType(JNIEnv *env, vtkIdType *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfIntFromLongLong(JNIEnv *env, long long *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfIntFromSignedChar(JNIEnv *env, signed char *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfLongFromLong(JNIEnv *env, long *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfByteFromUnsignedChar(JNIEnv *env, unsigned char *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfByteFromChar(JNIEnv *env, char *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfCharFromChar(JNIEnv *env, char *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfUnsignedCharFromUnsignedChar(JNIEnv *env, unsigned char *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfUnsignedIntFromUnsignedInt(JNIEnv *env, unsigned int *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfUnsignedShortFromUnsignedShort(JNIEnv *env,unsigned short *ptr,int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfUnsignedLongFromUnsignedLong(JNIEnv *env, unsigned long *arr, int size);
const double *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfShortFromShort(JNIEnv *env, const short *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfIntFromInt(JNIEnv *env, const int *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfIntFromIdType(JNIEnv *env, const vtkIdType *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfIntFromLongLong(JNIEnv *env, const long long *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfIntFromSignedChar(JNIEnv *env, const signed char *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfLongFromLong(JNIEnv *env, const long *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfByteFromUnsignedChar(JNIEnv *env, const unsigned char *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfByteFromChar(JNIEnv *env, const char *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfCharFromChar(JNIEnv *env, const char *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfUnsignedCharFromUnsignedChar(JNIEnv *env, const unsigned char *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfUnsignedIntFromUnsignedInt(JNIEnv *env, const unsigned int *arr, int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfUnsignedShortFromUnsignedShort(JNIEnv *env, const unsigned short *ptr,int size);
extern VTKWRAPPINGJAVA_EXPORT jarray vtkJavaMakeJArrayOfUnsignedLongFromUnsignedLong(JNIEnv *env, const unsigned long *arr, int size);
// this is the void pointer parameter passed to the vtk callback routines on
// behalf of the Java interface for callbacks.
......
......@@ -857,6 +857,21 @@ int main(int argc, char *argv[])
exit(0);
}
if (data->Template)
{
fclose(fp);
exit(0);
}
for (i = 0; i < data->NumberOfSuperClasses; ++i)
{
if (strchr(data->SuperClasses[i], '<'))
{
fclose(fp);
exit(0);
}
}
/* get the hierarchy info for accurate typing */
if (options->HierarchyFileNames)
{
......@@ -872,6 +887,15 @@ int main(int argc, char *argv[])
}
}
if (hierarchyInfo)
{
if (!vtkWrap_IsTypeOf(hierarchyInfo, data->Name, "vtkObjectBase"))
{
fclose(fp);
exit(0);
}
}
fprintf(fp,"// java wrapper for %s object\n//\n",data->Name);
fprintf(fp,"\npackage vtk;\n");
......
......@@ -782,7 +782,7 @@ static int isClassWrapped(const char *classname)
entry = vtkParseHierarchy_FindEntry(hierarchyInfo, classname);
if (entry == 0 ||
vtkParseHierarchy_GetProperty(entry, "WRAP_EXCLUDE") ||
vtkParseHierarchy_GetProperty(entry, "WRAP_EXCLUDE_PYTHON") ||
!vtkParseHierarchy_IsTypeOf(hierarchyInfo, entry, "vtkObjectBase"))
{
return 0;
......@@ -1269,7 +1269,22 @@ int main(int argc, char *argv[])
if ((data = file_info->MainClass) == NULL)
{
fclose(fp);
exit(1);
exit(0);
}
if (data->Template)
{
fclose(fp);
exit(0);
}
for (i = 0; i < data->NumberOfSuperClasses; ++i)
{
if (strchr(data->SuperClasses[i], '<'))
{
fclose(fp);
exit(0);
}
}
/* get the hierarchy info for accurate typing */
......@@ -1287,6 +1302,15 @@ int main(int argc, char *argv[])
}
}
if (hierarchyInfo)
{
if (!vtkWrap_IsTypeOf(hierarchyInfo, data->Name, "vtkObjectBase"))
{
fclose(fp);
exit(0);
}
}
fprintf(fp,"// java wrapper for %s object\n//\n",data->Name);
fprintf(fp,"#define VTK_WRAPPING_CXX\n");
if (strcmp("vtkObjectBase",data->Name) != 0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment