From 26dbeeb6e0dd4270e1b0da654fd4e2444312790b Mon Sep 17 00:00:00 2001 From: scholza Date: Tue, 24 Jul 2012 19:04:32 +0000 Subject: [PATCH 01/51] created jassimp folder git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1296 67173fc5-114c-0410-ac8e-9d2fd5bffc1f From 9687531b20bd414964bcfb8e3a12a17016ebf333 Mon Sep 17 00:00:00 2001 From: scholza Date: Tue, 24 Jul 2012 19:11:04 +0000 Subject: [PATCH 02/51] jassimp initial import git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1297 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- port/jassimp/README | 52 + port/jassimp/build.xml | 45 + port/jassimp/jassimp-native/src/jassimp.cpp | 1408 ++++++++++++++++ port/jassimp/jassimp-native/src/jassimp.h | 31 + .../jassimp/src/jassimp/AiAnimBehavior.java | 112 ++ .../jassimp/src/jassimp/AiAnimation.java | 179 +++ .../jassimp/src/jassimp/AiBlendMode.java | 117 ++ port/jassimp/jassimp/src/jassimp/AiBone.java | 137 ++ .../jassimp/src/jassimp/AiBoneWeight.java | 88 + .../src/jassimp/AiBuiltInWrapperProvider.java | 84 + .../jassimp/jassimp/src/jassimp/AiCamera.java | 303 ++++ port/jassimp/jassimp/src/jassimp/AiColor.java | 162 ++ .../jassimp/jassimp/src/jassimp/AiConfig.java | 15 + .../jassimp/src/jassimp/AiConfigOptions.java | 663 ++++++++ port/jassimp/jassimp/src/jassimp/AiLight.java | 387 +++++ .../jassimp/src/jassimp/AiLightType.java | 112 ++ .../jassimp/src/jassimp/AiMaterial.java | 1202 ++++++++++++++ .../jassimp/src/jassimp/AiMatrix4f.java | 133 ++ port/jassimp/jassimp/src/jassimp/AiMesh.java | 1429 +++++++++++++++++ .../jassimp/src/jassimp/AiMeshAnim.java | 49 + port/jassimp/jassimp/src/jassimp/AiNode.java | 228 +++ .../jassimp/src/jassimp/AiNodeAnim.java | 502 ++++++ .../src/jassimp/AiPostProcessSteps.java | 571 +++++++ .../jassimp/src/jassimp/AiPrimitiveType.java | 113 ++ .../jassimp/src/jassimp/AiQuaternion.java | 166 ++ port/jassimp/jassimp/src/jassimp/AiScene.java | 251 +++ .../jassimp/src/jassimp/AiSceneFlag.java | 153 ++ .../jassimp/src/jassimp/AiShadingMode.java | 168 ++ .../jassimp/src/jassimp/AiTextureInfo.java | 224 +++ .../jassimp/src/jassimp/AiTextureMapMode.java | 113 ++ .../jassimp/src/jassimp/AiTextureMapping.java | 78 + .../jassimp/src/jassimp/AiTextureOp.java | 137 ++ .../jassimp/src/jassimp/AiTextureType.java | 212 +++ .../jassimp/jassimp/src/jassimp/AiVector.java | 195 +++ .../src/jassimp/AiWrapperProvider.java | 149 ++ .../jassimp/jassimp/src/jassimp/JaiDebug.java | 209 +++ port/jassimp/jassimp/src/jassimp/Jassimp.java | 256 +++ .../jassimp/src/jassimp/JassimpConfig.java | 66 + .../jassimp/src/jassimp/package-info.java | 45 + 39 files changed, 10544 insertions(+) create mode 100644 port/jassimp/README create mode 100644 port/jassimp/build.xml create mode 100644 port/jassimp/jassimp-native/src/jassimp.cpp create mode 100644 port/jassimp/jassimp-native/src/jassimp.h create mode 100644 port/jassimp/jassimp/src/jassimp/AiAnimBehavior.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiAnimation.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiBlendMode.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiBone.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiBoneWeight.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiBuiltInWrapperProvider.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiCamera.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiColor.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiConfig.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiConfigOptions.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiLight.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiLightType.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiMaterial.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiMatrix4f.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiMesh.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiMeshAnim.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiNode.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiNodeAnim.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiPostProcessSteps.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiPrimitiveType.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiQuaternion.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiScene.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiSceneFlag.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiShadingMode.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiTextureInfo.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiTextureMapMode.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiTextureMapping.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiTextureOp.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiTextureType.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiVector.java create mode 100644 port/jassimp/jassimp/src/jassimp/AiWrapperProvider.java create mode 100644 port/jassimp/jassimp/src/jassimp/JaiDebug.java create mode 100644 port/jassimp/jassimp/src/jassimp/Jassimp.java create mode 100644 port/jassimp/jassimp/src/jassimp/JassimpConfig.java create mode 100644 port/jassimp/jassimp/src/jassimp/package-info.java diff --git a/port/jassimp/README b/port/jassimp/README new file mode 100644 index 000000000..be78db404 --- /dev/null +++ b/port/jassimp/README @@ -0,0 +1,52 @@ +jassimp +------- + +Java binding for assimp. + +The class model used by jassimp is not a one-to-one mapping of assimps class/ +structure model (due to performance considerations). Please read the javadoc +descriptions of AiMesh and AiWrapperProvider. + +The jassimp.lwjgl package contains a LWJGL specific wrapper provider and some +application examples using this wrapper + + + +How To Build +------------ + + I) native library + +II) Java binding + The java library is built using ant. Executing "ant" in the port/jassimp + directory should be sufficient to build the library including docs. You + still need to build the native library separately, see above + + The java build is configured to create java 1.6 classes + + + +Limitations +----------- + +Not all data imports have been tested yet, especially the countless texture +parameters. If you find bugs please report them. + +jassimp supports most of assimps features. Current limitations are +* only importing scenes is supported. There are some methods that allow a + modification of the returned objects, but these should be considered as + work in progress. Full blown export support is planned for a future release +* no support for mesh animations +* no support for embedded textures +* no support for importer configurations +* no support for the custom I/O API of assimp +* some texture related material properties are not exposed via the API but only + accessible by traversing the list of properties. However this limitation is + also present in the c-API ... + + +License +------- + +The license for jassimp is the same as the main Assimp license. + diff --git a/port/jassimp/build.xml b/port/jassimp/build.xml new file mode 100644 index 000000000..d81d1958a --- /dev/null +++ b/port/jassimp/build.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/port/jassimp/jassimp-native/src/jassimp.cpp b/port/jassimp/jassimp-native/src/jassimp.cpp new file mode 100644 index 000000000..ae64ad191 --- /dev/null +++ b/port/jassimp/jassimp-native/src/jassimp.cpp @@ -0,0 +1,1408 @@ +#include "jassimp.h" + +#include +#include + + +#ifdef JNI_LOG +#define lprintf(...) printf (__VA_ARGS__) +#else +#define lprintf +#endif + + +static bool createInstance(JNIEnv *env, const char* className, jobject& newInstance) +{ + jclass clazz = env->FindClass(className); + + if (NULL == clazz) + { + lprintf("could not find class %s\n", className); + return false; + } + + jmethodID ctr_id = env->GetMethodID(clazz, "", "()V"); + + if (NULL == ctr_id) + { + lprintf("could not find no-arg constructor for class %s\n", className); + return false; + } + + newInstance = env->NewObject(clazz, ctr_id); + + if (NULL == newInstance) + { + lprintf("error calling no-arg constructor for class %s\n", className); + return false; + } + + return true; +} + + +static bool createInstance(JNIEnv *env, const char* className, const char* signature, const jvalue* params, jobject& newInstance) +{ + jclass clazz = env->FindClass(className); + + if (NULL == clazz) + { + lprintf("could not find class %s\n", className); + return false; + } + + jmethodID ctr_id = env->GetMethodID(clazz, "", signature); + + if (NULL == ctr_id) + { + lprintf("could not find no-arg constructor for class %s\n", className); + return false; + } + + newInstance = env->NewObjectA(clazz, ctr_id, params); + + if (NULL == newInstance) + { + lprintf("error calling constructor for class %s, signature %s\n", className, signature); + return false; + } + + return true; +} + + +static bool getField(JNIEnv *env, jobject object, const char* fieldName, const char* signature, jobject& field) +{ + jclass clazz = env->GetObjectClass(object); + + if (NULL == clazz) + { + lprintf("could not get class for object\n"); + return false; + } + + jfieldID fieldId = env->GetFieldID(clazz, fieldName, signature); + + if (NULL == fieldId) + { + lprintf("could not get field %s with signature %s\n", fieldName, signature); + return false; + } + + field = env->GetObjectField(object, fieldId); + + return true; +} + + +static bool setIntField(JNIEnv *env, jobject object, const char* fieldName, jint value) +{ + jclass clazz = env->GetObjectClass(object); + + if (NULL == clazz) + { + lprintf("could not get class for object\n"); + return false; + } + + jfieldID fieldId = env->GetFieldID(clazz, fieldName, "I"); + + if (NULL == fieldId) + { + lprintf("could not get field %s with signature I\n", fieldName); + return false; + } + + env->SetIntField(object, fieldId, value); + + return true; +} + + +static bool setFloatField(JNIEnv *env, jobject object, const char* fieldName, jfloat value) +{ + jclass clazz = env->GetObjectClass(object); + + if (NULL == clazz) + { + lprintf("could not get class for object\n"); + return false; + } + + jfieldID fieldId = env->GetFieldID(clazz, fieldName, "F"); + + if (NULL == fieldId) + { + lprintf("could not get field %s with signature F\n", fieldName); + return false; + } + + env->SetFloatField(object, fieldId, value); + + return true; +} + + +static bool setObjectField(JNIEnv *env, jobject object, const char* fieldName, const char* signature, jobject value) +{ + jclass clazz = env->GetObjectClass(object); + + if (NULL == clazz) + { + lprintf("could not get class for object\n"); + return false; + } + + jfieldID fieldId = env->GetFieldID(clazz, fieldName, signature); + + if (NULL == fieldId) + { + lprintf("could not get field %s with signature %s\n", fieldName, signature); + return false; + } + + env->SetObjectField(object, fieldId, value); + + return true; +} + + +static bool getStaticField(JNIEnv *env, const char* className, const char* fieldName, const char* signature, jobject& field) +{ + jclass clazz = env->FindClass(className); + + if (NULL == clazz) + { + lprintf("could not find class %s\n", className); + return false; + } + + jfieldID fieldId = env->GetFieldID(clazz, fieldName, signature); + + if (NULL == fieldId) + { + lprintf("could not get field %s with signature %s\n", fieldName, signature); + return false; + } + + field = env->GetStaticObjectField(clazz, fieldId); + + return true; +} + + +static bool call(JNIEnv *env, jobject object, const char* typeName, const char* methodName, + const char* signature, const jvalue* params) +{ + jclass clazz = env->FindClass(typeName); + + if (NULL == clazz) + { + lprintf("could not find class %s\n", typeName); + return false; + } + + jmethodID mid = env->GetMethodID(clazz, methodName, signature); + + if (NULL == mid) + { + lprintf("could not find method %s with signature %s in type %s\n", methodName, signature, typeName); + return false; + } + + env->CallVoidMethodA(object, mid, params); + + return true; +} + + +static bool callStaticObject(JNIEnv *env, const char* typeName, const char* methodName, + const char* signature, const jvalue* params, jobject& returnValue) +{ + jclass clazz = env->FindClass(typeName); + + if (NULL == clazz) + { + lprintf("could not find class %s\n", typeName); + return false; + } + + jmethodID mid = env->GetStaticMethodID(clazz, methodName, signature); + + if (NULL == mid) + { + lprintf("could not find method %s with signature %s in type %s\n", methodName, signature, typeName); + return false; + } + + returnValue = env->CallStaticObjectMethodA(clazz, mid, params); + + return true; +} + + +static bool copyBuffer(JNIEnv *env, jobject jMesh, const char* jBufferName, void* cData, size_t size) +{ + jobject jBuffer = NULL; + + if (!getField(env, jMesh, jBufferName, "Ljava/nio/ByteBuffer;", jBuffer)) + { + return false; + } + + if (env->GetDirectBufferCapacity(jBuffer) != size) + { + lprintf("invalid direct buffer, expected %u, got %u\n", size, env->GetDirectBufferCapacity(jBuffer)); + return false; + } + + void* jBufferPtr = env->GetDirectBufferAddress(jBuffer); + + if (NULL == jBufferPtr) + { + lprintf("could not access direct buffer\n"); + return false; + } + + memcpy(jBufferPtr, cData, size); + + return true; +} + + +static bool copyBufferArray(JNIEnv *env, jobject jMesh, const char* jBufferName, int index, void* cData, size_t size) +{ + jobject jBufferArray = NULL; + + if (!getField(env, jMesh, jBufferName, "[Ljava/nio/ByteBuffer;", jBufferArray)) + { + return false; + } + + jobject jBuffer = env->GetObjectArrayElement((jobjectArray) jBufferArray, index); + + if (env->GetDirectBufferCapacity(jBuffer) != size) + { + lprintf("invalid direct buffer, expected %u, got %u\n", size, env->GetDirectBufferCapacity(jBuffer)); + return false; + } + + void* jBufferPtr = env->GetDirectBufferAddress(jBuffer); + + if (NULL == jBufferPtr) + { + lprintf("could not access direct buffer\n"); + return false; + } + + memcpy(jBufferPtr, cData, size); + + return true; +} + + + +static bool loadMeshes(JNIEnv *env, const aiScene* cScene, jobject& jScene) +{ + for (unsigned int meshNr = 0; meshNr < cScene->mNumMeshes; meshNr++) + { + const aiMesh *cMesh = cScene->mMeshes[meshNr]; + + lprintf("converting mesh %s ...\n", cMesh->mName.C_Str()); + + /* create mesh */ + jobject jMesh = NULL; + + if (!createInstance(env, "jassimp/AiMesh", jMesh)) + { + return false; + } + + + /* add mesh to m_meshes java.util.List */ + jobject jMeshes = NULL; + + if (!getField(env, jScene, "m_meshes", "Ljava/util/List;", jMeshes)) + { + return false; + } + + jvalue addParams[1]; + addParams[0].l = jMesh; + if (!call(env, jMeshes, "java/util/Collection", "add", "(Ljava/lang/Object;)Z", addParams)) + { + return false; + } + + + /* set general mesh data in java */ + jvalue setTypesParams[1]; + setTypesParams[0].i = cMesh->mPrimitiveTypes; + if (!call(env, jMesh, "jassimp/AiMesh", "setPrimitiveTypes", "(I)V", setTypesParams)) + { + return false; + } + + + if (!setIntField(env, jMesh, "m_materialIndex", cMesh->mMaterialIndex)) + { + return false; + } + + if (!setObjectField(env, jMesh, "m_name", "Ljava/lang/String;", env->NewStringUTF(cMesh->mName.C_Str()))) + { + return false; + } + + + /* determine face buffer size */ + bool isPureTriangle = cMesh->mPrimitiveTypes == aiPrimitiveType_TRIANGLE; + size_t faceBufferSize; + if (isPureTriangle) + { + faceBufferSize = cMesh->mNumFaces * 3 * sizeof(unsigned int); + } + else + { + int numVertexReferences = 0; + for (unsigned int face = 0; face < cMesh->mNumFaces; face++) + { + numVertexReferences += cMesh->mFaces[face].mNumIndices; + } + + faceBufferSize = numVertexReferences * sizeof(unsigned int); + } + + + /* allocate buffers - we do this from java so they can be garbage collected */ + jvalue allocateBuffersParams[4]; + allocateBuffersParams[0].i = cMesh->mNumVertices; + allocateBuffersParams[1].i = cMesh->mNumFaces; + allocateBuffersParams[2].z = isPureTriangle; + allocateBuffersParams[3].i = (jint) faceBufferSize; + if (!call(env, jMesh, "jassimp/AiMesh", "allocateBuffers", "(IIZI)V", allocateBuffersParams)) + { + return false; + } + + + if (cMesh->mNumVertices > 0) + { + /* push vertex data to java */ + if (!copyBuffer(env, jMesh, "m_vertices", cMesh->mVertices, cMesh->mNumVertices * sizeof(aiVector3D))) + { + lprintf("could not copy vertex data\n"); + return false; + } + + lprintf(" with %u vertices\n", cMesh->mNumVertices); + } + + + /* push face data to java */ + if (cMesh->mNumFaces > 0) + { + if (isPureTriangle) + { + char* faceBuffer = (char*) malloc(faceBufferSize); + + size_t faceDataSize = 3 * sizeof(unsigned int); + for (unsigned int face = 0; face < cMesh->mNumFaces; face++) + { + memcpy(faceBuffer + face * faceDataSize, cMesh->mFaces[face].mIndices, faceDataSize); + } + + bool res = copyBuffer(env, jMesh, "m_faces", faceBuffer, faceBufferSize); + + free(faceBuffer); + + if (!res) + { + lprintf("could not copy face data\n"); + return false; + } + } + else + { + char* faceBuffer = (char*) malloc(faceBufferSize); + char* offsetBuffer = (char*) malloc(cMesh->mNumFaces * sizeof(unsigned int)); + + size_t faceBufferPos = 0; + for (unsigned int face = 0; face < cMesh->mNumFaces; face++) + { + size_t faceBufferOffset = faceBufferPos / sizeof(unsigned int); + memcpy(offsetBuffer + face * sizeof(unsigned int), &faceBufferOffset, sizeof(unsigned int)); + + size_t faceDataSize = cMesh->mFaces[face].mNumIndices * sizeof(unsigned int); + memcpy(faceBuffer + faceBufferPos, cMesh->mFaces[face].mIndices, faceDataSize); + faceBufferPos += faceDataSize; + } + + if (faceBufferPos != faceBufferSize) + { + /* this should really not happen */ + lprintf("faceBufferPos %u, faceBufferSize %u\n", faceBufferPos, faceBufferSize); + env->FatalError("error copying face data"); + exit(-1); + } + + + bool res = copyBuffer(env, jMesh, "m_faces", faceBuffer, faceBufferSize); + res &= copyBuffer(env, jMesh, "m_faceOffsets", offsetBuffer, cMesh->mNumFaces * sizeof(unsigned int)); + + free(faceBuffer); + free(offsetBuffer); + + if (!res) + { + lprintf("could not copy face data\n"); + return false; + } + } + + lprintf(" with %u faces\n", cMesh->mNumFaces); + } + + + /* push normals to java */ + if (cMesh->HasNormals()) + { + jvalue allocateDataChannelParams[2]; + allocateDataChannelParams[0].i = 0; + allocateDataChannelParams[1].i = 0; + if (!call(env, jMesh, "jassimp/AiMesh", "allocateDataChannel", "(II)V", allocateDataChannelParams)) + { + lprintf("could not allocate normal data channel\n"); + return false; + } + if (!copyBuffer(env, jMesh, "m_normals", cMesh->mNormals, cMesh->mNumVertices * 3 * sizeof(float))) + { + lprintf("could not copy normal data\n"); + return false; + } + + lprintf(" with normals\n"); + } + + + /* push tangents to java */ + if (cMesh->mTangents != NULL) + { + jvalue allocateDataChannelParams[2]; + allocateDataChannelParams[0].i = 1; + allocateDataChannelParams[1].i = 0; + if (!call(env, jMesh, "jassimp/AiMesh", "allocateDataChannel", "(II)V", allocateDataChannelParams)) + { + lprintf("could not allocate tangents data channel\n"); + return false; + } + if (!copyBuffer(env, jMesh, "m_tangents", cMesh->mTangents, cMesh->mNumVertices * 3 * sizeof(float))) + { + lprintf("could not copy tangents data\n"); + return false; + } + + lprintf(" with tangents\n"); + } + + + /* push bitangents to java */ + if (cMesh->mBitangents != NULL) + { + jvalue allocateDataChannelParams[2]; + allocateDataChannelParams[0].i = 2; + allocateDataChannelParams[1].i = 0; + if (!call(env, jMesh, "jassimp/AiMesh", "allocateDataChannel", "(II)V", allocateDataChannelParams)) + { + lprintf("could not allocate bitangents data channel\n"); + return false; + } + if (!copyBuffer(env, jMesh, "m_bitangents", cMesh->mBitangents, cMesh->mNumVertices * 3 * sizeof(float))) + { + lprintf("could not copy bitangents data\n"); + return false; + } + + lprintf(" with bitangents\n"); + } + + + /* push color sets to java */ + for (int c = 0; c < AI_MAX_NUMBER_OF_COLOR_SETS; c++) + { + if (cMesh->mColors[c] != NULL) + { + jvalue allocateDataChannelParams[2]; + allocateDataChannelParams[0].i = 3; + allocateDataChannelParams[1].i = c; + if (!call(env, jMesh, "jassimp/AiMesh", "allocateDataChannel", "(II)V", allocateDataChannelParams)) + { + lprintf("could not allocate colorset data channel\n"); + return false; + } + if (!copyBufferArray(env, jMesh, "m_colorsets", c, cMesh->mColors[c], cMesh->mNumVertices * 4 * sizeof(float))) + { + lprintf("could not copy colorset data\n"); + return false; + } + + lprintf(" with colorset[%d]\n", c); + } + } + + + /* push tex coords to java */ + for (int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS; c++) + { + if (cMesh->mTextureCoords[c] != NULL) + { + jvalue allocateDataChannelParams[2]; + + switch (cMesh->mNumUVComponents[c]) + { + case 1: + allocateDataChannelParams[0].i = 4; + break; + case 2: + allocateDataChannelParams[0].i = 5; + break; + case 3: + allocateDataChannelParams[0].i = 6; + break; + default: + return false; + } + + allocateDataChannelParams[1].i = c; + if (!call(env, jMesh, "jassimp/AiMesh", "allocateDataChannel", "(II)V", allocateDataChannelParams)) + { + lprintf("could not allocate texture coordinates data channel\n"); + return false; + } + + /* gather data */ + size_t coordBufferSize = cMesh->mNumVertices * cMesh->mNumUVComponents[c] * sizeof(float); + char* coordBuffer = (char*) malloc(coordBufferSize); + size_t coordBufferOffset = 0; + + for (unsigned int v = 0; v < cMesh->mNumVertices; v++) + { + memcpy(coordBuffer + coordBufferOffset, &cMesh->mTextureCoords[c][v], cMesh->mNumUVComponents[c] * sizeof(float)); + coordBufferOffset += cMesh->mNumUVComponents[c] * sizeof(float); + } + + if (coordBufferOffset != coordBufferSize) + { + /* this should really not happen */ + lprintf("coordBufferPos %u, coordBufferSize %u\n", coordBufferOffset, coordBufferSize); + env->FatalError("error copying coord data"); + exit(-1); + } + + bool res = copyBufferArray(env, jMesh, "m_texcoords", c, coordBuffer, coordBufferSize); + + free(coordBuffer); + + if (!res) + { + lprintf("could not copy texture coordinates data\n"); + return false; + } + + lprintf(" with %uD texcoord[%d]\n", cMesh->mNumUVComponents[c], c); + } + } + + + for (unsigned int b = 0; b < cMesh->mNumBones; b++) + { + aiBone *cBone = cMesh->mBones[b]; + + jobject jBone; + if (!createInstance(env, "jassimp/AiBone", jBone)) + { + return false; + } + + /* add bone to bone list */ + jobject jBones = NULL; + + if (!getField(env, jMesh, "m_bones", "Ljava/util/List;", jBones)) + { + return false; + } + + jvalue addParams[1]; + addParams[0].l = jBone; + if (!call(env, jBones, "java/util/Collection", "add", "(Ljava/lang/Object;)Z", addParams)) + { + return false; + } + + /* set bone data */ + if (!setObjectField(env, jBone, "m_name", "Ljava/lang/String;", env->NewStringUTF(cBone->mName.C_Str()))) + { + return false; + } + + /* add bone weights */ + for (unsigned int w = 0; w < cBone->mNumWeights; w++) + { + jobject jBoneWeight; + if (!createInstance(env, "jassimp/AiBoneWeight", jBoneWeight)) + { + return false; + } + + /* add boneweight to bone list */ + jobject jBoneWeights = NULL; + + if (!getField(env, jBone, "m_boneWeights", "Ljava/util/List;", jBoneWeights)) + { + return false; + } + + + /* copy offset matrix */ + jfloatArray jMatrixArr = env->NewFloatArray(16); + env->SetFloatArrayRegion(jMatrixArr, 0, 16, (jfloat*) &cBone->mOffsetMatrix); + + jvalue wrapParams[1]; + wrapParams[0].l = jMatrixArr; + jobject jMatrix; + + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapMatrix", "([F)Ljava/lang/Object;", wrapParams, jMatrix)) + { + return false; + } + + if (!setObjectField(env, jBone, "m_offsetMatrix", "Ljava/lang/Object;", jMatrix)) + { + return false; + } + + + jvalue addBwParams[1]; + addBwParams[0].l = jBoneWeight; + if (!call(env, jBoneWeights, "java/util/Collection", "add", "(Ljava/lang/Object;)Z", addBwParams)) + { + return false; + } + + + if (!setIntField(env, jBoneWeight, "m_vertexId", cBone->mWeights[w].mVertexId)) + { + return false; + } + + if (!setFloatField(env, jBoneWeight, "m_weight", cBone->mWeights[w].mWeight)) + { + return false; + } + } + } + } + + return true; +} + + +static bool loadSceneNode(JNIEnv *env, const aiNode *cNode, jobject parent, jobject* loadedNode = NULL) +{ + lprintf(" converting node %s ...\n", cNode->mName.C_Str()); + + /* wrap matrix */ + jfloatArray jMatrixArr = env->NewFloatArray(16); + env->SetFloatArrayRegion(jMatrixArr, 0, 16, (jfloat*) &cNode->mTransformation); + + jvalue wrapMatParams[1]; + wrapMatParams[0].l = jMatrixArr; + jobject jMatrix; + + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapMatrix", "([F)Ljava/lang/Object;", wrapMatParams, jMatrix)) + { + return false; + } + + + /* create mesh references array */ + jintArray jMeshrefArr = env->NewIntArray(cNode->mNumMeshes); + jint *temp = (jint*) malloc(sizeof(jint) * cNode->mNumMeshes); + + for (unsigned int i = 0; i < cNode->mNumMeshes; i++) + { + temp[i] = cNode->mMeshes[i]; + } + env->SetIntArrayRegion(jMeshrefArr, 0, cNode->mNumMeshes, (jint*) temp); + + free(temp); + + + /* convert name */ + jstring jNodeName = env->NewStringUTF(cNode->mName.C_Str()); + + + /* wrap scene node */ + jvalue wrapNodeParams[4]; + wrapNodeParams[0].l = parent; + wrapNodeParams[1].l = jMatrix; + wrapNodeParams[2].l = jMeshrefArr; + wrapNodeParams[3].l = jNodeName; + jobject jNode; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapSceneNode", + "(Ljava/lang/Object;Ljava/lang/Object;[ILjava/lang/String;)Ljava/lang/Object;", wrapNodeParams, jNode)) + { + return false; + } + + + /* and recurse */ + for (unsigned int c = 0; c < cNode->mNumChildren; c++) + { + if (!loadSceneNode(env, cNode->mChildren[c], jNode)) + { + return false; + } + } + + if (NULL != loadedNode) + { + *loadedNode = jNode; + } + + return true; +} + + +static bool loadSceneGraph(JNIEnv *env, const aiScene* cScene, jobject& jScene) +{ + lprintf("converting scene graph ...\n"); + + if (NULL != cScene->mRootNode) + { + jobject jRoot; + + if (!loadSceneNode(env, cScene->mRootNode, NULL, &jRoot)) + { + return false; + } + + if (!setObjectField(env, jScene, "m_sceneRoot", "Ljava/lang/Object;", jRoot)) + { + return false; + } + } + + lprintf("converting scene graph finished\n"); + + return true; +} + + +static bool loadMaterials(JNIEnv *env, const aiScene* cScene, jobject& jScene) +{ + for (unsigned int m = 0; m < cScene->mNumMaterials; m++) + { + const aiMaterial* cMaterial = cScene->mMaterials[m]; + + lprintf("converting material ...\n", m); + + jobject jMaterial = NULL; + + if (!createInstance(env, "jassimp/AiMaterial", jMaterial)) + { + return false; + } + + /* add material to m_materials java.util.List */ + jobject jMaterials = NULL; + + if (!getField(env, jScene, "m_materials", "Ljava/util/List;", jMaterials)) + { + return false; + } + + jvalue addMatParams[1]; + addMatParams[0].l = jMaterial; + if (!call(env, jMaterials, "java/util/Collection", "add", "(Ljava/lang/Object;)Z", addMatParams)) + { + return false; + } + + /* set texture numbers */ + for (int ttInd = aiTextureType_DIFFUSE; ttInd < aiTextureType_UNKNOWN; ttInd++) + { + aiTextureType tt = static_cast(ttInd); + + unsigned int num = cMaterial->GetTextureCount(tt); + + lprintf(" found %d textures of type %d ...\n", num, ttInd); + + jvalue setNumberParams[2]; + setNumberParams[0].i = ttInd; + setNumberParams[1].i = num; + + if (!call(env, jMaterial, "jassimp/AiMaterial", "setTextureNumber", "(II)V", setNumberParams)) + { + return false; + } + } + + + for (unsigned int p = 0; p < cMaterial->mNumProperties; p++) + { + //printf("%s - %u - %u\n", cScene->mMaterials[m]->mProperties[p]->mKey.C_Str(), + // cScene->mMaterials[m]->mProperties[p]->mSemantic, + // cScene->mMaterials[m]->mProperties[p]->mDataLength); + + const aiMaterialProperty* cProperty = cMaterial->mProperties[p]; + + lprintf(" converting property %s ...\n", cProperty->mKey.C_Str()); + + jobject jProperty = NULL; + + jvalue constructorParams[5]; + constructorParams[0].l = env->NewStringUTF(cProperty->mKey.C_Str()); + constructorParams[1].i = cProperty->mSemantic; + constructorParams[2].i = cProperty->mIndex; + constructorParams[3].i = cProperty->mType; + + + /* special case conversion for color3 */ + if (NULL != strstr(cProperty->mKey.C_Str(), "clr") && + cProperty->mType == aiPTI_Float && + cProperty->mDataLength == 3 * sizeof(float)) + { + jobject jData = NULL; + + /* wrap color */ + jvalue wrapColorParams[3]; + wrapColorParams[0].f = ((float*) cProperty->mData)[0]; + wrapColorParams[1].f = ((float*) cProperty->mData)[1]; + wrapColorParams[2].f = ((float*) cProperty->mData)[2]; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapColor3", "(FFF)Ljava/lang/Object;", wrapColorParams, jData)) + { + return false; + } + + constructorParams[4].l = jData; + if (!createInstance(env, "jassimp/AiMaterial$Property", "(Ljava/lang/String;IIILjava/lang/Object;)V", + constructorParams, jProperty)) + { + return false; + } + } + /* special case conversion for color4 */ + else if (NULL != strstr(cProperty->mKey.C_Str(), "clr") && + cProperty->mType == aiPTI_Float && + cProperty->mDataLength == 4 * sizeof(float)) + { + jobject jData = NULL; + + /* wrap color */ + jvalue wrapColorParams[4]; + wrapColorParams[0].f = ((float*) cProperty->mData)[0]; + wrapColorParams[1].f = ((float*) cProperty->mData)[1]; + wrapColorParams[2].f = ((float*) cProperty->mData)[2]; + wrapColorParams[3].f = ((float*) cProperty->mData)[3]; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapColor4", "(FFFF)Ljava/lang/Object;", wrapColorParams, jData)) + { + return false; + } + + constructorParams[4].l = jData; + if (!createInstance(env, "jassimp/AiMaterial$Property", "(Ljava/lang/String;IIILjava/lang/Object;)V", + constructorParams, jProperty)) + { + return false; + } + } + else if (cProperty->mType == aiPTI_Float && cProperty->mDataLength == sizeof(float)) + { + jobject jData = NULL; + + jvalue newFloatParams[1]; + newFloatParams[0].f = ((float*) cProperty->mData)[0]; + if (!createInstance(env, "java/lang/Float", "(F)V", newFloatParams, jData)) + { + return false; + } + + constructorParams[4].l = jData; + if (!createInstance(env, "jassimp/AiMaterial$Property", "(Ljava/lang/String;IIILjava/lang/Object;)V", + constructorParams, jProperty)) + { + return false; + } + } + else if (cProperty->mType == aiPTI_Integer && cProperty->mDataLength == sizeof(int)) + { + jobject jData = NULL; + + jvalue newIntParams[1]; + newIntParams[0].i = ((int*) cProperty->mData)[0]; + if (!createInstance(env, "java/lang/Integer", "(I)V", newIntParams, jData)) + { + return false; + } + + constructorParams[4].l = jData; + if (!createInstance(env, "jassimp/AiMaterial$Property", "(Ljava/lang/String;IIILjava/lang/Object;)V", + constructorParams, jProperty)) + { + return false; + } + } + else if (cProperty->mType == aiPTI_String) + { + /* skip length prefix */ + jobject jData = env->NewStringUTF(cProperty->mData + 4); + + constructorParams[4].l = jData; + if (!createInstance(env, "jassimp/AiMaterial$Property", "(Ljava/lang/String;IIILjava/lang/Object;)V", + constructorParams, jProperty)) + { + return false; + } + } + else + { + constructorParams[4].i = cProperty->mDataLength; + + /* generic copy code, uses dump ByteBuffer on java side */ + if (!createInstance(env, "jassimp/AiMaterial$Property", "(Ljava/lang/String;IIII)V", constructorParams, jProperty)) + { + return false; + } + + jobject jBuffer = NULL; + + if (!getField(env, jProperty, "m_data", "Ljava/lang/Object;", jBuffer)) + { + return false; + } + + if (env->GetDirectBufferCapacity(jBuffer) != cProperty->mDataLength) + { + lprintf("invalid direct buffer\n"); + return false; + } + + void* jBufferPtr = env->GetDirectBufferAddress(jBuffer); + + if (NULL == jBufferPtr) + { + lprintf("could not access direct buffer\n"); + return false; + } + + memcpy(jBufferPtr, cProperty->mData, cProperty->mDataLength); + } + + + /* add property */ + jobject jProperties = NULL; + + if (!getField(env, jMaterial, "m_properties", "Ljava/util/List;", jProperties)) + { + return false; + } + + jvalue addPropParams[1]; + addPropParams[0].l = jProperty; + if (!call(env, jProperties, "java/util/Collection", "add", "(Ljava/lang/Object;)Z", addPropParams)) + { + return false; + } + } + } + + lprintf("materials finished\n"); + + return true; +} + + +static bool loadAnimations(JNIEnv *env, const aiScene* cScene, jobject& jScene) +{ + lprintf("converting %d animations ...\n", cScene->mNumAnimations); + + for (unsigned int a = 0; a < cScene->mNumAnimations; a++) + { + const aiAnimation *cAnimation = cScene->mAnimations[a]; + + lprintf(" converting animation %s ...\n", cAnimation->mName.C_Str()); + + jobject jAnimation; + jvalue newAnimParams[3]; + newAnimParams[0].l = env->NewStringUTF(cAnimation->mName.C_Str()); + newAnimParams[1].d = cAnimation->mDuration; + newAnimParams[2].d = cAnimation->mTicksPerSecond; + + if (!createInstance(env, "jassimp/AiAnimation", "(Ljava/lang/String;DD)V", newAnimParams, jAnimation)) + { + return false; + } + + /* add animation to m_animations java.util.List */ + jobject jAnimations = NULL; + + if (!getField(env, jScene, "m_animations", "Ljava/util/List;", jAnimations)) + { + return false; + } + + jvalue addParams[1]; + addParams[0].l = jAnimation; + if (!call(env, jAnimations, "java/util/Collection", "add", "(Ljava/lang/Object;)Z", addParams)) + { + return false; + } + + + for (unsigned int c = 0; c < cAnimation->mNumChannels; c++) + { + const aiNodeAnim *cNodeAnim = cAnimation->mChannels[c]; + + jobject jNodeAnim; + jvalue newNodeAnimParams[6]; + newNodeAnimParams[0].l = env->NewStringUTF(cNodeAnim->mNodeName.C_Str()); + newNodeAnimParams[1].i = cNodeAnim->mNumPositionKeys; + newNodeAnimParams[2].i = cNodeAnim->mNumRotationKeys; + newNodeAnimParams[3].i = cNodeAnim->mNumScalingKeys; + newNodeAnimParams[4].i = cNodeAnim->mPreState; + newNodeAnimParams[5].i = cNodeAnim->mPostState; + + if (!createInstance(env, "jassimp/AiNodeAnim", "(Ljava/lang/String;IIIII)V", newNodeAnimParams, jNodeAnim)) + { + return false; + } + + + /* add nodeanim to m_animations java.util.List */ + jobject jNodeAnims = NULL; + + if (!getField(env, jAnimation, "m_nodeAnims", "Ljava/util/List;", jNodeAnims)) + { + return false; + } + + jvalue addParams[1]; + addParams[0].l = jNodeAnim; + if (!call(env, jNodeAnims, "java/util/Collection", "add", "(Ljava/lang/Object;)Z", addParams)) + { + return false; + } + + /* copy keys */ + if (!copyBuffer(env, jNodeAnim, "m_posKeys", cNodeAnim->mPositionKeys, + cNodeAnim->mNumPositionKeys * sizeof(aiVectorKey))) + { + return false; + } + + if (!copyBuffer(env, jNodeAnim, "m_rotKeys", cNodeAnim->mRotationKeys, + cNodeAnim->mNumRotationKeys * sizeof(aiQuatKey))) + { + return false; + } + + if (!copyBuffer(env, jNodeAnim, "m_scaleKeys", cNodeAnim->mScalingKeys, + cNodeAnim->mNumScalingKeys * sizeof(aiVectorKey))) + { + return false; + } + } + } + + lprintf("converting animations finished\n"); + + return true; +} + + +static bool loadLights(JNIEnv *env, const aiScene* cScene, jobject& jScene) +{ + lprintf("converting %d lights ...\n", cScene->mNumLights); + + for (unsigned int l = 0; l < cScene->mNumLights; l++) + { + const aiLight *cLight = cScene->mLights[l]; + + lprintf("converting light %s ...\n", cLight->mName.C_Str()); + + /* wrap color nodes */ + jvalue wrapColorParams[3]; + wrapColorParams[0].f = cLight->mColorDiffuse.r; + wrapColorParams[1].f = cLight->mColorDiffuse.g; + wrapColorParams[2].f = cLight->mColorDiffuse.b; + jobject jDiffuse; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapColor3", "(FFF)Ljava/lang/Object;", wrapColorParams, jDiffuse)) + { + return false; + } + + wrapColorParams[0].f = cLight->mColorSpecular.r; + wrapColorParams[1].f = cLight->mColorSpecular.g; + wrapColorParams[2].f = cLight->mColorSpecular.b; + jobject jSpecular; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapColor3", "(FFF)Ljava/lang/Object;", wrapColorParams, jSpecular)) + { + return false; + } + + wrapColorParams[0].f = cLight->mColorAmbient.r; + wrapColorParams[1].f = cLight->mColorAmbient.g; + wrapColorParams[2].f = cLight->mColorAmbient.b; + jobject jAmbient; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapColor3", "(FFF)Ljava/lang/Object;", wrapColorParams, jAmbient)) + { + return false; + } + + + /* wrap vec3 nodes */ + jvalue wrapVec3Params[3]; + wrapVec3Params[0].f = cLight->mPosition.x; + wrapVec3Params[1].f = cLight->mPosition.y; + wrapVec3Params[2].f = cLight->mPosition.z; + jobject jPosition; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapVec3", "(FFF)Ljava/lang/Object;", wrapVec3Params, jPosition)) + { + return false; + } + + wrapVec3Params[0].f = cLight->mPosition.x; + wrapVec3Params[1].f = cLight->mPosition.y; + wrapVec3Params[2].f = cLight->mPosition.z; + jobject jDirection; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapVec3", "(FFF)Ljava/lang/Object;", wrapVec3Params, jDirection)) + { + return false; + } + + + jobject jLight; + + jvalue params[12]; + params[0].l = env->NewStringUTF(cLight->mName.C_Str());; + params[1].i = cLight->mType; + params[2].l = jPosition; + params[3].l = jDirection; + params[4].f = cLight->mAttenuationConstant; + params[5].f = cLight->mAttenuationLinear; + params[6].f = cLight->mAttenuationQuadratic; + params[7].l = jDiffuse; + params[8].l = jSpecular; + params[9].l = jAmbient; + params[10].f = cLight->mAngleInnerCone; + params[11].f = cLight->mAngleOuterCone; + + if (!createInstance(env, "jassimp/AiLight", "(Ljava/lang/String;ILjava/lang/Object;Ljava/lang/Object;FFFLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;FF)V", + params, jLight)) + { + return false; + } + + /* add light to m_lights java.util.List */ + jobject jLights = NULL; + + if (!getField(env, jScene, "m_lights", "Ljava/util/List;", jLights)) + { + return false; + } + + jvalue addParams[1]; + addParams[0].l = jLight; + if (!call(env, jLights, "java/util/Collection", "add", "(Ljava/lang/Object;)Z", addParams)) + { + return false; + } + } + + lprintf("converting lights finished ...\n"); + + return true; +} + + +static bool loadCameras(JNIEnv *env, const aiScene* cScene, jobject& jScene) +{ + lprintf("converting %d cameras ...\n", cScene->mNumCameras); + + for (unsigned int c = 0; c < cScene->mNumCameras; c++) + { + const aiCamera *cCamera = cScene->mCameras[c]; + + lprintf("converting camera %s ...\n", cCamera->mName.C_Str()); + + /* wrap color nodes */ + jvalue wrapPositionParams[3]; + wrapPositionParams[0].f = cCamera->mPosition.x; + wrapPositionParams[1].f = cCamera->mPosition.y; + wrapPositionParams[2].f = cCamera->mPosition.z; + jobject jPosition; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapVec3", "(FFF)Ljava/lang/Object;", wrapPositionParams, jPosition)) + { + return false; + } + + wrapPositionParams[0].f = cCamera->mUp.x; + wrapPositionParams[1].f = cCamera->mUp.y; + wrapPositionParams[2].f = cCamera->mUp.z; + jobject jUp; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapVec3", "(FFF)Ljava/lang/Object;", wrapPositionParams, jUp)) + { + return false; + } + + wrapPositionParams[0].f = cCamera->mLookAt.x; + wrapPositionParams[1].f = cCamera->mLookAt.y; + wrapPositionParams[2].f = cCamera->mLookAt.z; + jobject jLookAt; + if (!callStaticObject(env, "Ljassimp/Jassimp;", "wrapVec3", "(FFF)Ljava/lang/Object;", wrapPositionParams, jLookAt)) + { + return false; + } + + + jobject jCamera; + + jvalue params[8]; + params[0].l = env->NewStringUTF(cCamera->mName.C_Str()); + params[1].l = jPosition; + params[2].l = jUp; + params[3].l = jLookAt; + params[4].f = cCamera->mHorizontalFOV; + params[5].f = cCamera->mClipPlaneNear; + params[6].f = cCamera->mClipPlaneFar; + params[7].f = cCamera->mAspect; + + if (!createInstance(env, "jassimp/AiCamera", "(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;FFFF)V", + params, jCamera)) + { + return false; + } + + /* add camera to m_cameras java.util.List */ + jobject jCameras = NULL; + + if (!getField(env, jScene, "m_cameras", "Ljava/util/List;", jCameras)) + { + return false; + } + + jvalue addParams[1]; + addParams[0].l = jCamera; + if (!call(env, jCameras, "java/util/Collection", "add", "(Ljava/lang/Object;)Z", addParams)) + { + return false; + } + } + + lprintf("converting cameras finished\n"); + + return true; +} + + +JNIEXPORT jstring JNICALL Java_jassimp_Jassimp_getErrorString + (JNIEnv *env, jclass jClazz) +{ + const char *err = aiGetErrorString(); + + if (NULL == err) + { + return env->NewStringUTF(""); + } + + return env->NewStringUTF(err); +} + + +JNIEXPORT jobject JNICALL Java_jassimp_Jassimp_aiImportFile + (JNIEnv *env, jclass jClazz, jstring jFilename, jlong postProcess) +{ + jobject jScene = NULL; + + /* convert params */ + const char* cFilename = env->GetStringUTFChars(jFilename, NULL); + + + lprintf("opening file: %s\n", cFilename); + + /* do import */ + const aiScene *cScene = aiImportFile(cFilename, (unsigned int) postProcess); + + if (!cScene) + { + lprintf("import file returned null\n"); + goto error; + } + + if (!createInstance(env, "jassimp/AiScene", jScene)) + { + goto error; + } + + if (!loadMeshes(env, cScene, jScene)) + { + goto error; + } + + if (!loadMaterials(env, cScene, jScene)) + { + goto error; + } + + if (!loadAnimations(env, cScene, jScene)) + { + goto error; + } + + if (!loadLights(env, cScene, jScene)) + { + goto error; + } + + if (!loadCameras(env, cScene, jScene)) + { + goto error; + } + + if (!loadSceneGraph(env, cScene, jScene)) + { + goto error; + } + + /* jump over error handling section */ + goto end; + +error: + jclass exception = env->FindClass("java/io/IOException"); + + if (NULL == exception) + { + /* thats really a problem because we cannot throw in this case */ + env->FatalError("could not throw java.io.IOException"); + } + + env->ThrowNew(exception, aiGetErrorString()); + + lprintf("problem detected\n"); + +end: + /* + * NOTE: this releases all memory used in the native domain. + * Ensure all data has been passed to java before! + */ + aiReleaseImport(cScene); + + + /* free params */ + env->ReleaseStringUTFChars(jFilename, cFilename); + + lprintf("return from native\n"); + + return jScene; +} \ No newline at end of file diff --git a/port/jassimp/jassimp-native/src/jassimp.h b/port/jassimp/jassimp-native/src/jassimp.h new file mode 100644 index 000000000..4eaec5541 --- /dev/null +++ b/port/jassimp/jassimp-native/src/jassimp.h @@ -0,0 +1,31 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class jassimp_Jassimp */ + +#ifndef _Included_jassimp_Jassimp +#define _Included_jassimp_Jassimp +#ifdef __cplusplus +extern "C" { +#endif +/* Inaccessible static: BUILTIN */ +/* Inaccessible static: s_wrapperProvider */ +/* + * Class: jassimp_Jassimp + * Method: getErrorString + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_jassimp_Jassimp_getErrorString + (JNIEnv *, jclass); + +/* + * Class: jassimp_Jassimp + * Method: aiImportFile + * Signature: (Ljava/lang/String;J)Ljassimp/AiScene; + */ +JNIEXPORT jobject JNICALL Java_jassimp_Jassimp_aiImportFile + (JNIEnv *, jclass, jstring, jlong); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/port/jassimp/jassimp/src/jassimp/AiAnimBehavior.java b/port/jassimp/jassimp/src/jassimp/AiAnimBehavior.java new file mode 100644 index 000000000..7dd3fb560 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiAnimBehavior.java @@ -0,0 +1,112 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * Defines how an animation channel behaves outside the defined time range. + */ +public enum AiAnimBehavior { + /** + * The value from the default node transformation is taken. + */ + DEFAULT(0x0), + + + /** + * The nearest key value is used without interpolation. + */ + CONSTANT(0x1), + + + /** + * The value of the nearest two keys is linearly extrapolated for the + * current time value. + */ + LINEAR(0x2), + + + /** + * The animation is repeated.

+ * + * If the animation key go from n to m and the current time is t, use the + * value at (t-n) % (|m-n|). + */ + REPEAT(0x3); + + + /** + * Utility method for converting from c/c++ based integer enums to java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param rawValue an integer based enum value (as defined by assimp) + * @return the enum value corresponding to rawValue + */ + static AiAnimBehavior fromRawValue(int rawValue) { + for (AiAnimBehavior type : AiAnimBehavior.values()) { + if (type.m_rawValue == rawValue) { + return type; + } + } + + throw new IllegalArgumentException("unexptected raw value: " + + rawValue); + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private AiAnimBehavior(int rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiAnimation.java b/port/jassimp/jassimp/src/jassimp/AiAnimation.java new file mode 100644 index 000000000..fca3bc53d --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiAnimation.java @@ -0,0 +1,179 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.util.ArrayList; +import java.util.List; + +/** + * An animation.

+ * + * An animation consists of keyframe data for a number of nodes. For + * each node affected by the animation a separate series of data is given.

+ * + * Like {@link AiMesh}, the animation related classes offer a Buffer API, a + * Direct API and a wrapped API. Please consult the documentation of + * {@link AiMesh} for a description and comparison of these APIs. + */ +public final class AiAnimation { + /** + * Constructor. + * + * @param name name + * @param duration duration + * @param ticksPerSecond ticks per second + */ + AiAnimation(String name, double duration, double ticksPerSecond) { + m_name = name; + m_duration = duration; + m_ticksPerSecond = ticksPerSecond; + } + + + /** + * Returns the name of the animation.

+ * + * If the modeling package this data was exported from does support only + * a single animation channel, this name is usually empty (length is zero). + * + * @return the name + */ + public String getName() { + return m_name; + } + + + /** + * Returns the duration of the animation in ticks. + * + * @return the duration + */ + public double getDuration() { + return m_duration; + } + + + /** + * Returns the ticks per second.

+ * + * 0 if not specified in the imported file + * + * @return the number of ticks per second + */ + public double getTicksPerSecond() { + return m_ticksPerSecond; + } + + + /** + * Returns the number of bone animation channels.

+ * + * Each channel affects a single node. This method will return the same + * value as getChannels().size() + * + * @return the number of bone animation channels + */ + public int getNumChannels() { + return m_nodeAnims.size(); + } + + + /** + * Returns the list of bone animation channels.

+ * + * Each channel affects a single node. The array is mNumChannels in size. + * + * @return the list of bone animation channels + */ + public List getChannels() { + return m_nodeAnims; + } + + + /** + * Returns the number of mesh animation channels.

+ * + * Each channel affects a single mesh and defines vertex-based animation. + * This method will return the same value as + * getMeshChannels().size() + * + * @return the number of mesh animation channels + */ + public int getNumMeshChannels() { + throw new UnsupportedOperationException("not implemented yet"); + } + + + /** + * Returns the list of mesh animation channels.

+ * + * Each channel affects a single mesh. + * + * @return the list of mesh animation channels + */ + public List getMeshChannels() { + throw new UnsupportedOperationException("not implemented yet"); + } + + + /** + * Name. + */ + private final String m_name; + + + /** + * Duration. + */ + private final double m_duration; + + + /** + * Ticks per second. + */ + private final double m_ticksPerSecond; + + + /** + * Bone animation channels. + */ + private final List m_nodeAnims = new ArrayList(); +} \ No newline at end of file diff --git a/port/jassimp/jassimp/src/jassimp/AiBlendMode.java b/port/jassimp/jassimp/src/jassimp/AiBlendMode.java new file mode 100644 index 000000000..941ace11e --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiBlendMode.java @@ -0,0 +1,117 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * Defines alpha-blend flags.

+ * + * If you're familiar with OpenGL or D3D, these flags aren't new to you. + * They define *how* the final color value of a pixel is computed, basing + * on the previous color at that pixel and the new color value from the + * material. The blend formula is: + *
+ * SourceColor * SourceBlend + DestColor * DestBlend + *
+ * where DestColor is the previous color in the framebuffer at + * this position and SourceColor is the material color before the + * transparency calculation. + */ +public enum AiBlendMode { + /** + * Default blending.

+ * + * Formula: + * + * SourceColor*SourceAlpha + DestColor*(1-SourceAlpha) + * + */ + DEFAULT(0x0), + + + /** + * Additive blending.

+ * + * Formula: + * + * SourceColor*1 + DestColor*1 + * + */ + ADDITIVE(0x1); + + + /** + * Utility method for converting from c/c++ based integer enums to java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param rawValue an integer based enum value (as defined by assimp) + * @return the enum value corresponding to rawValue + */ + static AiBlendMode fromRawValue(int rawValue) { + for (AiBlendMode type : AiBlendMode.values()) { + if (type.m_rawValue == rawValue) { + return type; + } + } + + throw new IllegalArgumentException("unexptected raw value: " + + rawValue); + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private AiBlendMode(int rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; +} \ No newline at end of file diff --git a/port/jassimp/jassimp/src/jassimp/AiBone.java b/port/jassimp/jassimp/src/jassimp/AiBone.java new file mode 100644 index 000000000..87c4b8199 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiBone.java @@ -0,0 +1,137 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.util.ArrayList; +import java.util.List; + + +/** + * A single bone of a mesh.

+ * + * A bone has a name by which it can be found in the frame hierarchy and by + * which it can be addressed by animations. In addition it has a number of + * influences on vertices.

+ * + * This class is designed to be mutable, i.e., the returned collections are + * writable and may be modified. + */ +public final class AiBone { + /** + * Constructor. + */ + AiBone() { + /* nothing to do */ + } + + + /** + * Returns the name of the bone. + * + * @return the name + */ + public String getName() { + return m_name; + } + + + /** + * Returns the number of bone weights.

+ * + * This method exists for compatibility with the native assimp API. + * The returned value is identical to getBoneWeights().size() + * + * @return the number of weights + */ + public int getNumWeights() { + return m_boneWeights.size(); + } + + + /** + * Returns a list of bone weights. + * + * @return the bone weights + */ + public List getBoneWeights() { + return m_boneWeights; + } + + + /** + * Returns the offset matrix.

+ * + * The offset matrix is a 4x4 matrix that transforms from mesh space to + * bone space in bind pose.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers). + * + * @param wrapperProvider the wrapper provider (used for type inference) + * + * @return the offset matrix + */ + @SuppressWarnings("unchecked") + public M4 getOffsetMatrix( + AiWrapperProvider wrapperProvider) { + + return (M4) m_offsetMatrix; + } + + + /** + * Name of the bone. + */ + private String m_name; + + + /** + * Bone weights. + */ + private final List m_boneWeights = + new ArrayList(); + + + /** + * Offset matrix. + */ + private Object m_offsetMatrix; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiBoneWeight.java b/port/jassimp/jassimp/src/jassimp/AiBoneWeight.java new file mode 100644 index 000000000..7d1d74bcc --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiBoneWeight.java @@ -0,0 +1,88 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * A single influence of a bone on a vertex. + */ +public final class AiBoneWeight { + /** + * Constructor. + */ + AiBoneWeight() { + /* nothing to do */ + } + + + /** + * Index of the vertex which is influenced by the bone. + * + * @return the vertex index + */ + public int getVertexId() { + return m_vertexId; + } + + + /** + * The strength of the influence in the range (0...1).

+ * + * The influence from all bones at one vertex amounts to 1 + * + * @return the influence + */ + public float getWeight() { + return m_weight; + } + + + /** + * Vertex index. + */ + private int m_vertexId; + + + /** + * Influence of bone on vertex. + */ + private float m_weight; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiBuiltInWrapperProvider.java b/port/jassimp/jassimp/src/jassimp/AiBuiltInWrapperProvider.java new file mode 100644 index 000000000..64fad515a --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiBuiltInWrapperProvider.java @@ -0,0 +1,84 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.nio.ByteBuffer; + + +/** + * Wrapper provider using jassimp built in types. + */ +public final class AiBuiltInWrapperProvider implements AiWrapperProvider< + AiVector, AiMatrix4f, AiColor, AiNode, AiQuaternion> { + + @Override + public AiVector wrapVector3f(ByteBuffer buffer, int offset, + int numComponents) { + + return new AiVector(buffer, offset, numComponents); + } + + + @Override + public AiMatrix4f wrapMatrix4f(float[] data) { + return new AiMatrix4f(data); + } + + + @Override + public AiColor wrapColor(ByteBuffer buffer, int offset) { + return new AiColor(buffer, offset); + } + + + @Override + public AiNode wrapSceneNode(Object parent, Object matrix, + int[] meshReferences, String name) { + + return new AiNode((AiNode) parent, matrix, meshReferences, name); + } + + + @Override + public AiQuaternion wrapQuaternion(ByteBuffer buffer, int offset) { + return new AiQuaternion(buffer, offset); + } +} diff --git a/port/jassimp/jassimp/src/jassimp/AiCamera.java b/port/jassimp/jassimp/src/jassimp/AiCamera.java new file mode 100644 index 000000000..6378210f7 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiCamera.java @@ -0,0 +1,303 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * Helper structure to describe a virtual camera.

+ * + * Cameras have a representation in the node graph and can be animated. + * An important aspect is that the camera itself is also part of the + * scenegraph. This means, any values such as the look-at vector are not + * *absolute*, they're relative to the coordinate system defined + * by the node which corresponds to the camera. This allows for camera + * animations. For static cameras parameters like the 'look-at' or 'up' vectors + * are usually specified directly in aiCamera, but beware, they could also + * be encoded in the node transformation. The following (pseudo)code sample + * shows how to do it:

+ *

+ * // Get the camera matrix for a camera at a specific time
+ * // if the node hierarchy for the camera does not contain
+ * // at least one animated node this is a static computation
+ * get-camera-matrix (node sceneRoot, camera cam) : matrix
+ * {
+ *    node   cnd = find-node-for-camera(cam)
+ *    matrix cmt = identity()
+ *
+ *    // as usual - get the absolute camera transformation for this frame
+ *    for each node nd in hierarchy from sceneRoot to cnd
+ *      matrix cur
+ *      if (is-animated(nd))
+ *         cur = eval-animation(nd)
+ *      else cur = nd->mTransformation;
+ *      cmt = mult-matrices( cmt, cur )
+ *    end for
+ *
+ *    // now multiply with the camera's own local transform
+ *    cam = mult-matrices (cam, get-camera-matrix(cmt) )
+ * }
+ * 
+ * + * Note: some file formats (such as 3DS, ASE) export a "target point" - + * the point the camera is looking at (it can even be animated). Assimp + * writes the target point as a subnode of the camera's main node, + * called ".Target". However this is just additional information + * then the transformation tracks of the camera main node make the + * camera already look in the right direction. + */ +public final class AiCamera { + /** + * Constructor. + * + * @param name name + * @param position position + * @param up up vector + * @param lookAt look-at vector + * @param horizontalFOV field of view + * @param clipNear near clip plane + * @param clipFar far clip plane + * @param aspect aspect ratio + */ + AiCamera(String name, Object position, Object up, Object lookAt, + float horizontalFOV, float clipNear, float clipFar, float aspect) { + + m_name = name; + m_position = position; + m_up = up; + m_lookAt = lookAt; + m_horizontalFOV = horizontalFOV; + m_clipNear = clipNear; + m_clipFar = clipFar; + m_aspect = aspect; + } + + + /** + * Returns the name of the camera.

+ * + * There must be a node in the scenegraph with the same name. + * This node specifies the position of the camera in the scene + * hierarchy and can be animated. + */ + public String getName() { + return m_name; + } + + + /** + * Returns the position of the camera.

+ * + * The returned position is relative to the coordinate space defined by the + * corresponding node.

+ * + * The default value is 0|0|0.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the position vector + */ + @SuppressWarnings("unchecked") + public V3 getPosition(AiWrapperProvider + wrapperProvider) { + + return (V3) m_position; + } + + + /** + * Returns the 'Up' - vector of the camera coordinate system. + * + * The returned vector is relative to the coordinate space defined by the + * corresponding node.

+ * + * The 'right' vector of the camera coordinate system is the cross product + * of the up and lookAt vectors. The default value is 0|1|0. The vector + * may be normalized, but it needn't.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the 'Up' vector + */ + @SuppressWarnings("unchecked") + public V3 getUp(AiWrapperProvider + wrapperProvider) { + + return (V3) m_up; + } + + + /** + * Returns the 'LookAt' - vector of the camera coordinate system.

+ * + * The returned vector is relative to the coordinate space defined by the + * corresponding node.

+ * + * This is the viewing direction of the user. The default value is 0|0|1. + * The vector may be normalized, but it needn't.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the 'LookAt' vector + */ + @SuppressWarnings("unchecked") + public V3 getLookAt(AiWrapperProvider + wrapperProvider) { + + return (V3) m_lookAt; + } + + + /** + * Returns the half horizontal field of view angle, in radians.

+ * + * The field of view angle is the angle between the center line of the + * screen and the left or right border. The default value is 1/4PI. + * + * @return the half horizontal field of view angle + */ + public float getHorizontalFOV() { + return m_horizontalFOV; + } + + + /** + * Returns the distance of the near clipping plane from the camera.

+ * + * The value may not be 0.f (for arithmetic reasons to prevent a division + * through zero). The default value is 0.1f. + * + * @return the distance of the near clipping plane + */ + public float getClipPlaneNear() { + return m_clipNear; + } + + + /** + * Returns the distance of the far clipping plane from the camera.

+ * + * The far clipping plane must, of course, be further away than the + * near clipping plane. The default value is 1000.0f. The ratio + * between the near and the far plane should not be too + * large (between 1000-10000 should be ok) to avoid floating-point + * inaccuracies which could lead to z-fighting. + * + * @return the distance of the far clipping plane + */ + public float getClipPlaneFar() { + return m_clipFar; + } + + + /** + * Returns the screen aspect ratio.

+ * + * This is the ration between the width and the height of the + * screen. Typical values are 4/3, 1/2 or 1/1. This value is + * 0 if the aspect ratio is not defined in the source file. + * 0 is also the default value. + * + * @return the screen aspect ratio + */ + public float getAspect() { + return m_aspect; + } + + + /** + * Name. + */ + private final String m_name; + + + /** + * Position. + */ + private final Object m_position; + + + /** + * Up vector. + */ + private final Object m_up; + + + /** + * Look-At vector. + */ + private final Object m_lookAt; + + + /** + * FOV. + */ + private final float m_horizontalFOV; + + + /** + * Near clipping plane. + */ + private final float m_clipNear; + + + /** + * Far clipping plane. + */ + private final float m_clipFar; + + + /** + * Aspect ratio. + */ + private final float m_aspect; +} \ No newline at end of file diff --git a/port/jassimp/jassimp/src/jassimp/AiColor.java b/port/jassimp/jassimp/src/jassimp/AiColor.java new file mode 100644 index 000000000..25eb251d6 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiColor.java @@ -0,0 +1,162 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.nio.ByteBuffer; + + +/** + * Wrapper for colors.

+ * + * The wrapper is writable, i.e., changes performed via the set-methods will + * modify the underlying mesh. + */ +public final class AiColor { + /** + * Constructor. + * + * @param buffer the buffer to wrap + * @param offset offset into buffer + */ + public AiColor(ByteBuffer buffer, int offset) { + m_buffer = buffer; + m_offset = offset; + } + + + /** + * Returns the red color component. + * + * @return the red component + */ + public float getRed() { + return m_buffer.getFloat(m_offset); + } + + + /** + * Returns the green color component. + * + * @return the green component + */ + public float getGreen() { + return m_buffer.getFloat(m_offset + 4); + } + + + /** + * Returns the blue color component. + * + * @return the blue component + */ + public float getBlue() { + return m_buffer.getFloat(m_offset + 8); + } + + + /** + * Returns the alpha color component. + * + * @return the alpha component + */ + public float getAlpha() { + return m_buffer.getFloat(m_offset + 12); + } + + + /** + * Sets the red color component. + * + * @param red the new value + */ + public void setRed(float red) { + m_buffer.putFloat(m_offset, red); + } + + + /** + * Sets the green color component. + * + * @param green the new value + */ + public void setGreen(float green) { + m_buffer.putFloat(m_offset + 4, green); + } + + + /** + * Sets the blue color component. + * + * @param blue the new value + */ + public void setBlue(float blue) { + m_buffer.putFloat(m_offset + 8, blue); + } + + + /** + * Sets the alpha color component. + * + * @param alpha the new value + */ + public void setAlpha(float alpha) { + m_buffer.putFloat(m_offset + 12, alpha); + } + + + @Override + public String toString() { + return "[" + getRed() + ", " + getGreen() + ", " + getBlue() + ", " + + getAlpha() + "]"; + } + + + /** + * Wrapped buffer. + */ + private final ByteBuffer m_buffer; + + + /** + * Offset into m_buffer. + */ + private final int m_offset; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiConfig.java b/port/jassimp/jassimp/src/jassimp/AiConfig.java new file mode 100644 index 000000000..f49ce8625 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiConfig.java @@ -0,0 +1,15 @@ +/* + * $Revision$ + * $Date$ + */ +package jassimp; + + +/** + * Configuration interface for assimp importer.

+ * + * This class is work-in-progress + */ +public class AiConfig { + +} diff --git a/port/jassimp/jassimp/src/jassimp/AiConfigOptions.java b/port/jassimp/jassimp/src/jassimp/AiConfigOptions.java new file mode 100644 index 000000000..6196598cd --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiConfigOptions.java @@ -0,0 +1,663 @@ +/* + * $Revision$ + * $Date$ + */ +package jassimp; + + +/** + * Lists all possible configuration options.

+ * + * This class is work-in-progress + */ +public enum AiConfigOptions { + /** + * Maximum bone count per mesh for the SplitbyBoneCount step.

+ * + * Meshes are split until the maximum number of bones is reached. The + * default value is AI_SBBC_DEFAULT_MAX_BONES, which may be altered at + * compile-time. This limit is imposed by the native jassimp library + * and typically is 60.

+ * + * Property data type: integer. + */ + PP_SBBC_MAX_BONES("PP_SBBC_MAX_BONES"), + + + /** + * Specifies the maximum angle that may be between two vertex tangents + * that their tangents and bi-tangents are smoothed.

+ * + * This applies to the CalcTangentSpace-Step. The angle is specified + * in degrees. The maximum value is 175.

+ * + * Property type: float. Default value: 45 degrees + */ + PP_CT_MAX_SMOOTHING_ANGLE("PP_CT_MAX_SMOOTHING_ANGLE"), + + + /** + * Source UV channel for tangent space computation.

+ * + * The specified channel must exist or an error will be raised.

+ * + * Property type: integer. Default value: 0 + */ + PP_CT_TEXTURE_CHANNEL_INDEX("PP_CT_TEXTURE_CHANNEL_INDEX"), + + + /** + * Specifies the maximum angle that may be between two face normals + * at the same vertex position that their are smoothed together.

+ * + * Sometimes referred to as 'crease angle'. This applies to the + * GenSmoothNormals-Step. The angle is specified in degrees, so 180 is PI. + * The default value is 175 degrees (all vertex normals are smoothed). The + * maximum value is 175, too.

+ * + * Property type: float.

+ * + * Warning: setting this option may cause a severe loss of performance. The + * performance is unaffected if the {@link #CONFIG_FAVOUR_SPEED} flag is + * set but the output quality may be reduced. + */ + PP_GSN_MAX_SMOOTHING_ANGLE("PP_GSN_MAX_SMOOTHING_ANGLE"), + + + /** + * Sets the colormap (= palette) to be used to decode embedded textures in + * MDL (Quake or 3DGS) files.

+ * + * This must be a valid path to a file. The file is 768 (256*3) bytes + * large and contains RGB triplets for each of the 256 palette entries. + * The default value is colormap.lmp. If the file is not found, + * a default palette (from Quake 1) is used.

+ * + * Property type: string. + */ + IMPORT_MDL_COLORMAP("IMPORT_MDL_COLORMAP"), + + + /** + * Configures the #aiProcess_RemoveRedundantMaterials step to keep + * materials matching a name in a given list.

+ * + * This is a list of 1 to n strings, ' ' serves as delimiter character. + * Identifiers containing whitespaces must be enclosed in *single* + * quotation marks. For example: + * "keep-me and_me_to anotherMaterialToBeKept \'name with whitespace\'". + * If a material matches on of these names, it will not be modified or + * removed by the postprocessing step nor will other materials be replaced + * by a reference to it.

+ * + * This option might be useful if you are using some magic material names + * to pass additional semantics through the content pipeline. This ensures + * they won't be optimized away, but a general optimization is still + * performed for materials not contained in the list.

+ * + * Property type: String. Default value: n/a

+ * + * Note:Linefeeds, tabs or carriage returns are treated as + * whitespace. Material names are case sensitive. + */ + PP_RRM_EXCLUDE_LIST("PP_RRM_EXCLUDE_LIST"), + + + /** + * Configures the {@link AiPostProcessSteps#PRE_TRANSFORM_VERTICES} step + * to keep the scene hierarchy. Meshes are moved to worldspace, but no + * optimization is performed (read: meshes with equal materials are not + * joined. The total number of meshes won't change).

+ * + * This option could be of use for you if the scene hierarchy contains + * important additional information which you intend to parse. + * For rendering, you can still render all meshes in the scene without + * any transformations.

+ * + * Property type: bool. Default value: false. + */ + PP_PTV_KEEP_HIERARCHY("PP_PTV_KEEP_HIERARCHY"), + + + /** + * Configures the {@link AiPostProcessSteps#PRE_TRANSFORM_VERTICES} step + * to normalize all vertex components into the [-1,1] range.

+ * + * That is, a bounding box for the whole scene is computed, the maximum + * component is taken and all meshes are scaled appropriately (uniformly + * of course!). This might be useful if you don't know the spatial + * dimension of the input data.

+ * + * Property type: bool. Default value: false. + */ + PP_PTV_NORMALIZE("PP_PTV_NORMALIZE"), + + + /** + * Configures the {@link AiPostProcessSteps#FIND_DEGENERATES} step to + * remove degenerated primitives from the import - immediately.

+ * + * The default behaviour converts degenerated triangles to lines and + * degenerated lines to points. See the documentation to the + * {@link AiPostProcessSteps#FIND_DEGENERATES} step for a detailed example + * of the various ways to get rid of these lines and points if you don't + * want them.

+ * + * Property type: bool. Default value: false. + */ + PP_FD_REMOVE("PP_FD_REMOVE") + + +// // --------------------------------------------------------------------------- +// /** @brief Configures the #aiProcess_OptimizeGraph step to preserve nodes +// * matching a name in a given list. +// * +// * This is a list of 1 to n strings, ' ' serves as delimiter character. +// * Identifiers containing whitespaces must be enclosed in *single* +// * quotation marks. For example: +// * "keep-me and_me_to anotherNodeToBeKept \'name with whitespace\'". +// * If a node matches on of these names, it will not be modified or +// * removed by the postprocessing step.
+// * This option might be useful if you are using some magic node names +// * to pass additional semantics through the content pipeline. This ensures +// * they won't be optimized away, but a general optimization is still +// * performed for nodes not contained in the list. +// * Property type: String. Default value: n/a +// * @note Linefeeds, tabs or carriage returns are treated as whitespace. +// * Node names are case sensitive. +// */ +// #define AI_CONFIG_PP_OG_EXCLUDE_LIST \ +// "PP_OG_EXCLUDE_LIST" +// +// // --------------------------------------------------------------------------- +// /** @brief Set the maximum number of triangles in a mesh. +// * +// * This is used by the "SplitLargeMeshes" PostProcess-Step to determine +// * whether a mesh must be split or not. +// * @note The default value is AI_SLM_DEFAULT_MAX_TRIANGLES +// * Property type: integer. +// */ +// #define AI_CONFIG_PP_SLM_TRIANGLE_LIMIT \ +// "PP_SLM_TRIANGLE_LIMIT" +// +// // default value for AI_CONFIG_PP_SLM_TRIANGLE_LIMIT +// #if (!defined AI_SLM_DEFAULT_MAX_TRIANGLES) +// # define AI_SLM_DEFAULT_MAX_TRIANGLES 1000000 +// #endif +// +// // --------------------------------------------------------------------------- +// /** @brief Set the maximum number of vertices in a mesh. +// * +// * This is used by the "SplitLargeMeshes" PostProcess-Step to determine +// * whether a mesh must be split or not. +// * @note The default value is AI_SLM_DEFAULT_MAX_VERTICES +// * Property type: integer. +// */ +// #define AI_CONFIG_PP_SLM_VERTEX_LIMIT \ +// "PP_SLM_VERTEX_LIMIT" +// +// // default value for AI_CONFIG_PP_SLM_VERTEX_LIMIT +// #if (!defined AI_SLM_DEFAULT_MAX_VERTICES) +// # define AI_SLM_DEFAULT_MAX_VERTICES 1000000 +// #endif +// +// // --------------------------------------------------------------------------- +// /** @brief Set the maximum number of bones affecting a single vertex +// * +// * This is used by the #aiProcess_LimitBoneWeights PostProcess-Step. +// * @note The default value is AI_LBW_MAX_WEIGHTS +// * Property type: integer.*/ +// #define AI_CONFIG_PP_LBW_MAX_WEIGHTS \ +// "PP_LBW_MAX_WEIGHTS" +// +// // default value for AI_CONFIG_PP_LBW_MAX_WEIGHTS +// #if (!defined AI_LMW_MAX_WEIGHTS) +// # define AI_LMW_MAX_WEIGHTS 0x4 +// #endif // !! AI_LMW_MAX_WEIGHTS +// +// // --------------------------------------------------------------------------- +// /** @brief Lower the deboning threshold in order to remove more bones. +// * +// * This is used by the #aiProcess_Debone PostProcess-Step. +// * @note The default value is AI_DEBONE_THRESHOLD +// * Property type: float.*/ +// #define AI_CONFIG_PP_DB_THRESHOLD \ +// "PP_DB_THRESHOLD" +// +// // default value for AI_CONFIG_PP_LBW_MAX_WEIGHTS +// #if (!defined AI_DEBONE_THRESHOLD) +// # define AI_DEBONE_THRESHOLD 1.0f +// #endif // !! AI_DEBONE_THRESHOLD +// +// // --------------------------------------------------------------------------- +// /** @brief Require all bones qualify for deboning before removing any +// * +// * This is used by the #aiProcess_Debone PostProcess-Step. +// * @note The default value is 0 +// * Property type: bool.*/ +// #define AI_CONFIG_PP_DB_ALL_OR_NONE \ +// "PP_DB_ALL_OR_NONE" +// +// /** @brief Default value for the #AI_CONFIG_PP_ICL_PTCACHE_SIZE property +// */ +// #ifndef PP_ICL_PTCACHE_SIZE +// # define PP_ICL_PTCACHE_SIZE 12 +// #endif +// +// // --------------------------------------------------------------------------- +// /** @brief Set the size of the post-transform vertex cache to optimize the +// * vertices for. This configures the #aiProcess_ImproveCacheLocality step. +// * +// * The size is given in vertices. Of course you can't know how the vertex +// * format will exactly look like after the import returns, but you can still +// * guess what your meshes will probably have. +// * @note The default value is #PP_ICL_PTCACHE_SIZE. That results in slight +// * performance improvements for most nVidia/AMD cards since 2002. +// * Property type: integer. +// */ +// #define AI_CONFIG_PP_ICL_PTCACHE_SIZE "PP_ICL_PTCACHE_SIZE" +// +// // --------------------------------------------------------------------------- +// /** @brief Enumerates components of the aiScene and aiMesh data structures +// * that can be excluded from the import using the #aiPrpcess_RemoveComponent step. +// * +// * See the documentation to #aiProcess_RemoveComponent for more details. +// */ +// enum aiComponent +// { +// /** Normal vectors */ +// #ifdef SWIG +// aiComponent_NORMALS = 0x2, +// #else +// aiComponent_NORMALS = 0x2u, +// #endif +// +// /** Tangents and bitangents go always together ... */ +// #ifdef SWIG +// aiComponent_TANGENTS_AND_BITANGENTS = 0x4, +// #else +// aiComponent_TANGENTS_AND_BITANGENTS = 0x4u, +// #endif +// +// /** ALL color sets +// * Use aiComponent_COLORn(N) to specify the N'th set */ +// aiComponent_COLORS = 0x8, +// +// /** ALL texture UV sets +// * aiComponent_TEXCOORDn(N) to specify the N'th set */ +// aiComponent_TEXCOORDS = 0x10, +// +// /** Removes all bone weights from all meshes. +// * The scenegraph nodes corresponding to the bones are NOT removed. +// * use the #aiProcess_OptimizeGraph step to do this */ +// aiComponent_BONEWEIGHTS = 0x20, +// +// /** Removes all node animations (aiScene::mAnimations). +// * The corresponding scenegraph nodes are NOT removed. +// * use the #aiProcess_OptimizeGraph step to do this */ +// aiComponent_ANIMATIONS = 0x40, +// +// /** Removes all embedded textures (aiScene::mTextures) */ +// aiComponent_TEXTURES = 0x80, +// +// /** Removes all light sources (aiScene::mLights). +// * The corresponding scenegraph nodes are NOT removed. +// * use the #aiProcess_OptimizeGraph step to do this */ +// aiComponent_LIGHTS = 0x100, +// +// /** Removes all light sources (aiScene::mCameras). +// * The corresponding scenegraph nodes are NOT removed. +// * use the #aiProcess_OptimizeGraph step to do this */ +// aiComponent_CAMERAS = 0x200, +// +// /** Removes all meshes (aiScene::mMeshes). */ +// aiComponent_MESHES = 0x400, +// +// /** Removes all materials. One default material will +// * be generated, so aiScene::mNumMaterials will be 1. */ +// aiComponent_MATERIALS = 0x800, +// +// +// /** This value is not used. It is just there to force the +// * compiler to map this enum to a 32 Bit integer. */ +// #ifndef SWIG +// _aiComponent_Force32Bit = 0x9fffffff +// #endif +// }; +// +// // Remove a specific color channel 'n' +// #define aiComponent_COLORSn(n) (1u << (n+20u)) +// +// // Remove a specific UV channel 'n' +// #define aiComponent_TEXCOORDSn(n) (1u << (n+25u)) +// +// // --------------------------------------------------------------------------- +// /** @brief Input parameter to the #aiProcess_RemoveComponent step: +// * Specifies the parts of the data structure to be removed. +// * +// * See the documentation to this step for further details. The property +// * is expected to be an integer, a bitwise combination of the +// * #aiComponent flags defined above in this header. The default +// * value is 0. Important: if no valid mesh is remaining after the +// * step has been executed (e.g you thought it was funny to specify ALL +// * of the flags defined above) the import FAILS. Mainly because there is +// * no data to work on anymore ... +// */ +// #define AI_CONFIG_PP_RVC_FLAGS \ +// "PP_RVC_FLAGS" +// +// // --------------------------------------------------------------------------- +// /** @brief Input parameter to the #aiProcess_SortByPType step: +// * Specifies which primitive types are removed by the step. +// * +// * This is a bitwise combination of the aiPrimitiveType flags. +// * Specifying all of them is illegal, of course. A typical use would +// * be to exclude all line and point meshes from the import. This +// * is an integer property, its default value is 0. +// */ +// #define AI_CONFIG_PP_SBP_REMOVE \ +// "PP_SBP_REMOVE" +// +// // --------------------------------------------------------------------------- +// /** @brief Input parameter to the #aiProcess_FindInvalidData step: +// * Specifies the floating-point accuracy for animation values. The step +// * checks for animation tracks where all frame values are absolutely equal +// * and removes them. This tweakable controls the epsilon for floating-point +// * comparisons - two keys are considered equal if the invariant +// * abs(n0-n1)>epsilon holds true for all vector respectively quaternion +// * components. The default value is 0.f - comparisons are exact then. +// */ +// #define AI_CONFIG_PP_FID_ANIM_ACCURACY \ +// "PP_FID_ANIM_ACCURACY" +// +// +// // TransformUVCoords evaluates UV scalings +// #define AI_UVTRAFO_SCALING 0x1 +// +// // TransformUVCoords evaluates UV rotations +// #define AI_UVTRAFO_ROTATION 0x2 +// +// // TransformUVCoords evaluates UV translation +// #define AI_UVTRAFO_TRANSLATION 0x4 +// +// // Everything baked together -> default value +// #define AI_UVTRAFO_ALL (AI_UVTRAFO_SCALING | AI_UVTRAFO_ROTATION | AI_UVTRAFO_TRANSLATION) +// +// // --------------------------------------------------------------------------- +// /** @brief Input parameter to the #aiProcess_TransformUVCoords step: +// * Specifies which UV transformations are evaluated. +// * +// * This is a bitwise combination of the AI_UVTRAFO_XXX flags (integer +// * property, of course). By default all transformations are enabled +// * (AI_UVTRAFO_ALL). +// */ +// #define AI_CONFIG_PP_TUV_EVALUATE \ +// "PP_TUV_EVALUATE" +// +// // --------------------------------------------------------------------------- +// /** @brief A hint to assimp to favour speed against import quality. +// * +// * Enabling this option may result in faster loading, but it needn't. +// * It represents just a hint to loaders and post-processing steps to use +// * faster code paths, if possible. +// * This property is expected to be an integer, != 0 stands for true. +// * The default value is 0. +// */ +// #define AI_CONFIG_FAVOUR_SPEED \ +// "FAVOUR_SPEED" +// +// +// // ########################################################################### +// // IMPORTER SETTINGS +// // Various stuff to fine-tune the behaviour of specific importer plugins. +// // ########################################################################### +// +// +// // --------------------------------------------------------------------------- +// /** @brief Set the vertex animation keyframe to be imported +// * +// * ASSIMP does not support vertex keyframes (only bone animation is supported). +// * The library reads only one frame of models with vertex animations. +// * By default this is the first frame. +// * \note The default value is 0. This option applies to all importers. +// * However, it is also possible to override the global setting +// * for a specific loader. You can use the AI_CONFIG_IMPORT_XXX_KEYFRAME +// * options (where XXX is a placeholder for the file format for which you +// * want to override the global setting). +// * Property type: integer. +// */ +// #define AI_CONFIG_IMPORT_GLOBAL_KEYFRAME "IMPORT_GLOBAL_KEYFRAME" +// +// #define AI_CONFIG_IMPORT_MD3_KEYFRAME "IMPORT_MD3_KEYFRAME" +// #define AI_CONFIG_IMPORT_MD2_KEYFRAME "IMPORT_MD2_KEYFRAME" +// #define AI_CONFIG_IMPORT_MDL_KEYFRAME "IMPORT_MDL_KEYFRAME" +// #define AI_CONFIG_IMPORT_MDC_KEYFRAME "IMPORT_MDC_KEYFRAME" +// #define AI_CONFIG_IMPORT_SMD_KEYFRAME "IMPORT_SMD_KEYFRAME" +// #define AI_CONFIG_IMPORT_UNREAL_KEYFRAME "IMPORT_UNREAL_KEYFRAME" +// +// +// // --------------------------------------------------------------------------- +// /** @brief Configures the AC loader to collect all surfaces which have the +// * "Backface cull" flag set in separate meshes. +// * +// * Property type: bool. Default value: true. +// */ +// #define AI_CONFIG_IMPORT_AC_SEPARATE_BFCULL \ +// "IMPORT_AC_SEPARATE_BFCULL" +// +// // --------------------------------------------------------------------------- +// /** @brief Configures whether the AC loader evaluates subdivision surfaces ( +// * indicated by the presence of the 'subdiv' attribute in the file). By +// * default, Assimp performs the subdivision using the standard +// * Catmull-Clark algorithm +// * +// * * Property type: bool. Default value: true. +// */ +// #define AI_CONFIG_IMPORT_AC_EVAL_SUBDIVISION \ +// "IMPORT_AC_EVAL_SUBDIVISION" +// +// // --------------------------------------------------------------------------- +// /** @brief Configures the UNREAL 3D loader to separate faces with different +// * surface flags (e.g. two-sided vs. single-sided). +// * +// * * Property type: bool. Default value: true. +// */ +// #define AI_CONFIG_IMPORT_UNREAL_HANDLE_FLAGS \ +// "UNREAL_HANDLE_FLAGS" +// +// // --------------------------------------------------------------------------- +// /** @brief Configures the terragen import plugin to compute uv's for +// * terrains, if not given. Furthermore a default texture is assigned. +// * +// * UV coordinates for terrains are so simple to compute that you'll usually +// * want to compute them on your own, if you need them. This option is intended +// * for model viewers which want to offer an easy way to apply textures to +// * terrains. +// * * Property type: bool. Default value: false. +// */ +// #define AI_CONFIG_IMPORT_TER_MAKE_UVS \ +// "IMPORT_TER_MAKE_UVS" +// +// // --------------------------------------------------------------------------- +// /** @brief Configures the ASE loader to always reconstruct normal vectors +// * basing on the smoothing groups loaded from the file. +// * +// * Some ASE files have carry invalid normals, other don't. +// * * Property type: bool. Default value: true. +// */ +// #define AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS \ +// "IMPORT_ASE_RECONSTRUCT_NORMALS" +// +// // --------------------------------------------------------------------------- +// /** @brief Configures the M3D loader to detect and process multi-part +// * Quake player models. +// * +// * These models usually consist of 3 files, lower.md3, upper.md3 and +// * head.md3. If this property is set to true, Assimp will try to load and +// * combine all three files if one of them is loaded. +// * Property type: bool. Default value: true. +// */ +// #define AI_CONFIG_IMPORT_MD3_HANDLE_MULTIPART \ +// "IMPORT_MD3_HANDLE_MULTIPART" +// +// // --------------------------------------------------------------------------- +// /** @brief Tells the MD3 loader which skin files to load. +// * +// * When loading MD3 files, Assimp checks whether a file +// * _.skin is existing. These files are used by +// * Quake III to be able to assign different skins (e.g. red and blue team) +// * to models. 'default', 'red', 'blue' are typical skin names. +// * Property type: String. Default value: "default". +// */ +// #define AI_CONFIG_IMPORT_MD3_SKIN_NAME \ +// "IMPORT_MD3_SKIN_NAME" +// +// // --------------------------------------------------------------------------- +// /** @brief Specify the Quake 3 shader file to be used for a particular +// * MD3 file. This can also be a search path. +// * +// * By default Assimp's behaviour is as follows: If a MD3 file +// * /models///.md3 is +// * loaded, the library tries to locate the corresponding shader file in +// * /scripts/.shader. This property overrides this +// * behaviour. It can either specify a full path to the shader to be loaded +// * or alternatively the path (relative or absolute) to the directory where +// * the shaders for all MD3s to be loaded reside. Assimp attempts to open +// *

/.shader first, /.shader +// * is the fallback file. Note that should have a terminal (back)slash. +// * Property type: String. Default value: n/a. +// */ +// #define AI_CONFIG_IMPORT_MD3_SHADER_SRC \ +// "IMPORT_MD3_SHADER_SRC" +// +// // --------------------------------------------------------------------------- +// /** @brief Configures the LWO loader to load just one layer from the model. +// * +// * LWO files consist of layers and in some cases it could be useful to load +// * only one of them. This property can be either a string - which specifies +// * the name of the layer - or an integer - the index of the layer. If the +// * property is not set the whole LWO model is loaded. Loading fails if the +// * requested layer is not available. The layer index is zero-based and the +// * layer name may not be empty.
+// * Property type: Integer. Default value: all layers are loaded. +// */ +// #define AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY \ +// "IMPORT_LWO_ONE_LAYER_ONLY" +// +// // --------------------------------------------------------------------------- +// /** @brief Configures the MD5 loader to not load the MD5ANIM file for +// * a MD5MESH file automatically. +// * +// * The default strategy is to look for a file with the same name but the +// * MD5ANIM extension in the same directory. If it is found, it is loaded +// * and combined with the MD5MESH file. This configuration option can be +// * used to disable this behaviour. +// * +// * * Property type: bool. Default value: false. +// */ +// #define AI_CONFIG_IMPORT_MD5_NO_ANIM_AUTOLOAD \ +// "IMPORT_MD5_NO_ANIM_AUTOLOAD" +// +// // --------------------------------------------------------------------------- +// /** @brief Defines the begin of the time range for which the LWS loader +// * evaluates animations and computes aiNodeAnim's. +// * +// * Assimp provides full conversion of LightWave's envelope system, including +// * pre and post conditions. The loader computes linearly subsampled animation +// * chanels with the frame rate given in the LWS file. This property defines +// * the start time. Note: animation channels are only generated if a node +// * has at least one envelope with more tan one key assigned. This property. +// * is given in frames, '0' is the first frame. By default, if this property +// * is not set, the importer takes the animation start from the input LWS +// * file ('FirstFrame' line)
+// * Property type: Integer. Default value: taken from file. +// * +// * @see AI_CONFIG_IMPORT_LWS_ANIM_END - end of the imported time range +// */ +// #define AI_CONFIG_IMPORT_LWS_ANIM_START \ +// "IMPORT_LWS_ANIM_START" +// #define AI_CONFIG_IMPORT_LWS_ANIM_END \ +// "IMPORT_LWS_ANIM_END" +// +// // --------------------------------------------------------------------------- +// /** @brief Defines the output frame rate of the IRR loader. +// * +// * IRR animations are difficult to convert for Assimp and there will +// * always be a loss of quality. This setting defines how many keys per second +// * are returned by the converter.
+// * Property type: integer. Default value: 100 +// */ +// #define AI_CONFIG_IMPORT_IRR_ANIM_FPS \ +// "IMPORT_IRR_ANIM_FPS" +// +// +// // --------------------------------------------------------------------------- +// /** @brief Ogre Importer will try to load this Materialfile. +// * +// * Ogre Meshes contain only the MaterialName, not the MaterialFile. If there +// * is no material file with the same name as the material, Ogre Importer will +// * try to load this file and search the material in it. +// *
+// * Property type: String. Default value: guessed. +// */ +// #define AI_CONFIG_IMPORT_OGRE_MATERIAL_FILE "IMPORT_OGRE_MATERIAL_FILE" +// +// +// // --------------------------------------------------------------------------- +// /** @brief Ogre Importer detect the texture usage from its filename +// * +// * Normally, a texture is loaded as a colormap, if no target is specified in the +// * materialfile. Is this switch is enabled, texture names ending with _n, _l, _s +// * are used as normalmaps, lightmaps or specularmaps. +// *
+// * Property type: Bool. Default value: false. +// */ +// #define AI_CONFIG_IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME "IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME" +// +// +// +// // --------------------------------------------------------------------------- +// /** @brief Specifies whether the IFC loader skips over IfcSpace elements. +// * +// * IfcSpace elements (and their geometric representations) are used to +// * represent, well, free space in a building storey.
+// * Property type: Bool. Default value: true. +// */ +// #define AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS "IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS" +// +// +// // --------------------------------------------------------------------------- +// /** @brief Specifies whether the IFC loader skips over +// * shape representations of type 'Curve2D'. +// * +// * A lot of files contain both a faceted mesh representation and a outline +// * with a presentation type of 'Curve2D'. Currently Assimp doesn't convert those, +// * so turning this option off just clutters the log with errors.
+// * Property type: Bool. Default value: true. +// */ +// #define AI_CONFIG_IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS "IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS" +// +// // --------------------------------------------------------------------------- +// /** @brief Specifies whether the IFC loader will use its own, custom triangulation +// * algorithm to triangulate wall and floor meshes. +// * +// * If this property is set to false, walls will be either triangulated by +// * #aiProcess_Triangulate or will be passed through as huge polygons with +// * faked holes (i.e. holes that are connected with the outer boundary using +// * a dummy edge). It is highly recommended to set this property to true +// * if you want triangulated data because #aiProcess_Triangulate is known to +// * have problems with the kind of polygons that the IFC loader spits out for +// * complicated meshes. +// * Property type: Bool. Default value: true. +// */ +// #define AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION "IMPORT_IFC_CUSTOM_TRIANGULATION" +// + ; + + private AiConfigOptions(String name) { + m_name = name; + } + + + private final String m_name; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiLight.java b/port/jassimp/jassimp/src/jassimp/AiLight.java new file mode 100644 index 000000000..0b1dd2f67 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiLight.java @@ -0,0 +1,387 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * Describes a light source.

+ * + * Assimp supports multiple sorts of light sources, including + * directional, point and spot lights. All of them are defined with just + * a single structure and distinguished by their parameters. + * Note - some file formats (such as 3DS, ASE) export a "target point" - + * the point a spot light is looking at (it can even be animated). Assimp + * writes the target point as a subnode of a spotlights's main node, + * called "<spotName>.Target". However, this is just additional + * information then, the transformation tracks of the main node make the + * spot light already point in the right direction. + */ +public final class AiLight { + /** + * Constructor. + * + * @param name + * @param type + * @param position + * @param direction + * @param attenuationConstant + * @param attenuationLinear + * @param attenuationQuadratic + * @param diffuse + * @param specular + * @param ambient + * @param innerCone + * @param outerCone + */ + AiLight(String name, int type, Object position, Object direction, + float attenuationConstant, float attenuationLinear, + float attenuationQuadratic, Object diffuse, Object specular, + Object ambient, float innerCone, float outerCone) { + + m_name = name; + m_type = AiLightType.fromRawValue(type); + m_position = position; + m_direction = direction; + m_attenuationConstant = attenuationConstant; + m_attenuationLinear = attenuationLinear; + m_attenuationQuadratic = attenuationQuadratic; + m_diffuse = diffuse; + m_specular = specular; + m_ambient = ambient; + m_innerCone = innerCone; + m_outerCone = outerCone; + } + + + /** + * Returns the name of the light source.

+ * + * There must be a node in the scenegraph with the same name. + * This node specifies the position of the light in the scene + * hierarchy and can be animated. + * + * @return the name + */ + public String getName() { + return m_name; + } + + + /** + * Returns The type of the light source. + * + * @return the type + */ + public AiLightType getType() { + return m_type; + } + + + /** + * Returns the position of the light.

+ * + * The position is relative to the transformation of the scene graph node + * corresponding to the light. The position is undefined for directional + * lights.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built in behavior is to return an {@link AiVector}. + * + * + * @param wrapperProvider the wrapper provider (used for type inference) + * + * @return the position + */ + @SuppressWarnings("unchecked") + public V3 getPosition(AiWrapperProvider + wrapperProvider) { + + return (V3) m_position; + } + + + /** + * Returns the direction of the light.

+ * + * The direction is relative to the transformation of the scene graph node + * corresponding to the light. The direction is undefined for point lights. + * The vector may be normalized, but it needn't..

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built in behavior is to return an {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the position + */ + @SuppressWarnings("unchecked") + public V3 getDirection(AiWrapperProvider + wrapperProvider) { + + return (V3) m_direction; + } + + + /** + * Constant light attenuation factor.

+ * + * The intensity of the light source at a given distance 'd' from + * the light's position is + * Atten = 1/( att0 + att1 * d + att2 * d*d) + * This member corresponds to the att0 variable in the equation. + * Naturally undefined for directional lights. + * + * @return the constant light attenuation factor + */ + public float getAttenuationConstant() { + return m_attenuationConstant; + } + + + /** + * Linear light attenuation factor.

+ * + * The intensity of the light source at a given distance 'd' from + * the light's position is + * Atten = 1/( att0 + att1 * d + att2 * d*d) + * This member corresponds to the att1 variable in the equation. + * Naturally undefined for directional lights. + * + * @return the linear light attenuation factor + */ + public float getAttenuationLinear() { + return m_attenuationLinear; + } + + + /** + * Quadratic light attenuation factor.

+ * + * The intensity of the light source at a given distance 'd' from + * the light's position is + * Atten = 1/( att0 + att1 * d + att2 * d*d) + * This member corresponds to the att2 variable in the equation. + * Naturally undefined for directional lights. + * + * @return the quadratic light attenuation factor + */ + public float getAttenuationQuadratic() { + return m_attenuationQuadratic; + } + + + /** + * Diffuse color of the light source.

+ * + * The diffuse light color is multiplied with the diffuse + * material color to obtain the final color that contributes + * to the diffuse shading term.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built in behavior is to return an {@link AiColor}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the diffuse color (alpha will be 1) + */ + @SuppressWarnings("unchecked") + public C getColorDiffuse( + AiWrapperProvider wrapperProvider) { + + return (C) m_diffuse; + } + + + /** + * Specular color of the light source.

+ * + * The specular light color is multiplied with the specular + * material color to obtain the final color that contributes + * to the specular shading term.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built in behavior is to return an {@link AiColor}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the specular color (alpha will be 1) + */ + @SuppressWarnings("unchecked") + public C getColorSpecular( + AiWrapperProvider wrapperProvider) { + + return (C) m_specular; + } + + + /** + * Ambient color of the light source.

+ * + * The ambient light color is multiplied with the ambient + * material color to obtain the final color that contributes + * to the ambient shading term. Most renderers will ignore + * this value it, is just a remaining of the fixed-function pipeline + * that is still supported by quite many file formats.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built in behavior is to return an {@link AiColor}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the ambient color (alpha will be 1) + */ + @SuppressWarnings("unchecked") + public C getColorAmbient( + AiWrapperProvider wrapperProvider) { + + return (C) m_ambient; + } + + + /** + * Inner angle of a spot light's light cone.

+ * + * The spot light has maximum influence on objects inside this + * angle. The angle is given in radians. It is 2PI for point + * lights and undefined for directional lights. + * + * @return the inner angle + */ + public float getAngleInnerCone() { + return m_innerCone; + } + + + /** + * Outer angle of a spot light's light cone.

+ * + * The spot light does not affect objects outside this angle. + * The angle is given in radians. It is 2PI for point lights and + * undefined for directional lights. The outer angle must be + * greater than or equal to the inner angle. + * It is assumed that the application uses a smooth + * interpolation between the inner and the outer cone of the + * spot light. + * + * @return the outer angle + */ + public float getAngleOuterCone() { + return m_outerCone; + } + + + /** + * Name. + */ + private final String m_name; + + + /** + * Type. + */ + private final AiLightType m_type; + + + /** + * Position. + */ + private final Object m_position; + + + /** + * Direction. + */ + private final Object m_direction; + + + /** + * Constant attenuation. + */ + private final float m_attenuationConstant; + + + /** + * Linear attenuation. + */ + private final float m_attenuationLinear; + + + /** + * Quadratic attenuation. + */ + private final float m_attenuationQuadratic; + + + /** + * Diffuse color. + */ + private final Object m_diffuse; + + + /** + * Specular color. + */ + private final Object m_specular; + + + /** + * Ambient color. + */ + private final Object m_ambient; + + + /** + * Inner cone of spotlight. + */ + private final float m_innerCone; + + + /** + * Outer cone of spotlight. + */ + private final float m_outerCone; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiLightType.java b/port/jassimp/jassimp/src/jassimp/AiLightType.java new file mode 100644 index 000000000..5df38763c --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiLightType.java @@ -0,0 +1,112 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * List of light types supported by {@link AiLight}. + */ +public enum AiLightType { + /** + * A directional light source.

+ * + * A directional light has a well-defined direction but is infinitely far + * away. That's quite a good approximation for sun light. + */ + DIRECTIONAL(0x1), + + + /** + * A point light source.

+ * + * A point light has a well-defined position in space but no direction - + * it emits light in all directions. A normal bulb is a point light. + */ + POINT(0x2), + + + /** + * A spot light source.

+ * + * A spot light emits light in a specific angle. It has a position and a + * direction it is pointing to. A good example for a spot light is a light + * spot in sport arenas. + */ + SPOT(0x3); + + + /** + * Utility method for converting from c/c++ based integer enums to java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param rawValue an integer based enum value (as defined by assimp) + * @return the enum value corresponding to rawValue + */ + static AiLightType fromRawValue(int rawValue) { + for (AiLightType type : AiLightType.values()) { + if (type.m_rawValue == rawValue) { + return type; + } + } + + throw new IllegalArgumentException("unexptected raw value: " + + rawValue); + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private AiLightType(int rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiMaterial.java b/port/jassimp/jassimp/src/jassimp/AiMaterial.java new file mode 100644 index 000000000..7a9abc0d3 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiMaterial.java @@ -0,0 +1,1202 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * Data structure for a material.

+ * + * Depending on the imported scene and scene format, individual properties + * might be present or not. A list of all imported properties can be retrieved + * via {@link #getProperties()}.

+ * + * This class offers getXXX() for all supported properties. These + * methods are fail-save, i.e., will return a default value when the + * corresponding property is not set. To change the built in default values, + * use the setDefaultXXX() methods.

+ * + * If your application expects a certain set of properties to be available, + * the {@link #hasProperties(Set)} method can be used to check whether all + * these properties are actually set. If this check fails, you can still + * use this material via the getXXX() methods without special + * error handling code as the implementation guarantees to return default + * values for missing properties. This check will not work on texture related + * properties (i.e., properties starting with TEX_). + */ +public final class AiMaterial { + /** + * Enumerates all supported material properties. + */ + public static enum PropertyKey { + /** + * Name. + */ + NAME("?mat.name", String.class), + + /** + * Two-sided flag. + */ + TWO_SIDED("$mat.twosided", Integer.class), + + /** + * Shading mode. + */ + SHADING_MODE("$mat.shadingm", AiShadingMode.class), + + /** + * Wireframe flag. + */ + WIREFRAME("$mat.wireframe", Integer.class), + + /** + * Blend mode. + */ + BLEND_MODE("$mat.blend", AiBlendMode.class), + + /** + * Opacity. + */ + OPACITY("$mat.opacity", Float.class), + + /** + * Bump scaling. + */ + BUMP_SCALING("$mat.bumpscaling", Float.class), + + + /** + * Shininess. + */ + SHININESS("$mat.shininess", Float.class), + + + /** + * Reflectivity. + */ + REFLECTIVITY("$mat.reflectivity", Float.class), + + + /** + * Shininess strength. + */ + SHININESS_STRENGTH("$mat.shinpercent", Float.class), + + + /** + * Refract index. + */ + REFRACTI("$mat.refracti", Float.class), + + + /** + * Diffuse color. + */ + COLOR_DIFFUSE("$clr.diffuse", Object.class), + + + /** + * Ambient color. + */ + COLOR_AMBIENT("$clr.ambient", Object.class), + + + /** + * Ambient color. + */ + COLOR_SPECULAR("$clr.specular", Object.class), + + + /** + * Emissive color. + */ + COLOR_EMISSIVE("$clr.emissive", Object.class), + + + /** + * Transparent color. + */ + COLOR_TRANSPARENT("$clr.transparent", Object.class), + + + /** + * Reflective color. + */ + COLOR_REFLECTIVE("$clr.reflective", Object.class), + + + /** + * Global background image. + */ + GLOBAL_BACKGROUND_IMAGE("?bg.global", String.class), + + + /** + * Texture file path. + */ + TEX_FILE("$tex.file", String.class), + + + /** + * Texture uv index. + */ + TEX_UV_INDEX("$tex.uvwsrc", Integer.class), + + + /** + * Texture blend factor. + */ + TEX_BLEND("$tex.blend", Float.class), + + + /** + * Texture operation. + */ + TEX_OP("$tex.op", AiTextureOp.class), + + + /** + * Texture map mode for u axis. + */ + TEX_MAP_MODE_U("$tex.mapmodeu", AiTextureMapMode.class), + + + /** + * Texture map mode for v axis. + */ + TEX_MAP_MODE_V("$tex.mapmodev", AiTextureMapMode.class), + + + /** + * Texture map mode for w axis. + */ + TEX_MAP_MODE_W("$tex.mapmodew", AiTextureMapMode.class); + + /** + * Constructor. + * + * @param key key name as used by assimp + * @param type key type, used for casts and checks + */ + private PropertyKey(String key, Class type) { + m_key = key; + m_type = type; + } + + + /** + * Key. + */ + private final String m_key; + + + /** + * Type. + */ + private final Class m_type; + } + + + /** + * A very primitive RTTI system for the contents of material properties. + */ + public static enum PropertyType { + /** + * Array of single-precision (32 Bit) floats. + */ + FLOAT(0x1), + + + /** + * The material property is a string. + */ + STRING(0x3), + + + /** + * Array of (32 Bit) integers. + */ + INTEGER(0x4), + + + /** + * Simple binary buffer, content undefined. Not convertible to anything. + */ + BUFFER(0x5); + + + /** + * Utility method for converting from c/c++ based integer enums to java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param rawValue an integer based enum value (as defined by assimp) + * @return the enum value corresponding to rawValue + */ + static PropertyType fromRawValue(int rawValue) { + for (PropertyType type : PropertyType.values()) { + if (type.m_rawValue == rawValue) { + return type; + } + } + + throw new IllegalArgumentException("unexptected raw value: " + + rawValue); + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private PropertyType(int rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; + } + + + /** + * Data structure for a single material property.

+ * + * As an user, you'll probably never need to deal with this data structure. + * Just use the provided get() family of functions to query material + * properties easily. + */ + public static final class Property { + /** + * Constructor. + * + * @param key + * @param semantic + * @param index + * @param type + * @param data + */ + Property(String key, int semantic, int index, int type, + Object data) { + + m_key = key; + m_semantic = semantic; + m_index = index; + m_type = PropertyType.fromRawValue(type); + m_data = data; + } + + + /** + * Constructor. + * + * @param key + * @param semantic + * @param index + * @param type + * @param dataLen + */ + Property(String key, int semantic, int index, int type, + int dataLen) { + + m_key = key; + m_semantic = semantic; + m_index = index; + m_type = PropertyType.fromRawValue(type); + + ByteBuffer b = ByteBuffer.allocateDirect(dataLen); + b.order(ByteOrder.nativeOrder()); + + m_data = b; + } + + + /** + * Returns the key of the property.

+ * + * Keys are generally case insensitive. + * + * @return the key + */ + public String getKey() { + return m_key; + } + + + /** + * Textures: Specifies their exact usage semantic. + * For non-texture properties, this member is always 0 + * (or, better-said, #aiTextureType_NONE). + * + * @return the semantic + */ + public int getSemantic() { + return m_semantic; + } + + + /** + * Textures: Specifies the index of the texture. + * For non-texture properties, this member is always 0. + * + * @return the index + */ + public int getIndex() { + return m_index; + } + + + /** + * Type information for the property.

+ * + * Defines the data layout inside the data buffer. This is used + * by the library internally to perform debug checks and to + * utilize proper type conversions. + * (It's probably a hacky solution, but it works.) + * + * @return the type + */ + public PropertyType getType() { + return m_type; + } + + + /** + * Binary buffer to hold the property's value. + * The size of the buffer is always mDataLength. + * + * @return the data + */ + Object getData() { + return m_data; + } + + + /** + * Key. + */ + private final String m_key; + + + /** + * Semantic. + */ + private final int m_semantic; + + + /** + * Index. + */ + private final int m_index; + + + /** + * Type. + */ + private final PropertyType m_type; + + + /** + * Data. + */ + private final Object m_data; + } + + + /** + * Constructor. + */ + AiMaterial() { + /* nothing to do */ + } + + + /** + * Checks whether the given set of properties is available. + * + * @param keys the keys to check + * @return true if all properties are available, false otherwise + */ + public boolean hasProperties(Set keys) { + for (PropertyKey key : keys) { + if (null == getProperty(key.m_key)) { + return false; + } + } + + return true; + } + + + /** + * Sets a default value.

+ * + * The passed in Object must match the type of the key as returned by + * the corresponding getXXX() method. + * + * @param key the key + * @param defaultValue the new default, may not be null + * @throws IllegalArgumentException if defaultValue is null or has a wrong + * type + */ + public void setDefault(PropertyKey key, Object defaultValue) { + if (null == defaultValue) { + throw new IllegalArgumentException("defaultValue may not be null"); + } + if (key.m_type != defaultValue.getClass()) { + throw new IllegalArgumentException( + "defaultValue has wrong type, " + + "expected: " + key.m_type + ", found: " + + defaultValue.getClass()); + } + + m_defaults.put(key, defaultValue); + } + + + // {{ Fail-save Getters + /** + * Returns the name of the material.

+ * + * If missing, defaults to empty string + * + * @return the name + */ + public String getName() { + return getTyped(PropertyKey.NAME, String.class); + } + + + /** + * Returns the two-sided flag.

+ * + * If missing, defaults to 0 + * + * @return the two-sided flag + */ + public int getTwoSided() { + return getTyped(PropertyKey.TWO_SIDED, Integer.class); + } + + + /** + * Returns the shading mode.

+ * + * If missing, defaults to {@link AiShadingMode#FLAT} + * + * @return the shading mode + */ + public AiShadingMode getShadingMode() { + Property p = getProperty(PropertyKey.SHADING_MODE.m_key); + + if (null == p || null == p.getData()) { + return (AiShadingMode) m_defaults.get(PropertyKey.SHADING_MODE); + } + + return AiShadingMode.fromRawValue((Integer) p.getData()); + } + + + /** + * Returns the wireframe flag.

+ * + * If missing, defaults to 0 + * + * @return the wireframe flag + */ + public int getWireframe() { + return getTyped(PropertyKey.WIREFRAME, Integer.class); + } + + + /** + * Returns the blend mode.

+ * + * If missing, defaults to {@link AiBlendMode#DEFAULT} + * + * @return the blend mode + */ + public AiBlendMode getBlendMode() { + Property p = getProperty(PropertyKey.BLEND_MODE.m_key); + + if (null == p || null == p.getData()) { + return (AiBlendMode) m_defaults.get(PropertyKey.BLEND_MODE); + } + + return AiBlendMode.fromRawValue((Integer) p.getData()); + } + + + /** + * Returns the opacity.

+ * + * If missing, defaults to 1.0 + * + * @return the opacity + */ + public float getOpacity() { + return getTyped(PropertyKey.OPACITY, Float.class); + } + + + /** + * Returns the bump scaling factor.

+ * + * If missing, defaults to 1.0 + * + * @return the bump scaling factor + */ + public float getBumpScaling() { + return getTyped(PropertyKey.BUMP_SCALING, Float.class); + } + + + /** + * Returns the shininess.

+ * + * If missing, defaults to 1.0 + * + * @return the shininess + */ + public float getShininess() { + return getTyped(PropertyKey.SHININESS, Float.class); + } + + + /** + * Returns the reflectivity.

+ * + * If missing, defaults to 0.0 + * + * @return the reflectivity + */ + public float getReflectivity() { + return getTyped(PropertyKey.REFLECTIVITY, Float.class); + } + + + /** + * Returns the shininess strength.

+ * + * If missing, defaults to 0.0 + * + * @return the shininess strength + */ + public float getShininessStrength() { + return getTyped(PropertyKey.SHININESS_STRENGTH, Float.class); + } + + + /** + * Returns the refract index.

+ * + * If missing, defaults to 0.0 + * + * @return the refract index + */ + public float getRefractIndex() { + return getTyped(PropertyKey.REFRACTI, Float.class); + } + + + /** + * Returns the diffuse color.

+ * + * If missing, defaults to opaque white (1.0, 1.0, 1.0, 1.0)

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the diffuse color + */ + @SuppressWarnings("unchecked") + public C getDiffuseColor( + AiWrapperProvider wrapperProvider) { + + Property p = getProperty(PropertyKey.COLOR_DIFFUSE.m_key); + + if (null == p || null == p.getData()) { + Object def = m_defaults.get(PropertyKey.COLOR_DIFFUSE); + if (def == null) { + return (C) Jassimp.wrapColor4(1.0f, 1.0f, 1.0f, 1.0f); + } + + return (C) def; + } + + return (C) p.getData(); + } + + + /** + * Returns the ambient color.

+ * + * If missing, defaults to opaque white (1.0, 1.0, 1.0, 1.0)

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the ambient color + */ + @SuppressWarnings("unchecked") + public C getAmbientColor( + AiWrapperProvider wrapperProvider) { + + Property p = getProperty(PropertyKey.COLOR_AMBIENT.m_key); + + if (null == p || null == p.getData()) { + Object def = m_defaults.get(PropertyKey.COLOR_AMBIENT); + if (def == null) { + return (C) Jassimp.wrapColor4(1.0f, 1.0f, 1.0f, 1.0f); + } + + return (C) def; + } + + return (C) p.getData(); + } + + + /** + * Returns the specular color.

+ * + * If missing, defaults to opaque white (1.0, 1.0, 1.0, 1.0)

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the specular color + */ + @SuppressWarnings("unchecked") + public C getSpecularColor( + AiWrapperProvider wrapperProvider) { + + Property p = getProperty(PropertyKey.COLOR_SPECULAR.m_key); + + if (null == p || null == p.getData()) { + Object def = m_defaults.get(PropertyKey.COLOR_SPECULAR); + if (def == null) { + return (C) Jassimp.wrapColor4(1.0f, 1.0f, 1.0f, 1.0f); + } + + return (C) def; + } + + return (C) p.getData(); + } + + + /** + * Returns the emissive color.

+ * + * If missing, defaults to opaque white (1.0, 1.0, 1.0, 1.0)

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the emissive color + */ + @SuppressWarnings("unchecked") + public C getEmissiveColor( + AiWrapperProvider wrapperProvider) { + + Property p = getProperty(PropertyKey.COLOR_EMISSIVE.m_key); + + if (null == p || null == p.getData()) { + Object def = m_defaults.get(PropertyKey.COLOR_EMISSIVE); + if (def == null) { + return (C) Jassimp.wrapColor4(1.0f, 1.0f, 1.0f, 1.0f); + } + + return (C) def; + } + + return (C) p.getData(); + } + + + /** + * Returns the transparent color.

+ * + * If missing, defaults to opaque white (1.0, 1.0, 1.0, 1.0)

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the transparent color + */ + @SuppressWarnings("unchecked") + public C getTransparentColor( + AiWrapperProvider wrapperProvider) { + + Property p = getProperty(PropertyKey.COLOR_TRANSPARENT.m_key); + + if (null == p || null == p.getData()) { + Object def = m_defaults.get(PropertyKey.COLOR_TRANSPARENT); + if (def == null) { + return (C) Jassimp.wrapColor4(1.0f, 1.0f, 1.0f, 1.0f); + } + + return (C) def; + } + + return (C) p.getData(); + } + + + /** + * Returns the reflective color.

+ * + * If missing, defaults to opaque white (1.0, 1.0, 1.0, 1.0)

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the reflective color + */ + @SuppressWarnings("unchecked") + public C getReflectiveColor( + AiWrapperProvider wrapperProvider) { + + Property p = getProperty(PropertyKey.COLOR_REFLECTIVE.m_key); + + if (null == p || null == p.getData()) { + Object def = m_defaults.get(PropertyKey.COLOR_REFLECTIVE); + if (def == null) { + return (C) Jassimp.wrapColor4(1.0f, 1.0f, 1.0f, 1.0f); + } + + return (C) def; + } + + return (C) p.getData(); + } + + + /** + * Returns the global background image.

+ * + * If missing, defaults to empty string + * + * @return the global background image + */ + public String getGlobalBackgroundImage() { + return getTyped(PropertyKey.GLOBAL_BACKGROUND_IMAGE, String.class); + } + + + /** + * Returns the number of textures of the given type. + * + * @param type the type + * @return the number of textures + */ + public int getNumTextures(AiTextureType type) { + return m_numTextures.get(type); + } + + + /** + * Returns the texture file.

+ * + * If missing, defaults to empty string + * + * @param type the texture type + * @param index the index in the texture stack + * @return the file + * @throws IndexOutOfBoundsException if index is invalid + */ + public String getTextureFile(AiTextureType type, int index) { + checkTexRange(type, index); + + return getTyped(PropertyKey.TEX_FILE, type, index, String.class); + } + + + /** + * Returns the index of the UV coordinate set used by the texture.

+ * + * If missing, defaults to 0 + * + * @param type the texture type + * @param index the index in the texture stack + * @return the UV index + * @throws IndexOutOfBoundsException if index is invalid + */ + public int getTextureUVIndex(AiTextureType type, int index) { + checkTexRange(type, index); + + return getTyped(PropertyKey.TEX_UV_INDEX, type, index, Integer.class); + } + + + /** + * Returns the blend factor of the texture.

+ * + * If missing, defaults to 1.0 + * + * @param type the texture type + * @param index the index in the texture stack + * @return the blend factor + */ + public float getBlendFactor(AiTextureType type, int index) { + checkTexRange(type, index); + + return getTyped(PropertyKey.TEX_BLEND, type, index, Float.class); + } + + + /** + * Returns the texture operation.

+ * + * If missing, defaults to {@link AiTextureOp#ADD} + * + * @param type the texture type + * @param index the index in the texture stack + * @return the texture operation + */ + public AiTextureOp getTextureOp(AiTextureType type, int index) { + checkTexRange(type, index); + + Property p = getProperty(PropertyKey.TEX_OP.m_key); + + if (null == p || null == p.getData()) { + return (AiTextureOp) m_defaults.get(PropertyKey.TEX_OP); + } + + return AiTextureOp.fromRawValue((Integer) p.getData()); + } + + + /** + * Returns the texture mapping mode for the u axis.

+ * + * If missing, defaults to {@link AiTextureMapMode#CLAMP} + * + * @param type the texture type + * @param index the index in the texture stack + * @return the texture mapping mode + */ + public AiTextureMapMode getTextureMapModeU(AiTextureType type, int index) { + checkTexRange(type, index); + + Property p = getProperty(PropertyKey.TEX_MAP_MODE_U.m_key); + + if (null == p || null == p.getData()) { + return (AiTextureMapMode) m_defaults.get( + PropertyKey.TEX_MAP_MODE_U); + } + + return AiTextureMapMode.fromRawValue((Integer) p.getData()); + } + + + /** + * Returns the texture mapping mode for the v axis.

+ * + * If missing, defaults to {@link AiTextureMapMode#CLAMP} + * + * @param type the texture type + * @param index the index in the texture stack + * @return the texture mapping mode + */ + public AiTextureMapMode getTextureMapModeV(AiTextureType type, int index) { + checkTexRange(type, index); + + Property p = getProperty(PropertyKey.TEX_MAP_MODE_V.m_key); + + if (null == p || null == p.getData()) { + return (AiTextureMapMode) m_defaults.get( + PropertyKey.TEX_MAP_MODE_V); + } + + return AiTextureMapMode.fromRawValue((Integer) p.getData()); + } + + + /** + * Returns the texture mapping mode for the w axis.

+ * + * If missing, defaults to {@link AiTextureMapMode#CLAMP} + * + * @param type the texture type + * @param index the index in the texture stack + * @return the texture mapping mode + */ + public AiTextureMapMode getTextureMapModeW(AiTextureType type, int index) { + checkTexRange(type, index); + + Property p = getProperty(PropertyKey.TEX_MAP_MODE_W.m_key); + + if (null == p || null == p.getData()) { + return (AiTextureMapMode) m_defaults.get( + PropertyKey.TEX_MAP_MODE_W); + } + + return AiTextureMapMode.fromRawValue((Integer) p.getData()); + } + + + /** + * Returns all information related to a single texture. + * + * @param type the texture type + * @param index the index in the texture stack + * @return the texture information + */ + public AiTextureInfo getTextureInfo(AiTextureType type, int index) { + return new AiTextureInfo(type, index, getTextureFile(type, index), + getTextureUVIndex(type, index), getBlendFactor(type, index), + getTextureOp(type, index), getTextureMapModeW(type, index), + getTextureMapModeW(type, index), + getTextureMapModeW(type, index)); + } + // }} + + // {{ Generic Getters + /** + * Returns a single property based on its key. + * + * @param key the key + * @return the property or null if the property is not set + */ + public Property getProperty(String key) { + for (Property property : m_properties) { + if (property.getKey().equals(key)) { + return property; + } + } + + return null; + } + + + /** + * Returns a single property based on its key. + * + * @param key the key + * @param semantic the semantic type (texture type) + * @param index the index + * @return the property or null if the property is not set + */ + public Property getProperty(String key, int semantic, int index) { + for (Property property : m_properties) { + if (property.getKey().equals(key) && + property.m_semantic == semantic && + property.m_index == index) { + + return property; + } + } + + return null; + } + + + /** + * Returns all properties of the material. + * + * @return the list of properties + */ + public List getProperties() { + return m_properties; + } + // }} + + + /** + * Helper method. Returns typed property data. + * + * @param type + * @param key the key + * @param clazz type + * @return the data + */ + private T getTyped(PropertyKey key, Class clazz) { + Property p = getProperty(key.m_key); + + if (null == p || null == p.getData()) { + return clazz.cast(m_defaults.get(key)); + } + + return clazz.cast(p.getData()); + } + + + /** + * Helper method. Returns typed property data. + * + * @param type + * @param key the key + * @param type the texture type + * @param index the texture index + * @param clazz type + * @return the data + */ + private T getTyped(PropertyKey key, AiTextureType type, int index, + Class clazz) { + + Property p = getProperty(key.m_key, AiTextureType.toRawValue(type), + index); + + if (null == p || null == p.getData()) { + return clazz.cast(m_defaults.get(key)); + } + + return clazz.cast(p.getData()); + } + + + /** + * Checks that index is valid an throw an exception if not. + * + * @param type the type + * @param index the index to check + */ + private void checkTexRange(AiTextureType type, int index) { + if (index < 0 || index > m_numTextures.get(type)) { + throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + + m_numTextures.get(type)); + } + } + + + /** + * Defaults for missing properties. + */ + private Map m_defaults = + new EnumMap(PropertyKey.class); + + { + setDefault(PropertyKey.NAME, ""); + setDefault(PropertyKey.TWO_SIDED, 0); + setDefault(PropertyKey.SHADING_MODE, AiShadingMode.FLAT); + setDefault(PropertyKey.WIREFRAME, 0); + setDefault(PropertyKey.BLEND_MODE, AiBlendMode.DEFAULT); + setDefault(PropertyKey.OPACITY, 1.0f); + setDefault(PropertyKey.BUMP_SCALING, 1.0f); + setDefault(PropertyKey.SHININESS, 1.0f); + setDefault(PropertyKey.REFLECTIVITY, 0.0f); + setDefault(PropertyKey.SHININESS_STRENGTH, 0.0f); + setDefault(PropertyKey.REFRACTI, 0.0f); + + /* bypass null checks for colors */ + m_defaults.put(PropertyKey.COLOR_DIFFUSE, null); + m_defaults.put(PropertyKey.COLOR_AMBIENT, null); + m_defaults.put(PropertyKey.COLOR_SPECULAR, null); + m_defaults.put(PropertyKey.COLOR_EMISSIVE, null); + m_defaults.put(PropertyKey.COLOR_TRANSPARENT, null); + m_defaults.put(PropertyKey.COLOR_REFLECTIVE, null); + + setDefault(PropertyKey.GLOBAL_BACKGROUND_IMAGE, ""); + + /* texture related values */ + setDefault(PropertyKey.TEX_FILE, ""); + setDefault(PropertyKey.TEX_UV_INDEX, 0); + setDefault(PropertyKey.TEX_BLEND, 1.0f); + setDefault(PropertyKey.TEX_OP, AiTextureOp.ADD); + setDefault(PropertyKey.TEX_MAP_MODE_U, AiTextureMapMode.CLAMP); + setDefault(PropertyKey.TEX_MAP_MODE_V, AiTextureMapMode.CLAMP); + setDefault(PropertyKey.TEX_MAP_MODE_W, AiTextureMapMode.CLAMP); + + /* ensure we have defaults for everything */ + for (PropertyKey key : PropertyKey.values()) { + if (!m_defaults.containsKey(key)) { + throw new IllegalStateException("missing default for: " + key); + } + } + } + + + /** + * This method is used by JNI, do not call or modify. + * + * @param type the type + * @param number the number + */ + @SuppressWarnings("unused") + private void setTextureNumber(int type, int number) { + m_numTextures.put(AiTextureType.fromRawValue(type), number); + } + + + /** + * List of properties. + */ + private final List m_properties = new ArrayList(); + + + /** + * Number of textures for each type. + */ + private final Map m_numTextures = + new EnumMap(AiTextureType.class); +} diff --git a/port/jassimp/jassimp/src/jassimp/AiMatrix4f.java b/port/jassimp/jassimp/src/jassimp/AiMatrix4f.java new file mode 100644 index 000000000..19640888d --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiMatrix4f.java @@ -0,0 +1,133 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; + +/** + * Simple 4x4 matrix of floats. + */ +public final class AiMatrix4f { + /** + * Wraps the given array of floats as matrix. + *

+ * + * The array must have exactly 16 entries. The data in the array must be in + * row-major order. + * + * @param data + * the array to wrap, may not be null + */ + public AiMatrix4f(float[] data) { + if (data == null) { + throw new IllegalArgumentException("data may not be null"); + } + if (data.length != 16) { + throw new IllegalArgumentException("array length is not 16"); + } + + m_data = data; + } + + /** + * Gets an element of the matrix. + * + * @param row + * the row + * @param col + * the column + * @return the element at the given position + */ + public float get(int row, int col) { + if (row < 0 || row > 3) { + throw new IndexOutOfBoundsException("Index: " + row + ", Size: 4"); + } + if (col < 0 || col > 3) { + throw new IndexOutOfBoundsException("Index: " + col + ", Size: 4"); + } + + return m_data[row * 4 + col]; + } + + /** + * Stores the matrix in a new direct ByteBuffer with native byte order. + *

+ * + * The returned buffer can be passed to rendering APIs such as LWJGL, e.g., + * as parameter for GL20.glUniformMatrix4(). Be sure to set + * transpose to true in this case, as OpenGL + * expects the matrix in column order. + * + * @return a new native order, direct ByteBuffer + */ + public FloatBuffer toByteBuffer() { + ByteBuffer bbuf = ByteBuffer.allocateDirect(16 * 4); + bbuf.order(ByteOrder.nativeOrder()); + FloatBuffer fbuf = bbuf.asFloatBuffer(); + fbuf.put(m_data); + fbuf.flip(); + + return fbuf; + } + + + @Override + public String toString() { + StringBuilder buf = new StringBuilder(); + + for (int row = 0; row < 4; row++) { + for (int col = 0; col < 4; col++) { + buf.append(m_data[row * 4 + col]).append(" "); + } + buf.append("\n"); + } + + return buf.toString(); + } + + + /** + * Data buffer. + */ + private final float[] m_data; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiMesh.java b/port/jassimp/jassimp/src/jassimp/AiMesh.java new file mode 100644 index 000000000..81ac0b775 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiMesh.java @@ -0,0 +1,1429 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Set; + + +/** + * A mesh represents a geometry or model with a single material. + *

+ * + *

Data

+ * Meshes usually consist of a number of vertices and a series of faces + * referencing the vertices. In addition there might be a series of bones, each + * of them addressing a number of vertices with a certain weight. Vertex data is + * presented in channels with each channel containing a single per-vertex + * information such as a set of texture coordinates or a normal vector.

+ * + * Faces consist of one or more references to vertices, called vertex indices. + * The {@link #getPrimitiveTypes()} method can be used to check what + * face types are present in the mesh. Note that a single mesh can possess + * faces of different types. The number of indices used by a specific face can + * be retrieved with the {@link #getFaceNumIndices(int)} method. + * + * + *

API for vertex and face data

+ * The jassimp interface for accessing vertex and face data is not a one-to-one + * mapping of the c/c++ interface. The c/c++ interface uses an object-oriented + * approach to represent data, which provides a considerable + * overhead using a naive java based realization (cache locality would be + * unpredictable and most likely bad, bulk data transfer would be impossible). + *

+ * + * The jassimp interface uses flat byte buffers to store vertex and face data. + * This data can be accessed through three APIs: + *

    + *
  • Buffer API: the getXXXBuffer() methods return + * raw data buffers. + *
  • Direct API: the getXXX() methods allow reading + * and writing of individual data values. + *
  • Wrapped API: the getWrappedXXX() methods provide + * an object oriented view on the data. + *
+ * + * The Buffer API is optimized for use in conjunction with rendering APIs + * such as LWJGL. The returned buffers are guaranteed to have native byte order + * and to be direct byte buffers. They can be passed directly to LWJGL + * methods, e.g., to fill VBOs with data. Each invocation of a + * getXXXBuffer() method will return a new view of the internal + * buffer, i.e., if is safe to use the relative byte buffer operations. + * The Buffer API provides the best performance of all three APIs, especially + * if large data volumes have to be processed.

+ * + * The Direct API provides an easy to use interface for reading and writing + * individual data values. Its performance is comparable to the Buffer API's + * performance for these operations. The main difference to the Buffer API is + * the missing support for bulk operations. If you intend to retrieve or modify + * large subsets of the raw data consider using the Buffer API, especially + * if the subsets are contiguous. + *

+ * + * The Wrapped API offers an object oriented interface for accessing + * and modifying mesh data. As the name implies, this interface is realized + * through wrapper objects that provide a view on the raw data. For each + * invocation of a getWrappedXXX() method, a new wrapper object + * is created. Iterating over mesh data via this interface will create many + * short-lived wrapper objects which -depending on usage and virtual machine- + * may cause considerable garbage collection overhead. The Wrapped API provides + * the worst performance of all three APIs, which may nevertheless still be + * good enough to warrant its usage. See {@link AiWrapperProvider} for more + * details on wrappers. + * + * + *

API for bones

+ * As there is no standardized way for doing skinning in different graphics + * engines, bones are not represented as flat buffers but as object structure. + * Users of this library should convert this structure to the format required + * by the specific graphics engine. + * + * + *

Changing Data

+ * This class is designed to be mutable, i.e., the returned objects and buffers + * may be modified. It is not possible to add/remove vertices as this would + * require reallocation of the data buffers. Wrapped objects may or may not + * propagate changes to the underlying data buffers. Consult the documentation + * of your wrapper provider for details. The built in wrappers will propagate + * changes. + *

+ * Modification of face data is theoretically possible by modifying the face + * buffer and the faceOffset buffer however it is strongly disadvised to do so + * because it might break all algorithms that depend on the internal consistency + * of these two data structures. + */ +public final class AiMesh { + /** + * Number of bytes per float value. + */ + private static final int SIZEOF_FLOAT = 4; + + + /** + * Number of bytes per int value. + */ + private static final int SIZEOF_INT = 4; + + + /** + * This class is instantiated via JNI, no accessible constructor. + */ + private AiMesh() { + /* nothing to do */ + } + + + /** + * Returns the primitive types used by this mesh. + * + * @return a set of primitive types used by this mesh + */ + public Set getPrimitiveTypes() { + return m_primitiveTypes; + } + + + /** + * Tells whether the mesh is a pure triangle mesh, i.e., contains only + * triangular faces.

+ * + * To automatically triangulate meshes the + * {@link AiPostProcessSteps#TRIANGULATE} post processing option can be + * used when loading the scene + * + * @return true if the mesh is a pure triangle mesh, false otherwise + */ + public boolean isPureTriangle() { + return m_primitiveTypes.contains(AiPrimitiveType.TRIANGLE) && + m_primitiveTypes.size() == 1; + } + + + /** + * Tells whether the mesh has vertex positions.

+ * + * Meshes almost always contain position data + * + * @return true if positions are available + */ + public boolean hasPositions() { + return m_vertices != null; + } + + + /** + * Tells whether the mesh has faces.

+ * + * Meshes almost always contain faces + * + * @return true if faces are available + */ + public boolean hasFaces() { + return m_faces != null; + } + + + /** + * Tells whether the mesh has normals. + * + * @return true if normals are available + */ + public boolean hasNormals() { + return m_normals != null; + } + + + /** + * Tells whether the mesh has tangents and bitangents.

+ * + * It is not possible that it contains tangents and no bitangents (or the + * other way round). The existence of one of them implies that the second + * is there, too. + * + * @return true if tangents and bitangents are available + */ + public boolean hasTangentsAndBitangents() { + return m_tangents != null && m_tangents != null; + } + + + /** + * Tells whether the mesh has a vertex color set. + * + * @param colorset index of the color set + * @return true if colors are available + */ + public boolean hasColors(int colorset) { + return m_colorsets[colorset] != null; + } + + + /** + * Tells whether the mesh has any vertex colors.

+ * + * Use {@link #hasColors(int)} to check which color sets are + * available. + * + * @return true if any colors are available + */ + public boolean hasVertexColors() { + for (ByteBuffer buf : m_colorsets) { + if (buf != null) { + return true; + } + } + + return false; + } + + + /** + * Tells whether the mesh has a texture coordinate set. + * + * @param coords index of the texture coordinate set + * @return true if texture coordinates are available + */ + public boolean hasTexCoords(int coords) { + return m_texcoords[coords] != null; + } + + + /** + * Tells whether the mesh has any texture coordinate sets.

+ * + * Use {@link #hasTexCoords(int)} to check which texture coordinate + * sets are available + * + * @return true if any texture coordinates are available + */ + public boolean hasTexCoords() { + for (ByteBuffer buf : m_texcoords) { + if (buf != null) { + return true; + } + } + + return false; + } + + + /** + * Tells whether the mesh has bones. + * + * @return true if bones are available + */ + public boolean hasBones() { + return !m_bones.isEmpty(); + } + + + /** + * Returns the bones of this mesh. + * + * @return a list of bones + */ + public List getBones() { + return m_bones; + } + + + /** + * Returns the number of vertices in this mesh. + * + * @return the number of vertices. + */ + public int getNumVertives() { + return m_numVertices; + } + + + /** + * Returns the number of faces in the mesh. + * + * @return the number of faces + */ + public int getNumFaces() { + return m_numFaces; + } + + + /** + * Returns the number of vertex indices for a single face. + * + * @param face the face + * @return the number of indices + */ + public int getFaceNumIndices(int face) { + if (null == m_faceOffsets) { + if (face >= m_numFaces || face < 0) { + throw new IndexOutOfBoundsException("Index: " + face + + ", Size: " + m_numFaces); + } + return 3; + } + else { + /* + * no need to perform bound checks here as the array access will + * throw IndexOutOfBoundsExceptions if the index is invalid + */ + + if (face == m_numFaces - 1) { + return m_faces.capacity() / 4 - m_faceOffsets.getInt(face * 4); + } + + return m_faceOffsets.getInt((face + 1) * 4) - + m_faceOffsets.getInt(face * 4); + } + } + + + /** + * Returns the number of UV components for a texture coordinate set.

+ * + * Possible values range from 1 to 3 (1D to 3D texture coordinates) + * + * @param coords the coordinate set + * @return the number of components + */ + public int getNumUVComponents(int coords) { + return m_numUVComponents[coords]; + } + + + /** + * Returns the material used by this mesh.

+ * + * A mesh does use only a single material. If an imported model uses + * multiple materials, the import splits up the mesh. Use this value + * as index into the scene's material list. + * + * @return the material index + */ + public int getMaterialIndex() { + return m_materialIndex; + } + + + /** + * Returns the name of the mesh.

+ * + * Not all meshes have a name, if no name is set an empty string is + * returned. + * + * @return the name or an empty string if no name is set + */ + public String getName() { + return m_name; + } + + + // CHECKSTYLE:OFF + @Override + public String toString() { + StringBuilder buf = new StringBuilder(); + buf.append("Mesh(").append(m_numVertices).append(" vertices, "). + append(m_numFaces).append(" faces"); + + if (hasNormals()) { + buf.append(", normals"); + } + if (hasTangentsAndBitangents()) { + buf.append(", (bi-)tangents"); + } + if (hasVertexColors()) { + buf.append(", colors"); + } + if (hasTexCoords()) { + buf.append(", texCoords"); + } + + buf.append(")"); + return buf.toString(); + } + // CHECKSTYLE:ON + + + // {{ Buffer API + /** + * Returns a buffer containing vertex positions.

+ * + * A vertex position consists of a triple of floats, the buffer will + * therefore contain 3 * getNumVertives() floats + * + * @return a native-order direct buffer, or null if no data is available + */ + public FloatBuffer getPositionBuffer() { + if (m_vertices == null) { + return null; + } + + return m_vertices.asFloatBuffer(); + } + + + /** + * Returns a buffer containing face data.

+ * + * You should use the {@link #getIndexBuffer()} method if you are + * interested in getting an index buffer used by graphics APIs such as + * LWJGL.

+ * + * The buffer contains all vertex indices from all faces as a flat list. If + * the mesh is a pure triangle mesh, the buffer returned by this method is + * identical to the buffer returned by {@link #getIndexBuffer()}. For other + * meshes, the {@link #getFaceOffsets()} method can be used to retrieve + * an index structure that allows addressing individual faces in the list. + * + * @return a native-order direct buffer, or null if no data is available + */ + public IntBuffer getFaceBuffer() { + if (m_faces == null) { + return null; + } + + return m_faces.asIntBuffer(); + } + + + /** + * Returns an index structure for the buffer returned by + * {@link #getFaceBuffer()}.

+ * + * You should use the {@link #getIndexBuffer()} method if you are + * interested in getting an index buffer used by graphics APIs such as + * LWJGL.

+ * + * The returned buffer contains one integer entry for each face. This entry + * specifies the offset at which the face's data is located inside the + * face buffer. The difference between two subsequent entries can be used + * to determine how many vertices belong to a given face (the last face + * contains all entries between the offset and the end of the face buffer). + * + * @return a native-order direct buffer, or null if no data is available + */ + public IntBuffer getFaceOffsets() { + if (m_faceOffsets == null) { + return null; + } + + return m_faceOffsets.asIntBuffer(); + } + + + + /** + * Returns a buffer containing vertex indices for the mesh's faces.

+ * + * This method may only be called on pure triangle meshes, i.e., meshes + * containing only triangles. The {@link #isPureTriangle()} method can be + * used to check whether this is the case.

+ * + * Indices are stored as integers, the buffer will therefore contain + * 3 * getNumVertives() integers (3 indices per triangle) + * + * @return a native-order direct buffer + * @throws UnsupportedOperationException + * if the mesh is not a pure triangle mesh + */ + public IntBuffer getIndexBuffer() { + if (!isPureTriangle()) { + throw new UnsupportedOperationException( + "mesh is not a pure triangle mesh"); + } + + return getFaceBuffer(); + } + + + /** + * Returns a buffer containing normals.

+ * + * A normal consists of a triple of floats, the buffer will + * therefore contain 3 * getNumVertives() floats + * + * @return a native-order direct buffer + */ + public FloatBuffer getNormalBuffer() { + if (m_normals == null) { + return null; + } + + return m_normals.asFloatBuffer(); + } + + + /** + * Returns a buffer containing tangents.

+ * + * A tangent consists of a triple of floats, the buffer will + * therefore contain 3 * getNumVertives() floats + * + * @return a native-order direct buffer + */ + public FloatBuffer getTangentBuffer() { + if (m_tangents == null) { + return null; + } + + return m_tangents.asFloatBuffer(); + } + + + /** + * Returns a buffer containing bitangents.

+ * + * A bitangent consists of a triple of floats, the buffer will + * therefore contain 3 * getNumVertives() floats + * + * @return a native-order direct buffer + */ + public FloatBuffer getBitangentBuffer() { + if (m_bitangents == null) { + return null; + } + + return m_bitangents.asFloatBuffer(); + } + + + /** + * Returns a buffer containing vertex colors for a color set.

+ * + * A vertex color consists of 4 floats (red, green, blue and alpha), the + * buffer will therefore contain 4 * getNumVertives() floats + * + * @param colorset the color set + * + * @return a native-order direct buffer, or null if no data is available + */ + public FloatBuffer getColorBuffer(int colorset) { + if (m_colorsets[colorset] == null) { + return null; + } + + return m_colorsets[colorset].asFloatBuffer(); + } + + + /** + * Returns a buffer containing coordinates for a texture coordinate set.

+ * + * A texture coordinate consists of up to 3 floats (u, v, w). The actual + * number can be queried via {@link #getNumUVComponents(int)}. The + * buffer will contain + * getNumUVComponents(coords) * getNumVertives() floats + * + * @param coords the texture coordinate set + * + * @return a native-order direct buffer, or null if no data is available + */ + public FloatBuffer getTexCoordBuffer(int coords) { + if (m_texcoords[coords] == null) { + return null; + } + + return m_texcoords[coords].asFloatBuffer(); + } + // }} + + + // {{ Direct API + /** + * Returns the x-coordinate of a vertex position. + * + * @param vertex the vertex index + * @return the x coordinate + */ + public float getPositionX(int vertex) { + if (!hasPositions()) { + throw new IllegalStateException("mesh has no positions"); + } + + checkVertexIndexBounds(vertex); + + return m_vertices.getFloat(vertex * 3 * SIZEOF_FLOAT); + } + + + /** + * Returns the y-coordinate of a vertex position. + * + * @param vertex the vertex index + * @return the y coordinate + */ + public float getPositionY(int vertex) { + if (!hasPositions()) { + throw new IllegalStateException("mesh has no positions"); + } + + checkVertexIndexBounds(vertex); + + return m_vertices.getFloat((vertex * 3 + 1) * SIZEOF_FLOAT); + } + + /** + * Returns the z-coordinate of a vertex position. + * + * @param vertex the vertex index + * @return the z coordinate + */ + public float getPositionZ(int vertex) { + if (!hasPositions()) { + throw new IllegalStateException("mesh has no positions"); + } + + checkVertexIndexBounds(vertex); + + return m_vertices.getFloat((vertex * 3 + 2) * SIZEOF_FLOAT); + } + + + /** + * Returns a vertex reference from a face.

+ * + * A face contains getFaceNumIndices(face) vertex references. + * This method returns the n'th of these. The returned index can be passed + * directly to the vertex oriented methods, such as + * getPosition() etc. + * + * @param face the face + * @param n the reference + * @return a vertex index + */ + public int getFaceVertex(int face, int n) { + if (!hasFaces()) { + throw new IllegalStateException("mesh has no faces"); + } + + if (face >= m_numFaces || face < 0) { + throw new IndexOutOfBoundsException("Index: " + face + ", Size: " + + m_numFaces); + } + if (n >= getFaceNumIndices(face) || n < 0) { + throw new IndexOutOfBoundsException("Index: " + n + ", Size: " + + getFaceNumIndices(face)); + } + + int faceOffset = 0; + if (m_faceOffsets == null) { + faceOffset = 3 * face * SIZEOF_INT; + } + else { + faceOffset = m_faceOffsets.getInt(face * SIZEOF_INT) * SIZEOF_INT; + } + + return m_faces.getInt(faceOffset + n * SIZEOF_INT); + } + + + /** + * Returns the x-coordinate of a vertex normal. + * + * @param vertex the vertex index + * @return the x coordinate + */ + public float getNormalX(int vertex) { + if (!hasNormals()) { + throw new IllegalStateException("mesh has no normals"); + } + + checkVertexIndexBounds(vertex); + + return m_normals.getFloat(vertex * 3 * SIZEOF_FLOAT); + } + + + /** + * Returns the y-coordinate of a vertex normal. + * + * @param vertex the vertex index + * @return the y coordinate + */ + public float getNormalY(int vertex) { + if (!hasNormals()) { + throw new IllegalStateException("mesh has no normals"); + } + + checkVertexIndexBounds(vertex); + + return m_normals.getFloat((vertex * 3 + 1) * SIZEOF_FLOAT); + } + + + /** + * Returns the z-coordinate of a vertex normal. + * + * @param vertex the vertex index + * @return the z coordinate + */ + public float getNormalZ(int vertex) { + if (!hasNormals()) { + throw new IllegalStateException("mesh has no normals"); + } + + checkVertexIndexBounds(vertex); + + return m_normals.getFloat((vertex * 3 + 2) * SIZEOF_FLOAT); + } + + + /** + * Returns the x-coordinate of a vertex tangent. + * + * @param vertex the vertex index + * @return the x coordinate + */ + public float getTangentX(int vertex) { + if (!hasTangentsAndBitangents()) { + throw new IllegalStateException("mesh has no tangents"); + } + + checkVertexIndexBounds(vertex); + + return m_tangents.getFloat(vertex * 3 * SIZEOF_FLOAT); + } + + + /** + * Returns the y-coordinate of a vertex bitangent. + * + * @param vertex the vertex index + * @return the y coordinate + */ + public float getTangentY(int vertex) { + if (!hasTangentsAndBitangents()) { + throw new IllegalStateException("mesh has no bitangents"); + } + + checkVertexIndexBounds(vertex); + + return m_tangents.getFloat((vertex * 3 + 1) * SIZEOF_FLOAT); + } + + + /** + * Returns the z-coordinate of a vertex tangent. + * + * @param vertex the vertex index + * @return the z coordinate + */ + public float getTangentZ(int vertex) { + if (!hasTangentsAndBitangents()) { + throw new IllegalStateException("mesh has no tangents"); + } + + checkVertexIndexBounds(vertex); + + return m_tangents.getFloat((vertex * 3 + 2) * SIZEOF_FLOAT); + } + + + /** + * Returns the x-coordinate of a vertex tangent. + * + * @param vertex the vertex index + * @return the x coordinate + */ + public float getBitangentX(int vertex) { + if (!hasTangentsAndBitangents()) { + throw new IllegalStateException("mesh has no bitangents"); + } + + checkVertexIndexBounds(vertex); + + return m_bitangents.getFloat(vertex * 3 * SIZEOF_FLOAT); + } + + + /** + * Returns the y-coordinate of a vertex tangent. + * + * @param vertex the vertex index + * @return the y coordinate + */ + public float getBitangentY(int vertex) { + if (!hasTangentsAndBitangents()) { + throw new IllegalStateException("mesh has no bitangents"); + } + + checkVertexIndexBounds(vertex); + + return m_bitangents.getFloat((vertex * 3 + 1) * SIZEOF_FLOAT); + } + + + /** + * Returns the z-coordinate of a vertex tangent. + * + * @param vertex the vertex index + * @return the z coordinate + */ + public float getBitangentZ(int vertex) { + if (!hasTangentsAndBitangents()) { + throw new IllegalStateException("mesh has no bitangents"); + } + + checkVertexIndexBounds(vertex); + + return m_bitangents.getFloat((vertex * 3 + 2) * SIZEOF_FLOAT); + } + + + /** + * Returns the red color component of a color from a vertex color set. + * + * @param vertex the vertex index + * @param colorset the color set + * @return the red color component + */ + public float getColorR(int vertex, int colorset) { + if (!hasColors(colorset)) { + throw new IllegalStateException("mesh has no colorset " + colorset); + } + + checkVertexIndexBounds(vertex); + /* bound checks for colorset are done by java for us */ + + return m_colorsets[colorset].getFloat(vertex * 4 * SIZEOF_FLOAT); + } + + + /** + * Returns the green color component of a color from a vertex color set. + * + * @param vertex the vertex index + * @param colorset the color set + * @return the green color component + */ + public float getColorG(int vertex, int colorset) { + if (!hasColors(colorset)) { + throw new IllegalStateException("mesh has no colorset " + colorset); + } + + checkVertexIndexBounds(vertex); + /* bound checks for colorset are done by java for us */ + + return m_colorsets[colorset].getFloat((vertex * 4 + 1) * SIZEOF_FLOAT); + } + + + /** + * Returns the blue color component of a color from a vertex color set. + * + * @param vertex the vertex index + * @param colorset the color set + * @return the blue color component + */ + public float getColorB(int vertex, int colorset) { + if (!hasColors(colorset)) { + throw new IllegalStateException("mesh has no colorset " + colorset); + } + + checkVertexIndexBounds(vertex); + /* bound checks for colorset are done by java for us */ + + return m_colorsets[colorset].getFloat((vertex * 4 + 2) * SIZEOF_FLOAT); + } + + + /** + * Returns the alpha color component of a color from a vertex color set. + * + * @param vertex the vertex index + * @param colorset the color set + * @return the alpha color component + */ + public float getColorA(int vertex, int colorset) { + if (!hasColors(colorset)) { + throw new IllegalStateException("mesh has no colorset " + colorset); + } + + checkVertexIndexBounds(vertex); + /* bound checks for colorset are done by java for us */ + + return m_colorsets[colorset].getFloat((vertex * 4 + 3) * SIZEOF_FLOAT); + } + + + /** + * Returns the u component of a coordinate from a texture coordinate set. + * + * @param vertex the vertex index + * @param coords the texture coordinate set + * @return the u component + */ + public float getTexCoordU(int vertex, int coords) { + if (!hasTexCoords(coords)) { + throw new IllegalStateException( + "mesh has no texture coordinate set " + coords); + } + + checkVertexIndexBounds(vertex); + /* bound checks for coords are done by java for us */ + + return m_texcoords[coords].getFloat( + vertex * m_numUVComponents[coords] * SIZEOF_FLOAT); + } + + + /** + * Returns the v component of a coordinate from a texture coordinate set.

+ * + * This method may only be called on 2- or 3-dimensional coordinate sets. + * Call getNumUVComponents(coords) to determine how may + * coordinate components are available. + * + * @param vertex the vertex index + * @param coords the texture coordinate set + * @return the v component + */ + public float getTexCoordV(int vertex, int coords) { + if (!hasTexCoords(coords)) { + throw new IllegalStateException( + "mesh has no texture coordinate set " + coords); + } + + checkVertexIndexBounds(vertex); + + /* bound checks for coords are done by java for us */ + + if (getNumUVComponents(coords) < 2) { + throw new IllegalArgumentException("coordinate set " + coords + + " does not contain 2D texture coordinates"); + } + + return m_texcoords[coords].getFloat( + (vertex * m_numUVComponents[coords] + 1) * SIZEOF_FLOAT); + } + + + /** + * Returns the w component of a coordinate from a texture coordinate set.

+ * + * This method may only be called on 3-dimensional coordinate sets. + * Call getNumUVComponents(coords) to determine how may + * coordinate components are available. + * + * @param vertex the vertex index + * @param coords the texture coordinate set + * @return the w component + */ + public float getTexCoordW(int vertex, int coords) { + if (!hasTexCoords(coords)) { + throw new IllegalStateException( + "mesh has no texture coordinate set " + coords); + } + + checkVertexIndexBounds(vertex); + + /* bound checks for coords are done by java for us */ + + if (getNumUVComponents(coords) < 3) { + throw new IllegalArgumentException("coordinate set " + coords + + " does not contain 3D texture coordinates"); + } + + return m_texcoords[coords].getFloat( + (vertex * m_numUVComponents[coords] + 1) * SIZEOF_FLOAT); + } + // }} + + + // {{ Wrapped API + /** + * Returns the vertex position as 3-dimensional vector.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param vertex the vertex index + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the position wrapped as object + */ + public V3 getWrappedPosition(int vertex, + AiWrapperProvider wrapperProvider) { + + if (!hasPositions()) { + throw new IllegalStateException("mesh has no positions"); + } + + checkVertexIndexBounds(vertex); + + return wrapperProvider.wrapVector3f(m_vertices, + vertex * 3 * SIZEOF_FLOAT, 3); + } + + + /** + * Returns the vertex normal as 3-dimensional vector.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param vertex the vertex index + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the normal wrapped as object + */ + public V3 getWrappedNormal(int vertex, + AiWrapperProvider wrapperProvider) { + + if (!hasNormals()) { + throw new IllegalStateException("mesh has no positions"); + } + + checkVertexIndexBounds(vertex); + + return wrapperProvider.wrapVector3f(m_normals, + vertex * 3 * SIZEOF_FLOAT, 3); + } + + + /** + * Returns the vertex tangent as 3-dimensional vector.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param vertex the vertex index + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the tangent wrapped as object + */ + public V3 getWrappedTangent(int vertex, + AiWrapperProvider wrapperProvider) { + + if (!hasTangentsAndBitangents()) { + throw new IllegalStateException("mesh has no tangents"); + } + + checkVertexIndexBounds(vertex); + + return wrapperProvider.wrapVector3f(m_tangents, + vertex * 3 * SIZEOF_FLOAT, 3); + } + + + /** + * Returns the vertex bitangent as 3-dimensional vector.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param vertex the vertex index + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the bitangent wrapped as object + */ + public V3 getWrappedBitangent(int vertex, + AiWrapperProvider wrapperProvider) { + + if (!hasTangentsAndBitangents()) { + throw new IllegalStateException("mesh has no bitangents"); + } + + checkVertexIndexBounds(vertex); + + return wrapperProvider.wrapVector3f(m_bitangents, + vertex * 3 * SIZEOF_FLOAT, 3); + } + + + /** + * Returns the vertex color.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiColor}. + * + * @param vertex the vertex index + * @param colorset the color set + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the vertex color wrapped as object + */ + public C getWrappedColor(int vertex, int colorset, + AiWrapperProvider wrapperProvider) { + + if (!hasColors(colorset)) { + throw new IllegalStateException("mesh has no colorset " + colorset); + } + + checkVertexIndexBounds(vertex); + + return wrapperProvider.wrapColor( + m_colorsets[colorset], vertex * 4 * SIZEOF_FLOAT); + } + + + /** + * Returns the texture coordinates as n-dimensional vector.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param vertex the vertex index + * @param coords the texture coordinate set + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the texture coordinates wrapped as object + */ + public V3 getWrappedTexCoords(int vertex, int coords, + AiWrapperProvider wrapperProvider) { + + if (!hasTexCoords(coords)) { + throw new IllegalStateException( + "mesh has no texture coordinate set " + coords); + } + + checkVertexIndexBounds(vertex); + + return wrapperProvider.wrapVector3f(m_texcoords[coords], + vertex * 3 * SIZEOF_FLOAT, getNumUVComponents(coords)); + } + // }} + + + // {{ Helpers + /** + * Throws an exception if the vertex index is not in the allowed range. + * + * @param vertex the index to check + */ + private void checkVertexIndexBounds(int vertex) { + if (vertex >= m_numVertices || vertex < 0) { + throw new IndexOutOfBoundsException("Index: " + vertex + + ", Size: " + m_numVertices); + } + } + // }} + + // {{ JNI interface + /* + * Channel constants used by allocate data channel. Do not modify or use + * as these may change at will + */ + // CHECKSTYLE:OFF + private static final int NORMALS = 0; + private static final int TANGENTS = 1; + private static final int BITANGENTS = 2; + private static final int COLORSET = 3; + private static final int TEXCOORDS_1D = 4; + private static final int TEXCOORDS_2D = 5; + private static final int TEXCOORDS_3D = 6; + // CHECKSTYLE:ON + + + /** + * This method is used by JNI. Do not call or modify.

+ * + * Sets the primitive types enum set + * + * @param types the bitwise or'ed c/c++ aiPrimitiveType enum values + */ + @SuppressWarnings("unused") + private void setPrimitiveTypes(int types) { + AiPrimitiveType.fromRawValue(m_primitiveTypes, types); + } + + + /** + * This method is used by JNI. Do not call or modify.

+ * + * Allocates byte buffers + * + * @param numVertices the number of vertices in the mesh + * @param numFaces the number of faces in the mesh + * @param optimizedFaces set true for optimized face representation + * @param faceBufferSize size of face buffer for non-optimized face + * representation + */ + @SuppressWarnings("unused") + private void allocateBuffers(int numVertices, int numFaces, + boolean optimizedFaces, int faceBufferSize) { + /* + * the allocated buffers are native order direct byte buffers, so they + * can be passed directly to LWJGL or similar graphics APIs + */ + + /* ensure face optimization is possible */ + if (optimizedFaces && !isPureTriangle()) { + throw new IllegalArgumentException("mesh is not purely triangular"); + } + + + m_numVertices = numVertices; + m_numFaces = numFaces; + + + /* allocate for each vertex 3 floats */ + if (m_numVertices > 0) { + m_vertices = ByteBuffer.allocateDirect(numVertices * 3 * + SIZEOF_FLOAT); + m_vertices.order(ByteOrder.nativeOrder()); + } + + + if (m_numFaces > 0) { + /* for optimized faces allocate 3 integers per face */ + if (optimizedFaces) { + m_faces = ByteBuffer.allocateDirect(numFaces * 3 * SIZEOF_INT); + m_faces.order(ByteOrder.nativeOrder()); + } + /* + * for non-optimized faces allocate the passed in buffer size + * and allocate the face index structure + */ + else { + m_faces = ByteBuffer.allocateDirect(faceBufferSize); + m_faces.order(ByteOrder.nativeOrder()); + + m_faceOffsets = ByteBuffer.allocateDirect(numFaces * + SIZEOF_INT); + m_faceOffsets.order(ByteOrder.nativeOrder()); + } + } + } + + + /** + * This method is used by JNI. Do not call or modify.

+ * + * Allocates a byte buffer for a vertex data channel + * + * @param channelType the channel type + * @param channelIndex sub-index, used for types that can have multiple + * channels, such as texture coordinates + */ + @SuppressWarnings("unused") + private void allocateDataChannel(int channelType, int channelIndex) { + switch (channelType) { + case NORMALS: + m_normals = ByteBuffer.allocateDirect( + m_numVertices * 3 * SIZEOF_FLOAT); + m_normals.order(ByteOrder.nativeOrder()); + break; + case TANGENTS: + m_tangents = ByteBuffer.allocateDirect( + m_numVertices * 3 * SIZEOF_FLOAT); + m_tangents.order(ByteOrder.nativeOrder()); + break; + case BITANGENTS: + m_bitangents = ByteBuffer.allocateDirect( + m_numVertices * 3 * SIZEOF_FLOAT); + m_bitangents.order(ByteOrder.nativeOrder()); + break; + case COLORSET: + m_colorsets[channelIndex] = ByteBuffer.allocateDirect( + m_numVertices * 4 * SIZEOF_FLOAT); + m_colorsets[channelIndex].order(ByteOrder.nativeOrder()); + break; + case TEXCOORDS_1D: + m_numUVComponents[channelIndex] = 1; + m_texcoords[channelIndex] = ByteBuffer.allocateDirect( + m_numVertices * 1 * SIZEOF_FLOAT); + m_texcoords[channelIndex].order(ByteOrder.nativeOrder()); + break; + case TEXCOORDS_2D: + m_numUVComponents[channelIndex] = 2; + m_texcoords[channelIndex] = ByteBuffer.allocateDirect( + m_numVertices * 2 * SIZEOF_FLOAT); + m_texcoords[channelIndex].order(ByteOrder.nativeOrder()); + break; + case TEXCOORDS_3D: + m_numUVComponents[channelIndex] = 3; + m_texcoords[channelIndex] = ByteBuffer.allocateDirect( + m_numVertices * 3 * SIZEOF_FLOAT); + m_texcoords[channelIndex].order(ByteOrder.nativeOrder()); + break; + default: + throw new IllegalArgumentException("unsupported channel type"); + } + } + // }} + + + /** + * The primitive types used by this mesh. + */ + private final Set m_primitiveTypes = + EnumSet.noneOf(AiPrimitiveType.class); + + + /** + * Number of vertices in this mesh. + */ + private int m_numVertices = 0; + + + /** + * Number of faces in this mesh. + */ + private int m_numFaces = 0; + + + /** + * Material used by this mesh. + */ + private int m_materialIndex = -1; + + + /** + * The name of the mesh. + */ + private String m_name = ""; + + + /** + * Buffer for vertex position data. + */ + private ByteBuffer m_vertices = null; + + + /** + * Buffer for faces/ indices. + */ + private ByteBuffer m_faces = null; + + + /** + * Index structure for m_faces.

+ * + * Only used by meshes that are not pure triangular + */ + private ByteBuffer m_faceOffsets = null; + + + /** + * Buffer for normals. + */ + private ByteBuffer m_normals = null; + + + /** + * Buffer for tangents. + */ + private ByteBuffer m_tangents = null; + + + /** + * Buffer for bitangents. + */ + private ByteBuffer m_bitangents = null; + + + /** + * Vertex colors. + */ + private ByteBuffer[] m_colorsets = + new ByteBuffer[JassimpConfig.MAX_NUMBER_COLORSETS]; + + + /** + * Number of UV components for each texture coordinate set. + */ + private int[] m_numUVComponents = new int[JassimpConfig.MAX_NUMBER_TEXCOORDS]; + + + /** + * Texture coordinates. + */ + private ByteBuffer[] m_texcoords = + new ByteBuffer[JassimpConfig.MAX_NUMBER_TEXCOORDS]; + + + /** + * Bones. + */ + private final List m_bones = new ArrayList(); +} diff --git a/port/jassimp/jassimp/src/jassimp/AiMeshAnim.java b/port/jassimp/jassimp/src/jassimp/AiMeshAnim.java new file mode 100644 index 000000000..bbccc71ac --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiMeshAnim.java @@ -0,0 +1,49 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * This class is a stub - mesh animations are currently not supported. + */ +public class AiMeshAnim { + +} diff --git a/port/jassimp/jassimp/src/jassimp/AiNode.java b/port/jassimp/jassimp/src/jassimp/AiNode.java new file mode 100644 index 000000000..5cd26b668 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiNode.java @@ -0,0 +1,228 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.util.ArrayList; +import java.util.List; + + +/** + * A node in the imported hierarchy.

+ * + * Each node has name, a parent node (except for the root node), + * a transformation relative to its parent and possibly several child nodes. + * Simple file formats don't support hierarchical structures - for these formats + * the imported scene consists of only a single root node without children. + */ +public final class AiNode { + /** + * Constructor. + * + * @param parent the parent node, may be null + * @param transform the transform matrix + * @param meshReferences array of mesh references + * @param name the name of the node + */ + AiNode(AiNode parent, Object transform, int[] meshReferences, String name) { + m_parent = parent; + m_transformationMatrix = transform; + m_meshReferences = meshReferences; + m_name = name; + + if (null != m_parent) { + m_parent.addChild(this); + } + } + + + /** + * Returns the name of this node. + * + * @return the name + */ + public String getName() { + return m_name; + } + + + /** + * Returns the number of child nodes.

+ * + * This method exists for compatibility reasons with the native assimp API. + * The returned value is identical to getChildren().size() + * + * @return the number of child nodes + */ + public int getNumChildren() { + return getChildren().size(); + } + + + /** + * Returns a 4x4 matrix that specifies the transformation relative to + * the parent node.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built in behavior is to return an {@link AiMatrix4f}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * + * @return a matrix + */ + @SuppressWarnings("unchecked") + public M4 getTransform(AiWrapperProvider + wrapperProvider) { + + return (M4) m_transformationMatrix; + } + + + /** + * Returns the children of this node. + * + * @return the children, or an empty list if the node has no children + */ + public List getChildren() { + return m_children; + } + + + /** + * Returns the parent node. + * + * @return the parent, or null of the node has no parent + */ + public AiNode getParent() { + return m_parent; + } + + + /** + * Searches the node hierarchy below (and including) this node for a node + * with the specified name. + * + * @param name the name to look for + * @return the first node with the given name, or null if no such node + * exists + */ + public AiNode findNode(String name) { + /* classic recursive depth first search */ + + if (m_name.equals(name)) { + return this; + } + + for (AiNode child : m_children) { + if (null != child.findNode(name)) { + return child; + } + } + + return null; + } + + + /** + * Returns the number of meshes references by this node.

+ * + * This method exists for compatibility with the native assimp API. + * The returned value is identical to getMeshes().length + * + * @return the number of references + */ + public int getNumMeshes() { + return m_meshReferences.length; + } + + + /** + * Returns the meshes referenced by this node.

+ * + * Each entry is an index into the mesh list stored in {@link AiScene}. + * + * @return an array of indices + */ + public int[] getMeshes() { + return m_meshReferences; + } + + + /** + * Adds a child node. + * + * @param child the child to add + */ + void addChild(AiNode child) { + m_children.add(child); + } + + + /** + * Name. + */ + private final String m_name; + + + /** + * Parent node. + */ + private final AiNode m_parent; + + + /** + * Mesh references. + */ + private final int[] m_meshReferences; + + + /** + * List of children. + */ + private final List m_children = new ArrayList(); + + + /** + * Buffer for transformation matrix. + */ + private final Object m_transformationMatrix; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java b/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java new file mode 100644 index 000000000..43b4ce66b --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiNodeAnim.java @@ -0,0 +1,502 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + + +/** + * Describes the animation of a single node.

+ * + * The node name ({@link #getNodeName()} specifies the bone/node which is + * affected by this animation channel. The keyframes are given in three + * separate series of values, one each for position, rotation and scaling. + * The transformation matrix computed from these values replaces the node's + * original transformation matrix at a specific time.

+ * + * This means all keys are absolute and not relative to the bone default pose. + * The order in which the transformations are applied is - as usual - + * scaling, rotation, translation.

+ * + * Note: All keys are returned in their correct, chronological order. + * Duplicate keys don't pass the validation step. Most likely there + * will be no negative time values, but they are not forbidden also (so + * implementations need to cope with them!)

+ * + * Like {@link AiMesh}, the animation related classes offer a Buffer API, a + * Direct API and a wrapped API. Please consult the documentation of + * {@link AiMesh} for a description and comparison of these APIs. + */ +public final class AiNodeAnim { + /** + * Size of one position key entry (includes padding). + */ + private static final int POS_KEY_SIZE = 24; + + /** + * Size of one rotation key entry. + */ + private static final int ROT_KEY_SIZE = 24; + + /** + * Size of one scaling key entry (includes padding). + */ + private static final int SCALE_KEY_SIZE = 24; + + + /** + * Constructor. + * + * @param nodeName name of corresponding scene graph node + * @param numPosKeys number of position keys + * @param numRotKeys number of rotation keys + * @param numScaleKeys number of scaling keys + * @param preBehavior behavior before animation start + * @param postBehavior behavior after animation end + */ + AiNodeAnim(String nodeName, int numPosKeys, int numRotKeys, + int numScaleKeys, int preBehavior, int postBehavior) { + + m_nodeName = nodeName; + m_numPosKeys = numPosKeys; + m_numRotKeys = numRotKeys; + m_numScaleKeys = numScaleKeys; + m_preState = AiAnimBehavior.fromRawValue(preBehavior); + m_postState = AiAnimBehavior.fromRawValue(postBehavior); + + /* c data is padded -> 24 bytes with 20 bytes data */ + m_posKeys = ByteBuffer.allocateDirect(numPosKeys * POS_KEY_SIZE); + m_posKeys.order(ByteOrder.nativeOrder()); + + m_rotKeys = ByteBuffer.allocateDirect(numRotKeys * 24); + m_rotKeys.order(ByteOrder.nativeOrder()); + + m_scaleKeys = ByteBuffer.allocateDirect(numScaleKeys * 24); + m_scaleKeys.order(ByteOrder.nativeOrder()); + } + + + /** + * Returns the name of the scene graph node affected by this animation.

+ * + * The node must exist and it must be unique. + * + * @return the name of the affected node + */ + public String getNodeName() { + return m_nodeName; + } + + + /** + * Returns the number of position keys. + * + * @return the number of position keys + */ + public int getNumPosKeys() { + return m_numPosKeys; + } + + + /** + * Returns the buffer with position keys of this animation channel.

+ * + * Position keys consist of a time value (double) and a position (3D vector + * of floats), resulting in a total of 24 bytes per entry with padding. + * The buffer contains {@link #getNumPosKeys()} of these entries.

+ * + * If there are position keys, there will also be at least one + * scaling and one rotation key.

+ * + * @return a native order, direct ByteBuffer + */ + public ByteBuffer getPosKeyBuffer() { + ByteBuffer buf = m_posKeys.duplicate(); + buf.order(ByteOrder.nativeOrder()); + + return buf; + } + + + /** + * Returns the time component of the specified position key. + * + * @param keyIndex the index of the position key + * @return the time component + */ + public double getPosKeyTime(int keyIndex) { + return m_posKeys.getDouble(POS_KEY_SIZE * keyIndex); + } + + + /** + * Returns the position x component of the specified position key. + * + * @param keyIndex the index of the position key + * @return the x component + */ + public float getPosKeyX(int keyIndex) { + return m_posKeys.getFloat(POS_KEY_SIZE * keyIndex + 8); + } + + + /** + * Returns the position y component of the specified position key. + * + * @param keyIndex the index of the position key + * @return the y component + */ + public float getPosKeyY(int keyIndex) { + return m_posKeys.getFloat(POS_KEY_SIZE * keyIndex + 12); + } + + + /** + * Returns the position z component of the specified position key. + * + * @param keyIndex the index of the position key + * @return the z component + */ + public float getPosKeyZ(int keyIndex) { + return m_posKeys.getFloat(POS_KEY_SIZE * keyIndex + 16); + } + + + /** + * Returns the position as vector.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built in behavior is to return an {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * + * @return the position as vector + */ + public V3 getPosKeyVector(int keyIndex, + AiWrapperProvider wrapperProvider) { + + return wrapperProvider.wrapVector3f(m_posKeys, + POS_KEY_SIZE * keyIndex + 8, 3); + } + + + /** + * Returns the number of rotation keys. + * + * @return the number of rotation keys + */ + public int getNumRotKeys() { + return m_numRotKeys; + } + + + /** + * Returns the buffer with rotation keys of this animation channel.

+ * + * Rotation keys consist of a time value (double) and a quaternion (4D + * vector of floats), resulting in a total of 24 bytes per entry. The + * buffer contains {@link #getNumRotKeys()} of these entries.

+ * + * If there are rotation keys, there will also be at least one + * scaling and one position key. + * + * @return a native order, direct ByteBuffer + */ + public ByteBuffer getRotKeyBuffer() { + ByteBuffer buf = m_rotKeys.duplicate(); + buf.order(ByteOrder.nativeOrder()); + + return buf; + } + + + /** + * Returns the time component of the specified rotation key. + * + * @param keyIndex the index of the position key + * @return the time component + */ + public double getRotKeyTime(int keyIndex) { + return m_rotKeys.getDouble(ROT_KEY_SIZE * keyIndex); + } + + + /** + * Returns the rotation w component of the specified rotation key. + * + * @param keyIndex the index of the position key + * @return the w component + */ + public float getRotKeyW(int keyIndex) { + return m_rotKeys.getFloat(ROT_KEY_SIZE * keyIndex + 8); + } + + + /** + * Returns the rotation x component of the specified rotation key. + * + * @param keyIndex the index of the position key + * @return the x component + */ + public float getRotKeyX(int keyIndex) { + return m_rotKeys.getFloat(ROT_KEY_SIZE * keyIndex + 12); + } + + + /** + * Returns the rotation y component of the specified rotation key. + * + * @param keyIndex the index of the position key + * @return the y component + */ + public float getRotKeyY(int keyIndex) { + return m_rotKeys.getFloat(ROT_KEY_SIZE * keyIndex + 16); + } + + + /** + * Returns the rotation z component of the specified rotation key. + * + * @param keyIndex the index of the position key + * @return the z component + */ + public float getRotKeyZ(int keyIndex) { + return m_rotKeys.getFloat(ROT_KEY_SIZE * keyIndex + 20); + } + + + /** + * Returns the rotation as quaternion.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built in behavior is to return an {@link AiQuaternion}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * + * @return the rotation as quaternion + */ + public Q getRotKeyQuaternion(int keyIndex, + AiWrapperProvider wrapperProvider) { + + return wrapperProvider.wrapQuaternion(m_rotKeys, + ROT_KEY_SIZE * keyIndex + 8); + } + + + /** + * Returns the number of scaling keys. + * + * @return the number of scaling keys + */ + public int getNumScaleKeys() { + return m_numScaleKeys; + } + + + /** + * Returns the buffer with scaling keys of this animation channel.

+ * + * Scaling keys consist of a time value (double) and a 3D vector of floats, + * resulting in a total of 24 bytes per entry with padding. The buffer + * contains {@link #getNumScaleKeys()} of these entries.

+ * + * If there are scaling keys, there will also be at least one + * position and one rotation key. + * + * @return a native order, direct ByteBuffer + */ + public ByteBuffer getScaleKeyBuffer() { + ByteBuffer buf = m_scaleKeys.duplicate(); + buf.order(ByteOrder.nativeOrder()); + + return buf; + } + + + /** + * Returns the time component of the specified scaling key. + * + * @param keyIndex the index of the position key + * @return the time component + */ + public double getScaleKeyTime(int keyIndex) { + return m_scaleKeys.getDouble(SCALE_KEY_SIZE * keyIndex); + } + + + /** + * Returns the scaling x component of the specified scaling key. + * + * @param keyIndex the index of the position key + * @return the x component + */ + public float getScaleKeyX(int keyIndex) { + return m_scaleKeys.getFloat(SCALE_KEY_SIZE * keyIndex + 8); + } + + + /** + * Returns the scaling y component of the specified scaling key. + * + * @param keyIndex the index of the position key + * @return the y component + */ + public float getScaleKeyY(int keyIndex) { + return m_scaleKeys.getFloat(SCALE_KEY_SIZE * keyIndex + 12); + } + + + /** + * Returns the scaling z component of the specified scaling key. + * + * @param keyIndex the index of the position key + * @return the z component + */ + public float getScaleKeyZ(int keyIndex) { + return m_scaleKeys.getFloat(SCALE_KEY_SIZE * keyIndex + 16); + } + + + /** + * Returns the scaling factor as vector.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built in behavior is to return an {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * + * @return the scaling factor as vector + */ + public V3 getScaleKeyVector(int keyIndex, + AiWrapperProvider wrapperProvider) { + + return wrapperProvider.wrapVector3f(m_scaleKeys, + SCALE_KEY_SIZE * keyIndex + 8, 3); + } + + + /** + * Defines how the animation behaves before the first key is encountered. + *

+ * + * The default value is {@link AiAnimBehavior#DEFAULT} (the original + * transformation matrix of the affected node is used). + * + * @return the animation behavior before the first key + */ + public AiAnimBehavior getPreState() { + return m_preState; + } + + + /** + * Defines how the animation behaves after the last key was processed.

+ * + * The default value is {@link AiAnimBehavior#DEFAULT} (the original + * transformation matrix of the affected node is taken). + * + * @return the animation behavior before after the last key + */ + public AiAnimBehavior getPostState() { + return m_postState; + } + + + /** + * Node name. + */ + private final String m_nodeName; + + + /** + * Number of position keys. + */ + private final int m_numPosKeys; + + + /** + * Buffer with position keys. + */ + private ByteBuffer m_posKeys; + + + /** + * Number of rotation keys. + */ + private final int m_numRotKeys; + + + /** + * Buffer for rotation keys. + */ + private ByteBuffer m_rotKeys; + + + /** + * Number of scaling keys. + */ + private final int m_numScaleKeys; + + + /** + * Buffer for scaling keys. + */ + private ByteBuffer m_scaleKeys; + + + /** + * Pre animation behavior. + */ + private final AiAnimBehavior m_preState; + + + /** + * Post animation behavior. + */ + private final AiAnimBehavior m_postState; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiPostProcessSteps.java b/port/jassimp/jassimp/src/jassimp/AiPostProcessSteps.java new file mode 100644 index 000000000..905229190 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiPostProcessSteps.java @@ -0,0 +1,571 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.util.Set; + +/** + * Enumerates the post processing steps supported by assimp. + */ +public enum AiPostProcessSteps { + + /** + * Calculates the tangents and bitangents for the imported meshes. + *

+ * + * Does nothing if a mesh does not have normals. You might want this post + * processing step to be executed if you plan to use tangent space + * calculations such as normal mapping applied to the meshes. There's a + * config setting, #AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE, which + * allows you to specify a maximum smoothing angle for the algorithm. + * However, usually you'll want to leave it at the default value. + */ + CALC_TANGENT_SPACE(0x1), + + + /** + * Identifies and joins identical vertex data sets within all imported + * meshes.

+ * + * After this step is run, each mesh contains unique vertices, so a vertex + * may be used by multiple faces. You usually want to use this post + * processing step. If your application deals with indexed geometry, this + * step is compulsory or you'll just waste rendering time. If this flag + * is not specified, no vertices are referenced by more than one face + * and no index buffer is required for rendering. + */ + JOIN_IDENTICAL_VERTICES(0x2), + + + /** + * Converts all the imported data to a left-handed coordinate space.

+ * + * By default the data is returned in a right-handed coordinate space (which + * OpenGL prefers). In this space, +X points to the right, +Z points towards + * the viewer, and +Y points upwards. In the DirectX coordinate space +X + * points to the right, +Y points upwards, and +Z points away from the + * viewer.

+ * + * You'll probably want to consider this flag if you use Direct3D for + * rendering. The #ConvertToLeftHanded flag supersedes this + * setting and bundles all conversions typically required for D3D-based + * applications. + */ + MAKE_LEFT_HANDED(0x4), + + + /** + * Triangulates all faces of all meshes.

+ * + * By default the imported mesh data might contain faces with more than 3 + * indices. For rendering you'll usually want all faces to be triangles. + * This post processing step splits up faces with more than 3 indices into + * triangles. Line and point primitives are *not* modified! If you want + * 'triangles only' with no other kinds of primitives, try the following + * solution: + *

    + *
  • Specify both #Triangulate and #SortByPType + *
  • Ignore all point and line meshes when you process assimp's output + *
+ */ + TRIANGULATE(0x8), + + + /** + * Removes some parts of the data structure (animations, materials, light + * sources, cameras, textures, vertex components).

+ * + * The components to be removed are specified in a separate configuration + * option, #AI_CONFIG_PP_RVC_FLAGS. This is quite useful if you + * don't need all parts of the output structure. Vertex colors are rarely + * used today for example... Calling this step to remove unneeded data from + * the pipeline as early as possible results in increased performance and a + * more optimized output data structure. This step is also useful if you + * want to force Assimp to recompute normals or tangents. The corresponding + * steps don't recompute them if they're already there (loaded from the + * source asset). By using this step you can make sure they are NOT there. + *

+ * + * This flag is a poor one, mainly because its purpose is usually + * misunderstood. Consider the following case: a 3D model has been exported + * from a CAD app, and it has per-face vertex colors. Vertex positions can't + * be shared, thus the #JoinIdenticalVertices step fails to + * optimize the data because of these nasty little vertex colors. Most apps + * don't even process them, so it's all for nothing. By using this step, + * unneeded components are excluded as early as possible thus opening more + * room for internal optimizations. + */ + REMOVE_COMPONENT(0x10), + + + /** + * Generates normals for all faces of all meshes.

+ * + * This is ignored if normals are already there at the time this flag is + * evaluated. Model importers try to load them from the source file, so + * they're usually already there. Face normals are shared between all points + * of a single face, so a single point can have multiple normals, which + * forces the library to duplicate vertices in some cases. + * #JoinIdenticalVertices is *senseless* then.

+ * + * This flag may not be specified together with {@link #GEN_SMOOTH_NORMALS}. + */ + GEN_NORMALS(0x20), + + + /** + * Generates smooth normals for all vertices in the mesh.

+ * + * This is ignored if normals are already there at the time this flag is + * evaluated. Model importers try to load them from the source file, so + * they're usually already there.

+ * + * This flag may not be specified together with {@link #GEN_NORMALS} + * There's a configuration option, + * #AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE which allows you to + * specify an angle maximum for the normal smoothing algorithm. Normals + * exceeding this limit are not smoothed, resulting in a 'hard' seam between + * two faces. Using a decent angle here (e.g. 80 degrees) results in very + * good visual appearance. + */ + GEN_SMOOTH_NORMALS(0x40), + + + /** + * Splits large meshes into smaller sub-meshes.

+ * + * This is quite useful for real-time rendering, where the number of + * triangles which can be maximally processed in a single draw-call is + * limited by the video driver/hardware. The maximum vertex buffer is + * usually limited too. Both requirements can be met with this step: you may + * specify both a triangle and vertex limit for a single mesh.

+ * + * The split limits can (and should!) be set through the + * #AI_CONFIG_PP_SLM_VERTEX_LIMIT and + * #AI_CONFIG_PP_SLM_TRIANGLE_LIMIT settings. The default values + * are #AI_SLM_DEFAULT_MAX_VERTICES and + * #AI_SLM_DEFAULT_MAX_TRIANGLES.

+ * + * Note that splitting is generally a time-consuming task, but only if + * there's something to split. The use of this step is recommended for most + * users. + */ + SPLIT_LARGE_MESHES(0x80), + + + /** + * Removes the node graph and pre-transforms all vertices with the local + * transformation matrices of their nodes.

+ * + * The output scene still contains nodes, however there is only a root node + * with children, each one referencing only one mesh, and each mesh + * referencing one material. For rendering, you can simply render all meshes + * in order - you don't need to pay attention to local transformations and + * the node hierarchy. Animations are removed during this step. This step is + * intended for applications without a scenegraph. The step CAN cause some + * problems: if e.g. a mesh of the asset contains normals and another, using + * the same material index, does not, they will be brought together, but the + * first meshes's part of the normal list is zeroed. However, these + * artifacts are rare.

+ * + * Note: The #AI_CONFIG_PP_PTV_NORMALIZE configuration + * property can be set to normalize the scene's spatial dimension to the + * -1...1 range. + */ + PRE_TRANSFORM_VERTICES(0x100), + + + /** + * Limits the number of bones simultaneously affecting a single vertex to a + * maximum value.

+ * + * If any vertex is affected by more than the maximum number of bones, the + * least important vertex weights are removed and the remaining vertex + * weights are renormalized so that the weights still sum up to 1. The + * default bone weight limit is 4 (defined as #AI_LMW_MAX_WEIGHTS + * in config.h), but you can use the #AI_CONFIG_PP_LBW_MAX_WEIGHTS + * setting to supply your own limit to the post processing step.

+ * + * If you intend to perform the skinning in hardware, this post processing + * step might be of interest to you. + */ + LIMIT_BONE_WEIGHTS(0x200), + + + /** + * Validates the imported scene data structure. This makes sure that all + * indices are valid, all animations and bones are linked correctly, all + * material references are correct .. etc.

+ * + * It is recommended that you capture Assimp's log output if you use this + * flag, so you can easily find out what's wrong if a file fails the + * validation. The validator is quite strict and will find *all* + * inconsistencies in the data structure... It is recommended that plugin + * developers use it to debug their loaders. There are two types of + * validation failures: + *

    + *
  • Error: There's something wrong with the imported data. Further + * postprocessing is not possible and the data is not usable at all. The + * import fails. #Importer::GetErrorString() or #aiGetErrorString() carry + * the error message around.
  • + *
  • Warning: There are some minor issues (e.g. 1000000 animation + * keyframes with the same time), but further postprocessing and use of the + * data structure is still safe. Warning details are written to the log + * file, #AI_SCENE_FLAGS_VALIDATION_WARNING is set in + * #aiScene::mFlags
  • + *
+ * + * This post-processing step is not time-consuming. Its use is not + * compulsory, but recommended. + */ + VALIDATE_DATA_STRUCTURE(0x400), + + + /** + * Reorders triangles for better vertex cache locality.

+ * + * The step tries to improve the ACMR (average post-transform vertex cache + * miss ratio) for all meshes. The implementation runs in O(n) and is + * roughly based on the 'tipsify' algorithm (see this + * paper).

+ * + * If you intend to render huge models in hardware, this step might be of + * interest to you. The #AI_CONFIG_PP_ICL_PTCACHE_SIZEconfig + * setting can be used to fine-tune the cache optimization. + */ + IMPROVE_CACHE_LOCALITY(0x800), + + + /** + * Searches for redundant/unreferenced materials and removes them.

+ * + * This is especially useful in combination with the + * #PretransformVertices and #OptimizeMeshes flags. Both + * join small meshes with equal characteristics, but they can't do their + * work if two meshes have different materials. Because several material + * settings are lost during Assimp's import filters, (and because many + * exporters don't check for redundant materials), huge models often have + * materials which are are defined several times with exactly the same + * settings.

+ * + * Several material settings not contributing to the final appearance of a + * surface are ignored in all comparisons (e.g. the material name). So, if + * you're passing additional information through the content pipeline + * (probably using *magic* material names), don't specify this flag. + * Alternatively take a look at the #AI_CONFIG_PP_RRM_EXCLUDE_LIST + * setting. + */ + REMOVE_REDUNDANT_MATERIALS(0x1000), + + + /** + * This step tries to determine which meshes have normal vectors that are + * facing inwards and inverts them.

+ * + * The algorithm is simple but effective: the bounding box of all vertices + + * their normals is compared against the volume of the bounding box of all + * vertices without their normals. This works well for most objects, + * problems might occur with planar surfaces. However, the step tries to + * filter such cases. The step inverts all in-facing normals. Generally it + * is recommended to enable this step, although the result is not always + * correct. + */ + FIX_INFACING_NORMALS(0x2000), + + + /** + * This step splits meshes with more than one primitive type in homogeneous + * sub-meshes.

+ * + * The step is executed after the triangulation step. After the step + * returns, just one bit is set in aiMesh::mPrimitiveTypes. This is + * especially useful for real-time rendering where point and line primitives + * are often ignored or rendered separately. You can use the + * #AI_CONFIG_PP_SBP_REMOVE option to specify which primitive types + * you need. This can be used to easily exclude lines and points, which are + * rarely used, from the import. + */ + SORT_BY_PTYPE(0x8000), + + + /** + * This step searches all meshes for degenerate primitives and converts them + * to proper lines or points.

+ * + * A face is 'degenerate' if one or more of its points are identical. To + * have the degenerate stuff not only detected and collapsed but removed, + * try one of the following procedures:
+ * 1. (if you support lines and points for rendering but don't want + * the degenerates)
+ *

    + *
  • Specify the #FindDegenerates flag.
  • + *
  • Set the AI_CONFIG_PP_FD_REMOVE option to 1. This will cause + * the step to remove degenerate triangles from the import as soon as + * they're detected. They won't pass any further pipeline steps.
  • + *
+ *
+ * 2.(if you don't support lines and points at all)
+ *
    + *
  • Specify the #FindDegenerates flag. + *
  • Specify the #SortByPType flag. This moves line and point + * primitives to separate meshes. + *
  • Set the AI_CONFIG_PP_SBP_REMOVE option to + * aiPrimitiveType_POINTS | aiPrimitiveType_LINES + * to cause SortByPType to reject point and line meshes from the + * scene. + *
+ * Note: Degenerated polygons are not necessarily evil and that's + * why they're not removed by default. There are several file formats + * which don't support lines or points, and some exporters bypass the + * format specification and write them as degenerate triangles instead. + */ + FIND_DEGENERATES(0x10000), + + + /** + * This step searches all meshes for invalid data, such as zeroed normal + * vectors or invalid UV coords and removes/fixes them. This is intended to + * get rid of some common exporter errors.

+ * + * This is especially useful for normals. If they are invalid, and the step + * recognizes this, they will be removed and can later be recomputed, i.e. + * by the {@link #GEN_SMOOTH_NORMALS} flag.

+ * + * The step will also remove meshes that are infinitely small and reduce + * animation tracks consisting of hundreds if redundant keys to a single + * key. The AI_CONFIG_PP_FID_ANIM_ACCURACY config property decides + * the accuracy of the check for duplicate animation tracks. + */ + FIND_INVALID_DATA(0x20000), + + + /** + * This step converts non-UV mappings (such as spherical or cylindrical + * mapping) to proper texture coordinate channels.

+ * + * Most applications will support UV mapping only, so you will probably want + * to specify this step in every case. Note that Assimp is not always able + * to match the original mapping implementation of the 3D app which produced + * a model perfectly. It's always better to let the modelling app compute + * the UV channels - 3ds max, Maya, Blender, LightWave, and Modo do this for + * example.

+ * + * Note: If this step is not requested, you'll need to process the + * MATKEY_MAPPING material property in order to display all + * assets properly. + */ + GEN_UV_COORDS(0x40000), + + + /** + * This step applies per-texture UV transformations and bakes them into + * stand-alone vtexture coordinate channels.

+ * + * UV transformations are specified per-texture - see the + * MATKEY_UVTRANSFORM material key for more information. This + * step processes all textures with transformed input UV coordinates and + * generates a new (pre-transformed) UV channel which replaces the old + * channel. Most applications won't support UV transformations, so you will + * probably want to specify this step.

+ * + * Note: UV transformations are usually implemented in real-time + * apps by transforming texture coordinates at vertex shader stage with a + * 3x3 (homogenous) transformation matrix. + */ + TRANSFORM_UV_COORDS(0x80000), + + + /** + * This step searches for duplicate meshes and replaces them with references + * to the first mesh.

+ * + * This step takes a while, so don't use it if speed is a concern. Its main + * purpose is to workaround the fact that many export file formats don't + * support instanced meshes, so exporters need to duplicate meshes. This + * step removes the duplicates again. Please note that Assimp does not + * currently support per-node material assignment to meshes, which means + * that identical meshes with different materials are currently *not* + * joined, although this is planned for future versions. + */ + FIND_INSTANCES(0x100000), + + + /** + * A postprocessing step to reduce the number of meshes.

+ * + * This will, in fact, reduce the number of draw calls.

+ * + * This is a very effective optimization and is recommended to be used + * together with #OptimizeGraph, if possible. The flag is fully + * compatible with both {@link #SPLIT_LARGE_MESHES} and + * {@link #SORT_BY_PTYPE}. + */ + OPTIMIZE_MESHES(0x200000), + + + /** + * A postprocessing step to optimize the scene hierarchy.

+ * + * Nodes without animations, bones, lights or cameras assigned are collapsed + * and joined.

+ * + * Node names can be lost during this step. If you use special 'tag nodes' + * to pass additional information through your content pipeline, use the + * #AI_CONFIG_PP_OG_EXCLUDE_LIST setting to specify a list of node + * names you want to be kept. Nodes matching one of the names in this list + * won't be touched or modified.

+ * + * Use this flag with caution. Most simple files will be collapsed to a + * single node, so complex hierarchies are usually completely lost. This is + * not useful for editor environments, but probably a very effective + * optimization if you just want to get the model data, convert it to your + * own format, and render it as fast as possible.

+ * + * This flag is designed to be used with #OptimizeMeshes for best + * results.

+ * + * Note: 'Crappy' scenes with thousands of extremely small meshes + * packed in deeply nested nodes exist for almost all file formats. + * {@link #OPTIMIZE_MESHES} in combination with {@link #OPTIMIZE_GRAPH} + * usually fixes them all and makes them renderable. + */ + OPTIMIZE_GRAPH(0x400000), + + + /** + * This step flips all UV coordinates along the y-axis and adjusts material + * settings and bitangents accordingly.

+ * + * Output UV coordinate system:
+ *

+     * 0y|0y ---------- 1x|0y 
+     *   |                | 
+     *   |                |
+     *   |                | 
+     * 0x|1y ---------- 1x|1y
+     * 
+ *

+ * + * You'll probably want to consider this flag if you use Direct3D for + * rendering. The {@link #MAKE_LEFT_HANDED} flag supersedes this setting + * and bundles all conversions typically required for D3D-based + * applications. + */ + FLIP_UVS(0x800000), + + + /** + * This step adjusts the output face winding order to be CW.

+ * + * The default face winding order is counter clockwise (CCW). + * + * Output face order: + * + *

+     *        x2
+     * 
+     *                      x0 
+     *  x1
+     * 
+ */ + FLIP_WINDING_ORDER(0x1000000), + + + /** + * This step splits meshes with many bones into sub-meshes so that each + * sub-mesh has fewer or as many bones as a given limit.

+ */ + SPLIT_BY_BONE_COUNT(0x2000000), + + + /** + * This step removes bones losslessly or according to some threshold.

+ * + * In some cases (i.e. formats that require it) exporters are forced to + * assign dummy bone weights to otherwise static meshes assigned to animated + * meshes. Full, weight-based skinning is expensive while animating nodes is + * extremely cheap, so this step is offered to clean up the data in that + * regard.

+ * + * Use #AI_CONFIG_PP_DB_THRESHOLD to control this. Use + * #AI_CONFIG_PP_DB_ALL_OR_NONE if you want bones removed if and + * only if all bones within the scene qualify for removal. + */ + DEBONE(0x4000000); + + + /** + * Utility method for converting to c/c++ based integer enums from java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param set the set to convert + * @return an integer based enum value (as defined by assimp) + */ + static long toRawValue(Set set) { + long rawValue = 0L; + + for (AiPostProcessSteps step : set) { + rawValue |= step.m_rawValue; + } + + return rawValue; + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private AiPostProcessSteps(long rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final long m_rawValue; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiPrimitiveType.java b/port/jassimp/jassimp/src/jassimp/AiPrimitiveType.java new file mode 100644 index 000000000..bb8f9041d --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiPrimitiveType.java @@ -0,0 +1,113 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.util.Set; + + +/** + * Enumerates the types of geometric primitives supported by Assimp.

+ */ +public enum AiPrimitiveType { + /** + * A point primitive. + */ + POINT(0x1), + + + /** + * A line primitive. + */ + LINE(0x2), + + + /** + * A triangular primitive. + */ + TRIANGLE(0x4), + + + /** + * A higher-level polygon with more than 3 edges.

+ * + * A triangle is a polygon, but polygon in this context means + * "all polygons that are not triangles". The "Triangulate"-Step is provided + * for your convenience, it splits all polygons in triangles (which are much + * easier to handle). + */ + POLYGON(0x8); + + + /** + * Utility method for converting from c/c++ based integer enums to java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param set the target set to fill + * @param rawValue an integer based enum value (as defined by assimp) + */ + static void fromRawValue(Set set, int rawValue) { + + for (AiPrimitiveType type : AiPrimitiveType.values()) { + if ((type.m_rawValue & rawValue) != 0) { + set.add(type); + } + } + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private AiPrimitiveType(int rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiQuaternion.java b/port/jassimp/jassimp/src/jassimp/AiQuaternion.java new file mode 100644 index 000000000..de162631b --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiQuaternion.java @@ -0,0 +1,166 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.nio.ByteBuffer; + + +/** + * Wrapper for a quaternion.

+ * + * The wrapper is writable, i.e., changes performed via the set-methods will + * modify the underlying mesh/animation. + */ +public final class AiQuaternion { + /** + * Constructor. + * + * @param buffer the buffer to wrap + * @param offset offset into buffer + */ + public AiQuaternion(ByteBuffer buffer, int offset) { + if (null == buffer) { + throw new IllegalArgumentException("buffer may not be null"); + } + + m_buffer = buffer; + m_offset = offset; + } + + + /** + * Returns the x value. + * + * @return the x value + */ + public float getX() { + return m_buffer.getFloat(m_offset + 4); + } + + + /** + * Returns the y value. + * + * @return the y value + */ + public float getY() { + return m_buffer.getFloat(m_offset + 8); + } + + + /** + * Returns the z value. + * + * @return the z value + */ + public float getZ() { + return m_buffer.getFloat(m_offset + 12); + } + + + /** + * Returns the w value. + * + * @return the w value + */ + public float getW() { + return m_buffer.getFloat(m_offset); + } + + + /** + * Sets the x component. + * + * @param x the new value + */ + public void setX(float x) { + m_buffer.putFloat(m_offset + 4, x); + } + + + /** + * Sets the y component. + * + * @param y the new value + */ + public void setY(float y) { + m_buffer.putFloat(m_offset + 8, y); + } + + + /** + * Sets the z component. + * + * @param z the new value + */ + public void setZ(float z) { + m_buffer.putFloat(m_offset + 12, z); + } + + + /** + * Sets the z component. + * + * @param w the new value + */ + public void setW(float w) { + m_buffer.putFloat(m_offset, w); + } + + + @Override + public String toString() { + return "[" + getX() + ", " + getY() + ", " + getZ() + ", " + + getW() + "]"; + } + + + /** + * Wrapped buffer. + */ + private final ByteBuffer m_buffer; + + + /** + * Offset into m_buffer. + */ + private final int m_offset; +} \ No newline at end of file diff --git a/port/jassimp/jassimp/src/jassimp/AiScene.java b/port/jassimp/jassimp/src/jassimp/AiScene.java new file mode 100644 index 000000000..f13348dec --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiScene.java @@ -0,0 +1,251 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.util.ArrayList; +import java.util.List; + + +/** + * The root structure of the imported data.

+ * + * Everything that was imported from the given file can be accessed from here. + *

+ * Jassimp copies all data into "java memory" during import and frees + * resources allocated by native code after scene loading is completed. No + * special care has to be taken for freeing resources, unreferenced jassimp + * objects (including the scene itself) are eligible to garbage collection like + * any other java object. + */ +public final class AiScene { + /** + * Constructor. + */ + AiScene() { + /* nothing to do */ + } + + + /** + * Returns the number of meshes contained in the scene.

+ * + * This method is provided for completeness reasons. It will return the + * same value as getMeshes().size() + * + * @return the number of meshes + */ + public int getNumMeshes() { + return m_meshes.size(); + } + + + /** + * Returns the meshes contained in the scene.

+ * + * If there are no meshes in the scene, an empty collection is returned + * + * @return the list of meshes + */ + public List getMeshes() { + return m_meshes; + } + + + /** + * Returns the number of materials in the scene.

+ * + * This method is provided for completeness reasons. It will return the + * same value as getMaterials().size() + * + * @return the number of materials + */ + public int getNumMaterials() { + return m_materials.size(); + } + + + /** + * Returns the list of materials.

+ * + * Use the index given in each aiMesh structure to access this + * array. If the {@link AiSceneFlag#INCOMPLETE} flag is not set there will + * always be at least ONE material. + * + * @return the list of materials + */ + public List getMaterials() { + return m_materials; + } + + + /** + * Returns the number of animations in the scene.

+ * + * This method is provided for completeness reasons. It will return the + * same value as getAnimations().size() + * + * @return the number of materials + */ + public int getNumAnimations() { + return m_animations.size(); + } + + + /** + * Returns the list of animations. + * + * @return the list of animations + */ + public List getAnimations() { + return m_animations; + } + + + /** + * Returns the number of light sources in the scene.

+ * + * This method is provided for completeness reasons. It will return the + * same value as getLights().size() + * + * @return the number of lights + */ + public int getNumLights() { + return m_lights.size(); + } + + + /** + * Returns the list of light sources.

+ * + * Light sources are fully optional, the returned list may be empty + * + * @return a possibly empty list of lights + */ + public List getLights() { + return m_lights; + } + + + /** + * Returns the number of cameras in the scene.

+ * + * This method is provided for completeness reasons. It will return the + * same value as getCameras().size() + * + * @return the number of cameras + */ + public int getNumCameras() { + return m_cameras.size(); + } + + + /** + * Returns the list of cameras.

+ * + * Cameras are fully optional, the returned list may be empty + * + * @return a possibly empty list of cameras + */ + public List getCameras() { + return m_cameras; + } + + + /** + * Returns the scene graph root. + * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers).

+ * + * The built-in behavior is to return a {@link AiVector}. + * + * @param wrapperProvider the wrapper provider (used for type inference) + * @return the scene graph root + */ + @SuppressWarnings("unchecked") + public N getSceneRoot(AiWrapperProvider + wrapperProvider) { + + return (N) m_sceneRoot; + } + + + @Override + public String toString() { + return "AiScene (" + m_meshes.size() + " mesh/es)"; + } + + + /** + * Meshes. + */ + private final List m_meshes = new ArrayList(); + + + /** + * Materials. + */ + private final List m_materials = new ArrayList(); + + + /** + * Animations. + */ + private final List m_animations = new ArrayList(); + + + /** + * Lights. + */ + private final List m_lights = new ArrayList(); + + + /** + * Cameras. + */ + private final List m_cameras = new ArrayList(); + + + /** + * Scene graph root. + */ + private Object m_sceneRoot; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java b/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java new file mode 100644 index 000000000..7f7e01ea9 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiSceneFlag.java @@ -0,0 +1,153 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.util.Set; + + +/** + * Status flags for {@link AiScene}s. + */ +public enum AiSceneFlag { + /** + * Specifies that the scene data structure that was imported is not + * complete.

+ * + * This flag bypasses some internal validations and allows the import + * of animation skeletons, material libraries or camera animation paths + * using Assimp. Most applications won't support such data. + */ + INCOMPLETE(0x1), + + + /** + * This flag is set by the validation + * ({@link AiPostProcessSteps#VALIDATE_DATA_STRUCTURE + * VALIDATE_DATA_STRUCTURE}) + * postprocess-step if the validation is successful.

+ * + * In a validated scene you can be sure that any cross references in the + * data structure (e.g. vertex indices) are valid. + */ + VALIDATED(0x2), + + + /** + * * This flag is set by the validation + * ({@link AiPostProcessSteps#VALIDATE_DATA_STRUCTURE + * VALIDATE_DATA_STRUCTURE}) + * postprocess-step if the validation is successful but some issues have + * been found.

+ * + * This can for example mean that a texture that does not exist is + * referenced by a material or that the bone weights for a vertex don't sum + * to 1.0 ... . In most cases you should still be able to use the import. + * This flag could be useful for applications which don't capture Assimp's + * log output. + */ + VALIDATION_WARNING(0x4), + + + /** + * This flag is currently only set by the + * {@link jassimp.AiPostProcessSteps#JOIN_IDENTICAL_VERTICES + * JOIN_IDENTICAL_VERTICES}.

+ * + * It indicates that the vertices of the output meshes aren't in the + * internal verbose format anymore. In the verbose format all vertices are + * unique, no vertex is ever referenced by more than one face. + */ + NON_VERBOSE_FORMAT(0x8), + + + /** + * Denotes pure height-map terrain data.

+ * + * Pure terrains usually consist of quads, sometimes triangles, in a + * regular grid. The x,y coordinates of all vertex positions refer to the + * x,y coordinates on the terrain height map, the z-axis stores the + * elevation at a specific point.

+ * + * TER (Terragen) and HMP (3D Game Studio) are height map formats. + *

+ * Assimp is probably not the best choice for loading *huge* terrains - + * fully triangulated data takes extremely much free store and should be + * avoided as long as possible (typically you'll do the triangulation when + * you actually need to render it). + */ + TERRAIN(0x10); + + + /** + * Utility method for converting from c/c++ based integer enums to java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param set the target set to fill + * @param rawValue an integer based enum value (as defined by assimp) + */ + static void fromRawValue(Set set, int rawValue) { + + for (AiSceneFlag type : AiSceneFlag.values()) { + if ((type.m_rawValue & rawValue) != 0) { + set.add(type); + } + } + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private AiSceneFlag(int rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiShadingMode.java b/port/jassimp/jassimp/src/jassimp/AiShadingMode.java new file mode 100644 index 000000000..af90f98a1 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiShadingMode.java @@ -0,0 +1,168 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * Defines all shading modes supported by the library.

+ * + * The list of shading modes has been taken from Blender. + * See Blender documentation for more information. The API does + * not distinguish between "specular" and "diffuse" shaders (thus the + * specular term for diffuse shading models like Oren-Nayar remains + * undefined).

+ * Again, this value is just a hint. Assimp tries to select the shader whose + * most common implementation matches the original rendering results of the + * 3D modeller which wrote a particular model as closely as possible. + */ +public enum AiShadingMode { + /** + * Flat shading.

+ * + * Shading is done on per-face base, diffuse only. Also known as + * 'faceted shading'. + */ + FLAT(0x1), + + + /** + * Simple Gouraud shading. + */ + GOURAUD(0x2), + + + /** + * Phong-Shading. + */ + PHONG(0x3), + + + /** + * Phong-Blinn-Shading. + */ + BLINN(0x4), + + + /** + * Toon-Shading per pixel.

+ * + * Also known as 'comic' shader. + */ + TOON(0x5), + + + /** + * OrenNayar-Shading per pixel.

+ * + * Extension to standard Lambertian shading, taking the roughness of the + * material into account + */ + OREN_NAYAR(0x6), + + + /** + * Minnaert-Shading per pixel.

+ * + * Extension to standard Lambertian shading, taking the "darkness" of the + * material into account + */ + MINNAERT(0x7), + + + /** + * CookTorrance-Shading per pixel.

+ * + * Special shader for metallic surfaces. + */ + COOK_TORRANCE(0x8), + + + /** + * No shading at all.

+ * + * Constant light influence of 1.0. + */ + NO_SHADING(0x9), + + + /** + * Fresnel shading. + */ + FRESNEL(0xa); + + + /** + * Utility method for converting from c/c++ based integer enums to java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param rawValue an integer based enum value (as defined by assimp) + * @return the enum value corresponding to rawValue + */ + static AiShadingMode fromRawValue(int rawValue) { + for (AiShadingMode type : AiShadingMode.values()) { + if (type.m_rawValue == rawValue) { + return type; + } + } + + throw new IllegalArgumentException("unexptected raw value: " + + rawValue); + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private AiShadingMode(int rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureInfo.java b/port/jassimp/jassimp/src/jassimp/AiTextureInfo.java new file mode 100644 index 000000000..bfa09397b --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiTextureInfo.java @@ -0,0 +1,224 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * Data structure for texture related material properties. + */ +public final class AiTextureInfo { + + /** + * Constructor. + * + * @param type type + * @param index index + * @param file file + * @param uvIndex uv index + * @param blend blend factor + * @param texOp texture operation + * @param mmU map mode for u axis + * @param mmV map mode for v axis + * @param mmW map mode for w axis + */ + AiTextureInfo(AiTextureType type, int index, String file, + int uvIndex, float blend, AiTextureOp texOp, AiTextureMapMode mmU, + AiTextureMapMode mmV, AiTextureMapMode mmW) { + + m_type = type; + m_index = index; + m_file = file; + m_uvIndex = uvIndex; + m_blend = blend; + m_textureOp = texOp; + m_textureMapModeU = mmU; + m_textureMapModeV = mmV; + m_textureMapModeW = mmW; + } + + + /** + * Specifies the type of the texture (e.g. diffuse, specular, ...). + * + * @return the type. + */ + public AiTextureType getType() { + return m_type; + } + + + /** + * Index of the texture in the texture stack.

+ * + * Each type maintains a stack of textures, i.e., there may be a diffuse.0, + * a diffuse.1, etc + * + * @return the index + */ + public int getIndex() { + return m_index; + } + + + /** + * Returns the path to the texture file. + * + * @return the path + */ + public String getFile() { + return m_file; + } + + + /** + * Returns the index of the UV coordinate set. + * + * @return the uv index + */ + public int getUVIndex() { + return m_uvIndex; + } + + + /** + * Returns the blend factor. + * + * @return the blend factor + */ + public float getBlend() { + return m_blend; + } + + + /** + * Returns the texture operation used to combine this texture and the + * preceding texture in the stack. + * + * @return the texture operation + */ + public AiTextureOp getTextureOp() { + return m_textureOp; + } + + + /** + * Returns the texture map mode for U texture axis. + * + * @return the texture map mode + */ + public AiTextureMapMode getTextureMapModeU() { + return m_textureMapModeU; + } + + + /** + * Returns the texture map mode for V texture axis. + * + * @return the texture map mode + */ + public AiTextureMapMode getTextureMapModeV() { + return m_textureMapModeV; + } + + + /** + * Returns the texture map mode for W texture axis. + * + * @return the texture map mode + */ + public AiTextureMapMode getTextureMapModeW() { + return m_textureMapModeW; + } + + + /** + * Type. + */ + private final AiTextureType m_type; + + + /** + * Index. + */ + private final int m_index; + + + /** + * Path. + */ + private final String m_file; + + + /** + * UV index. + */ + private final int m_uvIndex; + + + /** + * Blend factor. + */ + private final float m_blend; + + + /** + * Texture operation. + */ + private final AiTextureOp m_textureOp; + + + /** + * Map mode U axis. + */ + private final AiTextureMapMode m_textureMapModeU; + + + /** + * Map mode V axis. + */ + private final AiTextureMapMode m_textureMapModeV; + + + /** + * Map mode W axis. + */ + private final AiTextureMapMode m_textureMapModeW; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureMapMode.java b/port/jassimp/jassimp/src/jassimp/AiTextureMapMode.java new file mode 100644 index 000000000..f9e86dfc6 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiTextureMapMode.java @@ -0,0 +1,113 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * Defines how UV coordinates outside the [0...1] range are handled.

+ * + * Commonly refered to as 'wrapping mode'. + */ +public enum AiTextureMapMode { + /** + * A texture coordinate u|v is translated to u%1|v%1. + */ + WRAP(0x0), + + + /** + * Texture coordinates outside [0...1] are clamped to the nearest + * valid value. + */ + CLAMP(0x1), + + + /** + * A texture coordinate u|v becomes u%1|v%1 if (u-(u%1))%2 is zero and + * 1-(u%1)|1-(v%1) otherwise. + */ + MIRROR(0x2), + + + /** + * If the texture coordinates for a pixel are outside [0...1] the texture + * is not applied to that pixel. + */ + DECAL(0x3); + + + /** + * Utility method for converting from c/c++ based integer enums to java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param rawValue an integer based enum value (as defined by assimp) + * @return the enum value corresponding to rawValue + */ + static AiTextureMapMode fromRawValue(int rawValue) { + for (AiTextureMapMode type : AiTextureMapMode.values()) { + if (type.m_rawValue == rawValue) { + return type; + } + } + + throw new IllegalArgumentException("unexptected raw value: " + + rawValue); + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private AiTextureMapMode(int rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureMapping.java b/port/jassimp/jassimp/src/jassimp/AiTextureMapping.java new file mode 100644 index 000000000..3112ba4bd --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiTextureMapping.java @@ -0,0 +1,78 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * Defines how the mapping coords for a texture are generated.

+ * + * Real-time applications typically require full UV coordinates, so the use of + * the {@link AiPostProcessSteps#GEN_UV_COORDS} step is highly recommended. + * It generates proper UV channels for non-UV mapped objects, as long as an + * accurate description how the mapping should look like (e.g spherical) is + * given. + */ +public enum AiTextureMapping { + /** + * The mapping coordinates are taken from an UV channel. + * + * The #AI_MATKEY_UVWSRC key specifies from which UV channel + * the texture coordinates are to be taken from (remember, + * meshes can have more than one UV channel). + */ +// aiTextureMapping_UV = 0x0, +// +// /** Spherical mapping */ +// aiTextureMapping_SPHERE = 0x1, +// +// /** Cylindrical mapping */ +// aiTextureMapping_CYLINDER = 0x2, +// +// /** Cubic mapping */ +// aiTextureMapping_BOX = 0x3, +// +// /** Planar mapping */ +// aiTextureMapping_PLANE = 0x4, +// +// /** Undefined mapping. Have fun. */ +// aiTextureMapping_OTHER = 0x5, + +} diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureOp.java b/port/jassimp/jassimp/src/jassimp/AiTextureOp.java new file mode 100644 index 000000000..d928167ca --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiTextureOp.java @@ -0,0 +1,137 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * Defines how the Nth texture of a specific type is combined with the result + * of all previous layers.

+ * + * Example (left: key, right: value):
+ *

+ *  DiffColor0     - gray
+ *  DiffTextureOp0 - aiTextureOpMultiply
+ *  DiffTexture0   - tex1.png
+ *  DiffTextureOp0 - aiTextureOpAdd
+ *  DiffTexture1   - tex2.png
+ * 
+ * + * Written as equation, the final diffuse term for a specific pixel would be: + *
+ *  diffFinal = DiffColor0 * sampleTex(DiffTexture0,UV0) + 
+ *     sampleTex(DiffTexture1,UV0) * diffContrib;
+ * 
+ * where 'diffContrib' is the intensity of the incoming light for that pixel. + */ +public enum AiTextureOp { + /** + * T = T1 * T2. + */ + MULTIPLY(0x0), + + + /** + * T = T1 + T2. + */ + ADD(0x1), + + + /** + * T = T1 - T2. + */ + SUBTRACT(0x2), + + + /** + * T = T1 / T2. + */ + DIVIDE(0x3), + + + /** + * T = (T1 + T2) - (T1 * T2) . + */ + SMOOTH_ADD(0x4), + + + /** + * T = T1 + (T2-0.5). + */ + SIGNED_ADD(0x5); + + + /** + * Utility method for converting from c/c++ based integer enums to java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param rawValue an integer based enum value (as defined by assimp) + * @return the enum value corresponding to rawValue + */ + static AiTextureOp fromRawValue(int rawValue) { + for (AiTextureOp type : AiTextureOp.values()) { + if (type.m_rawValue == rawValue) { + return type; + } + } + + throw new IllegalArgumentException("unexptected raw value: " + + rawValue); + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private AiTextureOp(int rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiTextureType.java b/port/jassimp/jassimp/src/jassimp/AiTextureType.java new file mode 100644 index 000000000..8756c18ee --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiTextureType.java @@ -0,0 +1,212 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +/** + * Defines the purpose of a texture.

+ * + * This is a very difficult topic. Different 3D packages support different + * kinds of textures. For very common texture types, such as bumpmaps, the + * rendering results depend on implementation details in the rendering + * pipelines of these applications. Assimp loads all texture references from + * the model file and tries to determine which of the predefined texture + * types below is the best choice to match the original use of the texture + * as closely as possible.

+ * + * In content pipelines you'll usually define how textures have to be handled, + * and the artists working on models have to conform to this specification, + * regardless which 3D tool they're using. + */ +public enum AiTextureType { + /** + * The texture is combined with the result of the diffuse + * lighting equation. + */ + DIFFUSE(0x1), + + + /** + * The texture is combined with the result of the specular + * lighting equation. + */ + SPECULAR(0x2), + + + /** + * The texture is combined with the result of the ambient + * lighting equation. + */ + AMBIENT(0x3), + + + /** + * The texture is added to the result of the lighting + * calculation. It isn't influenced by incoming light. + */ + EMISSIVE(0x4), + + + /** + * The texture is a height map.

+ * + * By convention, higher gray-scale values stand for + * higher elevations from the base height. + */ + HEIGHT(0x5), + + + /** + * The texture is a (tangent space) normal-map.

+ * + * Again, there are several conventions for tangent-space + * normal maps. Assimp does (intentionally) not distinguish here. + */ + NORMALS(0x6), + + + /** + * The texture defines the glossiness of the material.

+ * + * The glossiness is in fact the exponent of the specular + * (phong) lighting equation. Usually there is a conversion + * function defined to map the linear color values in the + * texture to a suitable exponent. Have fun. + */ + SHININESS(0x7), + + + /** + * The texture defines per-pixel opacity.

+ * + * Usually 'white' means opaque and 'black' means + * 'transparency'. Or quite the opposite. Have fun. + */ + OPACITY(0x8), + + + /** + * Displacement texture.

+ * + * The exact purpose and format is application-dependent. + * Higher color values stand for higher vertex displacements. + */ + DISPLACEMENT(0x9), + + + /** + * Lightmap texture (aka Ambient Occlusion).

+ * + * Both 'Lightmaps' and dedicated 'ambient occlusion maps' are + * covered by this material property. The texture contains a + * scaling value for the final color value of a pixel. Its + * intensity is not affected by incoming light. + */ + LIGHTMAP(0xA), + + + /** + * Reflection texture.

+ * + * Contains the color of a perfect mirror reflection. + * Rarely used, almost never for real-time applications. + */ + REFLECTION(0xB), + + + /** + * Unknown texture.

+ * + * A texture reference that does not match any of the definitions + * above is considered to be 'unknown'. It is still imported, + * but is excluded from any further postprocessing. + */ + UNKNOWN(0xC); + + + /** + * Utility method for converting from c/c++ based integer enums to java + * enums.

+ * + * This method is intended to be used from JNI and my change based on + * implementation needs. + * + * @param rawValue an integer based enum value (as defined by assimp) + * @return the enum value corresponding to rawValue + */ + static AiTextureType fromRawValue(int rawValue) { + for (AiTextureType type : AiTextureType.values()) { + if (type.m_rawValue == rawValue) { + return type; + } + } + + throw new IllegalArgumentException("unexptected raw value: " + + rawValue); + } + + + /** + * Utility method for converting from java enums to c/c++ based integer + * enums.

+ * + * @param type the type to convert, may not be null + * @return the rawValue corresponding to type + */ + static int toRawValue(AiTextureType type) { + return type.m_rawValue; + } + + + /** + * Constructor. + * + * @param rawValue maps java enum to c/c++ integer enum values + */ + private AiTextureType(int rawValue) { + m_rawValue = rawValue; + } + + + /** + * The mapped c/c++ integer enum value. + */ + private final int m_rawValue; +} \ No newline at end of file diff --git a/port/jassimp/jassimp/src/jassimp/AiVector.java b/port/jassimp/jassimp/src/jassimp/AiVector.java new file mode 100644 index 000000000..3136f3888 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiVector.java @@ -0,0 +1,195 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.nio.ByteBuffer; + + +/** + * Wrapper for 3-dimensional vectors.

+ * + * This wrapper is also used to represent 1- and 2-dimensional vectors. In + * these cases only the x (or the x and y coordinate) will be used. + * Accessing unused components will throw UnsupportedOperationExceptions.

+ * + * The wrapper is writable, i.e., changes performed via the set-methods will + * modify the underlying mesh. + */ +public final class AiVector { + /** + * Constructor. + * + * @param buffer the buffer to wrap + * @param offset offset into buffer + * @param numComponents number vector of components + */ + public AiVector(ByteBuffer buffer, int offset, int numComponents) { + if (null == buffer) { + throw new IllegalArgumentException("buffer may not be null"); + } + + m_buffer = buffer; + m_offset = offset; + m_numComponents = numComponents; + } + + + /** + * Returns the x value. + * + * @return the x value + */ + public float getX() { + return m_buffer.getFloat(m_offset); + } + + + /** + * Returns the y value.

+ * + * May only be called on 2- or 3-dimensional vectors. + * + * @return the y value + */ + public float getY() { + if (m_numComponents <= 1) { + throw new UnsupportedOperationException( + "vector has only 1 component"); + } + + return m_buffer.getFloat(m_offset + 4); + } + + + /** + * Returns the z value.

+ * + * May only be called on 3-dimensional vectors. + * + * @return the z value + */ + public float getZ() { + if (m_numComponents <= 2) { + throw new UnsupportedOperationException( + "vector has only 2 components"); + } + + return m_buffer.getFloat(m_offset + 8); + } + + + /** + * Sets the x component. + * + * @param x the new value + */ + public void setX(float x) { + m_buffer.putFloat(m_offset, x); + } + + + /** + * Sets the y component.

+ * + * May only be called on 2- or 3-dimensional vectors. + * + * @param y the new value + */ + public void setY(float y) { + if (m_numComponents <= 1) { + throw new UnsupportedOperationException( + "vector has only 1 component"); + } + + m_buffer.putFloat(m_offset + 4, y); + } + + + /** + * Sets the z component.

+ * + * May only be called on 3-dimensional vectors. + * + * @param z the new value + */ + public void setZ(float z) { + if (m_numComponents <= 2) { + throw new UnsupportedOperationException( + "vector has only 2 components"); + } + + m_buffer.putFloat(m_offset + 8, z); + } + + + /** + * Returns the number of components in this vector. + * + * @return the number of components + */ + public int getNumComponents() { + return m_numComponents; + } + + + @Override + public String toString() { + return "[" + getX() + ", " + getY() + ", " + getZ() + "]"; + } + + + /** + * Wrapped buffer. + */ + private final ByteBuffer m_buffer; + + + /** + * Offset into m_buffer. + */ + private final int m_offset; + + + /** + * Number of components. + */ + private final int m_numComponents; +} diff --git a/port/jassimp/jassimp/src/jassimp/AiWrapperProvider.java b/port/jassimp/jassimp/src/jassimp/AiWrapperProvider.java new file mode 100644 index 000000000..e916ad260 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/AiWrapperProvider.java @@ -0,0 +1,149 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.nio.ByteBuffer; + + +/** + * Provides wrapper objects for raw data buffers.

+ * + * It is likely that applications using Jassimp will already have a scene + * graph implementation and/ or the typical math related classes such as + * vectors, matrices, etc.

+ * + * To ease the integration with existing code, Jassimp can be customized to + * represent the scene graph and compound data structures such as vectors and + * matrices with user supplied classes.

+ * + * All methods returning wrapped objects rely on the AiWrapperProvider to + * create individual instances. Custom wrappers can be created by implementing + * AiWrapperProvider and registering the implementation via + * {@link Jassimp#setWrapperProvider(AiWrapperProvider)} before the + * scene is imported.

+ * + * The methods returning wrapped types take an AiWrapperProvider instance. This + * instance must match the instance set via + * {@link Jassimp#setWrapperProvider(AiWrapperProvider)}. The method parameter + * is used to infer the type of the returned object. The passed in wrapper + * provider is not necessarily used to actually create the wrapped object, as + * the object may be cached for performance reasons. It is not possible to + * use different AiWrapperProviders throughout the lifetime of an imported + * scene. + * + * @param the type used to represent vectors + * @param the type used to represent matrices + * @param the type used to represent colors + * @param the type used to represent scene graph nodes + * @param the type used to represent quaternions + */ +public interface AiWrapperProvider { + /** + * Wraps a vector.

+ * + * Most vectors are 3-dimensional, i.e., with 3 components. The exception + * are texture coordinates, which may be 1- or 2-dimensional. A vector + * consists of numComponents floats (x,y,z) starting from offset + * + * @param buffer the buffer to wrap + * @param offset the offset into buffer + * @param numComponents the number of components + * @return the wrapped vector + */ + V3 wrapVector3f(ByteBuffer buffer, int offset, int numComponents); + + + /** + * Wraps a 4x4 matrix of floats.

+ * + * The calling code will allocate a new array for each invocation of this + * method. It is safe to store a reference to the passed in array and + * use the array to store the matrix data. + * + * @param data the matrix data in row-major order + * @return the wrapped matrix + */ + M4 wrapMatrix4f(float[] data); + + + /** + * Wraps a RGBA color.

+ * + * A color consists of 4 float values (r,g,b,a) starting from offset + * + * @param buffer the buffer to wrap + * @param offset the offset into buffer + * @return the wrapped color + */ + C wrapColor(ByteBuffer buffer, int offset); + + + /** + * Wraps a scene graph node.

+ * + * See {@link AiNode} for a description of the scene graph structure used + * by assimp.

+ * + * The parent node is either null or an instance returned by this method. + * It is therefore safe to cast the passed in parent object to the + * implementation specific type + * + * @param parent the parent node + * @param matrix the transformation matrix + * @param meshReferences array of mesh references (indexes) + * @param name the name of the node + * @return the wrapped scene graph node + */ + N wrapSceneNode(Object parent, Object matrix, int[] meshReferences, + String name); + + + /** + * Wraps a quaternion.

+ * + * A quaternion consists of 4 float values (w,x,y,z) starting from offset + * + * @param buffer the buffer to wrap + * @param offset the offset into buffer + * @return the wrapped quaternion + */ + Q wrapQuaternion(ByteBuffer buffer, int offset); +} diff --git a/port/jassimp/jassimp/src/jassimp/JaiDebug.java b/port/jassimp/jassimp/src/jassimp/JaiDebug.java new file mode 100644 index 000000000..0f91ce662 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/JaiDebug.java @@ -0,0 +1,209 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.nio.ByteBuffer; + + +/** + * Debug/utility methods. + */ +public final class JaiDebug { + + /** + * Pure static class, no accessible constructor. + */ + private JaiDebug() { + /* nothing to do */ + } + + + /** + * Dumps vertex positions of a mesh to stdout.

+ * + * @param mesh the mesh + */ + public static void dumpPositions(AiMesh mesh) { + if (!mesh.hasPositions()) { + System.out.println("mesh has no vertex positions"); + return; + } + + for (int i = 0; i < mesh.getNumVertives(); i++) { + System.out.println("[" + + mesh.getPositionX(i) + ", " + + mesh.getPositionY(i) + ", " + + mesh.getPositionZ(i) + "]" + ); + } + } + + + /** + * Dumps faces of a mesh to stdout.

+ * + * @param mesh the mesh + */ + public static void dumpFaces(AiMesh mesh) { + if (!mesh.hasFaces()) { + System.out.println("mesh has no faces"); + return; + } + + for (int face = 0; face < mesh.getNumFaces(); face++) { + int faceNumIndices = mesh.getFaceNumIndices(face); + System.out.print(faceNumIndices + ": "); + + for (int vertex = 0; vertex < faceNumIndices; vertex++) { + int reference = mesh.getFaceVertex(face, vertex); + + System.out.print("[" + + mesh.getPositionX(reference) + ", " + + mesh.getPositionY(reference) + ", " + + mesh.getPositionZ(reference) + "] " + ); + } + + System.out.println(); + } + } + + + /** + * Dumps a vertex color set of a mesh to stdout.

+ * + * @param mesh the mesh + * @param colorset the color set + */ + public static void dumpColorset(AiMesh mesh, int colorset) { + if (!mesh.hasColors(colorset)) { + System.out.println("mesh has no vertex color set " + colorset); + return; + } + + for (int i = 0; i < mesh.getNumVertives(); i++) { + System.out.println("[" + + mesh.getColorR(i, colorset) + ", " + + mesh.getColorG(i, colorset) + ", " + + mesh.getColorB(i, colorset) + ", " + + mesh.getColorA(i, colorset) + "]" + ); + } + } + + + /** + * Dumps a texture coordinate set of a mesh to stdout. + * + * @param mesh the mesh + * @param coords the coordinates + */ + public static void dumpTexCoords(AiMesh mesh, int coords) { + if (!mesh.hasTexCoords(coords)) { + System.out.println("mesh has no texture coordinate set " + coords); + return; + } + + for (int i = 0; i < mesh.getNumVertives(); i++) { + int numComponents = mesh.getNumUVComponents(coords); + System.out.print("[" + mesh.getTexCoordU(i, coords)); + + if (numComponents > 1) { + System.out.print(", " + mesh.getTexCoordV(i, coords)); + } + + if (numComponents > 2) { + System.out.print(", " + mesh.getTexCoordW(i, coords)); + } + + System.out.println("]"); + } + } + + + /** + * Dumps a single material property to stdout. + * + * @param property the property + */ + public static void dumpMaterialProperty(AiMaterial.Property property) { + System.out.print(property.getKey() + " " + property.getSemantic() + + " " + property.getIndex() + ": "); + Object data = property.getData(); + + if (data instanceof ByteBuffer) { + ByteBuffer buf = (ByteBuffer) data; + for (int i = 0; i < buf.capacity(); i++) { + System.out.print(Integer.toHexString(buf.get(i) & 0xFF) + " "); + } + + System.out.println(); + } + else { + System.out.println(data.toString()); + } + } + + + /** + * Dumps all properties of a material to stdout. + * + * @param material the material + */ + public static void dumpMaterial(AiMaterial material) { + for (AiMaterial.Property prop : material.getProperties()) { + dumpMaterialProperty(prop); + } + } + + + /** + * Dumps an animation channel to stdout. + * + * @param nodeAnim the channel + */ + public static void dumpNodeAnim(AiNodeAnim nodeAnim) { + for (int i = 0; i < nodeAnim.getNumPosKeys(); i++) { + System.out.println(i + ": " + nodeAnim.getPosKeyTime(i) + + " ticks, " + nodeAnim.getPosKeyVector(i, Jassimp.BUILTIN)); + } + } +} diff --git a/port/jassimp/jassimp/src/jassimp/Jassimp.java b/port/jassimp/jassimp/src/jassimp/Jassimp.java new file mode 100644 index 000000000..238456c1d --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/Jassimp.java @@ -0,0 +1,256 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.EnumSet; +import java.util.Set; + + + +/** + * Entry point to the jassimp library.

+ * + * Use {@link #importFile(String, Set)} to load a file. + * + *

General Notes and Pitfalls

+ * Due to the loading via JNI, strings (for example as returned by the + * getName() methods) are not interned. You should therefore + * compare strings the way it should be done, i.e, via equals(). + * Pointer comparison will fail. + */ +public final class Jassimp { + + /** + * The default wrapper provider using built in types. + */ + public static final AiWrapperProvider BUILTIN = + new AiBuiltInWrapperProvider(); + + + /** + * Imports a file via assimp without post processing. + * + * @param filename the file to import + * @return the loaded scene + * @throws IOException if an error occurs + */ + public static AiScene importFile(String filename) throws IOException { + + return importFile(filename, EnumSet.noneOf(AiPostProcessSteps.class)); + } + + + /** + * Imports a file via assimp. + * + * @param filename the file to import + * @param postProcessing post processing flags + * @return the loaded scene, or null if an error occurred + * @throws IOException if an error occurs + */ + public static AiScene importFile(String filename, + Set postProcessing) throws IOException { + + return aiImportFile(filename, AiPostProcessSteps.toRawValue( + postProcessing)); + } + + + /** + * Returns a human readable error description.

+ * + * This method can be called when one of the import methods fails, i.e., + * throws an exception, to get a human readable error description. + * + * @return the error string + */ + public static native String getErrorString(); + + + /** + * Returns the active wrapper provider.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers). + * + * @return the active wrapper provider + */ + public static AiWrapperProvider getWrapperProvider() { + return s_wrapperProvider; + } + + + /** + * Sets a new wrapper provider.

+ * + * This method is part of the wrapped API (see {@link AiWrapperProvider} + * for details on wrappers). + * + * @param wrapperProvider the new wrapper provider + */ + public static void setWrapperProvider(AiWrapperProvider + wrapperProvider) { + + s_wrapperProvider = wrapperProvider; + } + + + /** + * Helper method for wrapping a matrix.

+ * + * Used by JNI, do not modify! + * + * @param data the matrix data + * @return the wrapped matrix + */ + static Object wrapMatrix(float[] data) { + return s_wrapperProvider.wrapMatrix4f(data); + } + + + /** + * Helper method for wrapping a color (rgb).

+ * + * Used by JNI, do not modify! + * + * @param red red component + * @param green green component + * @param blue blue component + * @return the wrapped color + */ + static Object wrapColor3(float red, float green, float blue) { + return wrapColor4(red, green, blue, 1.0f); + } + + + /** + * Helper method for wrapping a color (rgba).

+ * + * Used by JNI, do not modify! + * + * @param red red component + * @param green green component + * @param blue blue component + * @param alpha alpha component + * @return the wrapped color + */ + static Object wrapColor4(float red, float green, float blue, float alpha) { + ByteBuffer temp = ByteBuffer.allocate(4 * 4); + temp.putFloat(red); + temp.putFloat(green); + temp.putFloat(blue); + temp.putFloat(alpha); + temp.flip(); + return s_wrapperProvider.wrapColor(temp, 0); + } + + + /** + * Helper method for wrapping a vector.

+ * + * Used by JNI, do not modify! + * + * @param x x component + * @param y y component + * @param z z component + * @return the wrapped vector + */ + static Object wrapVec3(float x, float y, float z) { + ByteBuffer temp = ByteBuffer.allocate(3 * 4); + temp.putFloat(x); + temp.putFloat(y); + temp.putFloat(z); + temp.flip(); + return s_wrapperProvider.wrapVector3f(temp, 0, 3); + } + + + /** + * Helper method for wrapping a scene graph node.

+ * + * Used by JNI, do not modify! + * + * @param parent the parent node + * @param matrix the transformation matrix + * @param meshRefs array of matrix references + * @param name the name of the node + * @return the wrapped matrix + */ + static Object wrapSceneNode(Object parent, Object matrix, int[] meshRefs, + String name) { + + return s_wrapperProvider.wrapSceneNode(parent, matrix, meshRefs, name); + } + + + /** + * The native interface. + * + * @param filename the file to load + * @param postProcessing post processing flags + * @return the loaded scene, or null if an error occurred + * @throws IOException if an error occurs + */ + private static native AiScene aiImportFile(String filename, + long postProcessing) throws IOException; + + + /** + * The active wrapper provider. + */ + private static AiWrapperProvider s_wrapperProvider = + new AiBuiltInWrapperProvider(); + + + /** + * Pure static class, no accessible constructor. + */ + private Jassimp() { + /* nothing to do */ + } + + + static { + System.loadLibrary("jassimp"); + } +} diff --git a/port/jassimp/jassimp/src/jassimp/JassimpConfig.java b/port/jassimp/jassimp/src/jassimp/JassimpConfig.java new file mode 100644 index 000000000..8370bb9f0 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/JassimpConfig.java @@ -0,0 +1,66 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ +package jassimp; + + +/** + * Global configuration values (limits). + */ +public final class JassimpConfig { + /** + * Maximum number of vertex color sets. + */ + public static final int MAX_NUMBER_COLORSETS = 8; + + + /** + * Maximum number of texture coordinate sets. + */ + public static final int MAX_NUMBER_TEXCOORDS = 8; + + + /** + * Pure static class, no accessible constructor. + */ + private JassimpConfig() { + /* nothing to do */ + } +} diff --git a/port/jassimp/jassimp/src/jassimp/package-info.java b/port/jassimp/jassimp/src/jassimp/package-info.java new file mode 100644 index 000000000..fa2883824 --- /dev/null +++ b/port/jassimp/jassimp/src/jassimp/package-info.java @@ -0,0 +1,45 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library - Java Binding (jassimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2012, assimp team + +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of the assimp team, nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of the assimp team. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--------------------------------------------------------------------------- +*/ + +/** + * Java binding for the Open Asset Import Library. + */ +package jassimp; From a038288af9c6dcb9ca433bb40a7994156a4481f9 Mon Sep 17 00:00:00 2001 From: jonathanklein Date: Sun, 12 Aug 2012 17:00:53 +0000 Subject: [PATCH 03/51] Ogre: Fixed memoryleak and missing \0 at end of cstring git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1298 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/OgreImporter.cpp | 24 ++++++++++++------------ code/OgreMaterial.cpp | 18 ++++++++++++++---- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/code/OgreImporter.cpp b/code/OgreImporter.cpp index c16cfc0f0..72141e437 100644 --- a/code/OgreImporter.cpp +++ b/code/OgreImporter.cpp @@ -100,7 +100,7 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass //Read the Mesh File: boost::scoped_ptr mIOWrapper( new CIrrXML_IOStreamReader( file.get())); - XmlReader* MeshFile = irr::io::createIrrXMLReader(mIOWrapper.get()); + boost::scoped_ptr MeshFile(irr::io::createIrrXMLReader(mIOWrapper.get())); if(!MeshFile)//parse the xml file throw DeadlyImportError("Failed to create XML Reader for "+pFile); @@ -108,21 +108,21 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass DefaultLogger::get()->debug("Mesh File opened"); //Read root Node: - if(!(XmlRead(MeshFile) && string(MeshFile->getNodeName())=="mesh")) + if(!(XmlRead(MeshFile.get()) && string(MeshFile->getNodeName())=="mesh")) { throw DeadlyImportError("Root Node is not ! "+pFile+" "+MeshFile->getNodeName()); } //eventually load shared geometry - XmlRead(MeshFile);//shared geometry is optional, so we need a reed for the next two if's + XmlRead(MeshFile.get());//shared geometry is optional, so we need a reed for the next two if's if(MeshFile->getNodeName()==string("sharedgeometry")) { - unsigned int NumVertices=GetAttribute(MeshFile, "vertexcount");; + unsigned int NumVertices=GetAttribute(MeshFile.get(), "vertexcount");; - XmlRead(MeshFile); + XmlRead(MeshFile.get()); while(MeshFile->getNodeName()==string("vertexbuffer")) { - ReadVertexBuffer(m_SharedGeometry, MeshFile, NumVertices); + ReadVertexBuffer(m_SharedGeometry, MeshFile.get(), NumVertices); } } @@ -136,13 +136,13 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass //-------------------Read the submeshs and materials:----------------------- std::list > SubMeshes; vector Materials; - XmlRead(MeshFile); + XmlRead(MeshFile.get()); while(MeshFile->getNodeName()==string("submesh")) { SubMesh* theSubMesh=new SubMesh(); - theSubMesh->MaterialName=GetAttribute(MeshFile, "material"); + theSubMesh->MaterialName=GetAttribute(MeshFile.get(), "material"); DefaultLogger::get()->debug("Loading Submehs with Material: "+theSubMesh->MaterialName); - ReadSubMesh(*theSubMesh, MeshFile); + ReadSubMesh(*theSubMesh, MeshFile.get()); //just a index in a array, we add a mesh in each loop cycle, so we get indicies like 0, 1, 2 ... n; //so it is important to do this before pushing the mesh in the vector! @@ -170,9 +170,9 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass vector Animations; if(MeshFile->getNodeName()==string("skeletonlink")) { - string SkeletonFile=GetAttribute(MeshFile, "name"); + string SkeletonFile=GetAttribute(MeshFile.get(), "name"); LoadSkeleton(SkeletonFile, Bones, Animations); - XmlRead(MeshFile); + XmlRead(MeshFile.get()); } else { @@ -185,7 +185,7 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass //now there might be boneassignments for the shared geometry: if(MeshFile->getNodeName()==string("boneassignments")) { - ReadBoneWeights(m_SharedGeometry, MeshFile); + ReadBoneWeights(m_SharedGeometry, MeshFile.get()); } diff --git a/code/OgreMaterial.cpp b/code/OgreMaterial.cpp index 95ca1cf42..48ab75523 100644 --- a/code/OgreMaterial.cpp +++ b/code/OgreMaterial.cpp @@ -148,12 +148,22 @@ aiMaterial* OgreImporter::LoadMaterial(const std::string MaterialName) const } } } + //Fill the stream boost::scoped_ptr MaterialFile(MatFilePtr); - vector FileData(MaterialFile->FileSize()); - MaterialFile->Read(&FileData[0], MaterialFile->FileSize(), 1); - BaseImporter::ConvertToUTF8(FileData); + if(MaterialFile->FileSize()>0) + { + vector FileData(MaterialFile->FileSize()); + MaterialFile->Read(&FileData[0], MaterialFile->FileSize(), 1); + BaseImporter::ConvertToUTF8(FileData); - ss << &FileData[0]; + FileData.push_back('\0');//terminate the string with zero, so that the ss can parse it correctly + ss << &FileData[0]; + } + else + { + DefaultLogger::get()->warn("Material " + MaterialName + " seams to be empty"); + return NULL; + } } //create the material From 15c0b8b9554002eb983e21a18037354675690e21 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Mon, 10 Sep 2012 00:40:41 +0000 Subject: [PATCH 04/51] - IFC: avoid artifacts in high-curvature regions (or the boundaries thereof) of IfcSweptDiskSolid elements. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1299 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 67 +++++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 525208abc..bb1fe35a1 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -581,6 +581,8 @@ void ProcessSweptDiskSolid(const IfcSweptDiskSolid solid, TempMesh& result, Conv startvec.y = 1.0f; startvec.z = 1.0f; + unsigned int last_dir = 0; + // generate circles at the sweep positions for(size_t i = 0; i < samples; ++i) { @@ -596,24 +598,34 @@ void ProcessSweptDiskSolid(const IfcSweptDiskSolid solid, TempMesh& result, Conv // figure out an arbitrary point q so that (p-q) * d = 0, // try to maximize ||(p-q)|| * ||(p_last-q_last)|| IfcVector3 q; - if (abs(d.x) > 1e-6) { - q.y = startvec.y; - q.z = startvec.z; - q.x = -(d.y * q.y + d.z * q.z) / d.x; - } - else if (abs(d.y) > 1e-6) { - q.x = startvec.x; - q.z = startvec.z; - q.y = -(d.x * q.x + d.z * q.z) / d.y; - } - else { // if (abs(d.z) > 1e-6) - q.y = startvec.y; - q.x = startvec.x; - q.z = -(d.y * q.y + d.x * q.x) / d.z; + bool take_any = false; + + for (unsigned int i = 0; i < 2; ++i, take_any = true) { + if ((last_dir == 0 || take_any) && abs(d.x) > 1e-6) { + q.y = startvec.y; + q.z = startvec.z; + q.x = -(d.y * q.y + d.z * q.z) / d.x; + last_dir = 0; + break; + } + else if ((last_dir == 1 || take_any) && abs(d.y) > 1e-6) { + q.x = startvec.x; + q.z = startvec.z; + q.y = -(d.x * q.x + d.z * q.z) / d.y; + last_dir = 1; + break; + } + else if ((last_dir == 2 && abs(d.z) > 1e-6) || take_any) { + q.y = startvec.y; + q.x = startvec.x; + q.z = -(d.y * q.y + d.x * q.x) / d.z; + last_dir = 2; + break; + } } - startvec = q; q *= solid.Radius / q.Length(); + startvec = q; // generate a rotation matrix to rotate q around d IfcMatrix4 rot; @@ -630,12 +642,27 @@ void ProcessSweptDiskSolid(const IfcSweptDiskSolid solid, TempMesh& result, Conv // make quads for(size_t i = 0; i < samples - 1; ++i) { - for (unsigned int seg = 0; seg < cnt_segments - 1; ++seg) { + const aiVector3D& this_start = points[ i * cnt_segments ]; - result.verts.push_back(points[ i * cnt_segments + seg]); - result.verts.push_back(points[ i * cnt_segments + seg + 1]); - result.verts.push_back(points[ (i+1) * cnt_segments + seg + 1]); - result.verts.push_back(points[ (i+1) * cnt_segments + seg]); + // locate corresponding point on next sample ring + unsigned int best_pair_offset = 0; + float best_distance_squared = 1e10f; + for (unsigned int seg = 0; seg < cnt_segments; ++seg) { + const aiVector3D& p = points[ (i+1) * cnt_segments + seg]; + const float l = (p-this_start).SquareLength(); + + if(l < best_distance_squared) { + best_pair_offset = seg; + best_distance_squared = l; + } + } + + for (unsigned int seg = 0; seg < cnt_segments; ++seg) { + + result.verts.push_back(points[ i * cnt_segments + (seg % cnt_segments)]); + result.verts.push_back(points[ i * cnt_segments + (seg + 1) % cnt_segments]); + result.verts.push_back(points[ (i+1) * cnt_segments + ((seg + 1 + best_pair_offset) % cnt_segments)]); + result.verts.push_back(points[ (i+1) * cnt_segments + ((seg + best_pair_offset) % cnt_segments)]); result.vertcnt.push_back(4); } From e22bb03f807b345a9058352e5453b6491a235677 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Mon, 10 Sep 2012 01:28:19 +0000 Subject: [PATCH 05/51] - IFC: fix face winding for IfcSweptDiskSolid geometry git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1300 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index bb1fe35a1..351f0a86b 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -664,6 +664,16 @@ void ProcessSweptDiskSolid(const IfcSweptDiskSolid solid, TempMesh& result, Conv result.verts.push_back(points[ (i+1) * cnt_segments + ((seg + 1 + best_pair_offset) % cnt_segments)]); result.verts.push_back(points[ (i+1) * cnt_segments + ((seg + best_pair_offset) % cnt_segments)]); + IfcVector3& v1 = *(result.verts.end()-1); + IfcVector3& v2 = *(result.verts.end()-2); + IfcVector3& v3 = *(result.verts.end()-3); + IfcVector3& v4 = *(result.verts.end()-4); + + if (((v4-v3) ^ (v4-v1)) * (v4 - curve_points[i]) < 0.0f) { + std::swap(v4, v1); + std::swap(v3, v2); + } + result.vertcnt.push_back(4); } } @@ -1835,6 +1845,7 @@ void ProcessBoolean(const IfcBooleanResult& boolean, TempMesh& result, Conversio // ------------------------------------------------------------------------------------------------ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector& mesh_indices, ConversionData& conv) { + bool fix_orientation = true; TempMesh meshtmp; if(const IfcShellBasedSurfaceModel* shellmod = geo.ToPtr()) { BOOST_FOREACH(boost::shared_ptr shell,shellmod->SbsmBoundary) { @@ -1857,6 +1868,7 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector()) { ProcessSweptDiskSolid(*disk,meshtmp,conv); + fix_orientation = false; } else if(const IfcManifoldSolidBrep* brep = geo.ToPtr()) { ProcessConnectedFaceSet(brep->Outer,meshtmp,conv); @@ -1879,7 +1891,10 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector Date: Fri, 21 Sep 2012 08:44:37 +0000 Subject: [PATCH 06/51] - applied patch by peteredc to make the Collada loader write mesh names - applied patch by asmaloney for better error messages in the Collada parser git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1301 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/ColladaLoader.cpp | 3 ++- code/ColladaParser.cpp | 15 +++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index 0cd6cb104..195ddf5ff 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -504,7 +504,8 @@ void ColladaLoader::BuildMeshesForNode( const ColladaParser& pParser, const Coll // assign the material index dstMesh->mMaterialIndex = matIdx; - } + dstMesh->mName = mid.mMeshOrController; + } } } diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 78b66bd62..3797977ba 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -1795,14 +1795,13 @@ void ColladaParser::ReadAccessor( const std::string& pID) SkipElement(); } else { - ThrowException( "Unexpected sub element in tag \"accessor\"."); + ThrowException( boost::str( boost::format( "Unexpected sub element <%s> in tag ") % mReader->getNodeName())); } } else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if( strcmp( mReader->getNodeName(), "accessor") != 0) - ThrowException( "Expected end of \"accessor\" element."); - + ThrowException( "Expected end of element."); break; } } @@ -1826,13 +1825,13 @@ void ColladaParser::ReadVertexData( Mesh* pMesh) ReadInputChannel( pMesh->mPerVertexData); } else { - ThrowException( "Unexpected sub element in tag \"vertices\"."); + ThrowException( boost::str( boost::format( "Unexpected sub element <%s> in tag ") % mReader->getNodeName())); } } else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if( strcmp( mReader->getNodeName(), "vertices") != 0) - ThrowException( "Expected end of \"vertices\" element."); + ThrowException( "Expected end of element."); break; } @@ -1919,13 +1918,13 @@ void ColladaParser::ReadIndexData( Mesh* pMesh) } } else { - ThrowException( "Unexpected sub element in tag \"vertices\"."); + ThrowException( boost::str( boost::format( "Unexpected sub element <%s> in tag <%s>") % mReader->getNodeName() % elementName)); } } else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { if( mReader->getNodeName() != elementName) - ThrowException( boost::str( boost::format( "Expected end of \"%s\" element.") % elementName)); + ThrowException( boost::str( boost::format( "Expected end of <%s> element.") % elementName)); break; } @@ -2063,7 +2062,7 @@ void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector& pPer { // warn if the vertex channel does not refer to the element in the same mesh if( input.mAccessor != pMesh->mVertexID) - ThrowException( "Unsupported vertex referencing scheme. I fucking hate Collada."); + ThrowException( "Unsupported vertex referencing scheme."); continue; } From 2944e7b210467ee02814aaee32abf253156e4ac8 Mon Sep 17 00:00:00 2001 From: ulfjorensen Date: Fri, 21 Sep 2012 18:53:36 +0000 Subject: [PATCH 07/51] - Added a workaround for some XFileExporter omitting separator chars at the end of data vectors git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1302 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/XFileParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/XFileParser.cpp b/code/XFileParser.cpp index 73914c516..018be3102 100644 --- a/code/XFileParser.cpp +++ b/code/XFileParser.cpp @@ -460,7 +460,7 @@ void XFileParser::ParseDataObjectMesh( Mesh* pMesh) Face& face = pMesh->mPosFaces[a]; for( unsigned int b = 0; b < numIndices; b++) face.mIndices.push_back( ReadInt()); - CheckForSeparator(); + TestForSeparator(); } // here, other data objects may follow @@ -583,7 +583,7 @@ void XFileParser::ParseDataObjectMeshNormals( Mesh* pMesh) for( unsigned int b = 0; b < numIndices; b++) face.mIndices.push_back( ReadInt()); - CheckForSeparator(); + TestForSeparator(); } CheckForClosingBrace(); From 54a5088e140432e625047e0953d47b2cff4cb8ee Mon Sep 17 00:00:00 2001 From: ulfjorensen Date: Mon, 24 Sep 2012 08:45:23 +0000 Subject: [PATCH 08/51] - added a workaround to load Collada files correctly in case the "texcoord" attribute was missing in a element git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1303 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/ColladaParser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 3797977ba..49b5eb755 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -1370,8 +1370,9 @@ void ColladaParser::ReadEffectColor( aiColor4D& pColor, Sampler& pSampler) pSampler.mName = mReader->getAttributeValue( attrTex); // get name of UV source channel - attrTex = GetAttribute( "texcoord"); - pSampler.mUVChannel = mReader->getAttributeValue( attrTex); + attrTex = TestAttribute( "texcoord"); + if( attrTex >= 0 ) + pSampler.mUVChannel = mReader->getAttributeValue( attrTex); //SkipElement(); } else if( IsElement( "technique")) From fa1016ddc88bca4d736312ea843e21ea224c6252 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Tue, 2 Oct 2012 14:19:24 +0000 Subject: [PATCH 09/51] - Ifc/Step: support line continuations in parser. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1304 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/STEPFileReader.cpp | 98 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 89 insertions(+), 9 deletions(-) diff --git a/code/STEPFileReader.cpp b/code/STEPFileReader.cpp index 66e08fcb5..c812187fb 100644 --- a/code/STEPFileReader.cpp +++ b/code/STEPFileReader.cpp @@ -160,6 +160,30 @@ STEP::DB* STEP::ReadFileHeader(boost::shared_ptr stream) } +namespace { + +// ------------------------------------------------------------------------------------------------ +// check whether the given line contains an entity definition (i.e. starts with "#=") +bool IsEntityDef(const std::string& snext) +{ + if (snext[0] == '#') { + // it is only a new entity if it has a '=' after the + // entity ID. + for(std::string::const_iterator it = snext.begin()+1; it != snext.end(); ++it) { + if (*it == '=') { + return true; + } + if (*it < '0' || *it > '9') { + break; + } + } + } + return false; +} + +} + + // ------------------------------------------------------------------------------------------------ void STEP::ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, const char* const* types_to_track, size_t len, @@ -171,8 +195,9 @@ void STEP::ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, const DB::ObjectMap& map = db.GetObjects(); LineSplitter& splitter = db.GetSplitter(); - for(; splitter; ++splitter) { - const std::string& s = *splitter; + while (splitter) { + bool has_next = false; + std::string s = *splitter; if (s == "ENDSEC;") { break; } @@ -184,6 +209,7 @@ void STEP::ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, ai_assert(s.length()); if (s[0] != '#') { DefaultLogger::get()->warn(AddLineNumber("expected token \'#\'",line)); + ++splitter; continue; } @@ -195,25 +221,75 @@ void STEP::ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, const std::string::size_type n0 = s.find_first_of('='); if (n0 == std::string::npos) { DefaultLogger::get()->warn(AddLineNumber("expected token \'=\'",line)); + ++splitter; continue; } const uint64_t id = strtoul10_64(s.substr(1,n0-1).c_str()); if (!id) { DefaultLogger::get()->warn(AddLineNumber("expected positive, numeric entity id",line)); + ++splitter; continue; } - const std::string::size_type n1 = s.find_first_of('(',n0); + std::string::size_type n1 = s.find_first_of('(',n0); if (n1 == std::string::npos) { - DefaultLogger::get()->warn(AddLineNumber("expected token \'(\'",line)); - continue; + + has_next = true; + bool ok = false; + + for( ++splitter; splitter; ++splitter) { + const std::string& snext = *splitter; + if (snext.empty()) { + continue; + } + + // the next line doesn't start an entity, so maybe it is + // just a continuation for this line, keep going + if (!IsEntityDef(snext)) { + s.append(snext); + n1 = s.find_first_of('(',n0); + ok = (n1 != std::string::npos); + } + else { + break; + } + } + + if(!ok) { + DefaultLogger::get()->warn(AddLineNumber("expected token \'(\'",line)); + continue; + } } - const std::string::size_type n2 = s.find_last_of(')'); - if (n2 == std::string::npos || n2 < n1) { - DefaultLogger::get()->warn(AddLineNumber("expected token \')\'",line)); - continue; + std::string::size_type n2 = s.find_last_of(')'); + if (n2 == std::string::npos || n2 < n1 || n2 == s.length() - 1 || s[n2 + 1] != ';') { + + has_next = true; + bool ok = false; + + for( ++splitter; splitter; ++splitter) { + const std::string& snext = *splitter; + if (snext.empty()) { + continue; + } + + // the next line doesn't start an entity, so maybe it is + // just a continuation for this line, keep going + if (!IsEntityDef(snext)) { + s.append(snext); + n2 = s.find_last_of(')'); + ok = !(n2 == std::string::npos || n2 < n1 || n2 == s.length() - 1 || s[n2 + 1] != ';'); + } + else { + break; + } + } + + if(!ok) { + DefaultLogger::get()->warn(AddLineNumber("expected token \')\'",line)); + continue; + } } if (map.find(id) != map.end()) { @@ -239,6 +315,10 @@ void STEP::ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, db.InternInsert(new LazyObject(db,id,line,sz,copysz)); } + + if(!has_next) { + ++splitter; + } } if (!splitter) { From 11a22b671ba1152865fa16c21eb4dc0ea1eb19c2 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Tue, 16 Oct 2012 19:51:00 +0000 Subject: [PATCH 10/51] - IFC: revamp binary subtraction and opening generation logic, which now supports 90deg rotated opening proxies. The new version adds extra cleanup steps to prepare the data for processing by clipper. It also has a slightly refactored code base. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1305 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 272 ++++++++++++++++++++++++++++--------------- 1 file changed, 175 insertions(+), 97 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 351f0a86b..070523976 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1143,7 +1143,6 @@ void QuadrifyPart(const IfcVector2& pmin, const IfcVector2& pmax, XYSortedField& void InsertWindowContours(const std::vector< BoundingBox >& bbs, const std::vector< std::vector >& contours, const std::vector& openings, - const std::vector& nors, const IfcMatrix3& minv, const IfcVector2& scale, const IfcVector2& offset, @@ -1272,7 +1271,9 @@ void InsertWindowContours(const std::vector< BoundingBox >& bbs, } // ------------------------------------------------------------------------------------------------ -void MergeContours (const std::vector& a, const std::vector& b, ClipperLib::ExPolygons& out) +void MergeWindowContours (const std::vector& a, + const std::vector& b, + ClipperLib::ExPolygons& out) { ClipperLib::Clipper clipper; ClipperLib::Polygon clip; @@ -1301,7 +1302,137 @@ void MergeContours (const std::vector& a, const std::vector& openings,const std::vector& nors, TempMesh& curmesh) +void CleanupWindowContours(std::vector< std::vector >& contours) +{ + std::vector scratch; + + // use polyclipper to clean up window contours as well + try { + BOOST_FOREACH(std::vector& contour, contours) { + ClipperLib::Polygon subject; + ClipperLib::Clipper clipper; + ClipperLib::ExPolygons clipped; + + BOOST_FOREACH(const IfcVector2& pip, contour) { + subject.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + } + + clipper.AddPolygon(subject,ClipperLib::ptSubject); + clipper.Execute(ClipperLib::ctUnion,clipped,ClipperLib::pftNonZero,ClipperLib::pftNonZero); + + // this should yield only one polygon or something went wrong + if (clipped.size() != 1) { + + // empty polygon? drop the contour altogether + if(clipped.empty()) { + contour.clear(); + continue; + } + + // else: take only the first ... + IFCImporter::LogError("error during polygon clipping, window contour is not convex"); + } + + scratch.clear(); + BOOST_FOREACH(const ClipperLib::IntPoint& point, clipped[0].outer) { + scratch.push_back( IfcVector2(from_int64(point.X), from_int64(point.Y))); + } + contour.swap(scratch); + } + } + catch (const char* sx) { + IFCImporter::LogError("error during polygon clipping, window shape may be wrong: (Clipper: " + + std::string(sx) + ")"); + } +} + +// ------------------------------------------------------------------------------------------------ +void CleanupOuterContour(const std::vector& contour_flat, TempMesh& curmesh, + const IfcMatrix3& minv, + const IfcVector2& vmin, + const IfcVector2& vmax, + IfcFloat coord, + const std::vector& outflat) +{ + std::vector vold; + std::vector iold; + + vold.reserve(outflat.size()); + iold.reserve(outflat.size() / 4); + + // Fix the outer contour using polyclipper + try { + + ClipperLib::Polygon subject; + ClipperLib::Clipper clipper; + ClipperLib::ExPolygons clipped; + + ClipperLib::Polygon clip; + clip.reserve(contour_flat.size()); + BOOST_FOREACH(const IfcVector2& pip, contour_flat) { + clip.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + } + + if (!ClipperLib::Orientation(clip)) { + std::reverse(clip.begin(), clip.end()); + } + + // We need to run polyclipper on every single quad -- we can't run it one all + // of them at once or it would merge them all together which would undo all + // previous steps + subject.reserve(4); + size_t cnt = 0; + BOOST_FOREACH(const IfcVector2& pip, outflat) { + subject.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + if (!(++cnt % 4)) { + if (!ClipperLib::Orientation(subject)) { + std::reverse(subject.begin(), subject.end()); + } + + clipper.AddPolygon(subject,ClipperLib::ptSubject); + clipper.AddPolygon(clip,ClipperLib::ptClip); + + clipper.Execute(ClipperLib::ctIntersection,clipped,ClipperLib::pftNonZero,ClipperLib::pftNonZero); + + BOOST_FOREACH(const ClipperLib::ExPolygon& ex, clipped) { + iold.push_back(ex.outer.size()); + BOOST_FOREACH(const ClipperLib::IntPoint& point, ex.outer) { + vold.push_back( minv * IfcVector3( + vmin.x + from_int64(point.X) * vmax.x, + vmin.y + from_int64(point.Y) * vmax.y, + coord)); + } + } + + subject.clear(); + clipped.clear(); + clipper.Clear(); + } + } + + assert(!(cnt % 4)); + } + catch (const char* sx) { + IFCImporter::LogError("Ifc: error during polygon clipping, wall contour line may be wrong: (Clipper: " + + std::string(sx) + ")"); + + iold.resize(outflat.size()/4,4); + + BOOST_FOREACH(const IfcVector2& vproj, outflat) { + const IfcVector3 v3 = minv * IfcVector3(vmin.x + vproj.x * vmax.x, vmin.y + vproj.y * vmax.y,coord); + vold.push_back(v3); + } + } + + // undo the projection, generate output quads + std::swap(vold,curmesh.verts); + std::swap(iold,curmesh.vertcnt); +} + +// ------------------------------------------------------------------------------------------------ +bool TryAddOpenings_Quadrulate(const std::vector& openings, + const std::vector& nors, + TempMesh& curmesh) { std::vector& out = curmesh.verts; @@ -1360,12 +1491,10 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings,const st BOOST_FOREACH(const TempOpening& t,openings) { const IfcVector3& outernor = nors[c++]; const IfcFloat dot = nor * outernor; - if (fabs(dot)<1.f-1e-6f) { - continue; - } - const std::vector& va = t.profileMesh->verts; - if(va.size() <= 2) { + std::vector profile_verts = t.profileMesh->verts; + std::vector profile_vertcnts = t.profileMesh->vertcnt; + if(profile_verts.size() <= 2) { continue; } @@ -1373,22 +1502,38 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings,const st MinMaxChooser()(vpmin,vpmax); std::vector contour; + for (size_t f = 0, vi_total = 0, fend = profile_vertcnts.size(); f < fend; ++f) { - BOOST_FOREACH(const IfcVector3& x, t.profileMesh->verts) { - const IfcVector3 v = m * x; - - IfcVector2 vv(v.x, v.y); + const IfcVector3& face_nor = ((profile_verts[vi_total+2] - profile_verts[vi_total]) ^ + (profile_verts[vi_total+1] - profile_verts[vi_total])).Normalize(); - // rescale - vv.x = (vv.x - vmin.x) / vmax.x; - vv.y = (vv.y - vmin.y) / vmax.y; + const IfcFloat dot_face_nor = nor * face_nor; + if (fabs(dot_face_nor) < 0.5) { + vi_total += profile_vertcnts[f]; + continue; + } - vpmin = std::min(vpmin,vv); - vpmax = std::max(vpmax,vv); + for (unsigned int vi = 0, vend = profile_vertcnts[f]; vi < vend; ++vi, ++vi_total) { + const IfcVector3& x = profile_verts[vi_total]; - contour.push_back(vv); + const IfcVector3 v = m * x; + IfcVector2 vv(v.x, v.y); + + // rescale + vv.x = (vv.x - vmin.x) / vmax.x; + vv.y = (vv.y - vmin.y) / vmax.y; + + vpmin = std::min(vpmin,vv); + vpmax = std::max(vpmax,vv); + + contour.push_back(vv); + } } - + + if(contour.size() <= 2) { + continue; + } + BoundingBox bb = BoundingBox(vpmin,vpmax); // see if this BB intersects any other, in which case we could not use the Quadrify() @@ -1405,11 +1550,11 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings,const st const std::vector& other = contours[std::distance(bbs.begin(),it)]; ClipperLib::ExPolygons poly; - MergeContours(contour, other, poly); + MergeWindowContours(contour, other, poly); if (poly.size() > 1) { IFCImporter::LogWarn("cannot use quadrify algorithm to generate wall openings due to " - "bounding box overlaps, using poly2tri fallback"); + "bounding box overlaps, using poly2tri fallback method"); return TryAddOpenings_Poly2Tri(openings, nors, curmesh); } else if (poly.size() == 0) { @@ -1459,81 +1604,10 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings,const st QuadrifyPart(IfcVector2(0.f,0.f),IfcVector2(1.f,1.f),field,bbs,outflat); ai_assert(!(outflat.size() % 4)); - std::vector vold; - std::vector iold; + CleanupOuterContour(contour_flat, curmesh, minv, vmin, vmax, coord, outflat); + CleanupWindowContours(contours); - vold.reserve(outflat.size()); - iold.reserve(outflat.size() / 4); - - // Fix the outer contour using polyclipper - try { - - ClipperLib::Polygon subject; - ClipperLib::Clipper clipper; - ClipperLib::ExPolygons clipped; - - ClipperLib::Polygon clip; - clip.reserve(contour_flat.size()); - BOOST_FOREACH(const IfcVector2& pip, contour_flat) { - clip.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); - } - - if (!ClipperLib::Orientation(clip)) { - std::reverse(clip.begin(), clip.end()); - } - - // We need to run polyclipper on every single quad -- we can't run it one all - // of them at once or it would merge them all together which would undo all - // previous steps - subject.reserve(4); - size_t cnt = 0; - BOOST_FOREACH(const IfcVector2& pip, outflat) { - subject.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); - if (!(++cnt % 4)) { - if (!ClipperLib::Orientation(subject)) { - std::reverse(subject.begin(), subject.end()); - } - - clipper.AddPolygon(subject,ClipperLib::ptSubject); - clipper.AddPolygon(clip,ClipperLib::ptClip); - - clipper.Execute(ClipperLib::ctIntersection,clipped,ClipperLib::pftNonZero,ClipperLib::pftNonZero); - - BOOST_FOREACH(const ClipperLib::ExPolygon& ex, clipped) { - iold.push_back(ex.outer.size()); - BOOST_FOREACH(const ClipperLib::IntPoint& point, ex.outer) { - vold.push_back( minv * IfcVector3( - vmin.x + from_int64(point.X) * vmax.x, - vmin.y + from_int64(point.Y) * vmax.y, - coord)); - } - } - - subject.clear(); - clipped.clear(); - clipper.Clear(); - } - } - - assert(!(cnt % 4)); - } - catch (const char* sx) { - IFCImporter::LogError("Ifc: error during polygon clipping, contour line may be wrong: (Clipper: " - + std::string(sx) + ")"); - - iold.resize(outflat.size()/4,4); - - BOOST_FOREACH(const IfcVector2& vproj, outflat) { - const IfcVector3 v3 = minv * IfcVector3(vmin.x + vproj.x * vmax.x, vmin.y + vproj.y * vmax.y,coord); - vold.push_back(v3); - } - } - - // undo the projection, generate output quads - std::swap(vold,curmesh.verts); - std::swap(iold,curmesh.vertcnt); - - InsertWindowContours(bbs,contours,openings, nors,minv,vmax, vmin, coord, curmesh); + InsertWindowContours(bbs,contours,openings, minv,vmax, vmin, coord, curmesh); return true; } @@ -1672,6 +1746,9 @@ void ProcessSweptAreaSolid(const IfcSweptAreaSolid& swept, TempMesh& meshout, Co // In this case we don't extrude the surface yet, just keep the profile and transform it correctly if(conv.collect_openings) { boost::shared_ptr meshtmp(new TempMesh()); + ProcessExtrudedAreaSolid(*solid,*meshtmp,conv); + + /* ProcessProfile(swept.SweptArea,*meshtmp,conv); IfcMatrix4 m; @@ -1679,8 +1756,9 @@ void ProcessSweptAreaSolid(const IfcSweptAreaSolid& swept, TempMesh& meshout, Co meshtmp->Transform(m); IfcVector3 dir; - ConvertDirection(dir,solid->ExtrudedDirection); - conv.collect_openings->push_back(TempOpening(solid, IfcMatrix3(m) * (dir*static_cast(solid->Depth)),meshtmp)); + ConvertDirection(dir,solid->ExtrudedDirection); */ + conv.collect_openings->push_back(TempOpening(solid,IfcVector3(0,0,0) + /* IfcMatrix3(m) * (dir*static_cast(solid->Depth)) */,meshtmp)); return; } From 39d13faf9a5bf84805759530a78d6cd690455ab3 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Tue, 16 Oct 2012 20:55:19 +0000 Subject: [PATCH 11/51] - Ifc: minor code cleanup. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1306 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 070523976..d53eb5ea9 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1349,8 +1349,8 @@ void CleanupWindowContours(std::vector< std::vector >& contours) // ------------------------------------------------------------------------------------------------ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& curmesh, const IfcMatrix3& minv, - const IfcVector2& vmin, - const IfcVector2& vmax, + const IfcVector2& scale, + const IfcVector2& offset, IfcFloat coord, const std::vector& outflat) { @@ -1398,8 +1398,8 @@ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& iold.push_back(ex.outer.size()); BOOST_FOREACH(const ClipperLib::IntPoint& point, ex.outer) { vold.push_back( minv * IfcVector3( - vmin.x + from_int64(point.X) * vmax.x, - vmin.y + from_int64(point.Y) * vmax.y, + offset.x + from_int64(point.X) * scale.x, + offset.y + from_int64(point.Y) * scale.y, coord)); } } @@ -1419,7 +1419,7 @@ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& iold.resize(outflat.size()/4,4); BOOST_FOREACH(const IfcVector2& vproj, outflat) { - const IfcVector3 v3 = minv * IfcVector3(vmin.x + vproj.x * vmax.x, vmin.y + vproj.y * vmax.y,coord); + const IfcVector3 v3 = minv * IfcVector3(offset.x + vproj.x * scale.x, offset.y + vproj.y * scale.y,coord); vold.push_back(v3); } } @@ -1452,7 +1452,7 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, // Move all points into the new coordinate system, collecting min/max verts on the way BOOST_FOREACH(IfcVector3& x, out) { - const IfcVector3 vv = m * x; + const IfcVector3& vv = m * x; // keep Z offset in the plane coordinate system. Ignoring precision issues // (which are present, of course), this should be the same value for @@ -1464,7 +1464,6 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, // if(coord != -1.0f) { // assert(fabs(coord - vv.z) < 1e-3f); // } - coord = vv.z; vmin = std::min(IfcVector2(vv.x, vv.y), vmin); vmax = std::max(IfcVector2(vv.x, vv.y), vmax); @@ -1474,7 +1473,7 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, // With the current code in DerivePlaneCoordinateSpace, // vmin,vmax should always be the 0...1 rectangle (+- numeric inaccuracies) - // but here we won't rely on this. + // but here we really need this to be accurate, so normalize again. vmax -= vmin; BOOST_FOREACH(IfcVector2& vv, contour_flat) { @@ -1482,16 +1481,13 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, vv.y = (vv.y - vmin.y) / vmax.y; } - // project all points into the coordinate system defined by the p+sv*tu plane + // project all openings into the coordinate system defined by the p+sv*tu plane // and compute bounding boxes for them std::vector< BoundingBox > bbs; std::vector< std::vector > contours; size_t c = 0; BOOST_FOREACH(const TempOpening& t,openings) { - const IfcVector3& outernor = nors[c++]; - const IfcFloat dot = nor * outernor; - std::vector profile_verts = t.profileMesh->verts; std::vector profile_vertcnts = t.profileMesh->vertcnt; if(profile_verts.size() <= 2) { @@ -1501,6 +1497,8 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, IfcVector2 vpmin,vpmax; MinMaxChooser()(vpmin,vpmax); + // the opening meshes are real 3D meshes so skip over all faces + // clearly facing into the wrong direction. std::vector contour; for (size_t f = 0, vi_total = 0, fend = profile_vertcnts.size(); f < fend; ++f) { @@ -1516,7 +1514,7 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, for (unsigned int vi = 0, vend = profile_vertcnts[f]; vi < vend; ++vi, ++vi_total) { const IfcVector3& x = profile_verts[vi_total]; - const IfcVector3 v = m * x; + const IfcVector3& v = m * x; IfcVector2 vv(v.x, v.y); // rescale @@ -1563,7 +1561,7 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, break; } else { - IFCImporter::LogDebug("merging oberlapping openings, this should not happen"); + IFCImporter::LogDebug("merging overlapping openings, this should not happen"); contour.clear(); BOOST_FOREACH(const ClipperLib::IntPoint& point, poly[0].outer) { @@ -1581,7 +1579,7 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, ++it; } - if(contour.size()) { + if(!contour.empty()) { contours.push_back(contour); bbs.push_back(bb); } @@ -1604,10 +1602,10 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, QuadrifyPart(IfcVector2(0.f,0.f),IfcVector2(1.f,1.f),field,bbs,outflat); ai_assert(!(outflat.size() % 4)); - CleanupOuterContour(contour_flat, curmesh, minv, vmin, vmax, coord, outflat); + CleanupOuterContour(contour_flat, curmesh, minv, vmax, vmin, coord, outflat); CleanupWindowContours(contours); - InsertWindowContours(bbs,contours,openings, minv,vmax, vmin, coord, curmesh); + return true; } From f329e1af6f3f52dafec6a4e162307036c1ad0cf3 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Tue, 16 Oct 2012 21:27:01 +0000 Subject: [PATCH 12/51] - IFC: fix possible infinite recursion in QuadrifyPart() git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1307 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index d53eb5ea9..5eac1b8dc 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1049,7 +1049,8 @@ typedef std::map XYSortedField; // ------------------------------------------------------------------------------------------------ -void QuadrifyPart(const IfcVector2& pmin, const IfcVector2& pmax, XYSortedField& field, const std::vector< BoundingBox >& bbs, +void QuadrifyPart(const IfcVector2& pmin, const IfcVector2& pmax, XYSortedField& field, + const std::vector< BoundingBox >& bbs, std::vector& out) { if (!(pmin.x-pmax.x) || !(pmin.y-pmax.y)) { @@ -1108,7 +1109,7 @@ void QuadrifyPart(const IfcVector2& pmin, const IfcVector2& pmax, XYSortedField& found = true; const IfcFloat ys = std::max(bb.first.y,pmin.y), ye = std::min(bb.second.y,pmax.y); - if (ys - ylast) { + if (ys - ylast > 0.0f) { QuadrifyPart( IfcVector2(xs,ylast), IfcVector2(xe,ys) ,field,bbs,out); } @@ -1439,7 +1440,7 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, // Try to derive a solid base plane within the current surface for use as // working coordinate system. const IfcMatrix3& m = DerivePlaneCoordinateSpace(curmesh); - const IfcMatrix3 minv = IfcMatrix3(m).Inverse(); + const IfcMatrix3& minv = IfcMatrix3(m).Inverse(); const IfcVector3& nor = IfcVector3(m.c1, m.c2, m.c3); IfcFloat coord = -1; @@ -1453,12 +1454,10 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, // Move all points into the new coordinate system, collecting min/max verts on the way BOOST_FOREACH(IfcVector3& x, out) { const IfcVector3& vv = m * x; - // keep Z offset in the plane coordinate system. Ignoring precision issues // (which are present, of course), this should be the same value for // all polygon vertices (assuming the polygon is planar). - // XXX this should be guarded, but we somehow need to pick a suitable // epsilon // if(coord != -1.0f) { @@ -1505,8 +1504,8 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, const IfcVector3& face_nor = ((profile_verts[vi_total+2] - profile_verts[vi_total]) ^ (profile_verts[vi_total+1] - profile_verts[vi_total])).Normalize(); - const IfcFloat dot_face_nor = nor * face_nor; - if (fabs(dot_face_nor) < 0.5) { + const IfcFloat abs_dot_face_nor = fabs(nor * face_nor); + if (abs_dot_face_nor < 0.5) { vi_total += profile_vertcnts[f]; continue; } @@ -1658,6 +1657,7 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul // Compute the normal vectors for all opening polygons as a prerequisite // to TryAddOpenings_Poly2Tri() + // XXX this belongs into the aforementioned function if (openings) { if (!conv.settings.useCustomTriangulation) { From 745a7383f690c7c2a394d69aaeffa14f50e0061e Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Wed, 17 Oct 2012 00:04:24 +0000 Subject: [PATCH 13/51] Ifc: fix artifacts from window boundaries. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1308 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 5eac1b8dc..ea54a9525 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1223,7 +1223,7 @@ void InsertWindowContours(const std::vector< BoundingBox >& bbs, if ((contour[a] - edge).SquareLength() > diag*diag*0.7) { continue; } - const IfcVector3 v3 = minv * IfcVector3(offset.x + contour[a].x * scale.x, offset.y + contour[a].y * scale.y,coord); + const IfcVector3 v3 = minv * IfcVector3(offset.x + contour[a].x * scale.x, offset.y + contour[a].y * scale.y, coord); curmesh.verts.push_back(v3); } @@ -1504,7 +1504,7 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, const IfcVector3& face_nor = ((profile_verts[vi_total+2] - profile_verts[vi_total]) ^ (profile_verts[vi_total+1] - profile_verts[vi_total])).Normalize(); - const IfcFloat abs_dot_face_nor = fabs(nor * face_nor); + const IfcFloat abs_dot_face_nor = abs(nor * face_nor); if (abs_dot_face_nor < 0.5) { vi_total += profile_vertcnts[f]; continue; @@ -1520,6 +1520,9 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, vv.x = (vv.x - vmin.x) / vmax.x; vv.y = (vv.y - vmin.y) / vmax.y; + vv = std::max(vv,IfcVector2()); + vv = std::min(vv,IfcVector2(static_cast(1.0),static_cast(1.0))); + vpmin = std::min(vpmin,vv); vpmax = std::max(vpmax,vv); @@ -1610,7 +1613,8 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, // ------------------------------------------------------------------------------------------------ -void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& result, ConversionData& conv) +void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& result, + ConversionData& conv) { TempMesh meshout; @@ -1737,7 +1741,8 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul // ------------------------------------------------------------------------------------------------ -void ProcessSweptAreaSolid(const IfcSweptAreaSolid& swept, TempMesh& meshout, ConversionData& conv) +void ProcessSweptAreaSolid(const IfcSweptAreaSolid& swept, TempMesh& meshout, + ConversionData& conv) { if(const IfcExtrudedAreaSolid* const solid = swept.ToPtr()) { // Do we just collect openings for a parent element (i.e. a wall)? @@ -1779,7 +1784,9 @@ enum Intersect { }; // ------------------------------------------------------------------------------------------------ -Intersect IntersectSegmentPlane(const IfcVector3& p,const IfcVector3& n, const IfcVector3& e0, const IfcVector3& e1, IfcVector3& out) +Intersect IntersectSegmentPlane(const IfcVector3& p,const IfcVector3& n, const IfcVector3& e0, + const IfcVector3& e1, + IfcVector3& out) { const IfcVector3 pdelta = e0 - p, seg = e1-e0; const IfcFloat dotOne = n*seg, dotTwo = -(n*pdelta); @@ -1919,7 +1926,8 @@ void ProcessBoolean(const IfcBooleanResult& boolean, TempMesh& result, Conversio // ------------------------------------------------------------------------------------------------ -bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector& mesh_indices, ConversionData& conv) +bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector& mesh_indices, + ConversionData& conv) { bool fix_orientation = true; TempMesh meshtmp; @@ -1983,7 +1991,8 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector& mesh_indices,aiNode* nd,ConversionData& /*conv*/) +void AssignAddedMeshes(std::vector& mesh_indices,aiNode* nd, + ConversionData& /*conv*/) { if (!mesh_indices.empty()) { @@ -2002,7 +2011,9 @@ void AssignAddedMeshes(std::vector& mesh_indices,aiNode* nd,Conver } // ------------------------------------------------------------------------------------------------ -bool TryQueryMeshCache(const IfcRepresentationItem& item, std::vector& mesh_indices, ConversionData& conv) +bool TryQueryMeshCache(const IfcRepresentationItem& item, + std::vector& mesh_indices, + ConversionData& conv) { ConversionData::MeshCache::const_iterator it = conv.cached_meshes.find(&item); if (it != conv.cached_meshes.end()) { @@ -2013,13 +2024,17 @@ bool TryQueryMeshCache(const IfcRepresentationItem& item, std::vector& mesh_indices, ConversionData& conv) +void PopulateMeshCache(const IfcRepresentationItem& item, + const std::vector& mesh_indices, + ConversionData& conv) { conv.cached_meshes[&item] = mesh_indices; } // ------------------------------------------------------------------------------------------------ -bool ProcessRepresentationItem(const IfcRepresentationItem& item, std::vector& mesh_indices, ConversionData& conv) +bool ProcessRepresentationItem(const IfcRepresentationItem& item, + std::vector& mesh_indices, + ConversionData& conv) { if (!TryQueryMeshCache(item,mesh_indices,conv)) { if(ProcessGeometricItem(item,mesh_indices,conv)) { From f8974b7209e09ed10992565389ce97eafa5582a8 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Wed, 17 Oct 2012 00:32:59 +0000 Subject: [PATCH 14/51] - Ifc: explicitly clamp some computations to [0,1] even if this is already their (arithmetically) defined range to improve numerical robustness. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1309 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index ea54a9525..61442bdba 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1437,6 +1437,8 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, { std::vector& out = curmesh.verts; + const IfcVector2 one_vec = IfcVector2(static_cast(1.0),static_cast(1.0)); + // Try to derive a solid base plane within the current surface for use as // working coordinate system. const IfcMatrix3& m = DerivePlaneCoordinateSpace(curmesh); @@ -1478,6 +1480,10 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, BOOST_FOREACH(IfcVector2& vv, contour_flat) { vv.x = (vv.x - vmin.x) / vmax.x; vv.y = (vv.y - vmin.y) / vmax.y; + + // sanity rounding + vv = std::max(vv,IfcVector2()); + vv = std::min(vv,one_vec); } // project all openings into the coordinate system defined by the p+sv*tu plane @@ -1521,7 +1527,7 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, vv.y = (vv.y - vmin.y) / vmax.y; vv = std::max(vv,IfcVector2()); - vv = std::min(vv,IfcVector2(static_cast(1.0),static_cast(1.0))); + vv = std::min(vv,one_vec); vpmin = std::min(vpmin,vv); vpmax = std::max(vpmax,vv); @@ -1567,7 +1573,11 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, contour.clear(); BOOST_FOREACH(const ClipperLib::IntPoint& point, poly[0].outer) { - contour.push_back( IfcVector2( from_int64(point.X), from_int64(point.Y))); + IfcVector2 vv = IfcVector2( from_int64(point.X), from_int64(point.Y)); + vv = std::max(vv,IfcVector2()); + vv = std::min(vv,one_vec); + + contour.push_back( vv ); } bb.first = std::min(bb.first, ibb.first); From 8a77193a332c6811a618c4b614c1eaf0039a9fd0 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Wed, 17 Oct 2012 00:37:52 +0000 Subject: [PATCH 15/51] - Ifc: more sanity clamping, improve error messages for degenerate windows. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1310 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 61442bdba..deff5a284 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -64,6 +64,7 @@ namespace Assimp { //#define to_int64(p) (static_cast( std::max( 0., std::min( static_cast((p)), 1.) ) * max_ulong64 )) #define to_int64(p) (static_cast(static_cast((p) ) * max_ulong64 )) #define from_int64(p) (static_cast((p)) / max_ulong64) +#define one_vec (IfcVector2(static_cast(1.0),static_cast(1.0))) // ------------------------------------------------------------------------------------------------ bool ProcessPolyloop(const IfcPolyLoop& loop, TempMesh& meshout, ConversionData& /*conv*/) @@ -1326,6 +1327,7 @@ void CleanupWindowContours(std::vector< std::vector >& contours) // empty polygon? drop the contour altogether if(clipped.empty()) { + IFCImporter::LogError("error during polygon clipping, window contour is degenerate"); contour.clear(); continue; } @@ -1336,7 +1338,10 @@ void CleanupWindowContours(std::vector< std::vector >& contours) scratch.clear(); BOOST_FOREACH(const ClipperLib::IntPoint& point, clipped[0].outer) { - scratch.push_back( IfcVector2(from_int64(point.X), from_int64(point.Y))); + IfcVector2 vv = IfcVector2(from_int64(point.X), from_int64(point.Y)); + vv = std::max(vv,IfcVector2()); + vv = std::min(vv,one_vec); + scratch.push_back( vv ); } contour.swap(scratch); } @@ -1437,8 +1442,6 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, { std::vector& out = curmesh.verts; - const IfcVector2 one_vec = IfcVector2(static_cast(1.0),static_cast(1.0)); - // Try to derive a solid base plane within the current surface for use as // working coordinate system. const IfcMatrix3& m = DerivePlaneCoordinateSpace(curmesh); @@ -2059,7 +2062,7 @@ bool ProcessRepresentationItem(const IfcRepresentationItem& item, #undef to_int64 #undef from_int64 -#undef from_int64_f +#undef one_vec } // ! IFC } // ! Assimp From 0696d97399cde53492499f875073aa69b95cd88a Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Wed, 17 Oct 2012 00:41:29 +0000 Subject: [PATCH 16/51] - update clipper to v4.8.8 git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1311 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- contrib/clipper/clipper.cpp | 724 +++++++++++++++++++++--------------- contrib/clipper/clipper.hpp | 26 +- 2 files changed, 449 insertions(+), 301 deletions(-) diff --git a/contrib/clipper/clipper.cpp b/contrib/clipper/clipper.cpp index daea1d4b9..b9754e4eb 100644 --- a/contrib/clipper/clipper.cpp +++ b/contrib/clipper/clipper.cpp @@ -1,10 +1,10 @@ /******************************************************************************* * * * Author : Angus Johnson * -* Version : 4.6.3 * -* Date : 11 November 2011 * +* Version : 4.8.8 * +* Date : 30 August 2012 * * Website : http://www.angusj.com * -* Copyright : Angus Johnson 2010-2011 * +* Copyright : Angus Johnson 2010-2012 * * * * License: * * Use, modification & distribution is subject to Boost Software License Ver 1. * @@ -49,11 +49,10 @@ namespace ClipperLib { -static long64 const loRange = 1518500249; //sqrt(2^63 -1)/2 -static long64 const hiRange = 6521908912666391106LL; //sqrt(2^127 -1)/2 +static long64 const loRange = 0x3FFFFFFF; +static long64 const hiRange = 0x3FFFFFFFFFFFFFFFLL; static double const pi = 3.141592653589793238; enum Direction { dRightToLeft, dLeftToRight }; -enum RangeTest { rtLo, rtHi, rtError }; #define HORIZONTAL (-1.0E+40) #define TOLERANCE (1.0e-20) @@ -62,7 +61,7 @@ enum RangeTest { rtLo, rtHi, rtError }; inline long64 Abs(long64 val) { - if (val < 0) return -val; else return val; + return val < 0 ? -val : val; } //------------------------------------------------------------------------------ @@ -80,43 +79,47 @@ class Int128 Int128(long64 _lo = 0) { - hi = 0; - if (_lo < 0) { - lo = -_lo; - Negate(*this); - } else - lo = _lo; + lo = _lo; + if (lo < 0) hi = -1; else hi = 0; } Int128(const Int128 &val): hi(val.hi), lo(val.lo){} long64 operator = (const long64 &val) { - hi = 0; - lo = Abs(val); - if (val < 0) Negate(*this); + lo = val; + if (lo < 0) hi = -1; else hi = 0; return val; } bool operator == (const Int128 &val) const {return (hi == val.hi && lo == val.lo);} - bool operator != (const Int128 &val) const { return !(*this == val);} + bool operator != (const Int128 &val) const + { return !(*this == val);} bool operator > (const Int128 &val) const { - if (hi > val.hi) return true; - else if (hi < val.hi) return false; - else return ulong64(lo) > ulong64(val.lo); + if (hi != val.hi) + return hi > val.hi; + else + return lo > val.lo; } bool operator < (const Int128 &val) const { - if (hi < val.hi) return true; - else if (hi > val.hi) return false; - else return ulong64(lo) < ulong64(val.lo); + if (hi != val.hi) + return hi < val.hi; + else + return lo < val.lo; } + bool operator >= (const Int128 &val) const + { return !(*this < val);} + + bool operator <= (const Int128 &val) const + { return !(*this > val);} + Int128& operator += (const Int128 &rhs) { hi += rhs.hi; @@ -140,14 +143,28 @@ class Int128 return *this; } + //Int128 operator -() const + //{ + // Int128 result(*this); + // if (result.lo == 0) { + // if (result.hi != 0) result.hi = -1; + // } + // else { + // result.lo = -result.lo; + // result.hi = ~result.hi; + // } + // return result; + //} + Int128 operator - (const Int128 &rhs) const { Int128 result(*this); - result-= rhs; + result -= rhs; return result; } - Int128 operator * (const Int128 &rhs) const { + Int128 operator * (const Int128 &rhs) const + { if ( !(hi == 0 || hi == -1) || !(rhs.hi == 0 || rhs.hi == -1)) throw "Int128 operator*: overflow error"; bool negate = (hi < 0) != (rhs.hi < 0); @@ -225,25 +242,25 @@ class Int128 } //for bug testing ... - std::string AsString() const - { - std::string result; - unsigned char r = 0; - Int128 tmp(0), val(*this); - if (hi < 0) Negate(val); - result.resize(50); - std::string::size_type i = result.size() -1; - while (val.hi != 0 || val.lo != 0) - { - Div10(val, tmp, r); - result[i--] = char('0' + r); - val = tmp; - } - if (hi < 0) result[i--] = '-'; - result.erase(0,i+1); - if (result.size() == 0) result = "0"; - return result; - } + //std::string AsString() const + //{ + // std::string result; + // unsigned char r = 0; + // Int128 tmp(0), val(*this); + // if (hi < 0) Negate(val); + // result.resize(50); + // std::string::size_type i = result.size() -1; + // while (val.hi != 0 || val.lo != 0) + // { + // Div10(val, tmp, r); + // result[i--] = char('0' + r); + // val = tmp; + // } + // if (hi < 0) result[i--] = '-'; + // result.erase(0,i+1); + // if (result.size() == 0) result = "0"; + // return result; + //} private: long64 hi; @@ -251,79 +268,70 @@ private: static void Negate(Int128 &val) { - if (val.lo == 0) - { - if( val.hi == 0) return; - val.lo = ~val.lo; - val.hi = ~val.hi +1; + if (val.lo == 0) { + if (val.hi != 0) val.hi = -val.hi;; } - else - { - val.lo = ~val.lo +1; + else { + val.lo = -val.lo; val.hi = ~val.hi; } } //debugging only ... - void Div10(const Int128 val, Int128& result, unsigned char & remainder) const - { - remainder = 0; - result = 0; - for (int i = 63; i >= 0; --i) - { - if ((val.hi & ((long64)1 << i)) != 0) - remainder = char((remainder * 2) + 1); else - remainder *= char(2); - if (remainder >= 10) - { - result.hi += ((long64)1 << i); - remainder -= char(10); - } - } - for (int i = 63; i >= 0; --i) - { - if ((val.lo & ((long64)1 << i)) != 0) - remainder = char((remainder * 2) + 1); else - remainder *= char(2); - if (remainder >= 10) - { - result.lo += ((long64)1 << i); - remainder -= char(10); - } - } - } + //void Div10(const Int128 val, Int128& result, unsigned char & remainder) const + //{ + // remainder = 0; + // result = 0; + // for (int i = 63; i >= 0; --i) + // { + // if ((val.hi & ((long64)1 << i)) != 0) + // remainder = char((remainder * 2) + 1); else + // remainder *= char(2); + // if (remainder >= 10) + // { + // result.hi += ((long64)1 << i); + // remainder -= char(10); + // } + // } + // for (int i = 63; i >= 0; --i) + // { + // if ((val.lo & ((long64)1 << i)) != 0) + // remainder = char((remainder * 2) + 1); else + // remainder *= char(2); + // if (remainder >= 10) + // { + // result.lo += ((long64)1 << i); + // remainder -= char(10); + // } + // } + //} }; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -RangeTest TestRange(const Polygon &pts) +bool FullRangeNeeded(const Polygon &pts) { - RangeTest result = rtLo; + bool result = false; for (Polygon::size_type i = 0; i < pts.size(); ++i) { if (Abs(pts[i].X) > hiRange || Abs(pts[i].Y) > hiRange) - return rtError; + throw "Coordinate exceeds range bounds."; else if (Abs(pts[i].X) > loRange || Abs(pts[i].Y) > loRange) - result = rtHi; + result = true; } return result; } //------------------------------------------------------------------------------ - + bool Orientation(const Polygon &poly) { int highI = (int)poly.size() -1; if (highI < 2) return false; - bool UseFullInt64Range = false; int j = 0, jplus, jminus; for (int i = 0; i <= highI; ++i) { - if (Abs(poly[i].X) > hiRange || Abs(poly[i].Y) > hiRange) - throw "Coordinate exceeds range bounds."; - if (Abs(poly[i].X) > loRange || Abs(poly[i].Y) > loRange) - UseFullInt64Range = true; if (poly[i].Y < poly[j].Y) continue; if ((poly[i].Y > poly[j].Y || poly[i].X < poly[j].X)) j = i; }; @@ -339,21 +347,30 @@ bool Orientation(const Polygon &poly) vec2.X = poly[jplus].X - poly[j].X; vec2.Y = poly[jplus].Y - poly[j].Y; - if (UseFullInt64Range) + if (Abs(vec1.X) > loRange || Abs(vec1.Y) > loRange || + Abs(vec2.X) > loRange || Abs(vec2.Y) > loRange) { + if (Abs(vec1.X) > hiRange || Abs(vec1.Y) > hiRange || + Abs(vec2.X) > hiRange || Abs(vec2.Y) > hiRange) + throw "Coordinate exceeds range bounds."; Int128 cross = Int128(vec1.X) * Int128(vec2.Y) - Int128(vec2.X) * Int128(vec1.Y); - return cross > 0; + return cross >= 0; } else - { - return (vec1.X * vec2.Y - vec2.X * vec1.Y) > 0; - } + return (vec1.X * vec2.Y - vec2.X * vec1.Y) >= 0; +} +//------------------------------------------------------------------------------ + +inline bool PointsEqual( const IntPoint &pt1, const IntPoint &pt2) +{ + return ( pt1.X == pt2.X && pt1.Y == pt2.Y ); } //------------------------------------------------------------------------------ bool Orientation(OutRec *outRec, bool UseFullInt64Range) { + //first make sure bottomPt is correctly assigned ... OutPt *opBottom = outRec->pts, *op = outRec->pts->next; while (op != outRec->pts) { @@ -364,28 +381,28 @@ bool Orientation(OutRec *outRec, bool UseFullInt64Range) } op = op->next; } + outRec->bottomPt = opBottom; + opBottom->idx = outRec->idx; - IntPoint vec1, vec2; - vec1.X = op->pt.X - op->prev->pt.X; - vec1.Y = op->pt.Y - op->prev->pt.Y; - vec2.X = op->next->pt.X - op->pt.X; - vec2.Y = op->next->pt.Y - op->pt.Y; + op = opBottom; + //find vertices either side of bottomPt (skipping duplicate points) .... + OutPt *opPrev = op->prev; + OutPt *opNext = op->next; + while (op != opPrev && PointsEqual(op->pt, opPrev->pt)) + opPrev = opPrev->prev; + while (op != opNext && PointsEqual(op->pt, opNext->pt)) + opNext = opNext->next; + + IntPoint ip1, ip2; + ip1.X = op->pt.X - opPrev->pt.X; + ip1.Y = op->pt.Y - opPrev->pt.Y; + ip2.X = opNext->pt.X - op->pt.X; + ip2.Y = opNext->pt.Y - op->pt.Y; if (UseFullInt64Range) - { - Int128 cross = Int128(vec1.X) * Int128(vec2.Y) - Int128(vec2.X) * Int128(vec1.Y); - return cross > 0; - } + return Int128(ip1.X) * Int128(ip2.Y) - Int128(ip2.X) * Int128(ip1.Y) >= 0; else - { - return (vec1.X * vec2.Y - vec2.X * vec1.Y) > 0; - } -} -//------------------------------------------------------------------------------ - -inline bool PointsEqual( const IntPoint &pt1, const IntPoint &pt2) -{ - return ( pt1.X == pt2.X && pt1.Y == pt2.Y ); + return (ip1.X * ip2.Y - ip2.X * ip1.Y) >= 0; } //------------------------------------------------------------------------------ @@ -393,21 +410,9 @@ double Area(const Polygon &poly) { int highI = (int)poly.size() -1; if (highI < 2) return 0; - bool UseFullInt64Range; - RangeTest rt = TestRange(poly); - switch (rt) { - case rtLo: - UseFullInt64Range = false; - break; - case rtHi: - UseFullInt64Range = true; - break; - default: - throw "Coordinate exceeds range bounds."; - } - if (UseFullInt64Range) { - Int128 a(0); + if (FullRangeNeeded(poly)) { + Int128 a; a = (Int128(poly[highI].X) * Int128(poly[0].Y)) - Int128(poly[0].X) * Int128(poly[highI].Y); for (int i = 0; i < highI; ++i) @@ -426,6 +431,30 @@ double Area(const Polygon &poly) } //------------------------------------------------------------------------------ +double Area(const OutRec &outRec, bool UseFullInt64Range) +{ + OutPt *op = outRec.pts; + if (UseFullInt64Range) { + Int128 a(0); + do { + a += (Int128(op->prev->pt.X) * Int128(op->pt.Y)) - + Int128(op->pt.X) * Int128(op->prev->pt.Y); + op = op->next; + } while (op != outRec.pts); + return a.AsDouble() / 2; + } + else + { + double a = 0; + do { + a += (op->prev->pt.X * op->pt.Y) - (op->pt.X * op->prev->pt.Y); + op = op->next; + } while (op != outRec.pts); + return a/2; + } +} +//------------------------------------------------------------------------------ + bool PointIsVertex(const IntPoint &pt, OutPt *pp) { OutPt *pp2 = pp; @@ -473,9 +502,7 @@ bool PointInPolygon(const IntPoint &pt, OutPt *pp, bool UseFullInt64Range) bool SlopesEqual(TEdge &e1, TEdge &e2, bool UseFullInt64Range) { - if (e1.ybot == e1.ytop) return (e2.ybot == e2.ytop); - else if (e1.xbot == e1.xtop) return (e2.xbot == e2.xtop); - else if (UseFullInt64Range) + if (UseFullInt64Range) return Int128(e1.ytop - e1.ybot) * Int128(e2.xtop - e2.xbot) == Int128(e1.xtop - e1.xbot) * Int128(e2.ytop - e2.ybot); else return (e1.ytop - e1.ybot)*(e2.xtop - e2.xbot) == @@ -486,9 +513,7 @@ bool SlopesEqual(TEdge &e1, TEdge &e2, bool UseFullInt64Range) bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, const IntPoint pt3, bool UseFullInt64Range) { - if (pt1.Y == pt2.Y) return (pt2.Y == pt3.Y); - else if (pt1.X == pt2.X) return (pt2.X == pt3.X); - else if (UseFullInt64Range) + if (UseFullInt64Range) return Int128(pt1.Y-pt2.Y) * Int128(pt2.X-pt3.X) == Int128(pt1.X-pt2.X) * Int128(pt2.Y-pt3.Y); else return (pt1.Y-pt2.Y)*(pt2.X-pt3.X) == (pt1.X-pt2.X)*(pt2.Y-pt3.Y); @@ -498,9 +523,7 @@ bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, const IntPoint pt3, const IntPoint pt4, bool UseFullInt64Range) { - if (pt1.Y == pt2.Y) return (pt3.Y == pt4.Y); - else if (pt1.X == pt2.X) return (pt3.X == pt4.X); - else if (UseFullInt64Range) + if (UseFullInt64Range) return Int128(pt1.Y-pt2.Y) * Int128(pt3.X-pt4.X) == Int128(pt1.X-pt2.X) * Int128(pt3.Y-pt4.Y); else return (pt1.Y-pt2.Y)*(pt3.X-pt4.X) == (pt1.X-pt2.X)*(pt3.Y-pt4.Y); @@ -509,17 +532,15 @@ bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, double GetDx(const IntPoint pt1, const IntPoint pt2) { - if (pt1.Y == pt2.Y) return HORIZONTAL; - else return - (double)(pt2.X - pt1.X) / (double)(pt2.Y - pt1.Y); + return (pt1.Y == pt2.Y) ? + HORIZONTAL : (double)(pt2.X - pt1.X) / (double)(pt2.Y - pt1.Y); } //--------------------------------------------------------------------------- void SetDx(TEdge &e) { if (e.ybot == e.ytop) e.dx = HORIZONTAL; - else e.dx = - (double)(e.xtop - e.xbot) / (double)(e.ytop - e.ybot); + else e.dx = (double)(e.xtop - e.xbot) / (double)(e.ytop - e.ybot); } //--------------------------------------------------------------------------- @@ -541,15 +562,15 @@ void SwapPolyIndexes(TEdge &edge1, TEdge &edge2) inline long64 Round(double val) { - if ((val < 0)) return static_cast(val - 0.5); - else return static_cast(val + 0.5); + return (val < 0) ? + static_cast(val - 0.5) : static_cast(val + 0.5); } //------------------------------------------------------------------------------ long64 TopX(TEdge &edge, const long64 currentY) { - if( currentY == edge.ytop ) return edge.xtop; - return edge.xbot + Round(edge.dx *(currentY - edge.ybot)); + return ( currentY == edge.ytop ) ? + edge.xtop : edge.xbot + Round(edge.dx *(currentY - edge.ybot)); } //------------------------------------------------------------------------------ @@ -709,17 +730,60 @@ bool GetOverlapSegment(IntPoint pt1a, IntPoint pt1b, IntPoint pt2a, } //------------------------------------------------------------------------------ -OutPt* PolygonBottom(OutPt* pp) +bool FirstIsBottomPt(const OutPt* btmPt1, const OutPt* btmPt2) { + OutPt *p = btmPt1->prev; + while (PointsEqual(p->pt, btmPt1->pt) && (p != btmPt1)) p = p->prev; + double dx1p = std::fabs(GetDx(btmPt1->pt, p->pt)); + p = btmPt1->next; + while (PointsEqual(p->pt, btmPt1->pt) && (p != btmPt1)) p = p->next; + double dx1n = std::fabs(GetDx(btmPt1->pt, p->pt)); + + p = btmPt2->prev; + while (PointsEqual(p->pt, btmPt2->pt) && (p != btmPt2)) p = p->prev; + double dx2p = std::fabs(GetDx(btmPt2->pt, p->pt)); + p = btmPt2->next; + while (PointsEqual(p->pt, btmPt2->pt) && (p != btmPt2)) p = p->next; + double dx2n = std::fabs(GetDx(btmPt2->pt, p->pt)); + return (dx1p >= dx2p && dx1p >= dx2n) || (dx1n >= dx2p && dx1n >= dx2n); +} +//------------------------------------------------------------------------------ + +OutPt* GetBottomPt(OutPt *pp) +{ + OutPt* dups = 0; OutPt* p = pp->next; - OutPt* result = pp; while (p != pp) { - if (p->pt.Y > result->pt.Y) result = p; - else if (p->pt.Y == result->pt.Y && p->pt.X < result->pt.X) result = p; + if (p->pt.Y > pp->pt.Y) + { + pp = p; + dups = 0; + } + else if (p->pt.Y == pp->pt.Y && p->pt.X <= pp->pt.X) + { + if (p->pt.X < pp->pt.X) + { + dups = 0; + pp = p; + } else + { + if (p->next != pp && p->prev != pp) dups = p; + } + } p = p->next; } - return result; + if (dups) + { + //there appears to be at least 2 vertices at bottomPt so ... + while (dups != p) + { + if (!FirstIsBottomPt(p, dups)) pp = dups; + dups = dups->next; + while (!PointsEqual(dups->pt, pp->pt)) dups = dups->next; + } + } + return pp; } //------------------------------------------------------------------------------ @@ -805,11 +869,9 @@ bool ClipperBase::AddPolygon( const Polygon &pg, PolyType polyType) { if (Abs(pg[i].X) > maxVal || Abs(pg[i].Y) > maxVal) { - if (m_UseFullRange) + if (Abs(pg[i].X) > hiRange || Abs(pg[i].Y) > hiRange) throw "Coordinate exceeds range bounds"; maxVal = hiRange; - if (Abs(pg[i].X) > maxVal || Abs(pg[i].Y) > maxVal) - throw "Coordinate exceeds range bounds"; m_UseFullRange = true; } @@ -823,7 +885,7 @@ bool ClipperBase::AddPolygon( const Polygon &pg, PolyType polyType) if (j < 2) return false; len = j+1; - for (;;) + while (len > 2) { //nb: test for point equality before testing slopes ... if (PointsEqual(p[j], p[0])) j--; @@ -836,9 +898,8 @@ bool ClipperBase::AddPolygon( const Polygon &pg, PolyType polyType) for (int i = 2; i <= j; ++i) p[i-1] = p[i]; j--; } - //exit loop if nothing is changed or there are too few vertices ... - if (j == len-1 || j < 2) break; - len = j +1; + else break; + len--; } if (len < 3) return false; @@ -961,9 +1022,9 @@ TEdge* ClipperBase::AddBoundsToLML(TEdge *e) bool ClipperBase::AddPolygons(const Polygons &ppg, PolyType polyType) { - bool result = true; + bool result = false; for (Polygons::size_type i = 0; i < ppg.size(); ++i) - if (AddPolygon(ppg[i], polyType)) result = false; + if (AddPolygon(ppg[i], polyType)) result = true; return result; } //------------------------------------------------------------------------------ @@ -1116,6 +1177,7 @@ void Clipper::Reset() m_Scanbeam = 0; m_ActiveEdges = 0; m_SortedEdges = 0; + DisposeAllPolyPts(); LocalMinima* lm = m_MinimaList; while (lm) { @@ -1165,7 +1227,7 @@ bool PolySort(OutRec *or1, OutRec *or2) { if (or1->pts != or2->pts) { - if (or1->pts) return true; else return false; + return or1->pts ? true : false; } else return false; } @@ -1179,8 +1241,7 @@ bool PolySort(OutRec *or1, OutRec *or2) int result = i1 - i2; if (result == 0 && (or1->isHole != or2->isHole)) { - if (or1->isHole) return false; - else return true; + return or1->isHole ? false : true; } else return result < 0; } @@ -1250,6 +1311,11 @@ bool Clipper::ExecuteInternal(bool fixHoleLinkages) FixupOutPolygon(*outRec); if (!outRec->pts) continue; if (outRec->isHole && fixHoleLinkages) FixHoleLinkage(outRec); + + if (outRec->bottomPt == outRec->bottomFlag && + (Orientation(outRec, m_UseFullRange) != (Area(*outRec, m_UseFullRange) > 0))) + DisposeBottomPt(*outRec); + if (outRec->isHole == (m_ReverseOutput ^ Orientation(outRec, m_UseFullRange))) ReversePolyPtLinks(*outRec->pts); @@ -1310,10 +1376,10 @@ void Clipper::DisposeAllPolyPts(){ } //------------------------------------------------------------------------------ -void Clipper::DisposeOutRec(PolyOutList::size_type index, bool ignorePts) +void Clipper::DisposeOutRec(PolyOutList::size_type index) { OutRec *outRec = m_PolyOuts[index]; - if (!ignorePts && outRec->pts) DisposeOutPts(outRec->pts); + if (outRec->pts) DisposeOutPts(outRec->pts); delete outRec; m_PolyOuts[index] = 0; } @@ -1476,32 +1542,49 @@ bool Clipper::IsContributing(const TEdge& edge) const void Clipper::AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt) { + TEdge *e, *prevE; if( NEAR_EQUAL(e2->dx, HORIZONTAL) || ( e1->dx > e2->dx ) ) { - AddOutPt( e1, e2, pt ); + AddOutPt( e1, pt ); e2->outIdx = e1->outIdx; e1->side = esLeft; e2->side = esRight; + e = e1; + if (e->prevInAEL == e2) + prevE = e2->prevInAEL; + else + prevE = e->prevInAEL; } else { - AddOutPt( e2, e1, pt ); + AddOutPt( e2, pt ); e1->outIdx = e2->outIdx; e1->side = esRight; e2->side = esLeft; + e = e2; + if (e->prevInAEL == e1) + prevE = e1->prevInAEL; + else + prevE = e->prevInAEL; } + if (prevE && prevE->outIdx >= 0 && + (TopX(*prevE, pt.Y) == TopX(*e, pt.Y)) && + SlopesEqual(*e, *prevE, m_UseFullRange)) + AddJoin(e, prevE, -1, -1); } //------------------------------------------------------------------------------ void Clipper::AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt) { - AddOutPt( e1, 0, pt ); + AddOutPt( e1, pt ); if( e1->outIdx == e2->outIdx ) { e1->outIdx = -1; e2->outIdx = -1; } - else - AppendPolygon( e1, e2 ); + else if (e1->outIdx < e2->outIdx) + AppendPolygon(e1, e2); + else + AppendPolygon(e2, e1); } //------------------------------------------------------------------------------ @@ -1620,12 +1703,6 @@ void Clipper::InsertLocalMinimaIntoAEL( const long64 botY) if( IsContributing(*lb) ) AddLocalMinPoly( lb, rb, IntPoint(lb->xcurr, m_CurrentLM->Y) ); - //if output polygons share an edge, they'll need joining later ... - if (lb->outIdx >= 0 && lb->prevInAEL && - lb->prevInAEL->outIdx >= 0 && lb->prevInAEL->xcurr == lb->xbot && - SlopesEqual(*lb, *lb->prevInAEL, m_UseFullRange)) - AddJoin(lb, lb->prevInAEL); - //if any output polygons share an edge, they'll need joining later ... if (rb->outIdx >= 0) { @@ -1818,10 +1895,8 @@ void Clipper::IntersectEdges(TEdge *e1, TEdge *e2, AddLocalMinPoly(e1, e2, pt); break; case ctDifference: - if ((e1->polyType == ptClip && e2->polyType == ptClip && - e1Wc2 > 0 && e2Wc2 > 0) || - (e1->polyType == ptSubject && e2->polyType == ptSubject && - e1Wc2 <= 0 && e2Wc2 <= 0)) + if (((e1->polyType == ptClip) && (e1Wc2 > 0) && (e2Wc2 > 0)) || + ((e1->polyType == ptSubject) && (e1Wc2 <= 0) && (e2Wc2 <= 0))) AddLocalMinPoly(e1, e2, pt); break; case ctXor: @@ -1862,24 +1937,6 @@ void Clipper::SetHoleState(TEdge *e, OutRec *outRec) } //------------------------------------------------------------------------------ -bool GetNextNonDupOutPt(OutPt* pp, OutPt*& next) -{ - next = pp->next; - while (next != pp && PointsEqual(pp->pt, next->pt)) - next = next->next; - return next != pp; -} -//------------------------------------------------------------------------------ - -bool GetPrevNonDupOutPt(OutPt* pp, OutPt*& prev) -{ - prev = pp->prev; - while (prev != pp && PointsEqual(pp->pt, prev->pt)) - prev = prev->prev; - return prev != pp; -} -//------------------------------------------------------------------------------ - OutRec* GetLowermostRec(OutRec *outRec1, OutRec *outRec2) { //work out which polygon fragment has the correct hole state ... @@ -1889,21 +1946,21 @@ OutRec* GetLowermostRec(OutRec *outRec1, OutRec *outRec2) else if (outPt1->pt.Y < outPt2->pt.Y) return outRec2; else if (outPt1->pt.X < outPt2->pt.X) return outRec1; else if (outPt1->pt.X > outPt2->pt.X) return outRec2; - else if (outRec1->bottomE2 == 0) return outRec2; - else if (outRec2->bottomE2 == 0) return outRec1; - else + else if (outPt1->next == outPt1) return outRec2; + else if (outPt2->next == outPt2) return outRec1; + else if (FirstIsBottomPt(outPt1, outPt2)) return outRec1; + else return outRec2; +} +//------------------------------------------------------------------------------ + +bool Param1RightOfParam2(OutRec* outRec1, OutRec* outRec2) +{ + do { - long64 y1 = std::max(outRec1->bottomE1->ybot, outRec1->bottomE2->ybot); - long64 y2 = std::max(outRec2->bottomE1->ybot, outRec2->bottomE2->ybot); - if (y2 == y1 || (y1 > outPt1->pt.Y && y2 > outPt1->pt.Y)) - { - double dx1 = std::max(outRec1->bottomE1->dx, outRec1->bottomE2->dx); - double dx2 = std::max(outRec2->bottomE1->dx, outRec2->bottomE2->dx); - if (dx2 > dx1) return outRec2; else return outRec1; - } - else if (y2 > y1) return outRec2; - else return outRec1; - } + outRec1 = outRec1->FirstLeft; + if (outRec1 == outRec2) return true; + } while (outRec1); + return false; } //------------------------------------------------------------------------------ @@ -1912,13 +1969,11 @@ void Clipper::AppendPolygon(TEdge *e1, TEdge *e2) //get the start and ends of both output polygons ... OutRec *outRec1 = m_PolyOuts[e1->outIdx]; OutRec *outRec2 = m_PolyOuts[e2->outIdx]; - OutRec *holeStateRec = GetLowermostRec(outRec1, outRec2); - //fixup hole status ... - if (holeStateRec == outRec2) - outRec1->isHole = outRec2->isHole; - else - outRec2->isHole = outRec1->isHole; + OutRec *holeStateRec; + if (Param1RightOfParam2(outRec1, outRec2)) holeStateRec = outRec2; + else if (Param1RightOfParam2(outRec2, outRec1)) holeStateRec = outRec1; + else holeStateRec = GetLowermostRec(outRec1, outRec2); OutPt* p1_lft = outRec1->pts; OutPt* p1_rt = p1_lft->prev; @@ -1973,11 +2028,9 @@ void Clipper::AppendPolygon(TEdge *e1, TEdge *e2) { outRec1->bottomPt = outRec2->bottomPt; outRec1->bottomPt->idx = outRec1->idx; - outRec1->bottomE1 = outRec2->bottomE1; - outRec1->bottomE2 = outRec2->bottomE2; - if (outRec2->FirstLeft != outRec1) outRec1->FirstLeft = outRec2->FirstLeft; + outRec1->isHole = outRec2->isHole; } outRec2->pts = 0; outRec2->bottomPt = 0; @@ -2023,11 +2076,27 @@ OutRec* Clipper::CreateOutRec() result->AppendLink = 0; result->pts = 0; result->bottomPt = 0; + result->sides = esNeither; + result->bottomFlag = 0; + return result; } //------------------------------------------------------------------------------ -void Clipper::AddOutPt(TEdge *e, TEdge *altE, const IntPoint &pt) +void Clipper::DisposeBottomPt(OutRec &outRec) +{ + OutPt* next = outRec.bottomPt->next; + OutPt* prev = outRec.bottomPt->prev; + if (outRec.pts == outRec.bottomPt) outRec.pts = next; + delete outRec.bottomPt; + next->prev = prev; + prev->next = next; + outRec.bottomPt = next; + FixupOutPolygon(outRec); +} +//------------------------------------------------------------------------------ + +void Clipper::AddOutPt(TEdge *e, const IntPoint &pt) { bool ToFront = (e->side == esLeft); if( e->outIdx < 0 ) @@ -2038,8 +2107,6 @@ void Clipper::AddOutPt(TEdge *e, TEdge *altE, const IntPoint &pt) e->outIdx = outRec->idx; OutPt* op = new OutPt; outRec->pts = op; - outRec->bottomE1 = e; - outRec->bottomE2 = altE; outRec->bottomPt = op; op->pt = pt; op->idx = outRec->idx; @@ -2052,16 +2119,59 @@ void Clipper::AddOutPt(TEdge *e, TEdge *altE, const IntPoint &pt) OutPt* op = outRec->pts; if ((ToFront && PointsEqual(pt, op->pt)) || (!ToFront && PointsEqual(pt, op->prev->pt))) return; + + if ((e->side | outRec->sides) != outRec->sides) + { + //check for 'rounding' artefacts ... + if (outRec->sides == esNeither && pt.Y == op->pt.Y) + if (ToFront) + { + if (pt.X == op->pt.X +1) return; //ie wrong side of bottomPt + } + else if (pt.X == op->pt.X -1) return; //ie wrong side of bottomPt + + outRec->sides = (EdgeSide)(outRec->sides | e->side); + if (outRec->sides == esBoth) + { + //A vertex from each side has now been added. + //Vertices of one side of an output polygon are quite commonly close to + //or even 'touching' edges of the other side of the output polygon. + //Very occasionally vertices from one side can 'cross' an edge on the + //the other side. The distance 'crossed' is always less that a unit + //and is purely an artefact of coordinate rounding. Nevertheless, this + //results in very tiny self-intersections. Because of the way + //orientation is calculated, even tiny self-intersections can cause + //the Orientation function to return the wrong result. Therefore, it's + //important to ensure that any self-intersections close to BottomPt are + //detected and removed before orientation is assigned. + + OutPt *opBot, *op2; + if (ToFront) + { + opBot = outRec->pts; + op2 = opBot->next; //op2 == right side + if (opBot->pt.Y != op2->pt.Y && opBot->pt.Y != pt.Y && + ((opBot->pt.X - pt.X)/(opBot->pt.Y - pt.Y) < + (opBot->pt.X - op2->pt.X)/(opBot->pt.Y - op2->pt.Y))) + outRec->bottomFlag = opBot; + } else + { + opBot = outRec->pts->prev; + op2 = opBot->prev; //op2 == left side + if (opBot->pt.Y != op2->pt.Y && opBot->pt.Y != pt.Y && + ((opBot->pt.X - pt.X)/(opBot->pt.Y - pt.Y) > + (opBot->pt.X - op2->pt.X)/(opBot->pt.Y - op2->pt.Y))) + outRec->bottomFlag = opBot; + } + } + } + OutPt* op2 = new OutPt; op2->pt = pt; op2->idx = outRec->idx; if (op2->pt.Y == outRec->bottomPt->pt.Y && op2->pt.X < outRec->bottomPt->pt.X) - { - outRec->bottomPt = op2; - outRec->bottomE1 = e; - outRec->bottomE2 = altE; - } + outRec->bottomPt = op2; op2->next = op; op2->prev = op->prev; op2->prev->next = op2; @@ -2216,8 +2326,7 @@ void Clipper::SwapPositionsInSEL(TEdge *edge1, TEdge *edge2) TEdge* GetNextInAEL(TEdge *e, Direction dir) { - if( dir == dLeftToRight ) return e->nextInAEL; - else return e->prevInAEL; + return dir == dLeftToRight ? e->nextInAEL : e->prevInAEL; } //------------------------------------------------------------------------------ @@ -2310,7 +2419,7 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge) if( horzEdge->nextInLML ) { if( horzEdge->outIdx >= 0 ) - AddOutPt( horzEdge, 0, IntPoint(horzEdge->xtop, horzEdge->ytop)); + AddOutPt( horzEdge, IntPoint(horzEdge->xtop, horzEdge->ytop)); UpdateEdgeIntoAEL( horzEdge ); } else @@ -2426,7 +2535,7 @@ void Clipper::BuildIntersectList(const long64 botY, const long64 topY) } //------------------------------------------------------------------------------ -bool Process1Before2(IntersectNode &node1, IntersectNode &node2) +bool ProcessParam1BeforeParam2(IntersectNode &node1, IntersectNode &node2) { bool result; if (node1.pt.Y == node2.pt.Y) @@ -2434,12 +2543,12 @@ bool Process1Before2(IntersectNode &node1, IntersectNode &node2) if (node1.edge1 == node2.edge1 || node1.edge2 == node2.edge1) { result = node2.pt.X > node1.pt.X; - if (node2.edge1->dx > 0) return !result; else return result; + return node2.edge1->dx > 0 ? !result : result; } else if (node1.edge1 == node2.edge2 || node1.edge2 == node2.edge2) { result = node2.pt.X > node1.pt.X; - if (node2.edge2->dx > 0) return !result; else return result; + return node2.edge2->dx > 0 ? !result : result; } else return node2.pt.X > node1.pt.X; } @@ -2455,7 +2564,7 @@ void Clipper::AddIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt) newNode->pt = pt; newNode->next = 0; if( !m_IntersectNodes ) m_IntersectNodes = newNode; - else if( Process1Before2(*newNode, *m_IntersectNodes) ) + else if( ProcessParam1BeforeParam2(*newNode, *m_IntersectNodes) ) { newNode->next = m_IntersectNodes; m_IntersectNodes = newNode; @@ -2463,7 +2572,7 @@ void Clipper::AddIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt) else { IntersectNode* iNode = m_IntersectNodes; - while( iNode->next && Process1Before2(*iNode->next, *newNode) ) + while( iNode->next && ProcessParam1BeforeParam2(*iNode->next, *newNode) ) iNode = iNode->next; newNode->next = iNode->next; iNode->next = newNode; @@ -2533,7 +2642,7 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const long64 topY) { if (e->outIdx >= 0) { - AddOutPt(e, 0, IntPoint(e->xtop, e->ytop)); + AddOutPt(e, IntPoint(e->xtop, e->ytop)); for (HorzJoinList::size_type i = 0; i < m_HorizJoins.size(); ++i) { @@ -2569,7 +2678,7 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const long64 topY) { if( IsIntermediate( e, topY ) ) { - if( e->outIdx >= 0 ) AddOutPt(e, 0, IntPoint(e->xtop,e->ytop)); + if( e->outIdx >= 0 ) AddOutPt(e, IntPoint(e->xtop,e->ytop)); UpdateEdgeIntoAEL(e); //if output polygons share an edge, they'll need joining later ... @@ -2579,18 +2688,18 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const long64 topY) IntPoint(e->xbot,e->ybot), IntPoint(e->prevInAEL->xtop, e->prevInAEL->ytop), m_UseFullRange)) { - AddOutPt(e->prevInAEL, 0, IntPoint(e->xbot, e->ybot)); + AddOutPt(e->prevInAEL, IntPoint(e->xbot, e->ybot)); AddJoin(e, e->prevInAEL); } else if (e->outIdx >= 0 && e->nextInAEL && e->nextInAEL->outIdx >= 0 && e->nextInAEL->ycurr > e->nextInAEL->ytop && - e->nextInAEL->ycurr < e->nextInAEL->ybot && + e->nextInAEL->ycurr <= e->nextInAEL->ybot && e->nextInAEL->xcurr == e->xbot && e->nextInAEL->ycurr == e->ybot && SlopesEqual(IntPoint(e->xbot,e->ybot), IntPoint(e->xtop, e->ytop), IntPoint(e->xbot,e->ybot), IntPoint(e->nextInAEL->xtop, e->nextInAEL->ytop), m_UseFullRange)) { - AddOutPt(e->nextInAEL, 0, IntPoint(e->xbot, e->ybot)); + AddOutPt(e->nextInAEL, IntPoint(e->xbot, e->ybot)); AddJoin(e, e->nextInAEL); } } @@ -2623,13 +2732,7 @@ void Clipper::FixupOutPolygon(OutRec &outRec) lastOK = 0; OutPt *tmp = pp; if (pp == outRec.bottomPt) - { - if (tmp->prev->pt.Y > tmp->next->pt.Y) - outRec.bottomPt = tmp->prev; else - outRec.bottomPt = tmp->next; - outRec.pts = outRec.bottomPt; - outRec.bottomPt->idx = outRec.idx; - } + outRec.bottomPt = 0; //flags need for updating pp->prev->next = pp->next; pp->next->prev = pp->prev; pp = pp->prev; @@ -2642,6 +2745,11 @@ void Clipper::FixupOutPolygon(OutRec &outRec) pp = pp->next; } } + if (!outRec.bottomPt) { + outRec.bottomPt = GetBottomPt(pp); + outRec.bottomPt->idx = outRec.idx; + outRec.pts = outRec.bottomPt; + } } //------------------------------------------------------------------------------ @@ -2766,8 +2874,7 @@ bool Clipper::FixupIntersections() bool E2InsertsBeforeE1(TEdge &e1, TEdge &e2) { - if (e2.xcurr == e1.xcurr) return e2.dx > e1.dx; - else return e2.xcurr < e1.xcurr; + return e2.xcurr == e1.xcurr ? e2.dx > e1.dx : e2.xcurr < e1.xcurr; } //------------------------------------------------------------------------------ @@ -2799,7 +2906,7 @@ void Clipper::InsertEdgeIntoAEL(TEdge *edge) void Clipper::DoEdge1(TEdge *edge1, TEdge *edge2, const IntPoint &pt) { - AddOutPt(edge1, edge2, pt); + AddOutPt(edge1, pt); SwapSides(*edge1, *edge2); SwapPolyIndexes(*edge1, *edge2); } @@ -2807,7 +2914,7 @@ void Clipper::DoEdge1(TEdge *edge1, TEdge *edge2, const IntPoint &pt) void Clipper::DoEdge2(TEdge *edge1, TEdge *edge2, const IntPoint &pt) { - AddOutPt(edge2, edge1, pt); + AddOutPt(edge2, pt); SwapSides(*edge1, *edge2); SwapPolyIndexes(*edge1, *edge2); } @@ -2815,8 +2922,8 @@ void Clipper::DoEdge2(TEdge *edge1, TEdge *edge2, const IntPoint &pt) void Clipper::DoBothEdges(TEdge *edge1, TEdge *edge2, const IntPoint &pt) { - AddOutPt(edge1, edge2, pt); - AddOutPt(edge2, edge1, pt); + AddOutPt(edge1, pt); + AddOutPt(edge2, pt); SwapSides( *edge1 , *edge2 ); SwapPolyIndexes( *edge1 , *edge2 ); } @@ -2920,31 +3027,37 @@ void Clipper::JoinCommonEdges(bool fixHoleLinkages) { //instead of joining two polygons, we've just created a new one by //splitting one polygon into two. - outRec1->pts = PolygonBottom(p1); + outRec1->pts = GetBottomPt(p1); outRec1->bottomPt = outRec1->pts; outRec1->bottomPt->idx = outRec1->idx; outRec2 = CreateOutRec(); m_PolyOuts.push_back(outRec2); outRec2->idx = (int)m_PolyOuts.size()-1; j->poly2Idx = outRec2->idx; - outRec2->pts = PolygonBottom(p2); + outRec2->pts = GetBottomPt(p2); outRec2->bottomPt = outRec2->pts; outRec2->bottomPt->idx = outRec2->idx; if (PointInPolygon(outRec2->pts->pt, outRec1->pts, m_UseFullRange)) { + //outRec2 is contained by outRec1 ... outRec2->isHole = !outRec1->isHole; outRec2->FirstLeft = outRec1; - if (outRec2->isHole == Orientation(outRec2, m_UseFullRange)) - ReversePolyPtLinks(*outRec2->pts); + if (outRec2->isHole == + (m_ReverseOutput ^ Orientation(outRec2, m_UseFullRange))) + ReversePolyPtLinks(*outRec2->pts); } else if (PointInPolygon(outRec1->pts->pt, outRec2->pts, m_UseFullRange)) { + //outRec1 is contained by outRec2 ... outRec2->isHole = outRec1->isHole; outRec1->isHole = !outRec2->isHole; outRec2->FirstLeft = outRec1->FirstLeft; outRec1->FirstLeft = outRec2; - if (outRec1->isHole == Orientation(outRec1, m_UseFullRange)) - ReversePolyPtLinks(*outRec1->pts); + if (outRec1->isHole == + (m_ReverseOutput ^ Orientation(outRec1, m_UseFullRange))) + ReversePolyPtLinks(*outRec1->pts); + //make sure any contained holes now link to the correct polygon ... + if (fixHoleLinkages) CheckHoleLinkages1(outRec1, outRec2); } else { outRec2->isHole = outRec1->isHole; @@ -2966,6 +3079,12 @@ void Clipper::JoinCommonEdges(bool fixHoleLinkages) //now cleanup redundant edges too ... FixupOutPolygon(*outRec1); FixupOutPolygon(*outRec2); + + if (Orientation(outRec1, m_UseFullRange) != (Area(*outRec1, m_UseFullRange) > 0)) + DisposeBottomPt(*outRec1); + if (Orientation(outRec2, m_UseFullRange) != (Area(*outRec2, m_UseFullRange) > 0)) + DisposeBottomPt(*outRec2); + } else { //joined 2 polygons together ... @@ -2973,14 +3092,22 @@ void Clipper::JoinCommonEdges(bool fixHoleLinkages) //make sure any holes contained by outRec2 now link to outRec1 ... if (fixHoleLinkages) CheckHoleLinkages2(outRec1, outRec2); + //now cleanup redundant edges too ... + FixupOutPolygon(*outRec1); + + if (outRec1->pts) + { + outRec1->isHole = !Orientation(outRec1, m_UseFullRange); + if (outRec1->isHole && !outRec1->FirstLeft) + outRec1->FirstLeft = outRec2->FirstLeft; + } + //delete the obsolete pointer ... int OKIdx = outRec1->idx; int ObsoleteIdx = outRec2->idx; outRec2->pts = 0; outRec2->bottomPt = 0; outRec2->AppendLink = outRec1; - //holes are practically always joined to outers, not vice versa ... - if (outRec1->isHole && !outRec2->isHole) outRec1->isHole = false; //now fixup any subsequent Joins that match this polygon for (JoinList::size_type k = i+1; k < m_Joins.size(); k++) @@ -2989,27 +3116,21 @@ void Clipper::JoinCommonEdges(bool fixHoleLinkages) if (j2->poly1Idx == ObsoleteIdx) j2->poly1Idx = OKIdx; if (j2->poly2Idx == ObsoleteIdx) j2->poly2Idx = OKIdx; } - - //now cleanup redundant edges too ... - if (outRec1->pts) - FixupOutPolygon(*outRec1); - else - FixupOutPolygon(*outRec2); } } } //------------------------------------------------------------------------------ -void ReversePoints(Polygon& p) +void ReversePolygon(Polygon& p) { std::reverse(p.begin(), p.end()); } //------------------------------------------------------------------------------ -void ReversePoints(Polygons& p) +void ReversePolygons(Polygons& p) { for (Polygons::size_type i = 0; i < p.size(); ++i) - ReversePoints(p[i]); + ReversePolygon(p[i]); } //------------------------------------------------------------------------------ @@ -3027,12 +3148,13 @@ struct DoublePoint Polygon BuildArc(const IntPoint &pt, const double a1, const double a2, const double r) { - int steps = std::max(6, int(std::sqrt(std::fabs(r)) * std::fabs(a2 - a1))); - Polygon result(steps); - int n = steps - 1; - double da = (a2 - a1) / n; + long64 steps = std::max(6, int(std::sqrt(std::fabs(r)) * std::fabs(a2 - a1))); + if (steps > 0x100000) steps = 0x100000; + int n = (unsigned)steps; + Polygon result(n); + double da = (a2 - a1) / (n -1); double a = a1; - for (int i = 0; i <= n; ++i) + for (int i = 0; i < n; ++i) { result[i].X = pt.X + Round(std::cos(a)*r); result[i].Y = pt.Y + Round(std::sin(a)*r); @@ -3160,7 +3282,7 @@ PolyOffsetBuilder(const Polygons& in_polys, Polygons& out_polys, if (clpr.Execute(ctUnion, out_polys, pftNegative, pftNegative)) { out_polys.erase(out_polys.begin()); - ReversePoints(out_polys); + ReversePolygons(out_polys); } else out_polys.clear(); @@ -3187,23 +3309,23 @@ void DoSquare(double mul = 1.0) (long64)Round(m_p[m_i][m_j].Y + normals[m_j].Y * m_delta)); if ((normals[m_k].X * normals[m_j].Y - normals[m_j].X * normals[m_k].Y) * m_delta >= 0) { - double a1 = std::atan2(normals[m_k].Y, normals[m_k].X); - double a2 = std::atan2(-normals[m_j].Y, -normals[m_j].X); - a1 = std::fabs(a2 - a1); - if (a1 > pi) a1 = pi * 2 - a1; - double dx = std::tan((pi - a1)/4) * std::fabs(m_delta * mul); - pt1 = IntPoint((long64)(pt1.X -normals[m_k].Y * dx), - (long64)(pt1.Y + normals[m_k].X * dx)); - AddPoint(pt1); - pt2 = IntPoint((long64)(pt2.X + normals[m_j].Y * dx), - (long64)(pt2.Y -normals[m_j].X * dx)); - AddPoint(pt2); + double a1 = std::atan2(normals[m_k].Y, normals[m_k].X); + double a2 = std::atan2(-normals[m_j].Y, -normals[m_j].X); + a1 = std::fabs(a2 - a1); + if (a1 > pi) a1 = pi * 2 - a1; + double dx = std::tan((pi - a1)/4) * std::fabs(m_delta * mul); + pt1 = IntPoint((long64)(pt1.X -normals[m_k].Y * dx), + (long64)(pt1.Y + normals[m_k].X * dx)); + AddPoint(pt1); + pt2 = IntPoint((long64)(pt2.X + normals[m_j].Y * dx), + (long64)(pt2.Y -normals[m_j].X * dx)); + AddPoint(pt2); } else { - AddPoint(pt1); - AddPoint(m_p[m_i][m_j]); - AddPoint(pt2); + AddPoint(pt1); + AddPoint(m_p[m_i][m_j]); + AddPoint(pt2); } } //------------------------------------------------------------------------------ @@ -3274,6 +3396,28 @@ void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys, } //------------------------------------------------------------------------------ +void SimplifyPolygon(const Polygon &in_poly, Polygons &out_polys, PolyFillType fillType) +{ + Clipper c; + c.AddPolygon(in_poly, ptSubject); + c.Execute(ctUnion, out_polys, fillType, fillType); +} +//------------------------------------------------------------------------------ + +void SimplifyPolygons(const Polygons &in_polys, Polygons &out_polys, PolyFillType fillType) +{ + Clipper c; + c.AddPolygons(in_polys, ptSubject); + c.Execute(ctUnion, out_polys, fillType, fillType); +} +//------------------------------------------------------------------------------ + +void SimplifyPolygons(Polygons &polys, PolyFillType fillType) +{ + SimplifyPolygons(polys, polys, fillType); +} +//------------------------------------------------------------------------------ + std::ostream& operator <<(std::ostream &s, IntPoint& p) { s << p.X << ' ' << p.Y << "\n"; diff --git a/contrib/clipper/clipper.hpp b/contrib/clipper/clipper.hpp index a56a46155..7cbe898df 100644 --- a/contrib/clipper/clipper.hpp +++ b/contrib/clipper/clipper.hpp @@ -1,10 +1,10 @@ /******************************************************************************* * * * Author : Angus Johnson * -* Version : 4.6.3 * -* Date : 11 November 2011 * +* Version : 4.8.8 * +* Date : 30 August 2012 * * Website : http://www.angusj.com * -* Copyright : Angus Johnson 2010-2011 * +* Copyright : Angus Johnson 2010-2012 * * * * License: * * Use, modification & distribution is subject to Boost Software License Ver 1. * @@ -73,18 +73,21 @@ struct ExPolygon { }; typedef std::vector< ExPolygon > ExPolygons; -enum JoinType { jtSquare, jtMiter, jtRound }; +enum JoinType { jtSquare, jtRound, jtMiter }; bool Orientation(const Polygon &poly); double Area(const Polygon &poly); void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys, double delta, JoinType jointype = jtSquare, double MiterLimit = 2); +void SimplifyPolygon(const Polygon &in_poly, Polygons &out_polys, PolyFillType fillType = pftEvenOdd); +void SimplifyPolygons(const Polygons &in_polys, Polygons &out_polys, PolyFillType fillType = pftEvenOdd); +void SimplifyPolygons(Polygons &polys, PolyFillType fillType = pftEvenOdd); -void ReversePoints(Polygon& p); -void ReversePoints(Polygons& p); +void ReversePolygon(Polygon& p); +void ReversePolygons(Polygons& p); //used internally ... -enum EdgeSide { esLeft, esRight }; +enum EdgeSide { esNeither = 0, esLeft = 1, esRight = 2, esBoth = 3 }; enum IntersectProtects { ipNone = 0, ipLeft = 1, ipRight = 2, ipBoth = 3 }; struct TEdge { @@ -139,8 +142,8 @@ struct OutRec { OutRec *AppendLink; OutPt *pts; OutPt *bottomPt; - TEdge *bottomE1; - TEdge *bottomE2; + OutPt *bottomFlag; + EdgeSide sides; }; struct OutPt { @@ -256,9 +259,10 @@ private: void IntersectEdges(TEdge *e1, TEdge *e2, const IntPoint &pt, IntersectProtects protects); OutRec* CreateOutRec(); - void AddOutPt(TEdge *e, TEdge *altE, const IntPoint &pt); + void AddOutPt(TEdge *e, const IntPoint &pt); + void DisposeBottomPt(OutRec &outRec); void DisposeAllPolyPts(); - void DisposeOutRec(PolyOutList::size_type index, bool ignorePts = false); + void DisposeOutRec(PolyOutList::size_type index); bool ProcessIntersections(const long64 botY, const long64 topY); void AddIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt); void BuildIntersectList(const long64 botY, const long64 topY); From a3d5b2e0d71395ba99d882d06b39594919b7b97a Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sat, 20 Oct 2012 21:26:49 +0000 Subject: [PATCH 17/51] - Ifc: replace old algorithm to merge nested polygons with a version that reduces the problem to an instance of the quadrulate algorithm. This great reduces artifacts in walls. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1312 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 274 +++++++++++-------------------------------- code/IFCUtil.h | 8 ++ 2 files changed, 75 insertions(+), 207 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index deff5a284..b21ecb74d 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -66,6 +66,12 @@ namespace Assimp { #define from_int64(p) (static_cast((p)) / max_ulong64) #define one_vec (IfcVector2(static_cast(1.0),static_cast(1.0))) + + bool TryAddOpenings_Quadrulate(const std::vector& openings, + const std::vector& nors, + TempMesh& curmesh); + + // ------------------------------------------------------------------------------------------------ bool ProcessPolyloop(const IfcPolyLoop& loop, TempMesh& meshout, ConversionData& /*conv*/) { @@ -173,250 +179,105 @@ void FixupFaceOrientation(TempMesh& result) } // ------------------------------------------------------------------------------------------------ -void RecursiveMergeBoundaries(TempMesh& final_result, const TempMesh& in, const TempMesh& boundary, std::vector& normals, const IfcVector3& nor_boundary) +void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t master_bounds = (size_t)-1) { - ai_assert(in.vertcnt.size() >= 1); - ai_assert(boundary.vertcnt.size() == 1); - std::vector::const_iterator end = in.vertcnt.end(), begin=in.vertcnt.begin(), iit, best_iit; - - TempMesh out; - - // iterate through all other bounds and find the one for which the shortest connection - // to the outer boundary is actually the shortest possible. - size_t vidx = 0, best_vidx_start = 0; - size_t best_ofs, best_outer = boundary.verts.size(); - IfcFloat best_dist = 1e10; - for(std::vector::const_iterator iit = begin; iit != end; vidx += *iit++) { - - for(size_t vofs = 0; vofs < *iit; ++vofs) { - const IfcVector3& v = in.verts[vidx+vofs]; - - for(size_t outer = 0; outer < boundary.verts.size(); ++outer) { - const IfcVector3& o = boundary.verts[outer]; - const IfcFloat d = (o-v).SquareLength(); - - if (d < best_dist) { - best_dist = d; - best_ofs = vofs; - best_outer = outer; - best_iit = iit; - best_vidx_start = vidx; - } - } - } + // handle all trivial cases + if(inmesh.vertcnt.empty()) { + return; } - - ai_assert(best_outer != boundary.verts.size()); - - - // now that we collected all vertex connections to be added, build the output polygon - const size_t cnt = boundary.verts.size() + *best_iit+2; - out.verts.reserve(cnt); - - for(size_t outer = 0; outer < boundary.verts.size(); ++outer) { - const IfcVector3& o = boundary.verts[outer]; - out.verts.push_back(o); - - if (outer == best_outer) { - for(size_t i = best_ofs; i < *best_iit; ++i) { - out.verts.push_back(in.verts[best_vidx_start + i]); - } - - // we need the first vertex of the inner polygon twice as we return to the - // outer loop through the very same connection through which we got there. - for(size_t i = 0; i <= best_ofs; ++i) { - out.verts.push_back(in.verts[best_vidx_start + i]); - } - - // reverse face winding if the normal of the sub-polygon points in the - // same direction as the normal of the outer polygonal boundary - if (normals[std::distance(begin,best_iit)] * nor_boundary > 0) { - std::reverse(out.verts.rbegin(),out.verts.rbegin()+*best_iit+1); - } - - // also append a copy of the initial insertion point to be able to continue the outer polygon - out.verts.push_back(o); - } - } - out.vertcnt.push_back(cnt); - ai_assert(out.verts.size() == cnt); - - if (in.vertcnt.size()-std::count(begin,end,0) > 1) { - // Recursively apply the same algorithm if there are more boundaries to merge. The - // current implementation is relatively inefficient, though. - - TempMesh temp; - - // drop the boundary that we just processed - const size_t dist = std::distance(begin, best_iit); - TempMesh remaining = in; - remaining.vertcnt.erase(remaining.vertcnt.begin() + dist); - remaining.verts.erase(remaining.verts.begin()+best_vidx_start,remaining.verts.begin()+best_vidx_start+*best_iit); - - normals.erase(normals.begin() + dist); - RecursiveMergeBoundaries(temp,remaining,out,normals,nor_boundary); - - final_result.Append(temp); - } - else final_result.Append(out); -} - -// ------------------------------------------------------------------------------------------------ -void MergePolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t master_bounds = -1) -{ - // standard case - only one boundary, just copy it to the result vector - if (inmesh.vertcnt.size() <= 1) { + if(inmesh.vertcnt.size() == 1) { result.Append(inmesh); return; } - result.vertcnt.reserve(inmesh.vertcnt.size()+result.vertcnt.size()); + ai_assert(std::count(inmesh.vertcnt.begin(), inmesh.vertcnt.end(), 0) == 0); - // XXX get rid of the extra copy if possible - TempMesh meshout = inmesh; + typedef std::vector::const_iterator face_iter; - // handle polygons with holes. Our built in triangulation won't handle them as is, but - // the ear cutting algorithm is solid enough to deal with them if we join the inner - // holes with the outer boundaries by dummy connections. - IFCImporter::LogDebug("fixing polygon with holes for triangulation via ear-cutting"); - std::vector::iterator outer_polygon = meshout.vertcnt.end(), begin=meshout.vertcnt.begin(), end=outer_polygon, iit; + face_iter begin = inmesh.vertcnt.begin(), end = inmesh.vertcnt.end(), iit; + std::vector::const_iterator outer_polygon_it = end; - // each hole results in two extra vertices - result.verts.reserve(meshout.verts.size()+meshout.vertcnt.size()*2+result.verts.size()); - size_t outer_polygon_start = 0; + // major task here: given a list of nested polygon boundaries (one of which + // is the outer contour), reduce the triangulation task arising here to + // one that can be solved using the "quadrulation" algorithm which we use + // for pouring windows out of walls. The algorithm does not handle all + // cases but at least it is numerically stable and gives "nice" triangles. + // first compute newell normals for all polygons // do not normalize 'normals', we need the original length for computing the polygon area std::vector normals; - ComputePolygonNormals(meshout,normals,false); + ComputePolygonNormals(inmesh,normals,false); - // see if one of the polygons is a IfcFaceOuterBound (in which case `master_bounds` is its index). - // sadly we can't rely on it, the docs say 'At most one of the bounds shall be of the type IfcFaceOuterBound' + // One of the polygons might be a IfcFaceOuterBound (in which case `master_bounds` + // is its index). Sadly we can't rely on it, the docs say 'At most one of the bounds + // shall be of the type IfcFaceOuterBound' IfcFloat area_outer_polygon = 1e-10f; if (master_bounds != (size_t)-1) { - outer_polygon = begin + master_bounds; - outer_polygon_start = std::accumulate(begin,outer_polygon,0); - area_outer_polygon = normals[master_bounds].SquareLength(); + ai_assert(master_bounds < inmesh.vertcnt.size()); + outer_polygon_it = begin + master_bounds; } else { - size_t vidx = 0; - for(iit = begin; iit != meshout.vertcnt.end(); vidx += *iit++) { - // find the polygon with the largest area, it must be the outer bound. + for(iit = begin; iit != end; iit++) { + // find the polygon with the largest area and take it as the outer bound. IfcVector3& n = normals[std::distance(begin,iit)]; const IfcFloat area = n.SquareLength(); if (area > area_outer_polygon) { area_outer_polygon = area; - outer_polygon = iit; - outer_polygon_start = vidx; + outer_polygon_it = iit; } } } - ai_assert(outer_polygon != meshout.vertcnt.end()); - std::vector& in = meshout.verts; + ai_assert(outer_polygon_it != end); - // skip over extremely small boundaries - this is a workaround to fix cases - // in which the number of holes is so extremely large that the - // triangulation code fails. -#define IFC_VERTICAL_HOLE_SIZE_THRESHOLD 0.000001f - size_t vidx = 0, removed = 0, index = 0; - const IfcFloat threshold = area_outer_polygon * IFC_VERTICAL_HOLE_SIZE_THRESHOLD; - for(iit = begin; iit != end ;++index) { - const IfcFloat sqlen = normals[index].SquareLength(); - if (sqlen < threshold) { - std::vector::iterator inbase = in.begin()+vidx; - in.erase(inbase,inbase+*iit); - - outer_polygon_start -= outer_polygon_start>vidx ? *iit : 0; - *iit++ = 0; - ++removed; + const size_t outer_polygon_size = *outer_polygon_it; + const IfcVector3& master_normal = normals[std::distance(begin, outer_polygon_it)]; - IFCImporter::LogDebug("skip small hole below threshold"); - } - else { - normals[index] /= sqrt(sqlen); - vidx += *iit++; - } - } + // generate fake openings to meet the interface for the quadrulate + // algorithm. It boils down to generating small boxes given the + // inner polygon and the surface normal of the outer contour. + // It is important that we use the outer contour's normal because + // this is the plane onto which the quadrulate algorithm will + // project the entire mesh. + std::vector fake_openings; + fake_openings.reserve(inmesh.vertcnt.size()-1); - // see if one or more of the hole has a face that lies directly on an outer bound. - // this happens for doors, for example. - vidx = 0; - for(iit = begin; ; vidx += *iit++) { -next_loop: - if (iit == end) { - break; - } - if (iit == outer_polygon) { + std::vector::const_iterator vit = inmesh.verts.begin(), outer_vit; + + for(iit = begin; iit != end; vit += *iit++) { + if (iit == outer_polygon_it) { + outer_vit = vit; continue; } - for(size_t vofs = 0; vofs < *iit; ++vofs) { - if (!*iit) { - continue; - } - const size_t next = (vofs+1)%*iit; - const IfcVector3& v = in[vidx+vofs], &vnext = in[vidx+next],&vd = (vnext-v).Normalize(); + fake_openings.push_back(TempOpening()); + TempOpening& opening = fake_openings.back(); - for(size_t outer = 0; outer < *outer_polygon; ++outer) { - const IfcVector3& o = in[outer_polygon_start+outer], &onext = in[outer_polygon_start+(outer+1)%*outer_polygon], &od = (onext-o).Normalize(); + opening.extrusionDir = master_normal; + opening.solid = NULL; - if (fabs(vd * od) > 1.f-1e-6f && (onext-v).Normalize() * vd > 1.f-1e-6f && (onext-v)*(o-v) < 0) { - IFCImporter::LogDebug("got an inner hole that lies partly on the outer polygonal boundary, merging them to a single contour"); + opening.profileMesh = boost::make_shared(); + opening.profileMesh->verts.reserve(*iit); + opening.profileMesh->vertcnt.push_back(*iit); - // in between outer and outer+1 insert all vertices of this loop, then drop the original altogether. - std::vector tmp(*iit); - - const size_t start = (v-o).SquareLength() > (vnext-o).SquareLength() ? vofs : next; - std::vector::iterator inbase = in.begin()+vidx, it = std::copy(inbase+start, inbase+*iit,tmp.begin()); - std::copy(inbase, inbase+start,it); - std::reverse(tmp.begin(),tmp.end()); - - in.insert(in.begin()+outer_polygon_start+(outer+1)%*outer_polygon,tmp.begin(),tmp.end()); - vidx += outer_polygon_startvidx ? *iit : 0; - - *outer_polygon += tmp.size(); - *iit++ = 0; - ++removed; - goto next_loop; - } - } - } + std::copy(vit, vit + *iit, std::back_inserter(opening.profileMesh->verts)); } - if ( meshout.vertcnt.size() - removed <= 1) { - result.Append(meshout); - return; - } + // fill a mesh with ONLY the main polygon + TempMesh temp; + temp.verts.reserve(outer_polygon_size); + temp.vertcnt.push_back(outer_polygon_size); + std::copy(outer_vit, outer_vit+outer_polygon_size, + std::back_inserter(temp.verts)); - // extract the outer boundary and move it to a separate mesh - TempMesh boundary; - boundary.vertcnt.resize(1,*outer_polygon); - boundary.verts.resize(*outer_polygon); - - std::vector::iterator b = in.begin()+outer_polygon_start; - std::copy(b,b+*outer_polygon,boundary.verts.begin()); - in.erase(b,b+*outer_polygon); - - std::vector::iterator norit = normals.begin()+std::distance(meshout.vertcnt.begin(),outer_polygon); - const IfcVector3 nor_boundary = *norit; - normals.erase(norit); - meshout.vertcnt.erase(outer_polygon); - - // keep merging the closest inner boundary with the outer boundary until no more boundaries are left - RecursiveMergeBoundaries(result,meshout,boundary,normals,nor_boundary); + TryAddOpenings_Quadrulate(fake_openings, normals, temp); + result.Append(temp); } - // ------------------------------------------------------------------------------------------------ void ProcessConnectedFaceSet(const IfcConnectedFaceSet& fset, TempMesh& result, ConversionData& conv) { BOOST_FOREACH(const IfcFace& face, fset.CfsFaces) { - // size_t ob = -1, cnt = 0; TempMesh meshout; BOOST_FOREACH(const IfcFaceBound& bound, face.Bounds) { @@ -446,12 +307,10 @@ void ProcessConnectedFaceSet(const IfcConnectedFaceSet& fset, TempMesh& result, }*/ } - MergePolygonBoundaries(result,meshout); + ProcessPolygonBoundaries(result, meshout); } } - - // ------------------------------------------------------------------------------------------------ void ProcessRevolvedAreaSolid(const IfcRevolvedAreaSolid& solid, TempMesh& result, ConversionData& conv) { @@ -1430,7 +1289,7 @@ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& } } - // undo the projection, generate output quads + // swap data arrays std::swap(vold,curmesh.verts); std::swap(iold,curmesh.vertcnt); } @@ -1550,8 +1409,8 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, for (std::vector::iterator it = bbs.begin(); it != bbs.end();) { const BoundingBox& ibb = *it; - if (ibb.first.x < bb.second.x && ibb.second.x > bb.first.x && - ibb.first.y < bb.second.y && ibb.second.y > bb.second.x) { + if (ibb.first.x <= bb.second.x && ibb.second.x >= bb.first.x && + ibb.first.y <= bb.second.y && ibb.second.y >= bb.second.x) { // take these two contours and try to merge them. If they overlap (which // should not happen, but in fact happens-in-the-real-world [tm] ), @@ -1669,6 +1528,7 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul IfcVector3 min = in[0]; dir *= IfcMatrix3(trafo); + std::vector nors; const bool openings = !!conv.apply_openings && conv.apply_openings->size(); diff --git a/code/IFCUtil.h b/code/IFCUtil.h index a8fe6f680..fb9d21eb2 100644 --- a/code/IFCUtil.h +++ b/code/IFCUtil.h @@ -80,6 +80,14 @@ struct TempOpening IfcVector3 extrusionDir; boost::shared_ptr profileMesh; + // ------------------------------------------------------------------------------ + TempOpening() + : solid() + , extrusionDir() + , profileMesh() + { + } + // ------------------------------------------------------------------------------ TempOpening(const IFC::IfcExtrudedAreaSolid* solid,IfcVector3 extrusionDir,boost::shared_ptr profileMesh) : solid(solid) From 2f5475d50ab83210742e45b1c07ac51305c55437 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sat, 20 Oct 2012 23:18:48 +0000 Subject: [PATCH 18/51] - Ifc: [Quadrulation] use generalized matrix multiplication for projections. Add table to map from contours to the openings they originated from and from openings to the points that were generated from it. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1313 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 76 +++++++++++++++++++++++++------------------- code/IFCUtil.h | 7 ++++ 2 files changed, 51 insertions(+), 32 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index b21ecb74d..bbd81b5bd 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -67,7 +67,7 @@ namespace Assimp { #define one_vec (IfcVector2(static_cast(1.0),static_cast(1.0))) - bool TryAddOpenings_Quadrulate(const std::vector& openings, + bool TryAddOpenings_Quadrulate(std::vector& openings, const std::vector& nors, TempMesh& curmesh); @@ -1004,10 +1004,7 @@ void QuadrifyPart(const IfcVector2& pmin, const IfcVector2& pmax, XYSortedField& void InsertWindowContours(const std::vector< BoundingBox >& bbs, const std::vector< std::vector >& contours, const std::vector& openings, - const IfcMatrix3& minv, - const IfcVector2& scale, - const IfcVector2& offset, - IfcFloat coord, + const IfcMatrix4& minv, TempMesh& curmesh) { ai_assert(contours.size() == bbs.size()); @@ -1083,7 +1080,7 @@ void InsertWindowContours(const std::vector< BoundingBox >& bbs, if ((contour[a] - edge).SquareLength() > diag*diag*0.7) { continue; } - const IfcVector3 v3 = minv * IfcVector3(offset.x + contour[a].x * scale.x, offset.y + contour[a].y * scale.y, coord); + const IfcVector3 v3 = minv * IfcVector3(contour[a].x, contour[a].y, 0.0f); curmesh.verts.push_back(v3); } @@ -1105,7 +1102,7 @@ void InsertWindowContours(const std::vector< BoundingBox >& bbs, corner.y = bb.second.y; } - const IfcVector3 v3 = minv * IfcVector3(offset.x + corner.x * scale.x, offset.y + corner.y * scale.y,coord); + const IfcVector3 v3 = minv * IfcVector3(corner.x, corner.y, 0.0f); curmesh.verts.push_back(v3); } else if (cnt == 1) { @@ -1213,10 +1210,7 @@ void CleanupWindowContours(std::vector< std::vector >& contours) // ------------------------------------------------------------------------------------------------ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& curmesh, - const IfcMatrix3& minv, - const IfcVector2& scale, - const IfcVector2& offset, - IfcFloat coord, + const IfcMatrix4& minv, const std::vector& outflat) { std::vector vold; @@ -1263,9 +1257,9 @@ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& iold.push_back(ex.outer.size()); BOOST_FOREACH(const ClipperLib::IntPoint& point, ex.outer) { vold.push_back( minv * IfcVector3( - offset.x + from_int64(point.X) * scale.x, - offset.y + from_int64(point.Y) * scale.y, - coord)); + from_int64(point.X), + from_int64(point.Y), + 0.0f)); } } @@ -1284,7 +1278,7 @@ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& iold.resize(outflat.size()/4,4); BOOST_FOREACH(const IfcVector2& vproj, outflat) { - const IfcVector3 v3 = minv * IfcVector3(offset.x + vproj.x * scale.x, offset.y + vproj.y * scale.y,coord); + const IfcVector3 v3 = minv * IfcVector3(vproj.x, vproj.y, static_cast(0.0)); vold.push_back(v3); } } @@ -1295,16 +1289,16 @@ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& } // ------------------------------------------------------------------------------------------------ -bool TryAddOpenings_Quadrulate(const std::vector& openings, +bool TryAddOpenings_Quadrulate(std::vector& openings, const std::vector& nors, TempMesh& curmesh) { std::vector& out = curmesh.verts; + std::vector > contours_to_openings; // Try to derive a solid base plane within the current surface for use as // working coordinate system. - const IfcMatrix3& m = DerivePlaneCoordinateSpace(curmesh); - const IfcMatrix3& minv = IfcMatrix3(m).Inverse(); + IfcMatrix4 m = IfcMatrix4(DerivePlaneCoordinateSpace(curmesh)); const IfcVector3& nor = IfcVector3(m.c1, m.c2, m.c3); IfcFloat coord = -1; @@ -1334,10 +1328,8 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, contour_flat.push_back(IfcVector2(vv.x,vv.y)); } - // With the current code in DerivePlaneCoordinateSpace, - // vmin,vmax should always be the 0...1 rectangle (+- numeric inaccuracies) - // but here we really need this to be accurate, so normalize again. - + // Further improve the projection by mapping the entire working set into + // [0,1] range vmax -= vmin; BOOST_FOREACH(IfcVector2& vv, contour_flat) { vv.x = (vv.x - vmin.x) / vmax.x; @@ -1348,15 +1340,26 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, vv = std::min(vv,one_vec); } - // project all openings into the coordinate system defined by the p+sv*tu plane - // and compute bounding boxes for them + IfcMatrix4 mult; + mult.a1 = static_cast(1.0) / vmax.x; + mult.b2 = static_cast(1.0) / vmax.y; + + mult.a4 = -vmin.x * mult.a1; + mult.b4 = -vmin.y * mult.b2; + mult.c4 = -coord; + m = mult * m; + + // Obtain inverse transform for getting back + const IfcMatrix4& minv = IfcMatrix4(m).Inverse(); + + // Compute bounding boxes for the projections of all openings std::vector< BoundingBox > bbs; std::vector< std::vector > contours; size_t c = 0; - BOOST_FOREACH(const TempOpening& t,openings) { - std::vector profile_verts = t.profileMesh->verts; - std::vector profile_vertcnts = t.profileMesh->vertcnt; + BOOST_FOREACH(TempOpening& opening,openings) { + std::vector profile_verts = opening.profileMesh->verts; + std::vector profile_vertcnts = opening.profileMesh->vertcnt; if(profile_verts.size() <= 2) { continue; } @@ -1385,8 +1388,8 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, IfcVector2 vv(v.x, v.y); // rescale - vv.x = (vv.x - vmin.x) / vmax.x; - vv.y = (vv.y - vmin.y) / vmax.y; + //vv.x = (vv.x - vmin.x) / vmax.x; + //vv.y = (vv.y - vmin.y) / vmax.y; vv = std::max(vv,IfcVector2()); vv = std::min(vv,one_vec); @@ -1403,6 +1406,7 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, } BoundingBox bb = BoundingBox(vpmin,vpmax); + std::vector joined_openings(1, &opening); // see if this BB intersects any other, in which case we could not use the Quadrify() // algorithm and would revert to Poly2Tri only. @@ -1445,6 +1449,10 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, bb.first = std::min(bb.first, ibb.first); bb.second = std::max(bb.second, ibb.second); + std::vector& t = contours_to_openings[std::distance(bbs.begin(),it)]; + joined_openings.insert(joined_openings.end(), t.begin(), t.end()); + + contours_to_openings.erase(contours_to_openings.begin() + std::distance(bbs.begin(),it)); contours.erase(contours.begin() + std::distance(bbs.begin(),it)); it = bbs.erase(it); continue; @@ -1454,6 +1462,10 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, } if(!contour.empty()) { + contours_to_openings.push_back(std::vector( + joined_openings.begin(), + joined_openings.end())); + contours.push_back(contour); bbs.push_back(bb); } @@ -1476,10 +1488,10 @@ bool TryAddOpenings_Quadrulate(const std::vector& openings, QuadrifyPart(IfcVector2(0.f,0.f),IfcVector2(1.f,1.f),field,bbs,outflat); ai_assert(!(outflat.size() % 4)); - CleanupOuterContour(contour_flat, curmesh, minv, vmax, vmin, coord, outflat); + CleanupOuterContour(contour_flat, curmesh, minv,outflat); CleanupWindowContours(contours); - InsertWindowContours(bbs,contours,openings, minv,vmax, vmin, coord, curmesh); - + InsertWindowContours(bbs,contours,openings, minv,curmesh); + //CloseWindows(contours, minv,contours_to_openings, curmesh); return true; } diff --git a/code/IFCUtil.h b/code/IFCUtil.h index fb9d21eb2..517e5d3c1 100644 --- a/code/IFCUtil.h +++ b/code/IFCUtil.h @@ -80,6 +80,13 @@ struct TempOpening IfcVector3 extrusionDir; boost::shared_ptr profileMesh; + // list of points generated for this opening. This is used to + // create connections between two opposing holes created + // from a single opening instance (two because walls tend to + // have two sides). If !empty(), the other side of the wall + // has already been processed. + std::vector wallPoints; + // ------------------------------------------------------------------------------ TempOpening() : solid() From 71fb04849c0a072a49f4c1d25dcfae551c4c6238 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 21 Oct 2012 01:05:48 +0000 Subject: [PATCH 19/51] - Ifc: experimental code to connect window holes, commented by default. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1314 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 116 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 106 insertions(+), 10 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index bbd81b5bd..ef1fb5843 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1000,9 +1000,11 @@ void QuadrifyPart(const IfcVector2& pmin, const IfcVector2& pmax, XYSortedField& } } +typedef std::vector< std::vector > ContourVector; + // ------------------------------------------------------------------------------------------------ void InsertWindowContours(const std::vector< BoundingBox >& bbs, - const std::vector< std::vector >& contours, + const ContourVector& contours, const std::vector& openings, const IfcMatrix4& minv, TempMesh& curmesh) @@ -1013,6 +1015,9 @@ void InsertWindowContours(const std::vector< BoundingBox >& bbs, for(size_t i = 0; i < contours.size();++i) { const BoundingBox& bb = bbs[i]; const std::vector& contour = contours[i]; + if(contour.empty()) { + continue; + } // check if we need to do it at all - many windows just fit perfectly into their quadratic holes, // i.e. their contours *are* already their bounding boxes. @@ -1160,7 +1165,7 @@ void MergeWindowContours (const std::vector& a, } // ------------------------------------------------------------------------------------------------ -void CleanupWindowContours(std::vector< std::vector >& contours) +void CleanupWindowContours(ContourVector& contours) { std::vector scratch; @@ -1288,13 +1293,103 @@ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& std::swap(iold,curmesh.vertcnt); } +typedef std::vector OpeningRefs; +typedef std::vector OpeningRefVector; + +// ------------------------------------------------------------------------------------------------ +void CloseWindows(const ContourVector& contours, const IfcMatrix4& minv, + OpeningRefVector contours_to_openings, + TempMesh& curmesh) +{ + // For all contour points, check if one of the assigned openings does + // already have points assigned to it. In this case, assume this is + // the second side of the wall and generate connections between + // the two holes in order to close the window margin. + + // All this gets complicated by the fact that contours may pertain to + // multiple openings. The code is based on the assumption that this + // relationship is identical on both sides of the wall. If this is + // not the case, wrong geometry may be generated. + for (ContourVector::const_iterator it = contours.begin(), end = contours.end(); it != end; ++it) { + if ((*it).empty()) { + continue; + } + OpeningRefs& refs = contours_to_openings[std::distance(contours.begin(), it)]; + + bool has_other_side = false; + BOOST_FOREACH(const TempOpening* opening, refs) { + if(!opening->wallPoints.empty()) { + has_other_side = true; + break; + } + } + + const ContourVector::value_type::const_iterator cbegin = (*it).begin(), cend = (*it).end(); + + if (has_other_side) { + // XXX this algorithm is really a bit inefficient - both in terms + // of constant factor and of asymptotic runtime. + std::vector::const_iterator vstart; + for (ContourVector::value_type::const_iterator cit = cbegin; cit != cend; ++cit) { + + const IfcVector2& proj_point = *cit; + const IfcVector3& world_point = minv * IfcVector3(proj_point.x,proj_point.y,0.0f); + + unsigned int i = 0; + IfcFloat best = static_cast(1e10); + IfcVector3 bestv; + + BOOST_FOREACH(const TempOpening* opening, refs) { + BOOST_FOREACH(const IfcVector3& other, opening->wallPoints) { + const IfcFloat sqdist = (world_point - other).SquareLength(); + if (sqdist < best) { + bestv = other; + best = sqdist; + } + ++i; + } + } + + curmesh.verts.push_back(world_point); + curmesh.verts.push_back(bestv); + + curmesh.vertcnt.push_back(4); + + if (cit != cbegin) { + + curmesh.verts.push_back(world_point); + curmesh.verts.push_back(bestv); + + if (cit == cend - 1) { + curmesh.verts.push_back(*(vstart)); + curmesh.verts.push_back(*(vstart+1)); + } + } + else { + vstart = curmesh.verts.end() - 2; + } + } + } + else { + BOOST_FOREACH(TempOpening* opening, refs) { + opening->wallPoints.reserve(opening->wallPoints.capacity() + (*it).size()); + for (ContourVector::value_type::const_iterator cit = cbegin; cit != cend; ++cit) { + + const IfcVector2& proj_point = *cit; + opening->wallPoints.push_back(minv * IfcVector3(proj_point.x,proj_point.y,0.0f)); + } + } + } + } +} + // ------------------------------------------------------------------------------------------------ bool TryAddOpenings_Quadrulate(std::vector& openings, const std::vector& nors, TempMesh& curmesh) { std::vector& out = curmesh.verts; - std::vector > contours_to_openings; + OpeningRefVector contours_to_openings; // Try to derive a solid base plane within the current surface for use as // working coordinate system. @@ -1354,7 +1449,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, // Compute bounding boxes for the projections of all openings std::vector< BoundingBox > bbs; - std::vector< std::vector > contours; + ContourVector contours; size_t c = 0; BOOST_FOREACH(TempOpening& opening,openings) { @@ -1387,10 +1482,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, const IfcVector3& v = m * x; IfcVector2 vv(v.x, v.y); - // rescale - //vv.x = (vv.x - vmin.x) / vmax.x; - //vv.y = (vv.y - vmin.y) / vmax.y; - + // sanity rounding vv = std::max(vv,IfcVector2()); vv = std::min(vv,one_vec); @@ -1491,7 +1583,12 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, CleanupOuterContour(contour_flat, curmesh, minv,outflat); CleanupWindowContours(contours); InsertWindowContours(bbs,contours,openings, minv,curmesh); - //CloseWindows(contours, minv,contours_to_openings, curmesh); + + // this should connect the window openings on both sides of the wall, + // but it produces lots of artifacts which are not resolved yet. + // Most of all, it makes all cases in which adjacent openings are + // not correctly merged together glaringly obvious. + //CloseWindows(contours, minv, contours_to_openings, curmesh); return true; } @@ -1615,7 +1712,6 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul } } - if(openings && ((sides_with_openings != 2 && sides_with_openings) || (sides_with_v_openings != 2 && sides_with_v_openings))) { IFCImporter::LogWarn("failed to resolve all openings, presumably their topology is not supported by Assimp"); } From d660ec35ad8016bd29c0151ef18b2eca1e4b775c Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 21 Oct 2012 16:58:22 +0000 Subject: [PATCH 20/51] - Ifc: first attempt at also supporting extruded area solids for boolean differentiation. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1315 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 281 ++++++++++++++++++++++++++----------------- 1 file changed, 170 insertions(+), 111 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index ef1fb5843..d841b0a09 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1462,7 +1462,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, IfcVector2 vpmin,vpmax; MinMaxChooser()(vpmin,vpmax); - // the opening meshes are real 3D meshes so skip over all faces + // The opening meshes are real 3D meshes so skip over all faces // clearly facing into the wrong direction. std::vector contour; for (size_t f = 0, vi_total = 0, fend = profile_vertcnts.size(); f < fend; ++f) { @@ -1500,7 +1500,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, BoundingBox bb = BoundingBox(vpmin,vpmax); std::vector joined_openings(1, &opening); - // see if this BB intersects any other, in which case we could not use the Quadrify() + // See if this BB intersects any other, in which case we could not use the Quadrify() // algorithm and would revert to Poly2Tri only. for (std::vector::iterator it = bbs.begin(); it != bbs.end();) { const BoundingBox& ibb = *it; @@ -1508,7 +1508,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, if (ibb.first.x <= bb.second.x && ibb.second.x >= bb.first.x && ibb.first.y <= bb.second.y && ibb.second.y >= bb.second.x) { - // take these two contours and try to merge them. If they overlap (which + // Take these two contours and try to merge them. If they overlap (which // should not happen, but in fact happens-in-the-real-world [tm] ), // resume using a single contour and a single bounding box. const std::vector& other = contours[std::distance(bbs.begin(),it)]; @@ -1584,11 +1584,12 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, CleanupWindowContours(contours); InsertWindowContours(bbs,contours,openings, minv,curmesh); - // this should connect the window openings on both sides of the wall, + // This should connect the window openings on both sides of the wall, // but it produces lots of artifacts which are not resolved yet. // Most of all, it makes all cases in which adjacent openings are // not correctly merged together glaringly obvious. - //CloseWindows(contours, minv, contours_to_openings, curmesh); + + // CloseWindows(contours, minv, contours_to_openings, curmesh); return true; } @@ -1719,30 +1720,20 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul IFCImporter::LogDebug("generate mesh procedurally by extrusion (IfcExtrudedAreaSolid)"); } - - // ------------------------------------------------------------------------------------------------ void ProcessSweptAreaSolid(const IfcSweptAreaSolid& swept, TempMesh& meshout, ConversionData& conv) { if(const IfcExtrudedAreaSolid* const solid = swept.ToPtr()) { // Do we just collect openings for a parent element (i.e. a wall)? - // In this case we don't extrude the surface yet, just keep the profile and transform it correctly + // In such a case, we generate the polygonal extrusion mesh as usual, + // but attach it to a TempOpening instance which will later be applied + // to the wall it pertains to. if(conv.collect_openings) { boost::shared_ptr meshtmp(new TempMesh()); ProcessExtrudedAreaSolid(*solid,*meshtmp,conv); - /* - ProcessProfile(swept.SweptArea,*meshtmp,conv); - - IfcMatrix4 m; - ConvertAxisPlacement(m,solid->Position); - meshtmp->Transform(m); - - IfcVector3 dir; - ConvertDirection(dir,solid->ExtrudedDirection); */ - conv.collect_openings->push_back(TempOpening(solid,IfcVector3(0,0,0) - /* IfcMatrix3(m) * (dir*static_cast(solid->Depth)) */,meshtmp)); + conv.collect_openings->push_back(TempOpening(solid,IfcVector3(0,0,0),meshtmp)); return; } @@ -1756,7 +1747,6 @@ void ProcessSweptAreaSolid(const IfcSweptAreaSolid& swept, TempMesh& meshout, } } - // ------------------------------------------------------------------------------------------------ enum Intersect { Intersect_No, @@ -1785,127 +1775,196 @@ Intersect IntersectSegmentPlane(const IfcVector3& p,const IfcVector3& n, const I return Intersect_Yes; } +// ------------------------------------------------------------------------------------------------ +void ProcessBooleanHalfSpaceDifference(const IfcHalfSpaceSolid* hs, TempMesh& result, + const TempMesh& first_operand, + ConversionData& conv) +{ + ai_assert(hs != NULL); + + const IfcPlane* const plane = hs->BaseSurface->ToPtr(); + if(!plane) { + IFCImporter::LogError("expected IfcPlane as base surface for the IfcHalfSpaceSolid"); + return; + } + + // extract plane base position vector and normal vector + IfcVector3 p,n(0.f,0.f,1.f); + if (plane->Position->Axis) { + ConvertDirection(n,plane->Position->Axis.Get()); + } + ConvertCartesianPoint(p,plane->Position->Location); + + if(!IsTrue(hs->AgreementFlag)) { + n *= -1.f; + } + + // clip the current contents of `meshout` against the plane we obtained from the second operand + const std::vector& in = first_operand.verts; + std::vector& outvert = result.verts; + + std::vector::const_iterator begin = first_operand.vertcnt.begin(), + end = first_operand.vertcnt.end(), iit; + + outvert.reserve(in.size()); + result.vertcnt.reserve(first_operand.vertcnt.size()); + + unsigned int vidx = 0; + for(iit = begin; iit != end; vidx += *iit++) { + + unsigned int newcount = 0; + for(unsigned int i = 0; i < *iit; ++i) { + const IfcVector3& e0 = in[vidx+i], e1 = in[vidx+(i+1)%*iit]; + + // does the next segment intersect the plane? + IfcVector3 isectpos; + const Intersect isect = IntersectSegmentPlane(p,n,e0,e1,isectpos); + if (isect == Intersect_No || isect == Intersect_LiesOnPlane) { + if ( (e0-p).Normalize()*n > 0 ) { + outvert.push_back(e0); + ++newcount; + } + } + else if (isect == Intersect_Yes) { + if ( (e0-p).Normalize()*n > 0 ) { + // e0 is on the right side, so keep it + outvert.push_back(e0); + outvert.push_back(isectpos); + newcount += 2; + } + else { + // e0 is on the wrong side, so drop it and keep e1 instead + outvert.push_back(isectpos); + ++newcount; + } + } + } + + if (!newcount) { + continue; + } + + IfcVector3 vmin,vmax; + ArrayBounds(&*(outvert.end()-newcount),newcount,vmin,vmax); + + // filter our IfcFloat points - those may happen if a point lies + // directly on the intersection line. However, due to IfcFloat + // precision a bitwise comparison is not feasible to detect + // this case. + const IfcFloat epsilon = (vmax-vmin).SquareLength() / 1e6f; + FuzzyVectorCompare fz(epsilon); + + std::vector::iterator e = std::unique( outvert.end()-newcount, outvert.end(), fz ); + + if (e != outvert.end()) { + newcount -= static_cast(std::distance(e,outvert.end())); + outvert.erase(e,outvert.end()); + } + if (fz(*( outvert.end()-newcount),outvert.back())) { + outvert.pop_back(); + --newcount; + } + if(newcount > 2) { + result.vertcnt.push_back(newcount); + } + else while(newcount-->0) { + result.verts.pop_back(); + } + + } + IFCImporter::LogDebug("generating CSG geometry by plane clipping (IfcBooleanClippingResult)"); +} + +// ------------------------------------------------------------------------------------------------ +void ProcessBooleanExtrudedAreaSolidDifference(const IfcExtrudedAreaSolid* as, TempMesh& result, + const TempMesh& first_operand, + ConversionData& conv) +{ + ai_assert(as != NULL); + + // This case is handled by reduction to an instance of the quadrify() algorithm. + // Obviously, this won't work for arbitrarily complex cases. In fact, the first + // operand should be near-planar. Luckily, this is usually the case in Ifc + // buildings. + + boost::shared_ptr meshtmp(new TempMesh()); + ProcessExtrudedAreaSolid(*as,*meshtmp,conv); + + std::vector openings(1, TempOpening(as,IfcVector3(0,0,0),meshtmp)); + + result = first_operand; + + TempMesh temp; + + std::vector::const_iterator vit = first_operand.verts.begin(); + BOOST_FOREACH(unsigned int pcount, first_operand.vertcnt) { + temp.Clear(); + + temp.verts.insert(temp.verts.end(), vit, vit + pcount); + temp.vertcnt.push_back(pcount); + + TryAddOpenings_Quadrulate(openings, std::vector(1,IfcVector3(1,0,0)), temp); + result.Append(temp); + + vit += pcount; + } + + + + IFCImporter::LogDebug("generating CSG geometry by geometric difference to a solid (IfcExtrudedAreaSolid)"); +} + // ------------------------------------------------------------------------------------------------ void ProcessBoolean(const IfcBooleanResult& boolean, TempMesh& result, ConversionData& conv) { + // supported CSG operations: + // DIFFERENCE if(const IfcBooleanResult* const clip = boolean.ToPtr()) { if(clip->Operator != "DIFFERENCE") { IFCImporter::LogWarn("encountered unsupported boolean operator: " + (std::string)clip->Operator); return; } - TempMesh meshout; + // supported cases (1st operand): + // IfcBooleanResult -- call ProcessBoolean recursively + // IfcSweptAreaSolid -- obtain polygonal geometry first + + // supported cases (2nd operand): + // IfcHalfSpaceSolid -- easy, clip against plane + // IfcExtrudedAreaSolid -- reduce to an instance of the quadrify() algorithm + + const IfcHalfSpaceSolid* const hs = clip->SecondOperand->ResolveSelectPtr(conv.db); - if(!hs) { - IFCImporter::LogError("expected IfcHalfSpaceSolid as second clipping operand"); - return; - } - - const IfcPlane* const plane = hs->BaseSurface->ToPtr(); - if(!plane) { - IFCImporter::LogError("expected IfcPlane as base surface for the IfcHalfSpaceSolid"); + const IfcExtrudedAreaSolid* const as = clip->SecondOperand->ResolveSelectPtr(conv.db); + if(!hs && !as) { + IFCImporter::LogError("expected IfcHalfSpaceSolid or IfcExtrudedAreaSolid as second clipping operand"); return; } + TempMesh first_operand; if(const IfcBooleanResult* const op0 = clip->FirstOperand->ResolveSelectPtr(conv.db)) { - ProcessBoolean(*op0,meshout,conv); + ProcessBoolean(*op0,first_operand,conv); } else if (const IfcSweptAreaSolid* const swept = clip->FirstOperand->ResolveSelectPtr(conv.db)) { - ProcessSweptAreaSolid(*swept,meshout,conv); + ProcessSweptAreaSolid(*swept,first_operand,conv); } else { IFCImporter::LogError("expected IfcSweptAreaSolid or IfcBooleanResult as first clipping operand"); return; } - // extract plane base position vector and normal vector - IfcVector3 p,n(0.f,0.f,1.f); - if (plane->Position->Axis) { - ConvertDirection(n,plane->Position->Axis.Get()); + if(hs) { + ProcessBooleanHalfSpaceDifference(hs, result, first_operand, conv); } - ConvertCartesianPoint(p,plane->Position->Location); - - if(!IsTrue(hs->AgreementFlag)) { - n *= -1.f; + else { + ProcessBooleanExtrudedAreaSolidDifference(as, result, first_operand, conv); } - - // clip the current contents of `meshout` against the plane we obtained from the second operand - const std::vector& in = meshout.verts; - std::vector& outvert = result.verts; - std::vector::const_iterator begin=meshout.vertcnt.begin(), end=meshout.vertcnt.end(), iit; - - outvert.reserve(in.size()); - result.vertcnt.reserve(meshout.vertcnt.size()); - - unsigned int vidx = 0; - for(iit = begin; iit != end; vidx += *iit++) { - - unsigned int newcount = 0; - for(unsigned int i = 0; i < *iit; ++i) { - const IfcVector3& e0 = in[vidx+i], e1 = in[vidx+(i+1)%*iit]; - - // does the next segment intersect the plane? - IfcVector3 isectpos; - const Intersect isect = IntersectSegmentPlane(p,n,e0,e1,isectpos); - if (isect == Intersect_No || isect == Intersect_LiesOnPlane) { - if ( (e0-p).Normalize()*n > 0 ) { - outvert.push_back(e0); - ++newcount; - } - } - else if (isect == Intersect_Yes) { - if ( (e0-p).Normalize()*n > 0 ) { - // e0 is on the right side, so keep it - outvert.push_back(e0); - outvert.push_back(isectpos); - newcount += 2; - } - else { - // e0 is on the wrong side, so drop it and keep e1 instead - outvert.push_back(isectpos); - ++newcount; - } - } - } - - if (!newcount) { - continue; - } - - IfcVector3 vmin,vmax; - ArrayBounds(&*(outvert.end()-newcount),newcount,vmin,vmax); - - // filter our IfcFloat points - those may happen if a point lies - // directly on the intersection line. However, due to IfcFloat - // precision a bitwise comparison is not feasible to detect - // this case. - const IfcFloat epsilon = (vmax-vmin).SquareLength() / 1e6f; - FuzzyVectorCompare fz(epsilon); - - std::vector::iterator e = std::unique( outvert.end()-newcount, outvert.end(), fz ); - if (e != outvert.end()) { - newcount -= static_cast(std::distance(e,outvert.end())); - outvert.erase(e,outvert.end()); - } - if (fz(*( outvert.end()-newcount),outvert.back())) { - outvert.pop_back(); - --newcount; - } - if(newcount > 2) { - result.vertcnt.push_back(newcount); - } - else while(newcount-->0)result.verts.pop_back(); - - } - IFCImporter::LogDebug("generating CSG geometry by plane clipping (IfcBooleanClippingResult)"); } else { IFCImporter::LogWarn("skipping unknown IfcBooleanResult entity, type is " + boolean.GetClassName()); } } - - // ------------------------------------------------------------------------------------------------ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector& mesh_indices, ConversionData& conv) From f6f2c087db55303132f33464a90d41f25e6f7cf1 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 21 Oct 2012 17:08:12 +0000 Subject: [PATCH 21/51] - Ifc: skip lines during boolean differentiation between two solids. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1316 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index d841b0a09..b1cd5d14a 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -282,10 +282,12 @@ void ProcessConnectedFaceSet(const IfcConnectedFaceSet& fset, TempMesh& result, TempMesh meshout; BOOST_FOREACH(const IfcFaceBound& bound, face.Bounds) { - // XXX implement proper merging for polygonal loops if(const IfcPolyLoop* const polyloop = bound.Bound->ToPtr()) { if(ProcessPolyloop(*polyloop, meshout,conv)) { + // The outer boundary is better determined by checking which + // polygon covers the largest area. + //if(bound.ToPtr()) { // ob = cnt; //} @@ -298,6 +300,9 @@ void ProcessConnectedFaceSet(const IfcConnectedFaceSet& fset, TempMesh& result, continue; } + // And this, even though it is sometimes TRUE and sometimes FALSE, + // does not really improve results. + /*if(!IsTrue(bound.Orientation)) { size_t c = 0; BOOST_FOREACH(unsigned int& c, meshout.vertcnt) { @@ -305,7 +310,6 @@ void ProcessConnectedFaceSet(const IfcConnectedFaceSet& fset, TempMesh& result, cnt += c; } }*/ - } ProcessPolygonBoundaries(result, meshout); } @@ -1903,6 +1907,17 @@ void ProcessBooleanExtrudedAreaSolidDifference(const IfcExtrudedAreaSolid* as, T temp.verts.insert(temp.verts.end(), vit, vit + pcount); temp.vertcnt.push_back(pcount); + // The algorithms used to generate mesh geometry sometimes + // spit out lines or other degenerates which must be + // filtered to avoid running into assertions later on. + + // ComputePolygonNormal returns the Newell normal, so the + // length of the normal is the area of the polygon. + const IfcVector3& normal = ComputePolygonNormal(temp, false); + if (normal.SquareLength() < static_cast(1e-5)) { + continue; + } + TryAddOpenings_Quadrulate(openings, std::vector(1,IfcVector3(1,0,0)), temp); result.Append(temp); From 7ed1400c687214dbbeb08e7adb585e2a45aafd17 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 21 Oct 2012 18:10:56 +0000 Subject: [PATCH 22/51] - Ifc: better handling of degenerate primitives occuring in clipping operations. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1317 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 48 +++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index b1cd5d14a..1ed13c936 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -546,40 +546,48 @@ void ProcessSweptDiskSolid(const IfcSweptDiskSolid solid, TempMesh& result, Conv } // ------------------------------------------------------------------------------------------------ -IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh) { - +IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok) +{ const std::vector& out = curmesh.verts; IfcMatrix3 m; + ok = true; + const size_t s = out.size(); assert(curmesh.vertcnt.size() == 1 && curmesh.vertcnt.back() == s); const IfcVector3 any_point = out[s-1]; IfcVector3 nor; - // The input polygon is arbitrarily shaped, so we might need some tries - // until we find a suitable normal (and it does not even need to be - // right in all cases, Newell's algorithm would be the correct one ... ). + // The input polygon is arbitrarily shaped, therefore we might need some tries + // until we find a suitable normal. Note that Newells algorithm would give + // a more robust result, but this variant also gives us a suitable first + // axis for the 2D coordinate space on the polygon plane, exploiting the + // fact that the input polygon is nearly always a quad. + bool done = false; size_t base = s-curmesh.vertcnt.back(), i, j; - for (i = base; i < s-1; ++i) { + for (i = base; !done && i < s-1; !done && ++i) { for (j = i+1; j < s; ++j) { nor = -((out[i]-any_point)^(out[j]-any_point)); if(fabs(nor.Length()) > 1e-8f) { - goto out; + done = true; + break; } } } - assert(0); - -out: + if(!done) { + ok = false; + return m; + } nor.Normalize(); IfcVector3 r = (out[i]-any_point); r.Normalize(); - // reconstruct orthonormal basis + // Reconstruct orthonormal basis + // XXX use Gram Schmidt for increased robustness IfcVector3 u = r ^ nor; u.Normalize(); @@ -599,7 +607,8 @@ out: } // ------------------------------------------------------------------------------------------------ -bool TryAddOpenings_Poly2Tri(const std::vector& openings,const std::vector& nors, TempMesh& curmesh) +bool TryAddOpenings_Poly2Tri(const std::vector& openings,const std::vector& nors, + TempMesh& curmesh) { std::vector& out = curmesh.verts; @@ -607,7 +616,12 @@ bool TryAddOpenings_Poly2Tri(const std::vector& openings,const std: // Try to derive a solid base plane within the current surface for use as // working coordinate system. - const IfcMatrix3& m = DerivePlaneCoordinateSpace(curmesh); + bool ok; + const IfcMatrix3& m = DerivePlaneCoordinateSpace(curmesh, ok); + if (!ok) { + return false; + } + const IfcMatrix3 minv = IfcMatrix3(m).Inverse(); const IfcVector3& nor = IfcVector3(m.c1, m.c2, m.c3); @@ -1397,7 +1411,11 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, // Try to derive a solid base plane within the current surface for use as // working coordinate system. - IfcMatrix4 m = IfcMatrix4(DerivePlaneCoordinateSpace(curmesh)); + bool ok; + IfcMatrix4 m = IfcMatrix4(DerivePlaneCoordinateSpace(curmesh,ok)); + if(!ok) { + return false; + } const IfcVector3& nor = IfcVector3(m.c1, m.c2, m.c3); IfcFloat coord = -1; @@ -1924,8 +1942,6 @@ void ProcessBooleanExtrudedAreaSolidDifference(const IfcExtrudedAreaSolid* as, T vit += pcount; } - - IFCImporter::LogDebug("generating CSG geometry by geometric difference to a solid (IfcExtrudedAreaSolid)"); } From 33a50f515a4cd6f7b6e5ded383e39f1fed91c446 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 21 Oct 2012 18:32:25 +0000 Subject: [PATCH 23/51] - Ifc: move some utility functions to TempMesh. Add TempMesh::RemoveDegenerates() method. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1318 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 86 ++-------------------------------- code/IFCUtil.cpp | 109 +++++++++++++++++++++++++++++++++++++++++++ code/IFCUtil.h | 8 ++++ 3 files changed, 120 insertions(+), 83 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 1ed13c936..5d3696cbc 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -98,86 +98,6 @@ bool ProcessPolyloop(const IfcPolyLoop& loop, TempMesh& meshout, ConversionData& return false; } -// ------------------------------------------------------------------------------------------------ -void ComputePolygonNormals(const TempMesh& meshout, std::vector& normals, bool normalize = true, size_t ofs = 0) -{ - size_t max_vcount = 0; - std::vector::const_iterator begin=meshout.vertcnt.begin()+ofs, end=meshout.vertcnt.end(), iit; - for(iit = begin; iit != end; ++iit) { - max_vcount = std::max(max_vcount,static_cast(*iit)); - } - - std::vector temp((max_vcount+2)*4); - normals.reserve( normals.size() + meshout.vertcnt.size()-ofs ); - - // `NewellNormal()` currently has a relatively strange interface and need to - // re-structure things a bit to meet them. - size_t vidx = std::accumulate(meshout.vertcnt.begin(),begin,0); - for(iit = begin; iit != end; vidx += *iit++) { - if (!*iit) { - normals.push_back(IfcVector3()); - continue; - } - for(size_t vofs = 0, cnt = 0; vofs < *iit; ++vofs) { - const IfcVector3& v = meshout.verts[vidx+vofs]; - temp[cnt++] = v.x; - temp[cnt++] = v.y; - temp[cnt++] = v.z; -#ifdef _DEBUG - temp[cnt] = std::numeric_limits::quiet_NaN(); -#endif - ++cnt; - } - - normals.push_back(IfcVector3()); - NewellNormal<4,4,4>(normals.back(),*iit,&temp[0],&temp[1],&temp[2]); - } - - if(normalize) { - BOOST_FOREACH(IfcVector3& n, normals) { - n.Normalize(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Compute the normal of the last polygon in the given mesh -IfcVector3 ComputePolygonNormal(const TempMesh& inmesh, bool normalize = true) -{ - size_t total = inmesh.vertcnt.back(), vidx = inmesh.verts.size() - total; - std::vector temp((total+2)*3); - for(size_t vofs = 0, cnt = 0; vofs < total; ++vofs) { - const IfcVector3& v = inmesh.verts[vidx+vofs]; - temp[cnt++] = v.x; - temp[cnt++] = v.y; - temp[cnt++] = v.z; - } - IfcVector3 nor; - NewellNormal<3,3,3>(nor,total,&temp[0],&temp[1],&temp[2]); - return normalize ? nor.Normalize() : nor; -} - -// ------------------------------------------------------------------------------------------------ -void FixupFaceOrientation(TempMesh& result) -{ - const IfcVector3 vavg = result.Center(); - - std::vector normals; - ComputePolygonNormals(result,normals); - - size_t c = 0, ofs = 0; - BOOST_FOREACH(unsigned int cnt, result.vertcnt) { - if (cnt>2){ - const IfcVector3& thisvert = result.verts[c]; - if (normals[ofs]*(thisvert-vavg) < 0) { - std::reverse(result.verts.begin()+c,result.verts.begin()+cnt+c); - } - } - c += cnt; - ++ofs; - } -} - // ------------------------------------------------------------------------------------------------ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t master_bounds = (size_t)-1) { @@ -206,7 +126,7 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m // first compute newell normals for all polygons // do not normalize 'normals', we need the original length for computing the polygon area std::vector normals; - ComputePolygonNormals(inmesh,normals,false); + inmesh.ComputePolygonNormals(normals,false); // One of the polygons might be a IfcFaceOuterBound (in which case `master_bounds` // is its index). Sadly we can't rely on it, the docs say 'At most one of the bounds @@ -1931,7 +1851,7 @@ void ProcessBooleanExtrudedAreaSolidDifference(const IfcExtrudedAreaSolid* as, T // ComputePolygonNormal returns the Newell normal, so the // length of the normal is the area of the polygon. - const IfcVector3& normal = ComputePolygonNormal(temp, false); + const IfcVector3& normal = temp.ComputeLastPolygonNormal(false); if (normal.SquareLength() < static_cast(1e-5)) { continue; } @@ -2048,7 +1968,7 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector normals; + ComputePolygonNormals(normals); + + std::vector::const_iterator vit = verts.begin(); + for (std::vector::const_iterator it = vertcnt.begin(); it != vertcnt.end();) { + const unsigned int pcount = *it; + + if (normals[std::distance(static_cast::const_iterator>(vertcnt.begin()),it)].SquareLength() < 1e-5f) { + it = vertcnt.erase(it); + vit = verts.erase(vit, vit + pcount); + continue; + } + + vit += pcount; + ++it; + } +} + +// ------------------------------------------------------------------------------------------------ +void TempMesh::ComputePolygonNormals(std::vector& normals, + bool normalize, + size_t ofs) const +{ + size_t max_vcount = 0; + std::vector::const_iterator begin = vertcnt.begin()+ofs, end = vertcnt.end(), iit; + for(iit = begin; iit != end; ++iit) { + max_vcount = std::max(max_vcount,static_cast(*iit)); + } + + std::vector temp((max_vcount+2)*4); + normals.reserve( normals.size() + vertcnt.size()-ofs ); + + // `NewellNormal()` currently has a relatively strange interface and need to + // re-structure things a bit to meet them. + size_t vidx = std::accumulate(vertcnt.begin(),begin,0); + for(iit = begin; iit != end; vidx += *iit++) { + if (!*iit) { + normals.push_back(IfcVector3()); + continue; + } + for(size_t vofs = 0, cnt = 0; vofs < *iit; ++vofs) { + const IfcVector3& v = verts[vidx+vofs]; + temp[cnt++] = v.x; + temp[cnt++] = v.y; + temp[cnt++] = v.z; +#ifdef _DEBUG + temp[cnt] = std::numeric_limits::quiet_NaN(); +#endif + ++cnt; + } + + normals.push_back(IfcVector3()); + NewellNormal<4,4,4>(normals.back(),*iit,&temp[0],&temp[1],&temp[2]); + } + + if(normalize) { + BOOST_FOREACH(IfcVector3& n, normals) { + n.Normalize(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Compute the normal of the last polygon in the given mesh +IfcVector3 TempMesh::ComputeLastPolygonNormal(bool normalize) const +{ + size_t total = vertcnt.back(), vidx = verts.size() - total; + std::vector temp((total+2)*3); + for(size_t vofs = 0, cnt = 0; vofs < total; ++vofs) { + const IfcVector3& v = verts[vidx+vofs]; + temp[cnt++] = v.x; + temp[cnt++] = v.y; + temp[cnt++] = v.z; + } + IfcVector3 nor; + NewellNormal<3,3,3>(nor,total,&temp[0],&temp[1],&temp[2]); + return normalize ? nor.Normalize() : nor; +} + +// ------------------------------------------------------------------------------------------------ +void TempMesh::FixupFaceOrientation() +{ + const IfcVector3 vavg = Center(); + + std::vector normals; + ComputePolygonNormals(normals); + + size_t c = 0, ofs = 0; + BOOST_FOREACH(unsigned int cnt, vertcnt) { + if (cnt>2){ + const IfcVector3& thisvert = verts[c]; + if (normals[ofs]*(thisvert-vavg) < 0) { + std::reverse(verts.begin()+c,verts.begin()+cnt+c); + } + } + c += cnt; + ++ofs; + } +} + // ------------------------------------------------------------------------------------------------ void TempMesh::RemoveAdjacentDuplicates() { diff --git a/code/IFCUtil.h b/code/IFCUtil.h index 517e5d3c1..22cc747fa 100644 --- a/code/IFCUtil.h +++ b/code/IFCUtil.h @@ -183,7 +183,15 @@ struct TempMesh void Transform(const IfcMatrix4& mat); IfcVector3 Center() const; void Append(const TempMesh& other); + void RemoveAdjacentDuplicates(); + void RemoveDegenerates(); + + void FixupFaceOrientation(); + IfcVector3 ComputeLastPolygonNormal(bool normalize = true) const; + void ComputePolygonNormals(std::vector& normals, + bool normalize = true, + size_t ofs = 0) const; }; From a598ac53b4dea7f44d0ff54c7752e23e446d77ab Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 21 Oct 2012 18:52:48 +0000 Subject: [PATCH 24/51] - Ifc: improve robustness towards degenerate geometry. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1319 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 5d3696cbc..3db4735ce 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -123,7 +123,7 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m // for pouring windows out of walls. The algorithm does not handle all // cases but at least it is numerically stable and gives "nice" triangles. - // first compute newell normals for all polygons + // first compute normals for all polygons using Newell's algorithm // do not normalize 'normals', we need the original length for computing the polygon area std::vector normals; inmesh.ComputePolygonNormals(normals,false); @@ -153,7 +153,7 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m const size_t outer_polygon_size = *outer_polygon_it; const IfcVector3& master_normal = normals[std::distance(begin, outer_polygon_it)]; - // generate fake openings to meet the interface for the quadrulate + // Generate fake openings to meet the interface for the quadrulate // algorithm. It boils down to generating small boxes given the // inner polygon and the surface normal of the outer contour. // It is important that we use the outer contour's normal because @@ -170,6 +170,14 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m continue; } + // Filter degenerate polygons to keep them from causing trouble later on + IfcVector3& n = normals[std::distance(begin,iit)]; + const IfcFloat area = n.SquareLength(); + if (area < 1e-5f) { + IFCImporter::LogWarn("skipping degenerate polygon (ProcessPolygonBoundaries)"); + continue; + } + fake_openings.push_back(TempOpening()); TempOpening& opening = fake_openings.back(); @@ -1853,6 +1861,7 @@ void ProcessBooleanExtrudedAreaSolidDifference(const IfcExtrudedAreaSolid* as, T // length of the normal is the area of the polygon. const IfcVector3& normal = temp.ComputeLastPolygonNormal(false); if (normal.SquareLength() < static_cast(1e-5)) { + IFCImporter::LogWarn("skipping degenerate polygon (ProcessBooleanExtrudedAreaSolidDifference)"); continue; } From c3adc004bfdce08cc8e71766a29068066d992cc2 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 21 Oct 2012 19:12:18 +0000 Subject: [PATCH 25/51] - Ifc: always remove degenerate geometry from geometric entities after finishing processing. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1320 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 1 + code/IFCUtil.cpp | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 3db4735ce..f6c7e9b02 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1975,6 +1975,7 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector normals; - ComputePolygonNormals(normals); + ComputePolygonNormals(normals, false); + + bool drop = false; + size_t inor = 0; std::vector::const_iterator vit = verts.begin(); - for (std::vector::const_iterator it = vertcnt.begin(); it != vertcnt.end();) { + for (std::vector::const_iterator it = vertcnt.begin(); it != vertcnt.end(); ++inor) { const unsigned int pcount = *it; - if (normals[std::distance(static_cast::const_iterator>(vertcnt.begin()),it)].SquareLength() < 1e-5f) { + if (normals[inor].SquareLength() < 1e-5f) { it = vertcnt.erase(it); vit = verts.erase(vit, vit + pcount); + + drop = true; continue; } vit += pcount; ++it; } + + if(drop) { + IFCImporter::LogDebug("removing degenerate faces"); + } } // ------------------------------------------------------------------------------------------------ @@ -298,7 +307,7 @@ void TempMesh::RemoveAdjacentDuplicates() base += cnt; } if(drop) { - IFCImporter::LogDebug("removed duplicate vertices"); + IFCImporter::LogDebug("removing duplicate vertices"); } } From d128e3d531d525dc5364ec79dbf82812fa339bea Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 21 Oct 2012 21:50:30 +0000 Subject: [PATCH 26/51] - Ifc: fix projection artifacts during opening generation. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1321 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index f6c7e9b02..ffee5cb6a 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1448,6 +1448,12 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, } BoundingBox bb = BoundingBox(vpmin,vpmax); + + // Skip over very small openings - these are likely projection errors + // (i.e. they don't belong to this side of the wall) + if(fabs(vpmax.x - vpmin.x) * fabs(vpmax.y - vpmin.y) < static_cast(1e-5)) { + continue; + } std::vector joined_openings(1, &opening); // See if this BB intersects any other, in which case we could not use the Quadrify() @@ -1477,7 +1483,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, break; } else { - IFCImporter::LogDebug("merging overlapping openings, this should not happen"); + IFCImporter::LogDebug("merging overlapping openings"); contour.clear(); BOOST_FOREACH(const ClipperLib::IntPoint& point, poly[0].outer) { From 2a580c5518feee80d5823e8346f562a92c0f3472 Mon Sep 17 00:00:00 2001 From: ulfjorensen Date: Thu, 25 Oct 2012 10:28:40 +0000 Subject: [PATCH 27/51] - fixed/changed/worked on issue 3580054 - XFile materials don't have ambient colours, but emissive git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1322 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/ColladaParser.cpp | 7 ++++--- code/XFileImporter.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 49b5eb755..195d0d7ca 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -1369,10 +1369,11 @@ void ColladaParser::ReadEffectColor( aiColor4D& pColor, Sampler& pSampler) int attrTex = GetAttribute( "texture"); pSampler.mName = mReader->getAttributeValue( attrTex); - // get name of UV source channel + // get name of UV source channel. Specification demands it to be there, but some exporters + // don't write it. It will be the default UV channel in case it's missing. attrTex = TestAttribute( "texcoord"); - if( attrTex >= 0 ) - pSampler.mUVChannel = mReader->getAttributeValue( attrTex); + if( attrTex >= 0 ) + pSampler.mUVChannel = mReader->getAttributeValue( attrTex); //SkipElement(); } else if( IsElement( "technique")) diff --git a/code/XFileImporter.cpp b/code/XFileImporter.cpp index b763489f5..d636e6954 100644 --- a/code/XFileImporter.cpp +++ b/code/XFileImporter.cpp @@ -52,7 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; static const aiImporterDesc desc = { - "Collada Importer", + "Direct3D XFile Importer", "", "", "", @@ -594,8 +594,9 @@ void XFileImporter::ConvertMaterials( aiScene* pScene, const std::vectorAddProperty( &shadeMode, 1, AI_MATKEY_SHADING_MODEL); // material colours - // FIX: Setup this as ambient not as emissive color - mat->AddProperty( &oldMat.mEmissive, 1, AI_MATKEY_COLOR_AMBIENT); + // Unclear: there's no ambient colour, but emissive. What to put for ambient? + // Probably nothing at all, let the user select a suitable default. + mat->AddProperty( &oldMat.mEmissive, 1, AI_MATKEY_COLOR_EMISSIVE); mat->AddProperty( &oldMat.mDiffuse, 1, AI_MATKEY_COLOR_DIFFUSE); mat->AddProperty( &oldMat.mSpecular, 1, AI_MATKEY_COLOR_SPECULAR); mat->AddProperty( &oldMat.mSpecularExponent, 1, AI_MATKEY_SHININESS); From 39ae26bfd871c72a83150ea4794d9a6b20033348 Mon Sep 17 00:00:00 2001 From: kimmi Date: Sat, 27 Oct 2012 19:41:56 +0000 Subject: [PATCH 28/51] bugfix : fix level 4 compiler warnings for Visual studio 2012. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1323 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/SMDLoader.cpp | 12 ++++++------ code/STLLoader.cpp | 2 +- code/StringComparison.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/SMDLoader.cpp b/code/SMDLoader.cpp index 3abe862fe..2bc73abec 100644 --- a/code/SMDLoader.cpp +++ b/code/SMDLoader.cpp @@ -684,7 +684,7 @@ void SMDImporter::ParseFile() const char* szCurrent = mBuffer; // read line per line ... - while (true) + for ( ;; ) { if(!SkipSpacesAndLineEnd(szCurrent,&szCurrent)) break; @@ -750,7 +750,7 @@ unsigned int SMDImporter::GetTextureIndex(const std::string& filename) void SMDImporter::ParseNodesSection(const char* szCurrent, const char** szCurrentOut) { - while (true) + for ( ;; ) { // "end\n" - Ends the nodes section if (0 == ASSIMP_strincmp(szCurrent,"end",3) && @@ -772,7 +772,7 @@ void SMDImporter::ParseTrianglesSection(const char* szCurrent, { // Parse a triangle, parse another triangle, parse the next triangle ... // and so on until we reach a token that looks quite similar to "end" - while (true) + for ( ;; ) { if(!SkipSpacesAndLineEnd(szCurrent,&szCurrent)) break; @@ -790,7 +790,7 @@ void SMDImporter::ParseVASection(const char* szCurrent, const char** szCurrentOut) { unsigned int iCurIndex = 0; - while (true) + for ( ;; ) { if(!SkipSpacesAndLineEnd(szCurrent,&szCurrent)) break; @@ -833,7 +833,7 @@ void SMDImporter::ParseSkeletonSection(const char* szCurrent, const char** szCurrentOut) { int iTime = 0; - while (true) + for ( ;; ) { if(!SkipSpacesAndLineEnd(szCurrent,&szCurrent)) break; @@ -887,7 +887,7 @@ void SMDImporter::ParseNodeInfo(const char* szCurrent, else ++szCurrent; const char* szEnd = szCurrent; - while (true) + for ( ;; ) { if (bQuota && '\"' == *szEnd) { diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index e96d38397..2c43b8258 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -203,7 +203,7 @@ void STLImporter::LoadASCIIFile() pMesh->mNormals = new aiVector3D[pMesh->mNumVertices]; unsigned int curFace = 0, curVertex = 3; - while (true) + for ( ;; ) { // go to the next token if(!SkipSpacesAndLineEnd(&sz)) diff --git a/code/StringComparison.h b/code/StringComparison.h index ca6f3e87f..0743c41be 100644 --- a/code/StringComparison.h +++ b/code/StringComparison.h @@ -87,7 +87,7 @@ inline unsigned int ASSIMP_itoa10( char* out, unsigned int max, int32_t number) // print all future zeroes from now mustPrint = true; - *out++ = '0'+digit; + *out++ = '0'+static_cast(digit); ++written; number -= digit*cur; From 11b2219b1af853b8c31a27a1075456f52c7b5262 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Thu, 1 Nov 2012 20:40:45 +0000 Subject: [PATCH 29/51] - Ifc: fix regressions caused by previous commit. This also fixes a bug which caused openings to appear at the wrong place. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1324 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 56 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index ffee5cb6a..47a45c33e 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -69,7 +69,8 @@ namespace Assimp { bool TryAddOpenings_Quadrulate(std::vector& openings, const std::vector& nors, - TempMesh& curmesh); + TempMesh& curmesh, + bool check_intersection = true); // ------------------------------------------------------------------------------------------------ @@ -152,6 +153,8 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m const size_t outer_polygon_size = *outer_polygon_it; const IfcVector3& master_normal = normals[std::distance(begin, outer_polygon_it)]; + const IfcVector3& master_normal_norm = IfcVector3(master_normal).Normalize(); + // Generate fake openings to meet the interface for the quadrulate // algorithm. It boils down to generating small boxes given the @@ -188,7 +191,7 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m opening.profileMesh->verts.reserve(*iit); opening.profileMesh->vertcnt.push_back(*iit); - std::copy(vit, vit + *iit, std::back_inserter(opening.profileMesh->verts)); + std::copy(vit, vit + *iit, std::back_inserter(opening.profileMesh->verts)); } // fill a mesh with ONLY the main polygon @@ -198,7 +201,7 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m std::copy(outer_vit, outer_vit+outer_polygon_size, std::back_inserter(temp.verts)); - TryAddOpenings_Quadrulate(fake_openings, normals, temp); + TryAddOpenings_Quadrulate(fake_openings, normals, temp, false); result.Append(temp); } @@ -474,7 +477,7 @@ void ProcessSweptDiskSolid(const IfcSweptDiskSolid solid, TempMesh& result, Conv } // ------------------------------------------------------------------------------------------------ -IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok) +IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok, IfcFloat* d = NULL) { const std::vector& out = curmesh.verts; IfcMatrix3 m; @@ -514,6 +517,10 @@ IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok) IfcVector3 r = (out[i]-any_point); r.Normalize(); + if(d) { + *d = -any_point * nor; + } + // Reconstruct orthonormal basis // XXX use Gram Schmidt for increased robustness IfcVector3 u = r ^ nor; @@ -1332,7 +1339,8 @@ void CloseWindows(const ContourVector& contours, const IfcMatrix4& minv, // ------------------------------------------------------------------------------------------------ bool TryAddOpenings_Quadrulate(std::vector& openings, const std::vector& nors, - TempMesh& curmesh) + TempMesh& curmesh, + bool check_intersection) { std::vector& out = curmesh.verts; OpeningRefVector contours_to_openings; @@ -1340,7 +1348,8 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, // Try to derive a solid base plane within the current surface for use as // working coordinate system. bool ok; - IfcMatrix4 m = IfcMatrix4(DerivePlaneCoordinateSpace(curmesh,ok)); + IfcFloat base_d; + IfcMatrix4 m = IfcMatrix4(DerivePlaneCoordinateSpace(curmesh,ok,&base_d)); if(!ok) { return false; } @@ -1412,11 +1421,18 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, IfcVector2 vpmin,vpmax; MinMaxChooser()(vpmin,vpmax); + // The opening meshes are real 3D meshes so skip over all faces - // clearly facing into the wrong direction. + // clearly facing into the wrong direction. Also, we need to check + // whether the meshes do actually intersect the base surface plane. + // This is done by recording minimum and maximum values for the + // d component of the plane equation for all polys and checking + // against the surface d. + IfcFloat dmin, dmax; + MinMaxChooser()(dmin,dmax); + std::vector contour; for (size_t f = 0, vi_total = 0, fend = profile_vertcnts.size(); f < fend; ++f) { - const IfcVector3& face_nor = ((profile_verts[vi_total+2] - profile_verts[vi_total]) ^ (profile_verts[vi_total+1] - profile_verts[vi_total])).Normalize(); @@ -1429,6 +1445,12 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, for (unsigned int vi = 0, vend = profile_vertcnts[f]; vi < vend; ++vi, ++vi_total) { const IfcVector3& x = profile_verts[vi_total]; + if(check_intersection) { + const IfcFloat vert_d = -(x * nor); + dmin = std::min(dmin, vert_d); + dmax = std::max(dmax, vert_d); + } + const IfcVector3& v = m * x; IfcVector2 vv(v.x, v.y); @@ -1447,6 +1469,12 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, continue; } + // TODO: This epsilon may be too large + const IfcFloat epsilon = fabs(dmax-dmin) * 0.01; + if (check_intersection && (base_d < dmin-epsilon || base_d > dmax+epsilon)) { + continue; + } + BoundingBox bb = BoundingBox(vpmin,vpmax); // Skip over very small openings - these are likely projection errors @@ -1461,8 +1489,8 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, for (std::vector::iterator it = bbs.begin(); it != bbs.end();) { const BoundingBox& ibb = *it; - if (ibb.first.x <= bb.second.x && ibb.second.x >= bb.first.x && - ibb.first.y <= bb.second.y && ibb.second.y >= bb.second.x) { + if (ibb.first.x < bb.second.x && ibb.second.x > bb.first.x && + ibb.first.y < bb.second.y && ibb.second.y > bb.second.x) { // Take these two contours and try to merge them. If they overlap (which // should not happen, but in fact happens-in-the-real-world [tm] ), @@ -1472,7 +1500,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, ClipperLib::ExPolygons poly; MergeWindowContours(contour, other, poly); - if (poly.size() > 1) { + if (false && poly.size() > 1) { IFCImporter::LogWarn("cannot use quadrify algorithm to generate wall openings due to " "bounding box overlaps, using poly2tri fallback method"); return TryAddOpenings_Poly2Tri(openings, nors, curmesh); @@ -1502,7 +1530,9 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, contours_to_openings.erase(contours_to_openings.begin() + std::distance(bbs.begin(),it)); contours.erase(contours.begin() + std::distance(bbs.begin(),it)); - it = bbs.erase(it); + bbs.erase(it); + + it = bbs.begin(); continue; } } @@ -1545,7 +1575,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, // Most of all, it makes all cases in which adjacent openings are // not correctly merged together glaringly obvious. - // CloseWindows(contours, minv, contours_to_openings, curmesh); + //CloseWindows(contours, minv, contours_to_openings, curmesh); return true; } From 612f67da0a53eb1aafa336002b21f6102900578b Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Thu, 1 Nov 2012 21:36:39 +0000 Subject: [PATCH 30/51] - Ifc: avoid duplicate points in opening contour lines, this sometimes screws up the clipping algorithm. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1325 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 47a45c33e..7e35999d8 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1461,7 +1461,17 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, vpmin = std::min(vpmin,vv); vpmax = std::max(vpmax,vv); - contour.push_back(vv); + // usually there won't be too many elements so the linear time check is ok + bool found = false; + for (std::vector::const_iterator it = contour.begin(); it != contour.end(); ++it) { + if (((*it)-vv).SquareLength() < 1e-5f) { + found = true; + break; + } + } + if(!found) { + contour.push_back(vv); + } } } From ccf629bd196f544b7e869e3e957274ad8b789ee5 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Fri, 2 Nov 2012 03:29:04 +0000 Subject: [PATCH 31/51] - Ifc: allow arbitrary IfcSolidModel entities as difference operands for openings (rather than just IfcExtrudedAreaSolid et al). git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1326 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 45 +++++++++++++++++++++----------------------- code/IFCUtil.h | 4 ++-- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 7e35999d8..4fa4fda06 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1721,18 +1721,6 @@ void ProcessSweptAreaSolid(const IfcSweptAreaSolid& swept, TempMesh& meshout, ConversionData& conv) { if(const IfcExtrudedAreaSolid* const solid = swept.ToPtr()) { - // Do we just collect openings for a parent element (i.e. a wall)? - // In such a case, we generate the polygonal extrusion mesh as usual, - // but attach it to a TempOpening instance which will later be applied - // to the wall it pertains to. - if(conv.collect_openings) { - boost::shared_ptr meshtmp(new TempMesh()); - ProcessExtrudedAreaSolid(*solid,*meshtmp,conv); - - conv.collect_openings->push_back(TempOpening(solid,IfcVector3(0,0,0),meshtmp)); - return; - } - ProcessExtrudedAreaSolid(*solid,meshout,conv); } else if(const IfcRevolvedAreaSolid* const rev = swept.ToPtr()) { @@ -1976,14 +1964,14 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector meshtmp = boost::make_shared(); if(const IfcShellBasedSurfaceModel* shellmod = geo.ToPtr()) { BOOST_FOREACH(boost::shared_ptr shell,shellmod->SbsmBoundary) { try { const EXPRESS::ENTITY& e = shell->To(); const IfcConnectedFaceSet& fs = conv.db.MustGetObject(e).To(); - ProcessConnectedFaceSet(fs,meshtmp,conv); + ProcessConnectedFaceSet(fs,*meshtmp.get(),conv); } catch(std::bad_cast&) { IFCImporter::LogWarn("unexpected type error, IfcShell ought to inherit from IfcConnectedFaceSet"); @@ -1991,25 +1979,25 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vector()) { - ProcessConnectedFaceSet(*fset,meshtmp,conv); + ProcessConnectedFaceSet(*fset,*meshtmp.get(),conv); } else if(const IfcSweptAreaSolid* swept = geo.ToPtr()) { - ProcessSweptAreaSolid(*swept,meshtmp,conv); + ProcessSweptAreaSolid(*swept,*meshtmp.get(),conv); } else if(const IfcSweptDiskSolid* disk = geo.ToPtr()) { - ProcessSweptDiskSolid(*disk,meshtmp,conv); + ProcessSweptDiskSolid(*disk,*meshtmp.get(),conv); fix_orientation = false; } else if(const IfcManifoldSolidBrep* brep = geo.ToPtr()) { - ProcessConnectedFaceSet(brep->Outer,meshtmp,conv); + ProcessConnectedFaceSet(brep->Outer,*meshtmp.get(),conv); } else if(const IfcFaceBasedSurfaceModel* surf = geo.ToPtr()) { BOOST_FOREACH(const IfcConnectedFaceSet& fc, surf->FbsmFaces) { - ProcessConnectedFaceSet(fc,meshtmp,conv); + ProcessConnectedFaceSet(fc,*meshtmp.get(),conv); } } else if(const IfcBooleanResult* boolean = geo.ToPtr()) { - ProcessBoolean(*boolean,meshtmp,conv); + ProcessBoolean(*boolean,*meshtmp.get(),conv); } else if(geo.ToPtr()) { // silently skip over bounding boxes @@ -2020,14 +2008,23 @@ bool ProcessGeometricItem(const IfcRepresentationItem& geo, std::vectorRemoveAdjacentDuplicates(); + meshtmp->RemoveDegenerates(); + + // Do we just collect openings for a parent element (i.e. a wall)? + // In such a case, we generate the polygonal extrusion mesh as usual, + // but attach it to a TempOpening instance which will later be applied + // to the wall it pertains to. + if(conv.collect_openings) { + conv.collect_openings->push_back(TempOpening(geo.ToPtr(),IfcVector3(0,0,0),meshtmp)); + return true; + } if(fix_orientation) { - meshtmp.FixupFaceOrientation(); + meshtmp->FixupFaceOrientation(); } - aiMesh* const mesh = meshtmp.ToMesh(); + aiMesh* const mesh = meshtmp->ToMesh(); if(mesh) { mesh->mMaterialIndex = ProcessMaterials(geo,conv); mesh_indices.push_back(conv.meshes.size()); diff --git a/code/IFCUtil.h b/code/IFCUtil.h index 22cc747fa..6323a032b 100644 --- a/code/IFCUtil.h +++ b/code/IFCUtil.h @@ -76,7 +76,7 @@ struct delete_fun struct TempMesh; struct TempOpening { - const IFC::IfcExtrudedAreaSolid* solid; + const IFC::IfcSolidModel* solid; IfcVector3 extrusionDir; boost::shared_ptr profileMesh; @@ -96,7 +96,7 @@ struct TempOpening } // ------------------------------------------------------------------------------ - TempOpening(const IFC::IfcExtrudedAreaSolid* solid,IfcVector3 extrusionDir,boost::shared_ptr profileMesh) + TempOpening(const IFC::IfcSolidModel* solid,IfcVector3 extrusionDir,boost::shared_ptr profileMesh) : solid(solid) , extrusionDir(extrusionDir) , profileMesh(profileMesh) From 7484dd379c5b6352806dfa7135439efbe3e0168d Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Fri, 2 Nov 2012 04:46:46 +0000 Subject: [PATCH 32/51] - Ifc: revamped Quadrify() version now correctly clips overlapping non-rectangular windows. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1327 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 147 +++++++++++++++++++++++++++---------------- code/IFCUtil.h | 4 ++ 2 files changed, 98 insertions(+), 53 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 4fa4fda06..516c1f8c0 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -959,7 +959,6 @@ typedef std::vector< std::vector > ContourVector; void InsertWindowContours(const std::vector< BoundingBox >& bbs, const ContourVector& contours, const std::vector& openings, - const IfcMatrix4& minv, TempMesh& curmesh) { ai_assert(contours.size() == bbs.size()); @@ -1038,8 +1037,7 @@ void InsertWindowContours(const std::vector< BoundingBox >& bbs, if ((contour[a] - edge).SquareLength() > diag*diag*0.7) { continue; } - const IfcVector3 v3 = minv * IfcVector3(contour[a].x, contour[a].y, 0.0f); - curmesh.verts.push_back(v3); + curmesh.verts.push_back(IfcVector3(contour[a].x, contour[a].y, 0.0f)); } if (edge != contour[last_hit]) { @@ -1060,8 +1058,7 @@ void InsertWindowContours(const std::vector< BoundingBox >& bbs, corner.y = bb.second.y; } - const IfcVector3 v3 = minv * IfcVector3(corner.x, corner.y, 0.0f); - curmesh.verts.push_back(v3); + curmesh.verts.push_back(IfcVector3(corner.x, corner.y, 0.0f)); } else if (cnt == 1) { // avoid degenerate polygons (also known as lines or points) @@ -1167,15 +1164,13 @@ void CleanupWindowContours(ContourVector& contours) } // ------------------------------------------------------------------------------------------------ -void CleanupOuterContour(const std::vector& contour_flat, TempMesh& curmesh, - const IfcMatrix4& minv, - const std::vector& outflat) +void CleanupOuterContour(const std::vector& contour_flat, TempMesh& curmesh) { std::vector vold; std::vector iold; - vold.reserve(outflat.size()); - iold.reserve(outflat.size() / 4); + vold.reserve(curmesh.verts.size()); + iold.reserve(curmesh.vertcnt.size()); // Fix the outer contour using polyclipper try { @@ -1194,14 +1189,21 @@ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& std::reverse(clip.begin(), clip.end()); } - // We need to run polyclipper on every single quad -- we can't run it one all + // We need to run polyclipper on every single polygon -- we can't run it one all // of them at once or it would merge them all together which would undo all // previous steps subject.reserve(4); - size_t cnt = 0; - BOOST_FOREACH(const IfcVector2& pip, outflat) { + size_t index = 0; + size_t countdown = 0; + BOOST_FOREACH(const IfcVector3& pip, curmesh.verts) { + if (!countdown) { + countdown = curmesh.vertcnt[index++]; + if (!countdown) { + continue; + } + } subject.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); - if (!(++cnt % 4)) { + if (--countdown == 0) { if (!ClipperLib::Orientation(subject)) { std::reverse(subject.begin(), subject.end()); } @@ -1214,7 +1216,7 @@ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& BOOST_FOREACH(const ClipperLib::ExPolygon& ex, clipped) { iold.push_back(ex.outer.size()); BOOST_FOREACH(const ClipperLib::IntPoint& point, ex.outer) { - vold.push_back( minv * IfcVector3( + vold.push_back(IfcVector3( from_int64(point.X), from_int64(point.Y), 0.0f)); @@ -1226,19 +1228,12 @@ void CleanupOuterContour(const std::vector& contour_flat, TempMesh& clipper.Clear(); } } - - assert(!(cnt % 4)); } catch (const char* sx) { IFCImporter::LogError("Ifc: error during polygon clipping, wall contour line may be wrong: (Clipper: " + std::string(sx) + ")"); - iold.resize(outflat.size()/4,4); - - BOOST_FOREACH(const IfcVector2& vproj, outflat) { - const IfcVector3 v3 = minv * IfcVector3(vproj.x, vproj.y, static_cast(0.0)); - vold.push_back(v3); - } + return; } // swap data arrays @@ -1336,6 +1331,35 @@ void CloseWindows(const ContourVector& contours, const IfcMatrix4& minv, } } +// ------------------------------------------------------------------------------------------------ +void Quadrify(const std::vector< BoundingBox >& bbs, TempMesh& curmesh) +{ + ai_assert(curmesh.IsEmpty()); + + std::vector quads; + quads.reserve(bbs.size()*4); + + // sort openings by x and y axis as a preliminiary to the QuadrifyPart() algorithm + XYSortedField field; + for (std::vector::const_iterator it = bbs.begin(); it != bbs.end(); ++it) { + if (field.find((*it).first) != field.end()) { + IFCImporter::LogWarn("constraint failure during generation of wall openings, results may be faulty"); + } + field[(*it).first] = std::distance(bbs.begin(),it); + } + + QuadrifyPart(IfcVector2(),IfcVector2(static_cast(1.0),static_cast(1.0)), + field,bbs,quads); + + ai_assert(!(quads.size() % 4)); + + curmesh.vertcnt.resize(quads.size()/4,4); + curmesh.verts.reserve(quads.size()); + BOOST_FOREACH(const IfcVector2& v2, quads) { + curmesh.verts.push_back(IfcVector3(v2.x, v2.y, static_cast(0.0))); + } +} + // ------------------------------------------------------------------------------------------------ bool TryAddOpenings_Quadrulate(std::vector& openings, const std::vector& nors, @@ -1363,7 +1387,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, IfcVector2 vmin, vmax; MinMaxChooser()(vmin, vmax); - // Move all points into the new coordinate system, collecting min/max verts on the way + // Project all points into the new coordinate system, collect min/max verts on the way BOOST_FOREACH(IfcVector3& x, out) { const IfcVector3& vv = m * x; // keep Z offset in the plane coordinate system. Ignoring precision issues @@ -1403,13 +1427,15 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, mult.c4 = -coord; m = mult * m; - // Obtain inverse transform for getting back + // Obtain inverse transform for getting back to world space later on const IfcMatrix4& minv = IfcMatrix4(m).Inverse(); - // Compute bounding boxes for the projections of all openings + // Compute bounding boxes for all 2D openings in projection space std::vector< BoundingBox > bbs; ContourVector contours; + std::vector temp_contour; + size_t c = 0; BOOST_FOREACH(TempOpening& opening,openings) { std::vector profile_verts = opening.profileMesh->verts; @@ -1427,11 +1453,11 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, // whether the meshes do actually intersect the base surface plane. // This is done by recording minimum and maximum values for the // d component of the plane equation for all polys and checking - // against the surface d. + // against surface d. IfcFloat dmin, dmax; MinMaxChooser()(dmin,dmax); - std::vector contour; + temp_contour.clear(); for (size_t f = 0, vi_total = 0, fend = profile_vertcnts.size(); f < fend; ++f) { const IfcVector3& face_nor = ((profile_verts[vi_total+2] - profile_verts[vi_total]) ^ (profile_verts[vi_total+1] - profile_verts[vi_total])).Normalize(); @@ -1462,20 +1488,20 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, vpmax = std::max(vpmax,vv); // usually there won't be too many elements so the linear time check is ok - bool found = false; - for (std::vector::const_iterator it = contour.begin(); it != contour.end(); ++it) { - if (((*it)-vv).SquareLength() < 1e-5f) { + bool found = false; + BOOST_FOREACH(const IfcVector2& cp, temp_contour) { + if ((cp-vv).SquareLength() < 1e-5f) { found = true; break; } - } + } if(!found) { - contour.push_back(vv); + temp_contour.push_back(vv); } } } - if(contour.size() <= 2) { + if(temp_contour.size() <= 2) { continue; } @@ -1508,8 +1534,10 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, const std::vector& other = contours[std::distance(bbs.begin(),it)]; ClipperLib::ExPolygons poly; - MergeWindowContours(contour, other, poly); + MergeWindowContours(temp_contour, other, poly); + // TODO: Commented because it causes more visible artifacts than + // it solves. if (false && poly.size() > 1) { IFCImporter::LogWarn("cannot use quadrify algorithm to generate wall openings due to " "bounding box overlaps, using poly2tri fallback method"); @@ -1517,19 +1545,19 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, } else if (poly.size() == 0) { IFCImporter::LogWarn("ignoring duplicate opening"); - contour.clear(); + temp_contour.clear(); break; } else { IFCImporter::LogDebug("merging overlapping openings"); - contour.clear(); + temp_contour.clear(); BOOST_FOREACH(const ClipperLib::IntPoint& point, poly[0].outer) { IfcVector2 vv = IfcVector2( from_int64(point.X), from_int64(point.Y)); vv = std::max(vv,IfcVector2()); vv = std::min(vv,one_vec); - contour.push_back( vv ); + temp_contour.push_back( vv ); } bb.first = std::min(bb.first, ibb.first); @@ -1549,37 +1577,50 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, ++it; } - if(!contour.empty()) { + if(!temp_contour.empty()) { contours_to_openings.push_back(std::vector( joined_openings.begin(), joined_openings.end())); - contours.push_back(contour); + contours.push_back(temp_contour); bbs.push_back(bb); } } + // Check if we still have any openings left - it may well be that this is + // not the cause, for example if all the opening candidates don't intersect + // this surface or point into a direction perpendicular to it. if (bbs.empty()) { return false; } - XYSortedField field; - for (std::vector::iterator it = bbs.begin(); it != bbs.end(); ++it) { - if (field.find((*it).first) != field.end()) { - IFCImporter::LogWarn("constraint failure during generation of wall openings, results may be faulty"); - } - field[(*it).first] = std::distance(bbs.begin(),it); - } + curmesh.Clear(); - std::vector outflat; - outflat.reserve(openings.size()*4); - QuadrifyPart(IfcVector2(0.f,0.f),IfcVector2(1.f,1.f),field,bbs,outflat); - ai_assert(!(outflat.size() % 4)); + // Generate a base subdivision into quads to accommodate the given list + // of window bounding boxes. + Quadrify(bbs,curmesh); - CleanupOuterContour(contour_flat, curmesh, minv,outflat); + // Run a sanity cleanup pass on the window contours to avoid generating + // artifacts during the contour generation phase later on. CleanupWindowContours(contours); - InsertWindowContours(bbs,contours,openings, minv,curmesh); + + // Previously we reduced all windows to rectangular AABBs in projection + // space, now it is time to fill the gaps between the BBs and the real + // window openings. + InsertWindowContours(bbs,contours,openings, curmesh); + + // Clip the entire outer contour of our current result against the real + // outer contour of the surface. This is necessary because the result + // of the Quadrify() algorithm is always a square area spanning + // over [0,1]^2 (i.e. entire projection space). + CleanupOuterContour(contour_flat, curmesh); + + // Undo the projection and get back to world (or local object) space + BOOST_FOREACH(IfcVector3& v3, curmesh.verts) { + v3 = minv * v3; + } + // TODO: // This should connect the window openings on both sides of the wall, // but it produces lots of artifacts which are not resolved yet. // Most of all, it makes all cases in which adjacent openings are diff --git a/code/IFCUtil.h b/code/IFCUtil.h index 6323a032b..aa835f270 100644 --- a/code/IFCUtil.h +++ b/code/IFCUtil.h @@ -184,6 +184,10 @@ struct TempMesh IfcVector3 Center() const; void Append(const TempMesh& other); + bool IsEmpty() const { + return verts.empty() && vertcnt.empty(); + } + void RemoveAdjacentDuplicates(); void RemoveDegenerates(); From 1553bd91f68165148383158a113d5f18832915bd Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Fri, 2 Nov 2012 23:56:38 +0000 Subject: [PATCH 33/51] - Ifc: work on generating proper closing caps for openings generated by doing a boolean difference. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1328 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 99 +++++++++++++++++++++++++++----------------- 1 file changed, 62 insertions(+), 37 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index 516c1f8c0..a1c4886c2 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -67,10 +67,11 @@ namespace Assimp { #define one_vec (IfcVector2(static_cast(1.0),static_cast(1.0))) - bool TryAddOpenings_Quadrulate(std::vector& openings, + bool GenerateOpenings(std::vector& openings, const std::vector& nors, TempMesh& curmesh, - bool check_intersection = true); + bool check_intersection = true, + bool generate_connection_geometry = true); // ------------------------------------------------------------------------------------------------ @@ -201,7 +202,7 @@ void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t m std::copy(outer_vit, outer_vit+outer_polygon_size, std::back_inserter(temp.verts)); - TryAddOpenings_Quadrulate(fake_openings, normals, temp, false); + GenerateOpenings(fake_openings, normals, temp, false, false); result.Append(temp); } @@ -1251,13 +1252,14 @@ void CloseWindows(const ContourVector& contours, const IfcMatrix4& minv, { // For all contour points, check if one of the assigned openings does // already have points assigned to it. In this case, assume this is - // the second side of the wall and generate connections between - // the two holes in order to close the window margin. + // the other side of the wall and generate connections between + // the two holes in order to close the window. // All this gets complicated by the fact that contours may pertain to - // multiple openings. The code is based on the assumption that this - // relationship is identical on both sides of the wall. If this is - // not the case, wrong geometry may be generated. + // multiple openings(due to merging of adjacent or overlapping openings). + // The code is based on the assumption that this happens symmetrically + // on both sides of the wall. If it doesn't (which would be a bug anyway) + // wrong geometry may be generated. for (ContourVector::const_iterator it = contours.begin(), end = contours.end(); it != end; ++it) { if ((*it).empty()) { continue; @@ -1275,15 +1277,17 @@ void CloseWindows(const ContourVector& contours, const IfcMatrix4& minv, const ContourVector::value_type::const_iterator cbegin = (*it).begin(), cend = (*it).end(); if (has_other_side) { + curmesh.verts.reserve(curmesh.verts.size() + (*it).size() * 4); + curmesh.vertcnt.reserve(curmesh.vertcnt.size() + (*it).size()); + // XXX this algorithm is really a bit inefficient - both in terms // of constant factor and of asymptotic runtime. - std::vector::const_iterator vstart; + size_t vstart; for (ContourVector::value_type::const_iterator cit = cbegin; cit != cend; ++cit) { const IfcVector2& proj_point = *cit; const IfcVector3& world_point = minv * IfcVector3(proj_point.x,proj_point.y,0.0f); - unsigned int i = 0; IfcFloat best = static_cast(1e10); IfcVector3 bestv; @@ -1294,10 +1298,13 @@ void CloseWindows(const ContourVector& contours, const IfcMatrix4& minv, bestv = other; best = sqdist; } - ++i; } } + if (cit == cbegin) { + vstart = curmesh.verts.size(); + } + curmesh.verts.push_back(world_point); curmesh.verts.push_back(bestv); @@ -1305,17 +1312,14 @@ void CloseWindows(const ContourVector& contours, const IfcMatrix4& minv, if (cit != cbegin) { - curmesh.verts.push_back(world_point); curmesh.verts.push_back(bestv); + curmesh.verts.push_back(world_point); if (cit == cend - 1) { - curmesh.verts.push_back(*(vstart)); - curmesh.verts.push_back(*(vstart+1)); + curmesh.verts.push_back(curmesh.verts[vstart]); + curmesh.verts.push_back(curmesh.verts[vstart+1]); } } - else { - vstart = curmesh.verts.end() - 2; - } } } else { @@ -1361,10 +1365,11 @@ void Quadrify(const std::vector< BoundingBox >& bbs, TempMesh& curmesh) } // ------------------------------------------------------------------------------------------------ -bool TryAddOpenings_Quadrulate(std::vector& openings, +bool GenerateOpenings(std::vector& openings, const std::vector& nors, TempMesh& curmesh, - bool check_intersection) + bool check_intersection, + bool generate_connection_geometry) { std::vector& out = curmesh.verts; OpeningRefVector contours_to_openings; @@ -1407,7 +1412,8 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, } // Further improve the projection by mapping the entire working set into - // [0,1] range + // [0,1] range. This gives us a consistent data range so all epsilons + // used below can be constants. vmax -= vmin; BOOST_FOREACH(IfcVector2& vv, contour_flat) { vv.x = (vv.x - vmin.x) / vmax.x; @@ -1430,7 +1436,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, // Obtain inverse transform for getting back to world space later on const IfcMatrix4& minv = IfcMatrix4(m).Inverse(); - // Compute bounding boxes for all 2D openings in projection space + // Compute bounding boxes for all 2D openings in projection space: std::vector< BoundingBox > bbs; ContourVector contours; @@ -1487,7 +1493,7 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, vpmin = std::min(vpmin,vv); vpmax = std::max(vpmax,vv); - // usually there won't be too many elements so the linear time check is ok + // sanity check for duplicate vertices bool found = false; BOOST_FOREACH(const IfcVector2& cp, temp_contour) { if ((cp-vv).SquareLength() < 1e-5f) { @@ -1525,8 +1531,8 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, for (std::vector::iterator it = bbs.begin(); it != bbs.end();) { const BoundingBox& ibb = *it; - if (ibb.first.x < bb.second.x && ibb.second.x > bb.first.x && - ibb.first.y < bb.second.y && ibb.second.y > bb.second.x) { + if (ibb.first.x <= bb.second.x && ibb.second.x >= bb.first.x && + ibb.first.y <= bb.second.y && ibb.second.y >= bb.first.y) { // Take these two contours and try to merge them. If they overlap (which // should not happen, but in fact happens-in-the-real-world [tm] ), @@ -1557,19 +1563,35 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, vv = std::max(vv,IfcVector2()); vv = std::min(vv,one_vec); - temp_contour.push_back( vv ); + // sanity check for duplicate vertices + bool found = false; + BOOST_FOREACH(const IfcVector2& cp, temp_contour) { + if ((cp-vv).SquareLength() < 1e-5f) { + found = true; + break; + } + } + if(!found) { + temp_contour.push_back(vv); + } } bb.first = std::min(bb.first, ibb.first); bb.second = std::max(bb.second, ibb.second); - std::vector& t = contours_to_openings[std::distance(bbs.begin(),it)]; - joined_openings.insert(joined_openings.end(), t.begin(), t.end()); + if (generate_connection_geometry) { + std::vector& t = contours_to_openings[std::distance(bbs.begin(),it)]; + joined_openings.insert(joined_openings.end(), t.begin(), t.end()); + + contours_to_openings.erase(contours_to_openings.begin() + std::distance(bbs.begin(),it)); + } - contours_to_openings.erase(contours_to_openings.begin() + std::distance(bbs.begin(),it)); contours.erase(contours.begin() + std::distance(bbs.begin(),it)); bbs.erase(it); + // restart from scratch because the newly formed BB might now + // overlap any other BB which its constituent BBs didn't + // previously overlap. it = bbs.begin(); continue; } @@ -1578,9 +1600,11 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, } if(!temp_contour.empty()) { - contours_to_openings.push_back(std::vector( - joined_openings.begin(), - joined_openings.end())); + if (generate_connection_geometry) { + contours_to_openings.push_back(std::vector( + joined_openings.begin(), + joined_openings.end())); + } contours.push_back(temp_contour); bbs.push_back(bb); @@ -1625,8 +1649,9 @@ bool TryAddOpenings_Quadrulate(std::vector& openings, // but it produces lots of artifacts which are not resolved yet. // Most of all, it makes all cases in which adjacent openings are // not correctly merged together glaringly obvious. - - //CloseWindows(contours, minv, contours_to_openings, curmesh); + if (generate_connection_geometry) { + CloseWindows(contours, minv, contours_to_openings, curmesh); + } return true; } @@ -1721,7 +1746,7 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul out.push_back(in[next]); if(openings) { - if(TryAddOpenings_Quadrulate(*conv.apply_openings,nors,temp)) { + if(GenerateOpenings(*conv.apply_openings,nors,temp)) { ++sides_with_openings; } @@ -1740,7 +1765,7 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul curmesh.vertcnt.push_back(size); if(openings && size > 2) { - if(TryAddOpenings_Quadrulate(*conv.apply_openings,nors,temp)) { + if(GenerateOpenings(*conv.apply_openings,nors,temp)) { ++sides_with_v_openings; } @@ -1750,7 +1775,7 @@ void ProcessExtrudedAreaSolid(const IfcExtrudedAreaSolid& solid, TempMesh& resul } } - if(openings && ((sides_with_openings != 2 && sides_with_openings) || (sides_with_v_openings != 2 && sides_with_v_openings))) { + if(openings && ((sides_with_openings == 1 && sides_with_openings) || (sides_with_v_openings == 2 && sides_with_v_openings))) { IFCImporter::LogWarn("failed to resolve all openings, presumably their topology is not supported by Assimp"); } @@ -1940,7 +1965,7 @@ void ProcessBooleanExtrudedAreaSolidDifference(const IfcExtrudedAreaSolid* as, T continue; } - TryAddOpenings_Quadrulate(openings, std::vector(1,IfcVector3(1,0,0)), temp); + GenerateOpenings(openings, std::vector(1,IfcVector3(1,0,0)), temp); result.Append(temp); vit += pcount; From 3f38d91e881add9fec976af10d1e763af0f805ac Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sat, 3 Nov 2012 00:43:28 +0000 Subject: [PATCH 34/51] - Ifc: further improvements to opening caps algorithm. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1329 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCGeometry.cpp | 72 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 13 deletions(-) diff --git a/code/IFCGeometry.cpp b/code/IFCGeometry.cpp index a1c4886c2..4f2a987ee 100644 --- a/code/IFCGeometry.cpp +++ b/code/IFCGeometry.cpp @@ -1282,15 +1282,25 @@ void CloseWindows(const ContourVector& contours, const IfcMatrix4& minv, // XXX this algorithm is really a bit inefficient - both in terms // of constant factor and of asymptotic runtime. - size_t vstart; + size_t vstart = curmesh.verts.size(); + bool outer_border = false; + IfcVector2 last_proj_point; + + const IfcFloat border_epsilon_upper = static_cast(1-1e-4); + const IfcFloat border_epsilon_lower = static_cast(1e-4); + + bool start_is_outer_border = false; + for (ContourVector::value_type::const_iterator cit = cbegin; cit != cend; ++cit) { - const IfcVector2& proj_point = *cit; - const IfcVector3& world_point = minv * IfcVector3(proj_point.x,proj_point.y,0.0f); + // Locate the closest opposite point. This should be a good heuristic to + // connect only the points that are really intended to be connected. IfcFloat best = static_cast(1e10); IfcVector3 bestv; + const IfcVector3& world_point = minv * IfcVector3(proj_point.x,proj_point.y,0.0f); + BOOST_FOREACH(const TempOpening* opening, refs) { BOOST_FOREACH(const IfcVector3& other, opening->wallPoints) { const IfcFloat sqdist = (world_point - other).SquareLength(); @@ -1301,23 +1311,59 @@ void CloseWindows(const ContourVector& contours, const IfcMatrix4& minv, } } - if (cit == cbegin) { - vstart = curmesh.verts.size(); + // Check if this connection is along the outer boundary of the projection + // plane. In such a case we better drop it because such 'edges' should + // not have any geometry to close them (think of door openings). + bool drop_this_edge = false; + if (proj_point.x <= border_epsilon_lower || proj_point.x >= border_epsilon_upper || + proj_point.y <= border_epsilon_lower || proj_point.y >= border_epsilon_upper) { + + if (outer_border) { + ai_assert(cit != cbegin); + if (fabs((proj_point.x - last_proj_point.x) * (proj_point.y - last_proj_point.y)) < 1e-5f) { + drop_this_edge = true; + + curmesh.verts.pop_back(); + curmesh.verts.pop_back(); + } + } + else if (cit == cbegin) { + start_is_outer_border = true; + } + outer_border = true; + } + else { + outer_border = false; } - curmesh.verts.push_back(world_point); - curmesh.verts.push_back(bestv); - - curmesh.vertcnt.push_back(4); - - if (cit != cbegin) { + last_proj_point = proj_point; + if (!drop_this_edge) { curmesh.verts.push_back(bestv); curmesh.verts.push_back(world_point); + curmesh.vertcnt.push_back(4); + } + + if (cit != cbegin) { + curmesh.verts.push_back(world_point); + curmesh.verts.push_back(bestv); + if (cit == cend - 1) { - curmesh.verts.push_back(curmesh.verts[vstart]); - curmesh.verts.push_back(curmesh.verts[vstart+1]); + + // Check if the final connection (last to first element) is itself + // a border edge that needs to be dropped. + if (start_is_outer_border && outer_border && + fabs((proj_point.x - (*cbegin).x) * (proj_point.y - (*cbegin).y)) < 1e-5f) { + + curmesh.vertcnt.pop_back(); + curmesh.verts.pop_back(); + curmesh.verts.pop_back(); + } + else { + curmesh.verts.push_back(curmesh.verts[vstart]); + curmesh.verts.push_back(curmesh.verts[vstart+1]); + } } } } From 54040901f03f6c310a8028210c6148cd9a415dd4 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sat, 3 Nov 2012 02:49:19 +0000 Subject: [PATCH 35/51] - update Assimp.NET git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1330 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- include/assimp/defs.h | 5 + port/Assimp.NET/Assimp.NET/AssimpSwigPort.i | 105 +- .../Assimp.NET/AssimpSwigPort_wrap.cxx | 5948 +++++++++-------- .../Assimp.NET_CS/Assimp.NET_CS.csproj | 17 +- port/Assimp.NET/Assimp.NET_CS/Assimp.cs | 67 +- .../Assimp.NET/Assimp.NET_CS/AssimpPINVOKE.cs | 1180 ++-- port/Assimp.NET/Assimp.NET_CS/FloatVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/Importer.cs | 48 +- .../Assimp.NET_CS/ProgressHandler.cs | 2 +- .../SWIGTYPE_p_Assimp__BaseImporter.cs | 27 + .../SWIGTYPE_p_Assimp__ImporterPimpl.cs | 27 + .../SWIGTYPE_p_aiImporterDesc.cs | 27 + .../Assimp.NET_CS/SWIGTYPE_p_float.cs | 27 + .../Assimp.NET_CS/SWIGTYPE_p_std__string.cs | 2 +- .../Assimp.NET_CS/SWIGTYPE_p_void.cs | 27 + port/Assimp.NET/Assimp.NET_CS/UintVector.cs | 2 +- .../Assimp.NET_CS/aiAnimBehaviour.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiAnimMesh.cs | 2 +- .../Assimp.NET_CS/aiAnimMeshVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiAnimation.cs | 2 +- .../Assimp.NET_CS/aiAnimationVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiBlendMode.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiBone.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiBoneVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiCamera.cs | 2 +- .../Assimp.NET_CS/aiCameraVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiColor3D.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiColor4D.cs | 2 +- .../Assimp.NET_CS/aiColor4DVector.cs | 2 +- .../Assimp.NET_CS/aiColor4DVectorVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiComponent.cs | 2 +- .../Assimp.NET_CS/aiDefaultLogStream.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiFace.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiFaceVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiLight.cs | 2 +- .../Assimp.NET_CS/aiLightSourceType.cs | 2 +- .../Assimp.NET/Assimp.NET_CS/aiLightVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiMaterial.cs | 45 +- .../Assimp.NET_CS/aiMaterialProperty.cs | 2 +- .../Assimp.NET_CS/aiMaterialVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiMatrix3x3.cs | 32 +- port/Assimp.NET/Assimp.NET_CS/aiMatrix4x4.cs | 32 +- port/Assimp.NET/Assimp.NET_CS/aiMemoryInfo.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiMesh.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiMeshAnim.cs | 2 +- .../Assimp.NET_CS/aiMeshAnimVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiMeshKey.cs | 2 +- .../Assimp.NET_CS/aiMeshKeyVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiMeshVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiNode.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiNodeAnim.cs | 2 +- .../Assimp.NET_CS/aiNodeAnimVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiNodeVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiOrigin.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiPlane.cs | 2 +- .../Assimp.NET_CS/aiPostProcessSteps.cs | 6 +- .../Assimp.NET_CS/aiPrimitiveType.cs | 2 +- .../Assimp.NET_CS/aiPropertyTypeInfo.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiQuatKey.cs | 2 +- .../Assimp.NET_CS/aiQuatKeyVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiQuaternion.cs | 4 +- port/Assimp.NET/Assimp.NET_CS/aiRay.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiReturn.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiScene.cs | 13 +- .../Assimp.NET/Assimp.NET_CS/aiShadingMode.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiString.cs | 7 +- port/Assimp.NET/Assimp.NET_CS/aiTexel.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiTexture.cs | 2 +- .../Assimp.NET_CS/aiTextureFlags.cs | 2 +- .../Assimp.NET_CS/aiTextureMapMode.cs | 2 +- .../Assimp.NET_CS/aiTextureMapping.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiTextureOp.cs | 2 +- .../Assimp.NET/Assimp.NET_CS/aiTextureType.cs | 2 +- .../Assimp.NET_CS/aiTextureVector.cs | 2 +- .../Assimp.NET/Assimp.NET_CS/aiUVTransform.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiVector2D.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiVector3D.cs | 2 +- .../Assimp.NET_CS/aiVector3DVector.cs | 2 +- .../Assimp.NET_CS/aiVector3DVectorVector.cs | 2 +- port/Assimp.NET/Assimp.NET_CS/aiVectorKey.cs | 2 +- .../Assimp.NET_CS/aiVectorKeyVector.cs | 2 +- .../Assimp.NET_CS/aiVertexWeight.cs | 2 +- .../Assimp.NET_CS/aiVertexWeightVector.cs | 2 +- port/Assimp.NET/Assimp.NET_DEMO/AssimpView.cs | 2 +- 84 files changed, 4243 insertions(+), 3531 deletions(-) create mode 100644 port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_Assimp__BaseImporter.cs create mode 100644 port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_Assimp__ImporterPimpl.cs create mode 100644 port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_aiImporterDesc.cs create mode 100644 port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_float.cs create mode 100644 port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_void.cs diff --git a/include/assimp/defs.h b/include/assimp/defs.h index 4d85e618f..200add7a5 100644 --- a/include/assimp/defs.h +++ b/include/assimp/defs.h @@ -135,6 +135,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Tells the compiler that a function never returns. Used in code analysis * to skip dead paths (e.g. after an assertion evaluated to false). */ # define AI_WONT_RETURN __declspec(noreturn) + +#elif defined(SWIG) + + /* Do nothing, the relevant defines are all in AssimpSwigPort.i */ + #else # define AI_WONT_RETURN diff --git a/port/Assimp.NET/Assimp.NET/AssimpSwigPort.i b/port/Assimp.NET/Assimp.NET/AssimpSwigPort.i index 38d79b76a..681b4f1a1 100644 --- a/port/Assimp.NET/Assimp.NET/AssimpSwigPort.i +++ b/port/Assimp.NET/Assimp.NET/AssimpSwigPort.i @@ -43,38 +43,39 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. %include "carrays.i" %include "typemaps.i" %{ -#include "..\..\..\include\aiDefines.h" -#include "..\..\..\include\aiConfig.h" -#include "..\..\..\include\aiTypes.h" -#include "..\..\..\include\aiVersion.h" -#include "..\..\..\include\aiPostProcess.h" -#include "..\..\..\include\aiVector2D.h" -#include "..\..\..\include\aiVector3D.h" -#include "..\..\..\include\aiColor4D.h" -#include "..\..\..\include\aiMatrix3x3.h" -#include "..\..\..\include\aiMatrix4x4.h" -#include "..\..\..\include\aiCamera.h" -#include "..\..\..\include\aiLight.h" -#include "..\..\..\include\aiAnim.h" -#include "..\..\..\include\aiMesh.h" -#include "..\..\..\include\aiFileIO.h" -#include "..\..\..\include\aiMaterial.h" -#include "..\..\..\include\aiQuaternion.h" -#include "..\..\..\include\aiScene.h" -#include "..\..\..\include\aiTexture.h" -#include "..\..\..\include\assimp.hpp" -#include "..\..\..\include\IOSystem.h" -#include "..\..\..\include\IOStream.h" -#include "..\..\..\include\Logger.h" -#include "..\..\..\include\LogStream.h" -#include "..\..\..\include\NullLogger.h" -#include "..\..\..\include\ProgressHandler.h" +#include "..\..\..\include\assimp\defs.h" +#include "..\..\..\include\assimp\config.h" +#include "..\..\..\include\assimp\types.h" +#include "..\..\..\include\assimp\version.h" +#include "..\..\..\include\assimp\postprocess.h" +#include "..\..\..\include\assimp\vector2.h" +#include "..\..\..\include\assimp\vector3.h" +#include "..\..\..\include\assimp\color4.h" +#include "..\..\..\include\assimp\matrix3x3.h" +#include "..\..\..\include\assimp\matrix4x4.h" +#include "..\..\..\include\assimp\camera.h" +#include "..\..\..\include\assimp\light.h" +#include "..\..\..\include\assimp\anim.h" +#include "..\..\..\include\assimp\mesh.h" +#include "..\..\..\include\assimp\cfileio.h" +#include "..\..\..\include\assimp\material.h" +#include "..\..\..\include\assimp\quaternion.h" +#include "..\..\..\include\assimp\scene.h" +#include "..\..\..\include\assimp\texture.h" +#include "..\..\..\include\assimp\Importer.hpp" +#include "..\..\..\include\assimp\IOSystem.hpp" +#include "..\..\..\include\assimp\IOStream.hpp" +#include "..\..\..\include\assimp\Logger.hpp" +#include "..\..\..\include\assimp\LogStream.hpp" +#include "..\..\..\include\assimp\NullLogger.hpp" +#include "..\..\..\include\assimp\ProgressHandler.hpp" %} #define C_STRUCT #define C_ENUM #define ASSIMP_API #define PACK_STRUCT +#define AI_FORCE_INLINE %rename(__add__) operator+; %rename(__addnset__) operator+=; @@ -504,33 +505,43 @@ ASSIMP_POINTER_POINTER(aiScene,aiTexture,mTextures,$self->mNumTextures); %ignore ::aiGetMaterialTexture; -%include "..\..\..\include\aiDefines.h" -%include "..\..\..\include\aiConfig.h" -%include "..\..\..\include\aiTypes.h" -%include "..\..\..\include\aiVersion.h" -%include "..\..\..\include\aiPostProcess.h" -%include "..\..\..\include\aiVector2D.h" -%include "..\..\..\include\aiVector3D.h" -%include "..\..\..\include\aiColor4D.h" -%include "..\..\..\include\aiMatrix3x3.h" -%include "..\..\..\include\aiMatrix4x4.h" -%include "..\..\..\include\aiCamera.h" -%include "..\..\..\include\aiLight.h" -%include "..\..\..\include\aiAnim.h" -%include "..\..\..\include\aiMesh.h" -%include "..\..\..\include\aiFileIO.h" -%include "..\..\..\include\aiMaterial.h" -%include "..\..\..\include\aiQuaternion.h" -%include "..\..\..\include\aiScene.h" -%include "..\..\..\include\aiTexture.h" -%include "..\..\..\include\assimp.hpp" -%include "..\..\..\include\ProgressHandler.h" +%include "..\..\..\include\assimp\defs.h" +%include "..\..\..\include\assimp\config.h" +%include "..\..\..\include\assimp\types.h" +%include "..\..\..\include\assimp\version.h" +%include "..\..\..\include\assimp\postprocess.h" +%include "..\..\..\include\assimp\vector2.h" +%include "..\..\..\include\assimp\vector3.h" +%include "..\..\..\include\assimp\color4.h" +%include "..\..\..\include\assimp\matrix3x3.h" +%include "..\..\..\include\assimp\matrix4x4.h" +%include "..\..\..\include\assimp\camera.h" +%include "..\..\..\include\assimp\light.h" +%include "..\..\..\include\assimp\anim.h" +%include "..\..\..\include\assimp\mesh.h" +%include "..\..\..\include\assimp\cfileio.h" +%include "..\..\..\include\assimp\material.h" +%include "..\..\..\include\assimp\quaternion.h" +%include "..\..\..\include\assimp\scene.h" +%include "..\..\..\include\assimp\texture.h" +%include "..\..\..\include\assimp\Importer.hpp" +%include "..\..\..\include\assimp\ProgressHandler.hpp" //%include "..\..\..\include\IOSystem.h" //%include "..\..\..\include\IOStream.h" //%include "..\..\..\include\Logger.h" //%include "..\..\..\include\LogStream.h" //%include "..\..\..\include\NullLogger.h" + +%template(aiColor4D) aiColor4t; + +%template(aiVector3D) aiVector3t; +%template(aiVector2D) aiVector2t; + +%template(aiQuaternion) aiQuaterniont; +%template(aiMatrix3x3) aiMatrix3x3t; +%template(aiMatrix4x4) aiMatrix4x4t; + %template(FloatVector) std::vector; %template(UintVector) std::vector; %template(aiAnimationVector) std::vector; diff --git a/port/Assimp.NET/Assimp.NET/AssimpSwigPort_wrap.cxx b/port/Assimp.NET/Assimp.NET/AssimpSwigPort_wrap.cxx index 34f8bb0c4..650552373 100644 --- a/port/Assimp.NET/Assimp.NET/AssimpSwigPort_wrap.cxx +++ b/port/Assimp.NET/Assimp.NET/AssimpSwigPort_wrap.cxx @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -280,32 +280,32 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_Assimp(SWIG_CSharpStringH #define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } else -#include "..\..\..\include\aiDefines.h" -#include "..\..\..\include\aiConfig.h" -#include "..\..\..\include\aiTypes.h" -#include "..\..\..\include\aiVersion.h" -#include "..\..\..\include\aiPostProcess.h" -#include "..\..\..\include\aiVector2D.h" -#include "..\..\..\include\aiVector3D.h" -#include "..\..\..\include\aiColor4D.h" -#include "..\..\..\include\aiMatrix3x3.h" -#include "..\..\..\include\aiMatrix4x4.h" -#include "..\..\..\include\aiCamera.h" -#include "..\..\..\include\aiLight.h" -#include "..\..\..\include\aiAnim.h" -#include "..\..\..\include\aiMesh.h" -#include "..\..\..\include\aiFileIO.h" -#include "..\..\..\include\aiMaterial.h" -#include "..\..\..\include\aiQuaternion.h" -#include "..\..\..\include\aiScene.h" -#include "..\..\..\include\aiTexture.h" -#include "..\..\..\include\assimp.hpp" -#include "..\..\..\include\IOSystem.h" -#include "..\..\..\include\IOStream.h" -#include "..\..\..\include\Logger.h" -#include "..\..\..\include\LogStream.h" -#include "..\..\..\include\NullLogger.h" -#include "..\..\..\include\ProgressHandler.h" +#include "..\..\..\include\assimp\defs.h" +#include "..\..\..\include\assimp\config.h" +#include "..\..\..\include\assimp\types.h" +#include "..\..\..\include\assimp\version.h" +#include "..\..\..\include\assimp\postprocess.h" +#include "..\..\..\include\assimp\vector2.h" +#include "..\..\..\include\assimp\vector3.h" +#include "..\..\..\include\assimp\color4.h" +#include "..\..\..\include\assimp\matrix3x3.h" +#include "..\..\..\include\assimp\matrix4x4.h" +#include "..\..\..\include\assimp\camera.h" +#include "..\..\..\include\assimp\light.h" +#include "..\..\..\include\assimp\anim.h" +#include "..\..\..\include\assimp\mesh.h" +#include "..\..\..\include\assimp\cfileio.h" +#include "..\..\..\include\assimp\material.h" +#include "..\..\..\include\assimp\quaternion.h" +#include "..\..\..\include\assimp\scene.h" +#include "..\..\..\include\assimp\texture.h" +#include "..\..\..\include\assimp\Importer.hpp" +#include "..\..\..\include\assimp\IOSystem.hpp" +#include "..\..\..\include\assimp\IOStream.hpp" +#include "..\..\..\include\assimp\Logger.hpp" +#include "..\..\..\include\assimp\LogStream.hpp" +#include "..\..\..\include\assimp\NullLogger.hpp" +#include "..\..\..\include\assimp\ProgressHandler.hpp" #include @@ -1432,52 +1432,52 @@ SWIGINTERN bool std_vector_Sl_aiCamera_Sm__Sg__Remove(std::vector< aiCamera * > return false; } SWIGINTERN std::vector< std::vector< aiColor4D * > > *new_std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg___SWIG_2(int capacity){ - std::vector< std::vector< aiColor4D * > >* pv = 0; + std::vector< std::vector< aiColor4t< float > * > >* pv = 0; if (capacity >= 0) { - pv = new std::vector< std::vector< aiColor4D * > >(); + pv = new std::vector< std::vector< aiColor4t< float > * > >(); pv->reserve(capacity); } else { throw std::out_of_range("capacity"); } return pv; } -SWIGINTERN std::vector< aiColor4D * > std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__getitemcopy(std::vector< std::vector< aiColor4D * > > *self,int index){ +SWIGINTERN std::vector< aiColor4t< float > * > std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__getitemcopy(std::vector< std::vector< aiColor4D * > > *self,int index){ if (index>=0 && index<(int)self->size()) return (*self)[index]; else throw std::out_of_range("index"); } -SWIGINTERN std::vector< std::vector< aiColor4D * > >::const_reference std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__getitem(std::vector< std::vector< aiColor4D * > > *self,int index){ +SWIGINTERN std::vector< std::vector< aiColor4t< float > * > >::const_reference std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__getitem(std::vector< std::vector< aiColor4D * > > *self,int index){ if (index>=0 && index<(int)self->size()) return (*self)[index]; else throw std::out_of_range("index"); } -SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__setitem(std::vector< std::vector< aiColor4D * > > *self,int index,std::vector< aiColor4D * > const &val){ +SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__setitem(std::vector< std::vector< aiColor4D * > > *self,int index,std::vector< aiColor4t< float > * > const &val){ if (index>=0 && index<(int)self->size()) (*self)[index] = val; else throw std::out_of_range("index"); } -SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__AddRange(std::vector< std::vector< aiColor4D * > > *self,std::vector< std::vector< aiColor4D * > > const &values){ +SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__AddRange(std::vector< std::vector< aiColor4D * > > *self,std::vector< std::vector< aiColor4t< float > * > > const &values){ self->insert(self->end(), values.begin(), values.end()); } -SWIGINTERN std::vector< std::vector< aiColor4D * > > *std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__GetRange(std::vector< std::vector< aiColor4D * > > *self,int index,int count){ +SWIGINTERN std::vector< std::vector< aiColor4t< float > * > > *std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__GetRange(std::vector< std::vector< aiColor4D * > > *self,int index,int count){ if (index < 0) throw std::out_of_range("index"); if (count < 0) throw std::out_of_range("count"); if (index >= (int)self->size()+1 || index+count > (int)self->size()) throw std::invalid_argument("invalid range"); - return new std::vector< std::vector< aiColor4D * > >(self->begin()+index, self->begin()+index+count); + return new std::vector< std::vector< aiColor4t< float > * > >(self->begin()+index, self->begin()+index+count); } -SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__Insert(std::vector< std::vector< aiColor4D * > > *self,int index,std::vector< aiColor4D * > const &x){ +SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__Insert(std::vector< std::vector< aiColor4D * > > *self,int index,std::vector< aiColor4t< float > * > const &x){ if (index>=0 && index<(int)self->size()+1) self->insert(self->begin()+index, x); else throw std::out_of_range("index"); } -SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__InsertRange(std::vector< std::vector< aiColor4D * > > *self,int index,std::vector< std::vector< aiColor4D * > > const &values){ +SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__InsertRange(std::vector< std::vector< aiColor4D * > > *self,int index,std::vector< std::vector< aiColor4t< float > * > > const &values){ if (index>=0 && index<(int)self->size()+1) self->insert(self->begin()+index, values.begin(), values.end()); else @@ -1498,10 +1498,10 @@ SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__RemoveRange(st throw std::invalid_argument("invalid range"); self->erase(self->begin()+index, self->begin()+index+count); } -SWIGINTERN std::vector< std::vector< aiColor4D * > > *std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__Repeat(std::vector< aiColor4D * > const &value,int count){ +SWIGINTERN std::vector< std::vector< aiColor4t< float > * > > *std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__Repeat(std::vector< aiColor4t< float > * > const &value,int count){ if (count < 0) throw std::out_of_range("count"); - return new std::vector< std::vector< aiColor4D * > >(count, value); + return new std::vector< std::vector< aiColor4t< float > * > >(count, value); } SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__Reverse__SWIG_0(std::vector< std::vector< aiColor4D * > > *self){ std::reverse(self->begin(), self->end()); @@ -1515,7 +1515,7 @@ SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__Reverse__SWIG_ throw std::invalid_argument("invalid range"); std::reverse(self->begin()+index, self->begin()+index+count); } -SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__SetRange(std::vector< std::vector< aiColor4D * > > *self,int index,std::vector< std::vector< aiColor4D * > > const &values){ +SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__SetRange(std::vector< std::vector< aiColor4D * > > *self,int index,std::vector< std::vector< aiColor4t< float > * > > const &values){ if (index < 0) throw std::out_of_range("index"); if (index+values.size() > self->size()) @@ -1523,52 +1523,52 @@ SWIGINTERN void std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__SetRange(std:: std::copy(values.begin(), values.end(), self->begin()+index); } SWIGINTERN std::vector< aiColor4D * > *new_std_vector_Sl_aiColor4D_Sm__Sg___SWIG_2(int capacity){ - std::vector< aiColor4D * >* pv = 0; + std::vector< aiColor4t< float > * >* pv = 0; if (capacity >= 0) { - pv = new std::vector< aiColor4D * >(); + pv = new std::vector< aiColor4t< float > * >(); pv->reserve(capacity); } else { throw std::out_of_range("capacity"); } return pv; } -SWIGINTERN aiColor4D *std_vector_Sl_aiColor4D_Sm__Sg__getitemcopy(std::vector< aiColor4D * > *self,int index){ +SWIGINTERN aiColor4t< float > *std_vector_Sl_aiColor4D_Sm__Sg__getitemcopy(std::vector< aiColor4D * > *self,int index){ if (index>=0 && index<(int)self->size()) return (*self)[index]; else throw std::out_of_range("index"); } -SWIGINTERN std::vector< aiColor4D * >::const_reference std_vector_Sl_aiColor4D_Sm__Sg__getitem(std::vector< aiColor4D * > *self,int index){ +SWIGINTERN std::vector< aiColor4t< float > * >::const_reference std_vector_Sl_aiColor4D_Sm__Sg__getitem(std::vector< aiColor4D * > *self,int index){ if (index>=0 && index<(int)self->size()) return (*self)[index]; else throw std::out_of_range("index"); } -SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__setitem(std::vector< aiColor4D * > *self,int index,aiColor4D *const &val){ +SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__setitem(std::vector< aiColor4D * > *self,int index,aiColor4t< float > *const &val){ if (index>=0 && index<(int)self->size()) (*self)[index] = val; else throw std::out_of_range("index"); } -SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__AddRange(std::vector< aiColor4D * > *self,std::vector< aiColor4D * > const &values){ +SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__AddRange(std::vector< aiColor4D * > *self,std::vector< aiColor4t< float > * > const &values){ self->insert(self->end(), values.begin(), values.end()); } -SWIGINTERN std::vector< aiColor4D * > *std_vector_Sl_aiColor4D_Sm__Sg__GetRange(std::vector< aiColor4D * > *self,int index,int count){ +SWIGINTERN std::vector< aiColor4t< float > * > *std_vector_Sl_aiColor4D_Sm__Sg__GetRange(std::vector< aiColor4D * > *self,int index,int count){ if (index < 0) throw std::out_of_range("index"); if (count < 0) throw std::out_of_range("count"); if (index >= (int)self->size()+1 || index+count > (int)self->size()) throw std::invalid_argument("invalid range"); - return new std::vector< aiColor4D * >(self->begin()+index, self->begin()+index+count); + return new std::vector< aiColor4t< float > * >(self->begin()+index, self->begin()+index+count); } -SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__Insert(std::vector< aiColor4D * > *self,int index,aiColor4D *const &x){ +SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__Insert(std::vector< aiColor4D * > *self,int index,aiColor4t< float > *const &x){ if (index>=0 && index<(int)self->size()+1) self->insert(self->begin()+index, x); else throw std::out_of_range("index"); } -SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__InsertRange(std::vector< aiColor4D * > *self,int index,std::vector< aiColor4D * > const &values){ +SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__InsertRange(std::vector< aiColor4D * > *self,int index,std::vector< aiColor4t< float > * > const &values){ if (index>=0 && index<(int)self->size()+1) self->insert(self->begin()+index, values.begin(), values.end()); else @@ -1589,10 +1589,10 @@ SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__RemoveRange(std::vector< aiColor throw std::invalid_argument("invalid range"); self->erase(self->begin()+index, self->begin()+index+count); } -SWIGINTERN std::vector< aiColor4D * > *std_vector_Sl_aiColor4D_Sm__Sg__Repeat(aiColor4D *const &value,int count){ +SWIGINTERN std::vector< aiColor4t< float > * > *std_vector_Sl_aiColor4D_Sm__Sg__Repeat(aiColor4t< float > *const &value,int count){ if (count < 0) throw std::out_of_range("count"); - return new std::vector< aiColor4D * >(count, value); + return new std::vector< aiColor4t< float > * >(count, value); } SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__Reverse__SWIG_0(std::vector< aiColor4D * > *self){ std::reverse(self->begin(), self->end()); @@ -1606,32 +1606,32 @@ SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__Reverse__SWIG_1(std::vector< aiC throw std::invalid_argument("invalid range"); std::reverse(self->begin()+index, self->begin()+index+count); } -SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__SetRange(std::vector< aiColor4D * > *self,int index,std::vector< aiColor4D * > const &values){ +SWIGINTERN void std_vector_Sl_aiColor4D_Sm__Sg__SetRange(std::vector< aiColor4D * > *self,int index,std::vector< aiColor4t< float > * > const &values){ if (index < 0) throw std::out_of_range("index"); if (index+values.size() > self->size()) throw std::out_of_range("index"); std::copy(values.begin(), values.end(), self->begin()+index); } -SWIGINTERN bool std_vector_Sl_aiColor4D_Sm__Sg__Contains(std::vector< aiColor4D * > *self,aiColor4D *const &value){ +SWIGINTERN bool std_vector_Sl_aiColor4D_Sm__Sg__Contains(std::vector< aiColor4D * > *self,aiColor4t< float > *const &value){ return std::find(self->begin(), self->end(), value) != self->end(); } -SWIGINTERN int std_vector_Sl_aiColor4D_Sm__Sg__IndexOf(std::vector< aiColor4D * > *self,aiColor4D *const &value){ +SWIGINTERN int std_vector_Sl_aiColor4D_Sm__Sg__IndexOf(std::vector< aiColor4D * > *self,aiColor4t< float > *const &value){ int index = -1; - std::vector< aiColor4D * >::iterator it = std::find(self->begin(), self->end(), value); + std::vector< aiColor4t< float > * >::iterator it = std::find(self->begin(), self->end(), value); if (it != self->end()) index = (int)(it - self->begin()); return index; } -SWIGINTERN int std_vector_Sl_aiColor4D_Sm__Sg__LastIndexOf(std::vector< aiColor4D * > *self,aiColor4D *const &value){ +SWIGINTERN int std_vector_Sl_aiColor4D_Sm__Sg__LastIndexOf(std::vector< aiColor4D * > *self,aiColor4t< float > *const &value){ int index = -1; - std::vector< aiColor4D * >::reverse_iterator rit = std::find(self->rbegin(), self->rend(), value); + std::vector< aiColor4t< float > * >::reverse_iterator rit = std::find(self->rbegin(), self->rend(), value); if (rit != self->rend()) index = (int)(self->rend() - 1 - rit); return index; } -SWIGINTERN bool std_vector_Sl_aiColor4D_Sm__Sg__Remove(std::vector< aiColor4D * > *self,aiColor4D *const &value){ - std::vector< aiColor4D * >::iterator it = std::find(self->begin(), self->end(), value); +SWIGINTERN bool std_vector_Sl_aiColor4D_Sm__Sg__Remove(std::vector< aiColor4D * > *self,aiColor4t< float > *const &value){ + std::vector< aiColor4t< float > * >::iterator it = std::find(self->begin(), self->end(), value); if (it != self->end()) { self->erase(it); return true; @@ -2799,52 +2799,52 @@ SWIGINTERN bool std_vector_Sl_aiTexture_Sm__Sg__Remove(std::vector< aiTexture * return false; } SWIGINTERN std::vector< aiVector3D * > *new_std_vector_Sl_aiVector3D_Sm__Sg___SWIG_2(int capacity){ - std::vector< aiVector3D * >* pv = 0; + std::vector< aiVector3t< float > * >* pv = 0; if (capacity >= 0) { - pv = new std::vector< aiVector3D * >(); + pv = new std::vector< aiVector3t< float > * >(); pv->reserve(capacity); } else { throw std::out_of_range("capacity"); } return pv; } -SWIGINTERN aiVector3D *std_vector_Sl_aiVector3D_Sm__Sg__getitemcopy(std::vector< aiVector3D * > *self,int index){ +SWIGINTERN aiVector3t< float > *std_vector_Sl_aiVector3D_Sm__Sg__getitemcopy(std::vector< aiVector3D * > *self,int index){ if (index>=0 && index<(int)self->size()) return (*self)[index]; else throw std::out_of_range("index"); } -SWIGINTERN std::vector< aiVector3D * >::const_reference std_vector_Sl_aiVector3D_Sm__Sg__getitem(std::vector< aiVector3D * > *self,int index){ +SWIGINTERN std::vector< aiVector3t< float > * >::const_reference std_vector_Sl_aiVector3D_Sm__Sg__getitem(std::vector< aiVector3D * > *self,int index){ if (index>=0 && index<(int)self->size()) return (*self)[index]; else throw std::out_of_range("index"); } -SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__setitem(std::vector< aiVector3D * > *self,int index,aiVector3D *const &val){ +SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__setitem(std::vector< aiVector3D * > *self,int index,aiVector3t< float > *const &val){ if (index>=0 && index<(int)self->size()) (*self)[index] = val; else throw std::out_of_range("index"); } -SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__AddRange(std::vector< aiVector3D * > *self,std::vector< aiVector3D * > const &values){ +SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__AddRange(std::vector< aiVector3D * > *self,std::vector< aiVector3t< float > * > const &values){ self->insert(self->end(), values.begin(), values.end()); } -SWIGINTERN std::vector< aiVector3D * > *std_vector_Sl_aiVector3D_Sm__Sg__GetRange(std::vector< aiVector3D * > *self,int index,int count){ +SWIGINTERN std::vector< aiVector3t< float > * > *std_vector_Sl_aiVector3D_Sm__Sg__GetRange(std::vector< aiVector3D * > *self,int index,int count){ if (index < 0) throw std::out_of_range("index"); if (count < 0) throw std::out_of_range("count"); if (index >= (int)self->size()+1 || index+count > (int)self->size()) throw std::invalid_argument("invalid range"); - return new std::vector< aiVector3D * >(self->begin()+index, self->begin()+index+count); + return new std::vector< aiVector3t< float > * >(self->begin()+index, self->begin()+index+count); } -SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__Insert(std::vector< aiVector3D * > *self,int index,aiVector3D *const &x){ +SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__Insert(std::vector< aiVector3D * > *self,int index,aiVector3t< float > *const &x){ if (index>=0 && index<(int)self->size()+1) self->insert(self->begin()+index, x); else throw std::out_of_range("index"); } -SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__InsertRange(std::vector< aiVector3D * > *self,int index,std::vector< aiVector3D * > const &values){ +SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__InsertRange(std::vector< aiVector3D * > *self,int index,std::vector< aiVector3t< float > * > const &values){ if (index>=0 && index<(int)self->size()+1) self->insert(self->begin()+index, values.begin(), values.end()); else @@ -2865,10 +2865,10 @@ SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__RemoveRange(std::vector< aiVect throw std::invalid_argument("invalid range"); self->erase(self->begin()+index, self->begin()+index+count); } -SWIGINTERN std::vector< aiVector3D * > *std_vector_Sl_aiVector3D_Sm__Sg__Repeat(aiVector3D *const &value,int count){ +SWIGINTERN std::vector< aiVector3t< float > * > *std_vector_Sl_aiVector3D_Sm__Sg__Repeat(aiVector3t< float > *const &value,int count){ if (count < 0) throw std::out_of_range("count"); - return new std::vector< aiVector3D * >(count, value); + return new std::vector< aiVector3t< float > * >(count, value); } SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__Reverse__SWIG_0(std::vector< aiVector3D * > *self){ std::reverse(self->begin(), self->end()); @@ -2882,32 +2882,32 @@ SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__Reverse__SWIG_1(std::vector< ai throw std::invalid_argument("invalid range"); std::reverse(self->begin()+index, self->begin()+index+count); } -SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__SetRange(std::vector< aiVector3D * > *self,int index,std::vector< aiVector3D * > const &values){ +SWIGINTERN void std_vector_Sl_aiVector3D_Sm__Sg__SetRange(std::vector< aiVector3D * > *self,int index,std::vector< aiVector3t< float > * > const &values){ if (index < 0) throw std::out_of_range("index"); if (index+values.size() > self->size()) throw std::out_of_range("index"); std::copy(values.begin(), values.end(), self->begin()+index); } -SWIGINTERN bool std_vector_Sl_aiVector3D_Sm__Sg__Contains(std::vector< aiVector3D * > *self,aiVector3D *const &value){ +SWIGINTERN bool std_vector_Sl_aiVector3D_Sm__Sg__Contains(std::vector< aiVector3D * > *self,aiVector3t< float > *const &value){ return std::find(self->begin(), self->end(), value) != self->end(); } -SWIGINTERN int std_vector_Sl_aiVector3D_Sm__Sg__IndexOf(std::vector< aiVector3D * > *self,aiVector3D *const &value){ +SWIGINTERN int std_vector_Sl_aiVector3D_Sm__Sg__IndexOf(std::vector< aiVector3D * > *self,aiVector3t< float > *const &value){ int index = -1; - std::vector< aiVector3D * >::iterator it = std::find(self->begin(), self->end(), value); + std::vector< aiVector3t< float > * >::iterator it = std::find(self->begin(), self->end(), value); if (it != self->end()) index = (int)(it - self->begin()); return index; } -SWIGINTERN int std_vector_Sl_aiVector3D_Sm__Sg__LastIndexOf(std::vector< aiVector3D * > *self,aiVector3D *const &value){ +SWIGINTERN int std_vector_Sl_aiVector3D_Sm__Sg__LastIndexOf(std::vector< aiVector3D * > *self,aiVector3t< float > *const &value){ int index = -1; - std::vector< aiVector3D * >::reverse_iterator rit = std::find(self->rbegin(), self->rend(), value); + std::vector< aiVector3t< float > * >::reverse_iterator rit = std::find(self->rbegin(), self->rend(), value); if (rit != self->rend()) index = (int)(self->rend() - 1 - rit); return index; } -SWIGINTERN bool std_vector_Sl_aiVector3D_Sm__Sg__Remove(std::vector< aiVector3D * > *self,aiVector3D *const &value){ - std::vector< aiVector3D * >::iterator it = std::find(self->begin(), self->end(), value); +SWIGINTERN bool std_vector_Sl_aiVector3D_Sm__Sg__Remove(std::vector< aiVector3D * > *self,aiVector3t< float > *const &value){ + std::vector< aiVector3t< float > * >::iterator it = std::find(self->begin(), self->end(), value); if (it != self->end()) { self->erase(it); return true; @@ -2930,7 +2930,7 @@ SWIGINTERN std::vector< aiVector3D * > std_vector_Sl_std_vector_Sl_aiVector3D_Sm else throw std::out_of_range("index"); } -SWIGINTERN std::vector< std::vector< aiVector3D * > >::const_reference std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__getitem(std::vector< std::vector< aiVector3D * > > *self,int index){ +SWIGINTERN std::vector< std::vector< aiVector3t< float > * > >::const_reference std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__getitem(std::vector< std::vector< aiVector3D * > > *self,int index){ if (index>=0 && index<(int)self->size()) return (*self)[index]; else @@ -3312,6 +3312,26 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_GLOB_MEASURE_TIME_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_PP_SBBC_MAX_BONES_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("PP_SBBC_MAX_BONES"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_AI_SBBC_DEFAULT_MAX_BONES_get() { + int jresult ; + int result; + + result = (int)(60); + jresult = result; + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE_get() { char * jresult ; char *result = 0 ; @@ -3322,6 +3342,16 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_PP_CT_TEXTURE_CHANNEL_INDEX_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("PP_CT_TEXTURE_CHANNEL_INDEX"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE_get() { char * jresult ; char *result = 0 ; @@ -3452,6 +3482,36 @@ SWIGEXPORT int SWIGSTDCALL CSharp_AI_LMW_MAX_WEIGHTS_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_PP_DB_THRESHOLD_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("PP_DB_THRESHOLD"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT double SWIGSTDCALL CSharp_AI_DEBONE_THRESHOLD_get() { + double jresult ; + double result; + + result = (double)(1.0); + jresult = result; + return jresult; +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_PP_DB_ALL_OR_NONE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("PP_DB_ALL_OR_NONE"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_PP_ICL_PTCACHE_SIZE_get() { int jresult ; int result; @@ -3772,6 +3832,46 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_IMPORT_OGRE_MATERIAL_FILE_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION_get() { + char * jresult ; + char *result = 0 ; + + result = (char *)("IMPORT_IFC_CUSTOM_TRIANGULATION"); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT unsigned long SWIGSTDCALL CSharp_MAXLEN_get() { unsigned long jresult ; size_t result; @@ -4373,6 +4473,18 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiString___nequal__(void * jarg1, voi } +SWIGEXPORT char * SWIGSTDCALL CSharp_aiString_C_Str(void * jarg1) { + char * jresult ; + aiString *arg1 = (aiString *) 0 ; + char *result = 0 ; + + arg1 = (aiString *)jarg1; + result = (char *)((aiString const *)arg1)->C_Str(); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_aiString_Length_set(void * jarg1, unsigned long jarg2) { aiString *arg1 = (aiString *) 0 ; size_t arg2 ; @@ -4726,2182 +4838,6 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiGetCompileFlags() { } -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector2D__SWIG_0() { - void * jresult ; - aiVector2D *result = 0 ; - - result = (aiVector2D *)new aiVector2D(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector2D__SWIG_1(float jarg1, float jarg2) { - void * jresult ; - float arg1 ; - float arg2 ; - aiVector2D *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (float)jarg2; - result = (aiVector2D *)new aiVector2D(arg1,arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector2D__SWIG_2(float jarg1) { - void * jresult ; - float arg1 ; - aiVector2D *result = 0 ; - - arg1 = (float)jarg1; - result = (aiVector2D *)new aiVector2D(arg1); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector2D__SWIG_3(void * jarg1) { - void * jresult ; - aiVector2D *arg1 = 0 ; - aiVector2D *result = 0 ; - - arg1 = (aiVector2D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = (aiVector2D *)new aiVector2D((aiVector2D const &)*arg1); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiVector2D_Set(void * jarg1, float jarg2, float jarg3) { - aiVector2D *arg1 = (aiVector2D *) 0 ; - float arg2 ; - float arg3 ; - - arg1 = (aiVector2D *)jarg1; - arg2 = (float)jarg2; - arg3 = (float)jarg3; - (arg1)->Set(arg2,arg3); -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector2D_SquareLength(void * jarg1) { - float jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - float result; - - arg1 = (aiVector2D *)jarg1; - result = (float)((aiVector2D const *)arg1)->SquareLength(); - jresult = result; - return jresult; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector2D_Length(void * jarg1) { - float jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - float result; - - arg1 = (aiVector2D *)jarg1; - result = (float)((aiVector2D const *)arg1)->Length(); - jresult = result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D_Normalize(void * jarg1) { - void * jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - aiVector2D *result = 0 ; - - arg1 = (aiVector2D *)jarg1; - result = (aiVector2D *) &(arg1)->Normalize(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D___addnset__(void * jarg1, void * jarg2) { - void * jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - aiVector2D *arg2 = 0 ; - aiVector2D *result = 0 ; - - arg1 = (aiVector2D *)jarg1; - arg2 = (aiVector2D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = (aiVector2D *) &(arg1)->operator +=((aiVector2D const &)*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D___subnset__(void * jarg1, void * jarg2) { - void * jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - aiVector2D *arg2 = 0 ; - aiVector2D *result = 0 ; - - arg1 = (aiVector2D *)jarg1; - arg2 = (aiVector2D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = (aiVector2D *) &(arg1)->operator -=((aiVector2D const &)*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D___mulnset__(void * jarg1, float jarg2) { - void * jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - float arg2 ; - aiVector2D *result = 0 ; - - arg1 = (aiVector2D *)jarg1; - arg2 = (float)jarg2; - result = (aiVector2D *) &(arg1)->operator *=(arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D___divnset__(void * jarg1, float jarg2) { - void * jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - float arg2 ; - aiVector2D *result = 0 ; - - arg1 = (aiVector2D *)jarg1; - arg2 = (float)jarg2; - result = (aiVector2D *) &(arg1)->operator /=(arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector2D___idx____SWIG_0(void * jarg1, unsigned int jarg2) { - float jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - unsigned int arg2 ; - float result; - - arg1 = (aiVector2D *)jarg1; - arg2 = (unsigned int)jarg2; - result = (float)((aiVector2D const *)arg1)->operator [](arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector2D___equal__(void * jarg1, void * jarg2) { - unsigned int jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - aiVector2D *arg2 = 0 ; - bool result; - - arg1 = (aiVector2D *)jarg1; - arg2 = (aiVector2D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = (bool)((aiVector2D const *)arg1)->operator ==((aiVector2D const &)*arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector2D___nequal__(void * jarg1, void * jarg2) { - unsigned int jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - aiVector2D *arg2 = 0 ; - bool result; - - arg1 = (aiVector2D *)jarg1; - arg2 = (aiVector2D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = (bool)((aiVector2D const *)arg1)->operator !=((aiVector2D const &)*arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D___set__(void * jarg1, float jarg2) { - void * jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - float arg2 ; - aiVector2D *result = 0 ; - - arg1 = (aiVector2D *)jarg1; - arg2 = (float)jarg2; - result = (aiVector2D *) &(arg1)->operator =(arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D_SymMul(void * jarg1, void * jarg2) { - void * jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - aiVector2D *arg2 = 0 ; - aiVector2D result; - - arg1 = (aiVector2D *)jarg1; - arg2 = (aiVector2D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = (arg1)->SymMul((aiVector2D const &)*arg2); - jresult = new aiVector2D((const aiVector2D &)result); - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiVector2D_x_set(void * jarg1, float jarg2) { - aiVector2D *arg1 = (aiVector2D *) 0 ; - float arg2 ; - - arg1 = (aiVector2D *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->x = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector2D_x_get(void * jarg1) { - float jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - float result; - - arg1 = (aiVector2D *)jarg1; - result = (float) ((arg1)->x); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiVector2D_y_set(void * jarg1, float jarg2) { - aiVector2D *arg1 = (aiVector2D *) 0 ; - float arg2 ; - - arg1 = (aiVector2D *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->y = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector2D_y_get(void * jarg1) { - float jresult ; - aiVector2D *arg1 = (aiVector2D *) 0 ; - float result; - - arg1 = (aiVector2D *)jarg1; - result = (float) ((arg1)->y); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiVector2D(void * jarg1) { - aiVector2D *arg1 = (aiVector2D *) 0 ; - - arg1 = (aiVector2D *)jarg1; - delete arg1; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp___add__(void * jarg1, void * jarg2) { - void * jresult ; - aiVector2D *arg1 = 0 ; - aiVector2D *arg2 = 0 ; - aiVector2D result; - - arg1 = (aiVector2D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - arg2 = (aiVector2D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = operator +((aiVector2D const &)*arg1,(aiVector2D const &)*arg2); - jresult = new aiVector2D((const aiVector2D &)result); - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp___sub____SWIG_0(void * jarg1, void * jarg2) { - void * jresult ; - aiVector2D *arg1 = 0 ; - aiVector2D *arg2 = 0 ; - aiVector2D result; - - arg1 = (aiVector2D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - arg2 = (aiVector2D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = operator -((aiVector2D const &)*arg1,(aiVector2D const &)*arg2); - jresult = new aiVector2D((const aiVector2D &)result); - return jresult; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp___mul____SWIG_0(void * jarg1, void * jarg2) { - float jresult ; - aiVector2D *arg1 = 0 ; - aiVector2D *arg2 = 0 ; - float result; - - arg1 = (aiVector2D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - arg2 = (aiVector2D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = (float)operator *((aiVector2D const &)*arg1,(aiVector2D const &)*arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp___mul____SWIG_1(float jarg1, void * jarg2) { - void * jresult ; - float arg1 ; - aiVector2D *arg2 = 0 ; - aiVector2D result; - - arg1 = (float)jarg1; - arg2 = (aiVector2D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = operator *(arg1,(aiVector2D const &)*arg2); - jresult = new aiVector2D((const aiVector2D &)result); - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp___mul____SWIG_2(void * jarg1, float jarg2) { - void * jresult ; - aiVector2D *arg1 = 0 ; - float arg2 ; - aiVector2D result; - - arg1 = (aiVector2D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - arg2 = (float)jarg2; - result = operator *((aiVector2D const &)*arg1,arg2); - jresult = new aiVector2D((const aiVector2D &)result); - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp___div____SWIG_0(void * jarg1, float jarg2) { - void * jresult ; - aiVector2D *arg1 = 0 ; - float arg2 ; - aiVector2D result; - - arg1 = (aiVector2D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - arg2 = (float)jarg2; - result = operator /((aiVector2D const &)*arg1,arg2); - jresult = new aiVector2D((const aiVector2D &)result); - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp___div____SWIG_1(void * jarg1, void * jarg2) { - void * jresult ; - aiVector2D *arg1 = 0 ; - aiVector2D *arg2 = 0 ; - aiVector2D result; - - arg1 = (aiVector2D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - arg2 = (aiVector2D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = operator /((aiVector2D const &)*arg1,(aiVector2D const &)*arg2); - jresult = new aiVector2D((const aiVector2D &)result); - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp___sub____SWIG_1(void * jarg1) { - void * jresult ; - aiVector2D *arg1 = 0 ; - aiVector2D result; - - arg1 = (aiVector2D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - result = operator -((aiVector2D const &)*arg1); - jresult = new aiVector2D((const aiVector2D &)result); - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector3D__SWIG_0() { - void * jresult ; - aiVector3D *result = 0 ; - - result = (aiVector3D *)new aiVector3D(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector3D__SWIG_1(float jarg1, float jarg2, float jarg3) { - void * jresult ; - float arg1 ; - float arg2 ; - float arg3 ; - aiVector3D *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (float)jarg2; - arg3 = (float)jarg3; - result = (aiVector3D *)new aiVector3D(arg1,arg2,arg3); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector3D__SWIG_2(float jarg1) { - void * jresult ; - float arg1 ; - aiVector3D *result = 0 ; - - arg1 = (float)jarg1; - result = (aiVector3D *)new aiVector3D(arg1); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector3D__SWIG_3(void * jarg1) { - void * jresult ; - aiVector3D *arg1 = 0 ; - aiVector3D *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - result = (aiVector3D *)new aiVector3D((aiVector3D const &)*arg1); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___addnset__(void * jarg1, void * jarg2) { - void * jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - aiVector3D *arg2 = 0 ; - aiVector3D *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - result = (aiVector3D *) &(arg1)->operator +=((aiVector3D const &)*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___subnset__(void * jarg1, void * jarg2) { - void * jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - aiVector3D *arg2 = 0 ; - aiVector3D *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - result = (aiVector3D *) &(arg1)->operator -=((aiVector3D const &)*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___mulnset____SWIG_0(void * jarg1, float jarg2) { - void * jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - float arg2 ; - aiVector3D *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - arg2 = (float)jarg2; - result = (aiVector3D *) &(arg1)->operator *=(arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___divnset__(void * jarg1, float jarg2) { - void * jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - float arg2 ; - aiVector3D *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - arg2 = (float)jarg2; - result = (aiVector3D *) &(arg1)->operator /=(arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___mulnset____SWIG_1(void * jarg1, void * jarg2) { - void * jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - aiMatrix3x3 *arg2 = 0 ; - aiVector3D *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - arg2 = (aiMatrix3x3 *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3 const & type is null", 0); - return 0; - } - result = (aiVector3D *) &(arg1)->operator *=((aiMatrix3x3 const &)*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___mulnset____SWIG_2(void * jarg1, void * jarg2) { - void * jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - aiMatrix4x4 *arg2 = 0 ; - aiVector3D *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - arg2 = (aiMatrix4x4 *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4 const & type is null", 0); - return 0; - } - result = (aiVector3D *) &(arg1)->operator *=((aiMatrix4x4 const &)*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D___idx____SWIG_0(void * jarg1, unsigned int jarg2) { - float jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - unsigned int arg2 ; - float result; - - arg1 = (aiVector3D *)jarg1; - arg2 = (unsigned int)jarg2; - result = (float)((aiVector3D const *)arg1)->operator [](arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector3D___equal__(void * jarg1, void * jarg2) { - unsigned int jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - aiVector3D *arg2 = 0 ; - bool result; - - arg1 = (aiVector3D *)jarg1; - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - result = (bool)((aiVector3D const *)arg1)->operator ==((aiVector3D const &)*arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector3D___nequal__(void * jarg1, void * jarg2) { - unsigned int jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - aiVector3D *arg2 = 0 ; - bool result; - - arg1 = (aiVector3D *)jarg1; - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - result = (bool)((aiVector3D const *)arg1)->operator !=((aiVector3D const &)*arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3D_Set(void * jarg1, float jarg2, float jarg3, float jarg4) { - aiVector3D *arg1 = (aiVector3D *) 0 ; - float arg2 ; - float arg3 ; - float arg4 = (float) 0. ; - - arg1 = (aiVector3D *)jarg1; - arg2 = (float)jarg2; - arg3 = (float)jarg3; - arg4 = (float)jarg4; - (arg1)->Set(arg2,arg3,arg4); -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D_SquareLength(void * jarg1) { - float jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - float result; - - arg1 = (aiVector3D *)jarg1; - result = (float)((aiVector3D const *)arg1)->SquareLength(); - jresult = result; - return jresult; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D_Length(void * jarg1) { - float jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - float result; - - arg1 = (aiVector3D *)jarg1; - result = (float)((aiVector3D const *)arg1)->Length(); - jresult = result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D_Normalize(void * jarg1) { - void * jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - aiVector3D *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - result = (aiVector3D *) &(arg1)->Normalize(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D_SymMul(void * jarg1, void * jarg2) { - void * jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - aiVector3D *arg2 = 0 ; - aiVector3D result; - - arg1 = (aiVector3D *)jarg1; - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - result = (arg1)->SymMul((aiVector3D const &)*arg2); - jresult = new aiVector3D((const aiVector3D &)result); - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3D_x_set(void * jarg1, float jarg2) { - aiVector3D *arg1 = (aiVector3D *) 0 ; - float arg2 ; - - arg1 = (aiVector3D *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->x = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D_x_get(void * jarg1) { - float jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - float result; - - arg1 = (aiVector3D *)jarg1; - result = (float) ((arg1)->x); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3D_y_set(void * jarg1, float jarg2) { - aiVector3D *arg1 = (aiVector3D *) 0 ; - float arg2 ; - - arg1 = (aiVector3D *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->y = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D_y_get(void * jarg1) { - float jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - float result; - - arg1 = (aiVector3D *)jarg1; - result = (float) ((arg1)->y); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3D_z_set(void * jarg1, float jarg2) { - aiVector3D *arg1 = (aiVector3D *) 0 ; - float arg2 ; - - arg1 = (aiVector3D *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->z = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D_z_get(void * jarg1) { - float jresult ; - aiVector3D *arg1 = (aiVector3D *) 0 ; - float result; - - arg1 = (aiVector3D *)jarg1; - result = (float) ((arg1)->z); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiVector3D(void * jarg1) { - aiVector3D *arg1 = (aiVector3D *) 0 ; - - arg1 = (aiVector3D *)jarg1; - delete arg1; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiColor4D__SWIG_0() { - void * jresult ; - aiColor4D *result = 0 ; - - result = (aiColor4D *)new aiColor4D(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiColor4D__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4) { - void * jresult ; - float arg1 ; - float arg2 ; - float arg3 ; - float arg4 ; - aiColor4D *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (float)jarg2; - arg3 = (float)jarg3; - arg4 = (float)jarg4; - result = (aiColor4D *)new aiColor4D(arg1,arg2,arg3,arg4); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiColor4D__SWIG_2(float jarg1) { - void * jresult ; - float arg1 ; - aiColor4D *result = 0 ; - - arg1 = (float)jarg1; - result = (aiColor4D *)new aiColor4D(arg1); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiColor4D__SWIG_3(void * jarg1) { - void * jresult ; - aiColor4D *arg1 = 0 ; - aiColor4D *result = 0 ; - - arg1 = (aiColor4D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiColor4D const & type is null", 0); - return 0; - } - result = (aiColor4D *)new aiColor4D((aiColor4D const &)*arg1); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4D___addnset__(void * jarg1, void * jarg2) { - void * jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - aiColor4D *arg2 = 0 ; - aiColor4D *result = 0 ; - - arg1 = (aiColor4D *)jarg1; - arg2 = (aiColor4D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiColor4D const & type is null", 0); - return 0; - } - result = (aiColor4D *) &(arg1)->operator +=((aiColor4D const &)*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4D___subnset__(void * jarg1, void * jarg2) { - void * jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - aiColor4D *arg2 = 0 ; - aiColor4D *result = 0 ; - - arg1 = (aiColor4D *)jarg1; - arg2 = (aiColor4D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiColor4D const & type is null", 0); - return 0; - } - result = (aiColor4D *) &(arg1)->operator -=((aiColor4D const &)*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4D___mulnset__(void * jarg1, float jarg2) { - void * jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - float arg2 ; - aiColor4D *result = 0 ; - - arg1 = (aiColor4D *)jarg1; - arg2 = (float)jarg2; - result = (aiColor4D *) &(arg1)->operator *=(arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4D___divnset__(void * jarg1, float jarg2) { - void * jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - float arg2 ; - aiColor4D *result = 0 ; - - arg1 = (aiColor4D *)jarg1; - arg2 = (float)jarg2; - result = (aiColor4D *) &(arg1)->operator /=(arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiColor4D___equal__(void * jarg1, void * jarg2) { - unsigned int jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - aiColor4D *arg2 = 0 ; - bool result; - - arg1 = (aiColor4D *)jarg1; - arg2 = (aiColor4D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiColor4D const & type is null", 0); - return 0; - } - result = (bool)((aiColor4D const *)arg1)->operator ==((aiColor4D const &)*arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiColor4D___nequal__(void * jarg1, void * jarg2) { - unsigned int jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - aiColor4D *arg2 = 0 ; - bool result; - - arg1 = (aiColor4D *)jarg1; - arg2 = (aiColor4D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiColor4D const & type is null", 0); - return 0; - } - result = (bool)((aiColor4D const *)arg1)->operator !=((aiColor4D const &)*arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiColor4D___idx____SWIG_0(void * jarg1, unsigned int jarg2) { - float jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - unsigned int arg2 ; - float result; - - arg1 = (aiColor4D *)jarg1; - arg2 = (unsigned int)jarg2; - result = (float)((aiColor4D const *)arg1)->operator [](arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiColor4D_IsBlack(void * jarg1) { - unsigned int jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - bool result; - - arg1 = (aiColor4D *)jarg1; - result = (bool)((aiColor4D const *)arg1)->IsBlack(); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4D_r_set(void * jarg1, float jarg2) { - aiColor4D *arg1 = (aiColor4D *) 0 ; - float arg2 ; - - arg1 = (aiColor4D *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->r = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiColor4D_r_get(void * jarg1) { - float jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - float result; - - arg1 = (aiColor4D *)jarg1; - result = (float) ((arg1)->r); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4D_g_set(void * jarg1, float jarg2) { - aiColor4D *arg1 = (aiColor4D *) 0 ; - float arg2 ; - - arg1 = (aiColor4D *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->g = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiColor4D_g_get(void * jarg1) { - float jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - float result; - - arg1 = (aiColor4D *)jarg1; - result = (float) ((arg1)->g); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4D_b_set(void * jarg1, float jarg2) { - aiColor4D *arg1 = (aiColor4D *) 0 ; - float arg2 ; - - arg1 = (aiColor4D *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->b = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiColor4D_b_get(void * jarg1) { - float jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - float result; - - arg1 = (aiColor4D *)jarg1; - result = (float) ((arg1)->b); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4D_a_set(void * jarg1, float jarg2) { - aiColor4D *arg1 = (aiColor4D *) 0 ; - float arg2 ; - - arg1 = (aiColor4D *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->a = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiColor4D_a_get(void * jarg1) { - float jresult ; - aiColor4D *arg1 = (aiColor4D *) 0 ; - float result; - - arg1 = (aiColor4D *)jarg1; - result = (float) ((arg1)->a); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiColor4D(void * jarg1) { - aiColor4D *arg1 = (aiColor4D *) 0 ; - - arg1 = (aiColor4D *)jarg1; - delete arg1; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix3x3__SWIG_0() { - void * jresult ; - aiMatrix3x3 *result = 0 ; - - result = (aiMatrix3x3 *)new aiMatrix3x3(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix3x3__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9) { - void * jresult ; - float arg1 ; - float arg2 ; - float arg3 ; - float arg4 ; - float arg5 ; - float arg6 ; - float arg7 ; - float arg8 ; - float arg9 ; - aiMatrix3x3 *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (float)jarg2; - arg3 = (float)jarg3; - arg4 = (float)jarg4; - arg5 = (float)jarg5; - arg6 = (float)jarg6; - arg7 = (float)jarg7; - arg8 = (float)jarg8; - arg9 = (float)jarg9; - result = (aiMatrix3x3 *)new aiMatrix3x3(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix3x3__SWIG_2(void * jarg1) { - void * jresult ; - aiMatrix4x4 *arg1 = 0 ; - aiMatrix3x3 *result = 0 ; - - arg1 = (aiMatrix4x4 *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4 const & type is null", 0); - return 0; - } - result = (aiMatrix3x3 *)new aiMatrix3x3((aiMatrix4x4 const &)*arg1); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_Transpose(void * jarg1) { - void * jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - aiMatrix3x3 *result = 0 ; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (aiMatrix3x3 *) &(arg1)->Transpose(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_Inverse(void * jarg1) { - void * jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - aiMatrix3x3 *result = 0 ; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (aiMatrix3x3 *) &(arg1)->Inverse(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_Determinant(void * jarg1) { - float jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float result; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (float)((aiMatrix3x3 const *)arg1)->Determinant(); - jresult = result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_RotationZ(float jarg1, void * jarg2) { - void * jresult ; - float arg1 ; - aiMatrix3x3 *arg2 = 0 ; - aiMatrix3x3 *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (aiMatrix3x3 *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3 & type is null", 0); - return 0; - } - result = (aiMatrix3x3 *) &aiMatrix3x3::RotationZ(arg1,*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_Rotation(float jarg1, void * jarg2, void * jarg3) { - void * jresult ; - float arg1 ; - aiVector3D *arg2 = 0 ; - aiMatrix3x3 *arg3 = 0 ; - aiMatrix3x3 *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - arg3 = (aiMatrix3x3 *)jarg3; - if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3 & type is null", 0); - return 0; - } - result = (aiMatrix3x3 *) &aiMatrix3x3::Rotation(arg1,(aiVector3D const &)*arg2,*arg3); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_Translation(void * jarg1, void * jarg2) { - void * jresult ; - aiVector2D *arg1 = 0 ; - aiMatrix3x3 *arg2 = 0 ; - aiMatrix3x3 *result = 0 ; - - arg1 = (aiVector2D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2D const & type is null", 0); - return 0; - } - arg2 = (aiMatrix3x3 *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3 & type is null", 0); - return 0; - } - result = (aiMatrix3x3 *) &aiMatrix3x3::Translation((aiVector2D const &)*arg1,*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_FromToMatrix(void * jarg1, void * jarg2, void * jarg3) { - void * jresult ; - aiVector3D *arg1 = 0 ; - aiVector3D *arg2 = 0 ; - aiMatrix3x3 *arg3 = 0 ; - aiMatrix3x3 *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - arg3 = (aiMatrix3x3 *)jarg3; - if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3 & type is null", 0); - return 0; - } - result = (aiMatrix3x3 *) &aiMatrix3x3::FromToMatrix((aiVector3D const &)*arg1,(aiVector3D const &)*arg2,*arg3); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_a1_set(void * jarg1, float jarg2) { - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix3x3 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->a1 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_a1_get(void * jarg1) { - float jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float result; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (float) ((arg1)->a1); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_a2_set(void * jarg1, float jarg2) { - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix3x3 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->a2 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_a2_get(void * jarg1) { - float jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float result; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (float) ((arg1)->a2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_a3_set(void * jarg1, float jarg2) { - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix3x3 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->a3 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_a3_get(void * jarg1) { - float jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float result; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (float) ((arg1)->a3); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_b1_set(void * jarg1, float jarg2) { - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix3x3 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->b1 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_b1_get(void * jarg1) { - float jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float result; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (float) ((arg1)->b1); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_b2_set(void * jarg1, float jarg2) { - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix3x3 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->b2 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_b2_get(void * jarg1) { - float jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float result; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (float) ((arg1)->b2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_b3_set(void * jarg1, float jarg2) { - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix3x3 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->b3 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_b3_get(void * jarg1) { - float jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float result; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (float) ((arg1)->b3); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_c1_set(void * jarg1, float jarg2) { - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix3x3 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->c1 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_c1_get(void * jarg1) { - float jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float result; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (float) ((arg1)->c1); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_c2_set(void * jarg1, float jarg2) { - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix3x3 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->c2 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_c2_get(void * jarg1) { - float jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float result; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (float) ((arg1)->c2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_c3_set(void * jarg1, float jarg2) { - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix3x3 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->c3 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_c3_get(void * jarg1) { - float jresult ; - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - float result; - - arg1 = (aiMatrix3x3 *)jarg1; - result = (float) ((arg1)->c3); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiMatrix3x3(void * jarg1) { - aiMatrix3x3 *arg1 = (aiMatrix3x3 *) 0 ; - - arg1 = (aiMatrix3x3 *)jarg1; - delete arg1; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix4x4__SWIG_0() { - void * jresult ; - aiMatrix4x4 *result = 0 ; - - result = (aiMatrix4x4 *)new aiMatrix4x4(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix4x4__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9, float jarg10, float jarg11, float jarg12, float jarg13, float jarg14, float jarg15, float jarg16) { - void * jresult ; - float arg1 ; - float arg2 ; - float arg3 ; - float arg4 ; - float arg5 ; - float arg6 ; - float arg7 ; - float arg8 ; - float arg9 ; - float arg10 ; - float arg11 ; - float arg12 ; - float arg13 ; - float arg14 ; - float arg15 ; - float arg16 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (float)jarg2; - arg3 = (float)jarg3; - arg4 = (float)jarg4; - arg5 = (float)jarg5; - arg6 = (float)jarg6; - arg7 = (float)jarg7; - arg8 = (float)jarg8; - arg9 = (float)jarg9; - arg10 = (float)jarg10; - arg11 = (float)jarg11; - arg12 = (float)jarg12; - arg13 = (float)jarg13; - arg14 = (float)jarg14; - arg15 = (float)jarg15; - arg16 = (float)jarg16; - result = (aiMatrix4x4 *)new aiMatrix4x4(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix4x4__SWIG_2(void * jarg1) { - void * jresult ; - aiMatrix3x3 *arg1 = 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (aiMatrix3x3 *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3 const & type is null", 0); - return 0; - } - result = (aiMatrix4x4 *)new aiMatrix4x4((aiMatrix3x3 const &)*arg1); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_Transpose(void * jarg1) { - void * jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (aiMatrix4x4 *) &(arg1)->Transpose(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_Inverse(void * jarg1) { - void * jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (aiMatrix4x4 *) &(arg1)->Inverse(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_Determinant(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float)((aiMatrix4x4 const *)arg1)->Determinant(); - jresult = result; - return jresult; -} - - -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiMatrix4x4_IsIdentity(void * jarg1) { - unsigned int jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - bool result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (bool)((aiMatrix4x4 const *)arg1)->IsIdentity(); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_Decompose(void * jarg1, void * jarg2, void * jarg3, void * jarg4) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - aiVector3D *arg2 = 0 ; - aiQuaternion *arg3 = 0 ; - aiVector3D *arg4 = 0 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D & type is null", 0); - return ; - } - arg3 = (aiQuaternion *)jarg3; - if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaternion & type is null", 0); - return ; - } - arg4 = (aiVector3D *)jarg4; - if (!arg4) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D & type is null", 0); - return ; - } - ((aiMatrix4x4 const *)arg1)->Decompose(*arg2,*arg3,*arg4); -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_DecomposeNoScaling(void * jarg1, void * jarg2, void * jarg3) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - aiQuaternion *arg2 = 0 ; - aiVector3D *arg3 = 0 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (aiQuaternion *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaternion & type is null", 0); - return ; - } - arg3 = (aiVector3D *)jarg3; - if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D & type is null", 0); - return ; - } - ((aiMatrix4x4 const *)arg1)->DecomposeNoScaling(*arg2,*arg3); -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_FromEulerAnglesXYZ__SWIG_0(void * jarg1, float jarg2, float jarg3, float jarg4) { - void * jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - float arg3 ; - float arg4 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - arg3 = (float)jarg3; - arg4 = (float)jarg4; - result = (aiMatrix4x4 *) &(arg1)->FromEulerAnglesXYZ(arg2,arg3,arg4); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_FromEulerAnglesXYZ__SWIG_1(void * jarg1, void * jarg2) { - void * jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - aiVector3D *arg2 = 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - result = (aiMatrix4x4 *) &(arg1)->FromEulerAnglesXYZ((aiVector3D const &)*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_RotationX(float jarg1, void * jarg2) { - void * jresult ; - float arg1 ; - aiMatrix4x4 *arg2 = 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (aiMatrix4x4 *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4 & type is null", 0); - return 0; - } - result = (aiMatrix4x4 *) &aiMatrix4x4::RotationX(arg1,*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_RotationY(float jarg1, void * jarg2) { - void * jresult ; - float arg1 ; - aiMatrix4x4 *arg2 = 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (aiMatrix4x4 *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4 & type is null", 0); - return 0; - } - result = (aiMatrix4x4 *) &aiMatrix4x4::RotationY(arg1,*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_RotationZ(float jarg1, void * jarg2) { - void * jresult ; - float arg1 ; - aiMatrix4x4 *arg2 = 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (aiMatrix4x4 *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4 & type is null", 0); - return 0; - } - result = (aiMatrix4x4 *) &aiMatrix4x4::RotationZ(arg1,*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_Rotation(float jarg1, void * jarg2, void * jarg3) { - void * jresult ; - float arg1 ; - aiVector3D *arg2 = 0 ; - aiMatrix4x4 *arg3 = 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - arg3 = (aiMatrix4x4 *)jarg3; - if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4 & type is null", 0); - return 0; - } - result = (aiMatrix4x4 *) &aiMatrix4x4::Rotation(arg1,(aiVector3D const &)*arg2,*arg3); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_Translation(void * jarg1, void * jarg2) { - void * jresult ; - aiVector3D *arg1 = 0 ; - aiMatrix4x4 *arg2 = 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - arg2 = (aiMatrix4x4 *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4 & type is null", 0); - return 0; - } - result = (aiMatrix4x4 *) &aiMatrix4x4::Translation((aiVector3D const &)*arg1,*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_Scaling(void * jarg1, void * jarg2) { - void * jresult ; - aiVector3D *arg1 = 0 ; - aiMatrix4x4 *arg2 = 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - arg2 = (aiMatrix4x4 *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4 & type is null", 0); - return 0; - } - result = (aiMatrix4x4 *) &aiMatrix4x4::Scaling((aiVector3D const &)*arg1,*arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_FromToMatrix(void * jarg1, void * jarg2, void * jarg3) { - void * jresult ; - aiVector3D *arg1 = 0 ; - aiVector3D *arg2 = 0 ; - aiMatrix4x4 *arg3 = 0 ; - aiMatrix4x4 *result = 0 ; - - arg1 = (aiVector3D *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - arg3 = (aiMatrix4x4 *)jarg3; - if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4 & type is null", 0); - return 0; - } - result = (aiMatrix4x4 *) &aiMatrix4x4::FromToMatrix((aiVector3D const &)*arg1,(aiVector3D const &)*arg2,*arg3); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_a1_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->a1 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_a1_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->a1); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_a2_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->a2 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_a2_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->a2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_a3_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->a3 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_a3_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->a3); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_a4_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->a4 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_a4_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->a4); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_b1_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->b1 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_b1_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->b1); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_b2_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->b2 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_b2_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->b2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_b3_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->b3 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_b3_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->b3); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_b4_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->b4 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_b4_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->b4); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_c1_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->c1 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_c1_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->c1); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_c2_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->c2 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_c2_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->c2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_c3_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->c3 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_c3_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->c3); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_c4_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->c4 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_c4_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->c4); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_d1_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->d1 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_d1_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->d1); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_d2_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->d2 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_d2_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->d2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_d3_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->d3 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_d3_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->d3); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_d4_set(void * jarg1, float jarg2) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float arg2 ; - - arg1 = (aiMatrix4x4 *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->d4 = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_d4_get(void * jarg1) { - float jresult ; - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - float result; - - arg1 = (aiMatrix4x4 *)jarg1; - result = (float) ((arg1)->d4); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiMatrix4x4(void * jarg1) { - aiMatrix4x4 *arg1 = (aiMatrix4x4 *) 0 ; - - arg1 = (aiMatrix4x4 *)jarg1; - delete arg1; -} - - SWIGEXPORT void SWIGSTDCALL CSharp_aiCamera_mName_set(void * jarg1, void * jarg2) { aiCamera *arg1 = (aiCamera *) 0 ; aiString *arg2 = (aiString *) 0 ; @@ -8300,7 +6236,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_AI_MAX_NUMBER_OF_COLOR_SETS_get() { int jresult ; int result; - result = (int)(0x4); + result = (int)(0x8); jresult = result; return jresult; } @@ -8310,7 +6246,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_AI_MAX_NUMBER_OF_TEXTURECOORDS_get() { int jresult ; int result; - result = (int)(0x4); + result = (int)(0x8); jresult = result; return jresult; } @@ -9166,16 +7102,6 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_AI_DEFAULT_MATERIAL_NAME_get() { } -SWIGEXPORT char * SWIGSTDCALL CSharp_AI_DEFAULT_TEXTURED_MATERIAL_NAME_get() { - char * jresult ; - char *result = 0 ; - - result = (char *)("TexturedDefaultMaterial"); - jresult = SWIG_csharp_string_callback((const char *)result); - return jresult; -} - - SWIGEXPORT void SWIGSTDCALL CSharp_aiUVTransform_mTranslation_set(void * jarg1, void * jarg2) { aiUVTransform *arg1 = (aiUVTransform *) 0 ; aiVector2D *arg2 = (aiVector2D *) 0 ; @@ -9377,7 +7303,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiMaterialProperty_mData_set(void * jarg1, ch arg1 = (aiMaterialProperty *)jarg1; arg2 = (char *)jarg2; { - if (arg1->mData) delete [] arg1->mData; + delete [] arg1->mData; if (arg2) { arg1->mData = (char *) (new char[strlen((const char *)arg2)+1]); strcpy((char *)arg1->mData, (const char *)arg2); @@ -9450,6 +7376,150 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiMaterial_GetTextureCount(void * jar } +SWIGEXPORT int SWIGSTDCALL CSharp_aiMaterial_AddBinaryProperty(void * jarg1, void * jarg2, unsigned int jarg3, char * jarg4, unsigned int jarg5, unsigned int jarg6, int jarg7) { + int jresult ; + aiMaterial *arg1 = (aiMaterial *) 0 ; + void *arg2 = (void *) 0 ; + unsigned int arg3 ; + char *arg4 = (char *) 0 ; + unsigned int arg5 ; + unsigned int arg6 ; + aiPropertyTypeInfo arg7 ; + aiReturn result; + + arg1 = (aiMaterial *)jarg1; + arg2 = (void *)jarg2; + arg3 = (unsigned int)jarg3; + arg4 = (char *)jarg4; + arg5 = (unsigned int)jarg5; + arg6 = (unsigned int)jarg6; + arg7 = (aiPropertyTypeInfo)jarg7; + result = (aiReturn)(arg1)->AddBinaryProperty((void const *)arg2,arg3,(char const *)arg4,arg5,arg6,arg7); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_aiMaterial_AddProperty__SWIG_0(void * jarg1, void * jarg2, char * jarg3, unsigned int jarg4, unsigned int jarg5) { + int jresult ; + aiMaterial *arg1 = (aiMaterial *) 0 ; + aiString *arg2 = (aiString *) 0 ; + char *arg3 = (char *) 0 ; + unsigned int arg4 ; + unsigned int arg5 ; + aiReturn result; + + arg1 = (aiMaterial *)jarg1; + arg2 = (aiString *)jarg2; + arg3 = (char *)jarg3; + arg4 = (unsigned int)jarg4; + arg5 = (unsigned int)jarg5; + result = (aiReturn)(arg1)->AddProperty((aiString const *)arg2,(char const *)arg3,arg4,arg5); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_aiMaterial_AddProperty__SWIG_1(void * jarg1, void * jarg2, char * jarg3, unsigned int jarg4) { + int jresult ; + aiMaterial *arg1 = (aiMaterial *) 0 ; + aiString *arg2 = (aiString *) 0 ; + char *arg3 = (char *) 0 ; + unsigned int arg4 ; + aiReturn result; + + arg1 = (aiMaterial *)jarg1; + arg2 = (aiString *)jarg2; + arg3 = (char *)jarg3; + arg4 = (unsigned int)jarg4; + result = (aiReturn)(arg1)->AddProperty((aiString const *)arg2,(char const *)arg3,arg4); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_aiMaterial_AddProperty__SWIG_2(void * jarg1, void * jarg2, char * jarg3) { + int jresult ; + aiMaterial *arg1 = (aiMaterial *) 0 ; + aiString *arg2 = (aiString *) 0 ; + char *arg3 = (char *) 0 ; + aiReturn result; + + arg1 = (aiMaterial *)jarg1; + arg2 = (aiString *)jarg2; + arg3 = (char *)jarg3; + result = (aiReturn)(arg1)->AddProperty((aiString const *)arg2,(char const *)arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_aiMaterial_RemoveProperty__SWIG_0(void * jarg1, char * jarg2, unsigned int jarg3, unsigned int jarg4) { + int jresult ; + aiMaterial *arg1 = (aiMaterial *) 0 ; + char *arg2 = (char *) 0 ; + unsigned int arg3 ; + unsigned int arg4 ; + aiReturn result; + + arg1 = (aiMaterial *)jarg1; + arg2 = (char *)jarg2; + arg3 = (unsigned int)jarg3; + arg4 = (unsigned int)jarg4; + result = (aiReturn)(arg1)->RemoveProperty((char const *)arg2,arg3,arg4); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_aiMaterial_RemoveProperty__SWIG_1(void * jarg1, char * jarg2, unsigned int jarg3) { + int jresult ; + aiMaterial *arg1 = (aiMaterial *) 0 ; + char *arg2 = (char *) 0 ; + unsigned int arg3 ; + aiReturn result; + + arg1 = (aiMaterial *)jarg1; + arg2 = (char *)jarg2; + arg3 = (unsigned int)jarg3; + result = (aiReturn)(arg1)->RemoveProperty((char const *)arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_aiMaterial_RemoveProperty__SWIG_2(void * jarg1, char * jarg2) { + int jresult ; + aiMaterial *arg1 = (aiMaterial *) 0 ; + char *arg2 = (char *) 0 ; + aiReturn result; + + arg1 = (aiMaterial *)jarg1; + arg2 = (char *)jarg2; + result = (aiReturn)(arg1)->RemoveProperty((char const *)arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMaterial_Clear(void * jarg1) { + aiMaterial *arg1 = (aiMaterial *) 0 ; + + arg1 = (aiMaterial *)jarg1; + (arg1)->Clear(); +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMaterial_CopyPropertyList(void * jarg1, void * jarg2) { + aiMaterial *arg1 = (aiMaterial *) 0 ; + aiMaterial *arg2 = (aiMaterial *) 0 ; + + arg1 = (aiMaterial *)jarg1; + arg2 = (aiMaterial *)jarg2; + aiMaterial::CopyPropertyList(arg1,(aiMaterial const *)arg2); +} + + SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiMaterial_GetDiffuse(void * jarg1, void * jarg2) { unsigned int jresult ; aiMaterial *arg1 = (aiMaterial *) 0 ; @@ -9844,334 +7914,6 @@ SWIGEXPORT char * SWIGSTDCALL CSharp__AI_MATKEY_TEXFLAGS_BASE_get() { } -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_0() { - void * jresult ; - aiQuaternion *result = 0 ; - - result = (aiQuaternion *)new aiQuaternion(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4) { - void * jresult ; - float arg1 ; - float arg2 ; - float arg3 ; - float arg4 ; - aiQuaternion *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (float)jarg2; - arg3 = (float)jarg3; - arg4 = (float)jarg4; - result = (aiQuaternion *)new aiQuaternion(arg1,arg2,arg3,arg4); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_2(void * jarg1) { - void * jresult ; - aiMatrix3x3 *arg1 = 0 ; - aiQuaternion *result = 0 ; - - arg1 = (aiMatrix3x3 *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3 const & type is null", 0); - return 0; - } - result = (aiQuaternion *)new aiQuaternion((aiMatrix3x3 const &)*arg1); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_3(float jarg1, float jarg2, float jarg3) { - void * jresult ; - float arg1 ; - float arg2 ; - float arg3 ; - aiQuaternion *result = 0 ; - - arg1 = (float)jarg1; - arg2 = (float)jarg2; - arg3 = (float)jarg3; - result = (aiQuaternion *)new aiQuaternion(arg1,arg2,arg3); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_4(void * jarg1, float jarg2) { - void * jresult ; - aiVector3D arg1 ; - float arg2 ; - aiVector3D *argp1 ; - aiQuaternion *result = 0 ; - - argp1 = (aiVector3D *)jarg1; - if (!argp1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null aiVector3D", 0); - return 0; - } - arg1 = *argp1; - arg2 = (float)jarg2; - result = (aiQuaternion *)new aiQuaternion(arg1,arg2); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_5(void * jarg1) { - void * jresult ; - aiVector3D arg1 ; - aiVector3D *argp1 ; - aiQuaternion *result = 0 ; - - argp1 = (aiVector3D *)jarg1; - if (!argp1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null aiVector3D", 0); - return 0; - } - arg1 = *argp1; - result = (aiQuaternion *)new aiQuaternion(arg1); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiQuaternion_GetMatrix(void * jarg1) { - void * jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - aiMatrix3x3 result; - - arg1 = (aiQuaternion *)jarg1; - result = ((aiQuaternion const *)arg1)->GetMatrix(); - jresult = new aiMatrix3x3((const aiMatrix3x3 &)result); - return jresult; -} - - -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiQuaternion___equal__(void * jarg1, void * jarg2) { - unsigned int jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - aiQuaternion *arg2 = 0 ; - bool result; - - arg1 = (aiQuaternion *)jarg1; - arg2 = (aiQuaternion *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaternion const & type is null", 0); - return 0; - } - result = (bool)((aiQuaternion const *)arg1)->operator ==((aiQuaternion const &)*arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiQuaternion___nequal__(void * jarg1, void * jarg2) { - unsigned int jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - aiQuaternion *arg2 = 0 ; - bool result; - - arg1 = (aiQuaternion *)jarg1; - arg2 = (aiQuaternion *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaternion const & type is null", 0); - return 0; - } - result = (bool)((aiQuaternion const *)arg1)->operator !=((aiQuaternion const &)*arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiQuaternion_Normalize(void * jarg1) { - void * jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - aiQuaternion *result = 0 ; - - arg1 = (aiQuaternion *)jarg1; - result = (aiQuaternion *) &(arg1)->Normalize(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiQuaternion_Conjugate(void * jarg1) { - void * jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - aiQuaternion *result = 0 ; - - arg1 = (aiQuaternion *)jarg1; - result = (aiQuaternion *) &(arg1)->Conjugate(); - jresult = (void *)result; - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiQuaternion_Rotate(void * jarg1, void * jarg2) { - void * jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - aiVector3D *arg2 = 0 ; - aiVector3D result; - - arg1 = (aiQuaternion *)jarg1; - arg2 = (aiVector3D *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3D const & type is null", 0); - return 0; - } - result = (arg1)->Rotate((aiVector3D const &)*arg2); - jresult = new aiVector3D((const aiVector3D &)result); - return jresult; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_aiQuaternion___mul__(void * jarg1, void * jarg2) { - void * jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - aiQuaternion *arg2 = 0 ; - aiQuaternion result; - - arg1 = (aiQuaternion *)jarg1; - arg2 = (aiQuaternion *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaternion const & type is null", 0); - return 0; - } - result = ((aiQuaternion const *)arg1)->operator *((aiQuaternion const &)*arg2); - jresult = new aiQuaternion((const aiQuaternion &)result); - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiQuaternion_Interpolate(void * jarg1, void * jarg2, void * jarg3, float jarg4) { - aiQuaternion *arg1 = 0 ; - aiQuaternion *arg2 = 0 ; - aiQuaternion *arg3 = 0 ; - float arg4 ; - - arg1 = (aiQuaternion *)jarg1; - if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaternion & type is null", 0); - return ; - } - arg2 = (aiQuaternion *)jarg2; - if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaternion const & type is null", 0); - return ; - } - arg3 = (aiQuaternion *)jarg3; - if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaternion const & type is null", 0); - return ; - } - arg4 = (float)jarg4; - aiQuaternion::Interpolate(*arg1,(aiQuaternion const &)*arg2,(aiQuaternion const &)*arg3,arg4); -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiQuaternion_w_set(void * jarg1, float jarg2) { - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - float arg2 ; - - arg1 = (aiQuaternion *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->w = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiQuaternion_w_get(void * jarg1) { - float jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - float result; - - arg1 = (aiQuaternion *)jarg1; - result = (float) ((arg1)->w); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiQuaternion_x_set(void * jarg1, float jarg2) { - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - float arg2 ; - - arg1 = (aiQuaternion *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->x = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiQuaternion_x_get(void * jarg1) { - float jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - float result; - - arg1 = (aiQuaternion *)jarg1; - result = (float) ((arg1)->x); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiQuaternion_y_set(void * jarg1, float jarg2) { - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - float arg2 ; - - arg1 = (aiQuaternion *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->y = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiQuaternion_y_get(void * jarg1) { - float jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - float result; - - arg1 = (aiQuaternion *)jarg1; - result = (float) ((arg1)->y); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_aiQuaternion_z_set(void * jarg1, float jarg2) { - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - float arg2 ; - - arg1 = (aiQuaternion *)jarg1; - arg2 = (float)jarg2; - if (arg1) (arg1)->z = arg2; -} - - -SWIGEXPORT float SWIGSTDCALL CSharp_aiQuaternion_z_get(void * jarg1) { - float jresult ; - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - float result; - - arg1 = (aiQuaternion *)jarg1; - result = (float) ((arg1)->z); - jresult = result; - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiQuaternion(void * jarg1) { - aiQuaternion *arg1 = (aiQuaternion *) 0 ; - - arg1 = (aiQuaternion *)jarg1; - delete arg1; -} - - SWIGEXPORT void SWIGSTDCALL CSharp_aiNode_mName_set(void * jarg1, void * jarg2) { aiNode *arg1 = (aiNode *) 0 ; aiString *arg2 = (aiString *) 0 ; @@ -10689,6 +8431,28 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiScene_HasAnimations(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_aiScene_mPrivate_set(void * jarg1, void * jarg2) { + aiScene *arg1 = (aiScene *) 0 ; + void *arg2 = (void *) 0 ; + + arg1 = (aiScene *)jarg1; + arg2 = (void *)jarg2; + if (arg1) (arg1)->mPrivate = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiScene_mPrivate_get(void * jarg1) { + void * jresult ; + aiScene *arg1 = (aiScene *) 0 ; + void *result = 0 ; + + arg1 = (aiScene *)jarg1; + result = (void *) ((arg1)->mPrivate); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_aiScene_GetmAnimations(void * jarg1) { void * jresult ; aiScene *arg1 = (aiScene *) 0 ; @@ -11040,24 +8804,6 @@ SWIGEXPORT int SWIGSTDCALL CSharp_AI_PROPERTY_WAS_NOT_EXISTING_get() { } -SWIGEXPORT void * SWIGSTDCALL CSharp_aiImportFileFromMemory(char * jarg1, unsigned int jarg2, unsigned int jarg3, char * jarg4) { - void * jresult ; - char *arg1 = (char *) 0 ; - unsigned int arg2 ; - unsigned int arg3 ; - char *arg4 = (char *) 0 ; - aiScene *result = 0 ; - - arg1 = (char *)jarg1; - arg2 = (unsigned int)jarg2; - arg3 = (unsigned int)jarg3; - arg4 = (char *)jarg4; - result = (aiScene *)aiImportFileFromMemory((char const *)arg1,arg2,arg3,(char const *)arg4); - jresult = (void *)result; - return jresult; -} - - SWIGEXPORT void * SWIGSTDCALL CSharp_new_Importer__SWIG_0() { void * jresult ; Assimp::Importer *result = 0 ; @@ -11313,6 +9059,30 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_Importer_GetErrorString(void * jarg1) { } +SWIGEXPORT void * SWIGSTDCALL CSharp_Importer_GetScene(void * jarg1) { + void * jresult ; + Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; + aiScene *result = 0 ; + + arg1 = (Assimp::Importer *)jarg1; + result = (aiScene *)((Assimp::Importer const *)arg1)->GetScene(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_Importer_GetOrphanedScene(void * jarg1) { + void * jresult ; + Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; + aiScene *result = 0 ; + + arg1 = (Assimp::Importer *)jarg1; + result = (aiScene *)(arg1)->GetOrphanedScene(); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Importer_IsExtensionSupported__SWIG_0(void * jarg1, char * jarg2) { unsigned int jresult ; Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; @@ -11355,30 +9125,74 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Importer_GetExtensionList__SWIG_1(void * jarg } -SWIGEXPORT void * SWIGSTDCALL CSharp_Importer_GetScene(void * jarg1) { - void * jresult ; +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_Importer_GetImporterCount(void * jarg1) { + unsigned long jresult ; Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; - aiScene *result = 0 ; + size_t result; arg1 = (Assimp::Importer *)jarg1; - result = (aiScene *)((Assimp::Importer const *)arg1)->GetScene(); + result = ((Assimp::Importer const *)arg1)->GetImporterCount(); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_Importer_GetImporterInfo(void * jarg1, unsigned long jarg2) { + void * jresult ; + Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; + size_t arg2 ; + aiImporterDesc *result = 0 ; + + arg1 = (Assimp::Importer *)jarg1; + arg2 = (size_t)jarg2; + result = (aiImporterDesc *)((Assimp::Importer const *)arg1)->GetImporterInfo(arg2); jresult = (void *)result; return jresult; } -SWIGEXPORT void * SWIGSTDCALL CSharp_Importer_GetOrphanedScene(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_Importer_GetImporter__SWIG_0(void * jarg1, unsigned long jarg2) { void * jresult ; Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; - aiScene *result = 0 ; + size_t arg2 ; + Assimp::BaseImporter *result = 0 ; arg1 = (Assimp::Importer *)jarg1; - result = (aiScene *)(arg1)->GetOrphanedScene(); + arg2 = (size_t)jarg2; + result = (Assimp::BaseImporter *)((Assimp::Importer const *)arg1)->GetImporter(arg2); jresult = (void *)result; return jresult; } +SWIGEXPORT void * SWIGSTDCALL CSharp_Importer_GetImporter__SWIG_1(void * jarg1, char * jarg2) { + void * jresult ; + Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; + char *arg2 = (char *) 0 ; + Assimp::BaseImporter *result = 0 ; + + arg1 = (Assimp::Importer *)jarg1; + arg2 = (char *)jarg2; + result = (Assimp::BaseImporter *)((Assimp::Importer const *)arg1)->GetImporter((char const *)arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_Importer_GetImporterIndex(void * jarg1, char * jarg2) { + unsigned long jresult ; + Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; + char *arg2 = (char *) 0 ; + size_t result; + + arg1 = (Assimp::Importer *)jarg1; + arg2 = (char *)jarg2; + result = ((Assimp::Importer const *)arg1)->GetImporterIndex((char const *)arg2); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_Importer_GetMemoryRequirements(void * jarg1, void * jarg2) { Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; aiMemoryInfo *arg2 = 0 ; @@ -11403,6 +9217,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Importer_SetExtraVerbose(void * jarg1, unsign } +SWIGEXPORT void * SWIGSTDCALL CSharp_Importer_Pimpl__SWIG_0(void * jarg1) { + void * jresult ; + Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; + Assimp::ImporterPimpl *result = 0 ; + + arg1 = (Assimp::Importer *)jarg1; + result = (Assimp::ImporterPimpl *)(arg1)->Pimpl(); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_Importer_GetExtensionList__SWIG_2(void * jarg1) { char * jresult ; Assimp::Importer *arg1 = (Assimp::Importer *) 0 ; @@ -11449,6 +9275,2532 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ProgressHandler_Update__SWIG_1(void * } +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiColor4D__SWIG_0() { + void * jresult ; + aiColor4t< float > *result = 0 ; + + result = (aiColor4t< float > *)new aiColor4t< float >(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiColor4D__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4) { + void * jresult ; + float arg1 ; + float arg2 ; + float arg3 ; + float arg4 ; + aiColor4t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (float)jarg2; + arg3 = (float)jarg3; + arg4 = (float)jarg4; + result = (aiColor4t< float > *)new aiColor4t< float >(arg1,arg2,arg3,arg4); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiColor4D__SWIG_2(float jarg1) { + void * jresult ; + float arg1 ; + aiColor4t< float > *result = 0 ; + + arg1 = (float)jarg1; + result = (aiColor4t< float > *)new aiColor4t< float >(arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiColor4D__SWIG_3(void * jarg1) { + void * jresult ; + aiColor4t< float > *arg1 = 0 ; + aiColor4t< float > *result = 0 ; + + arg1 = (aiColor4t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiColor4t< float > const & type is null", 0); + return 0; + } + result = (aiColor4t< float > *)new aiColor4t< float >((aiColor4t< float > const &)*arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4D___addnset__(void * jarg1, void * jarg2) { + void * jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + aiColor4t< float > *arg2 = 0 ; + aiColor4t< float > *result = 0 ; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (aiColor4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiColor4t< float > const & type is null", 0); + return 0; + } + result = (aiColor4t< float > *) &(arg1)->operator +=((aiColor4t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4D___subnset__(void * jarg1, void * jarg2) { + void * jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + aiColor4t< float > *arg2 = 0 ; + aiColor4t< float > *result = 0 ; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (aiColor4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiColor4t< float > const & type is null", 0); + return 0; + } + result = (aiColor4t< float > *) &(arg1)->operator -=((aiColor4t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4D___mulnset__(void * jarg1, float jarg2) { + void * jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + float arg2 ; + aiColor4t< float > *result = 0 ; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (float)jarg2; + result = (aiColor4t< float > *) &(arg1)->operator *=(arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4D___divnset__(void * jarg1, float jarg2) { + void * jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + float arg2 ; + aiColor4t< float > *result = 0 ; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (float)jarg2; + result = (aiColor4t< float > *) &(arg1)->operator /=(arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiColor4D___equal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + aiColor4t< float > *arg2 = 0 ; + bool result; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (aiColor4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiColor4t< float > const & type is null", 0); + return 0; + } + result = (bool)((aiColor4t< float > const *)arg1)->operator ==((aiColor4t< float > const &)*arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiColor4D___nequal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + aiColor4t< float > *arg2 = 0 ; + bool result; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (aiColor4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiColor4t< float > const & type is null", 0); + return 0; + } + result = (bool)((aiColor4t< float > const *)arg1)->operator !=((aiColor4t< float > const &)*arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiColor4D___idx____SWIG_0(void * jarg1, unsigned int jarg2) { + float jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + unsigned int arg2 ; + float result; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (unsigned int)jarg2; + result = (float)((aiColor4t< float > const *)arg1)->operator [](arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiColor4D_IsBlack(void * jarg1) { + unsigned int jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + bool result; + + arg1 = (aiColor4t< float > *)jarg1; + result = (bool)((aiColor4t< float > const *)arg1)->IsBlack(); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4D_r_set(void * jarg1, float jarg2) { + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->r = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiColor4D_r_get(void * jarg1) { + float jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + float result; + + arg1 = (aiColor4t< float > *)jarg1; + result = (float) ((arg1)->r); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4D_g_set(void * jarg1, float jarg2) { + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->g = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiColor4D_g_get(void * jarg1) { + float jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + float result; + + arg1 = (aiColor4t< float > *)jarg1; + result = (float) ((arg1)->g); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4D_b_set(void * jarg1, float jarg2) { + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->b = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiColor4D_b_get(void * jarg1) { + float jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + float result; + + arg1 = (aiColor4t< float > *)jarg1; + result = (float) ((arg1)->b); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4D_a_set(void * jarg1, float jarg2) { + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiColor4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->a = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiColor4D_a_get(void * jarg1) { + float jresult ; + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + float result; + + arg1 = (aiColor4t< float > *)jarg1; + result = (float) ((arg1)->a); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiColor4D(void * jarg1) { + aiColor4t< float > *arg1 = (aiColor4t< float > *) 0 ; + + arg1 = (aiColor4t< float > *)jarg1; + delete arg1; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector3D__SWIG_0() { + void * jresult ; + aiVector3t< float > *result = 0 ; + + result = (aiVector3t< float > *)new aiVector3t< float >(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector3D__SWIG_1(float jarg1, float jarg2, float jarg3) { + void * jresult ; + float arg1 ; + float arg2 ; + float arg3 ; + aiVector3t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (float)jarg2; + arg3 = (float)jarg3; + result = (aiVector3t< float > *)new aiVector3t< float >(arg1,arg2,arg3); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector3D__SWIG_2(float jarg1) { + void * jresult ; + float arg1 ; + aiVector3t< float > *result = 0 ; + + arg1 = (float)jarg1; + result = (aiVector3t< float > *)new aiVector3t< float >(arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector3D__SWIG_3(void * jarg1) { + void * jresult ; + aiVector3t< float > *arg1 = 0 ; + aiVector3t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + result = (aiVector3t< float > *)new aiVector3t< float >((aiVector3t< float > const &)*arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___addnset__(void * jarg1, void * jarg2) { + void * jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + aiVector3t< float > *arg2 = 0 ; + aiVector3t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + result = (aiVector3t< float > *) &(arg1)->operator +=((aiVector3t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___subnset__(void * jarg1, void * jarg2) { + void * jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + aiVector3t< float > *arg2 = 0 ; + aiVector3t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + result = (aiVector3t< float > *) &(arg1)->operator -=((aiVector3t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___mulnset____SWIG_0(void * jarg1, float jarg2) { + void * jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float arg2 ; + aiVector3t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (float)jarg2; + result = (aiVector3t< float > *) &(arg1)->operator *=(arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___divnset__(void * jarg1, float jarg2) { + void * jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float arg2 ; + aiVector3t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (float)jarg2; + result = (aiVector3t< float > *) &(arg1)->operator /=(arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___mulnset____SWIG_1(void * jarg1, void * jarg2) { + void * jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + aiMatrix3x3t< float > *arg2 = 0 ; + aiVector3t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (aiMatrix3x3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3t< float > const & type is null", 0); + return 0; + } + result = (aiVector3t< float > *) &(arg1)->operator *=((aiMatrix3x3t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D___mulnset____SWIG_2(void * jarg1, void * jarg2) { + void * jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + aiMatrix4x4t< float > *arg2 = 0 ; + aiVector3t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (aiMatrix4x4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > const & type is null", 0); + return 0; + } + result = (aiVector3t< float > *) &(arg1)->operator *=((aiMatrix4x4t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D___idx____SWIG_0(void * jarg1, unsigned int jarg2) { + float jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + unsigned int arg2 ; + float result; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (unsigned int)jarg2; + result = (float)((aiVector3t< float > const *)arg1)->operator [](arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector3D___equal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + aiVector3t< float > *arg2 = 0 ; + bool result; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + result = (bool)((aiVector3t< float > const *)arg1)->operator ==((aiVector3t< float > const &)*arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector3D___nequal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + aiVector3t< float > *arg2 = 0 ; + bool result; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + result = (bool)((aiVector3t< float > const *)arg1)->operator !=((aiVector3t< float > const &)*arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3D_Set(void * jarg1, float jarg2, float jarg3, float jarg4) { + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float arg2 ; + float arg3 ; + float arg4 ; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (float)jarg2; + arg3 = (float)jarg3; + arg4 = (float)jarg4; + (arg1)->Set(arg2,arg3,arg4); +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D_SquareLength(void * jarg1) { + float jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float result; + + arg1 = (aiVector3t< float > *)jarg1; + result = (float)((aiVector3t< float > const *)arg1)->SquareLength(); + jresult = result; + return jresult; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D_Length(void * jarg1) { + float jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float result; + + arg1 = (aiVector3t< float > *)jarg1; + result = (float)((aiVector3t< float > const *)arg1)->Length(); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D_Normalize(void * jarg1) { + void * jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + aiVector3t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + result = (aiVector3t< float > *) &(arg1)->Normalize(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3D_SymMul(void * jarg1, void * jarg2) { + void * jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + aiVector3t< float > *arg2 = 0 ; + aiVector3t< float > result; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + result = (arg1)->SymMul((aiVector3t< float > const &)*arg2); + jresult = new aiVector3t< float >((const aiVector3t< float > &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3D_x_set(void * jarg1, float jarg2) { + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->x = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D_x_get(void * jarg1) { + float jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float result; + + arg1 = (aiVector3t< float > *)jarg1; + result = (float) ((arg1)->x); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3D_y_set(void * jarg1, float jarg2) { + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->y = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D_y_get(void * jarg1) { + float jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float result; + + arg1 = (aiVector3t< float > *)jarg1; + result = (float) ((arg1)->y); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3D_z_set(void * jarg1, float jarg2) { + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiVector3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->z = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector3D_z_get(void * jarg1) { + float jresult ; + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + float result; + + arg1 = (aiVector3t< float > *)jarg1; + result = (float) ((arg1)->z); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiVector3D(void * jarg1) { + aiVector3t< float > *arg1 = (aiVector3t< float > *) 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + delete arg1; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector2D__SWIG_0() { + void * jresult ; + aiVector2t< float > *result = 0 ; + + result = (aiVector2t< float > *)new aiVector2t< float >(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector2D__SWIG_1(float jarg1, float jarg2) { + void * jresult ; + float arg1 ; + float arg2 ; + aiVector2t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (float)jarg2; + result = (aiVector2t< float > *)new aiVector2t< float >(arg1,arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector2D__SWIG_2(float jarg1) { + void * jresult ; + float arg1 ; + aiVector2t< float > *result = 0 ; + + arg1 = (float)jarg1; + result = (aiVector2t< float > *)new aiVector2t< float >(arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiVector2D__SWIG_3(void * jarg1) { + void * jresult ; + aiVector2t< float > *arg1 = 0 ; + aiVector2t< float > *result = 0 ; + + arg1 = (aiVector2t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2t< float > const & type is null", 0); + return 0; + } + result = (aiVector2t< float > *)new aiVector2t< float >((aiVector2t< float > const &)*arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiVector2D_Set(void * jarg1, float jarg2, float jarg3) { + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + float arg2 ; + float arg3 ; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (float)jarg2; + arg3 = (float)jarg3; + (arg1)->Set(arg2,arg3); +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector2D_SquareLength(void * jarg1) { + float jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + float result; + + arg1 = (aiVector2t< float > *)jarg1; + result = (float)((aiVector2t< float > const *)arg1)->SquareLength(); + jresult = result; + return jresult; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector2D_Length(void * jarg1) { + float jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + float result; + + arg1 = (aiVector2t< float > *)jarg1; + result = (float)((aiVector2t< float > const *)arg1)->Length(); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D_Normalize(void * jarg1) { + void * jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + aiVector2t< float > *result = 0 ; + + arg1 = (aiVector2t< float > *)jarg1; + result = (aiVector2t< float > *) &(arg1)->Normalize(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D___addnset__(void * jarg1, void * jarg2) { + void * jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + aiVector2t< float > *arg2 = 0 ; + aiVector2t< float > *result = 0 ; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (aiVector2t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2t< float > const & type is null", 0); + return 0; + } + result = (aiVector2t< float > *) &(arg1)->operator +=((aiVector2t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D___subnset__(void * jarg1, void * jarg2) { + void * jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + aiVector2t< float > *arg2 = 0 ; + aiVector2t< float > *result = 0 ; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (aiVector2t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2t< float > const & type is null", 0); + return 0; + } + result = (aiVector2t< float > *) &(arg1)->operator -=((aiVector2t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D___mulnset__(void * jarg1, float jarg2) { + void * jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + float arg2 ; + aiVector2t< float > *result = 0 ; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (float)jarg2; + result = (aiVector2t< float > *) &(arg1)->operator *=(arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D___divnset__(void * jarg1, float jarg2) { + void * jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + float arg2 ; + aiVector2t< float > *result = 0 ; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (float)jarg2; + result = (aiVector2t< float > *) &(arg1)->operator /=(arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector2D___idx____SWIG_0(void * jarg1, unsigned int jarg2) { + float jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + unsigned int arg2 ; + float result; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (unsigned int)jarg2; + result = (float)((aiVector2t< float > const *)arg1)->operator [](arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector2D___equal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + aiVector2t< float > *arg2 = 0 ; + bool result; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (aiVector2t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2t< float > const & type is null", 0); + return 0; + } + result = (bool)((aiVector2t< float > const *)arg1)->operator ==((aiVector2t< float > const &)*arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector2D___nequal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + aiVector2t< float > *arg2 = 0 ; + bool result; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (aiVector2t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2t< float > const & type is null", 0); + return 0; + } + result = (bool)((aiVector2t< float > const *)arg1)->operator !=((aiVector2t< float > const &)*arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D___set__(void * jarg1, float jarg2) { + void * jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + float arg2 ; + aiVector2t< float > *result = 0 ; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (float)jarg2; + result = (aiVector2t< float > *) &(arg1)->operator =(arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector2D_SymMul(void * jarg1, void * jarg2) { + void * jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + aiVector2t< float > *arg2 = 0 ; + aiVector2t< float > result; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (aiVector2t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2t< float > const & type is null", 0); + return 0; + } + result = (arg1)->SymMul((aiVector2t< float > const &)*arg2); + jresult = new aiVector2t< float >((const aiVector2t< float > &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiVector2D_x_set(void * jarg1, float jarg2) { + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + float arg2 ; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->x = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector2D_x_get(void * jarg1) { + float jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + float result; + + arg1 = (aiVector2t< float > *)jarg1; + result = (float) ((arg1)->x); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiVector2D_y_set(void * jarg1, float jarg2) { + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + float arg2 ; + + arg1 = (aiVector2t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->y = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiVector2D_y_get(void * jarg1) { + float jresult ; + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + float result; + + arg1 = (aiVector2t< float > *)jarg1; + result = (float) ((arg1)->y); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiVector2D(void * jarg1) { + aiVector2t< float > *arg1 = (aiVector2t< float > *) 0 ; + + arg1 = (aiVector2t< float > *)jarg1; + delete arg1; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_0() { + void * jresult ; + aiQuaterniont< float > *result = 0 ; + + result = (aiQuaterniont< float > *)new aiQuaterniont< float >(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4) { + void * jresult ; + float arg1 ; + float arg2 ; + float arg3 ; + float arg4 ; + aiQuaterniont< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (float)jarg2; + arg3 = (float)jarg3; + arg4 = (float)jarg4; + result = (aiQuaterniont< float > *)new aiQuaterniont< float >(arg1,arg2,arg3,arg4); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_2(void * jarg1) { + void * jresult ; + aiMatrix3x3t< float > *arg1 = 0 ; + aiQuaterniont< float > *result = 0 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3t< float > const & type is null", 0); + return 0; + } + result = (aiQuaterniont< float > *)new aiQuaterniont< float >((aiMatrix3x3t< float > const &)*arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_3(float jarg1, float jarg2, float jarg3) { + void * jresult ; + float arg1 ; + float arg2 ; + float arg3 ; + aiQuaterniont< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (float)jarg2; + arg3 = (float)jarg3; + result = (aiQuaterniont< float > *)new aiQuaterniont< float >(arg1,arg2,arg3); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_4(void * jarg1, float jarg2) { + void * jresult ; + aiVector3t< float > arg1 ; + float arg2 ; + aiVector3t< float > *argp1 ; + aiQuaterniont< float > *result = 0 ; + + argp1 = (aiVector3t< float > *)jarg1; + if (!argp1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null aiVector3t< float >", 0); + return 0; + } + arg1 = *argp1; + arg2 = (float)jarg2; + result = (aiQuaterniont< float > *)new aiQuaterniont< float >(arg1,arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiQuaternion__SWIG_5(void * jarg1) { + void * jresult ; + aiVector3t< float > arg1 ; + aiVector3t< float > *argp1 ; + aiQuaterniont< float > *result = 0 ; + + argp1 = (aiVector3t< float > *)jarg1; + if (!argp1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null aiVector3t< float >", 0); + return 0; + } + arg1 = *argp1; + result = (aiQuaterniont< float > *)new aiQuaterniont< float >(arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiQuaternion_GetMatrix(void * jarg1) { + void * jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + aiMatrix3x3t< float > result; + + arg1 = (aiQuaterniont< float > *)jarg1; + result = ((aiQuaterniont< float > const *)arg1)->GetMatrix(); + jresult = new aiMatrix3x3t< float >((const aiMatrix3x3t< float > &)result); + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiQuaternion___equal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + aiQuaterniont< float > *arg2 = 0 ; + bool result; + + arg1 = (aiQuaterniont< float > *)jarg1; + arg2 = (aiQuaterniont< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaterniont< float > const & type is null", 0); + return 0; + } + result = (bool)((aiQuaterniont< float > const *)arg1)->operator ==((aiQuaterniont< float > const &)*arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiQuaternion___nequal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + aiQuaterniont< float > *arg2 = 0 ; + bool result; + + arg1 = (aiQuaterniont< float > *)jarg1; + arg2 = (aiQuaterniont< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaterniont< float > const & type is null", 0); + return 0; + } + result = (bool)((aiQuaterniont< float > const *)arg1)->operator !=((aiQuaterniont< float > const &)*arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiQuaternion_Normalize(void * jarg1) { + void * jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + aiQuaterniont< float > *result = 0 ; + + arg1 = (aiQuaterniont< float > *)jarg1; + result = (aiQuaterniont< float > *) &(arg1)->Normalize(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiQuaternion_Conjugate(void * jarg1) { + void * jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + aiQuaterniont< float > *result = 0 ; + + arg1 = (aiQuaterniont< float > *)jarg1; + result = (aiQuaterniont< float > *) &(arg1)->Conjugate(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiQuaternion_Rotate(void * jarg1, void * jarg2) { + void * jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + aiVector3t< float > *arg2 = 0 ; + aiVector3t< float > result; + + arg1 = (aiQuaterniont< float > *)jarg1; + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + result = (arg1)->Rotate((aiVector3t< float > const &)*arg2); + jresult = new aiVector3t< float >((const aiVector3t< float > &)result); + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiQuaternion___mul__(void * jarg1, void * jarg2) { + void * jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + aiQuaterniont< float > *arg2 = 0 ; + aiQuaterniont< float > result; + + arg1 = (aiQuaterniont< float > *)jarg1; + arg2 = (aiQuaterniont< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaterniont< float > const & type is null", 0); + return 0; + } + result = ((aiQuaterniont< float > const *)arg1)->operator *((aiQuaterniont< float > const &)*arg2); + jresult = new aiQuaterniont< float >((const aiQuaterniont< float > &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiQuaternion_Interpolate(void * jarg1, void * jarg2, void * jarg3, float jarg4) { + aiQuaterniont< float > *arg1 = 0 ; + aiQuaterniont< float > *arg2 = 0 ; + aiQuaterniont< float > *arg3 = 0 ; + float arg4 ; + + arg1 = (aiQuaterniont< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaterniont< float > & type is null", 0); + return ; + } + arg2 = (aiQuaterniont< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaterniont< float > const & type is null", 0); + return ; + } + arg3 = (aiQuaterniont< float > *)jarg3; + if (!arg3) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaterniont< float > const & type is null", 0); + return ; + } + arg4 = (float)jarg4; + aiQuaterniont< float >::SWIGTEMPLATEDISAMBIGUATOR Interpolate(*arg1,(aiQuaterniont< float > const &)*arg2,(aiQuaterniont< float > const &)*arg3,arg4); +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiQuaternion_w_set(void * jarg1, float jarg2) { + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + float arg2 ; + + arg1 = (aiQuaterniont< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->w = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiQuaternion_w_get(void * jarg1) { + float jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + float result; + + arg1 = (aiQuaterniont< float > *)jarg1; + result = (float) ((arg1)->w); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiQuaternion_x_set(void * jarg1, float jarg2) { + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + float arg2 ; + + arg1 = (aiQuaterniont< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->x = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiQuaternion_x_get(void * jarg1) { + float jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + float result; + + arg1 = (aiQuaterniont< float > *)jarg1; + result = (float) ((arg1)->x); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiQuaternion_y_set(void * jarg1, float jarg2) { + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + float arg2 ; + + arg1 = (aiQuaterniont< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->y = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiQuaternion_y_get(void * jarg1) { + float jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + float result; + + arg1 = (aiQuaterniont< float > *)jarg1; + result = (float) ((arg1)->y); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiQuaternion_z_set(void * jarg1, float jarg2) { + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + float arg2 ; + + arg1 = (aiQuaterniont< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->z = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiQuaternion_z_get(void * jarg1) { + float jresult ; + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + float result; + + arg1 = (aiQuaterniont< float > *)jarg1; + result = (float) ((arg1)->z); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiQuaternion(void * jarg1) { + aiQuaterniont< float > *arg1 = (aiQuaterniont< float > *) 0 ; + + arg1 = (aiQuaterniont< float > *)jarg1; + delete arg1; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix3x3__SWIG_0() { + void * jresult ; + aiMatrix3x3t< float > *result = 0 ; + + result = (aiMatrix3x3t< float > *)new aiMatrix3x3t< float >(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix3x3__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9) { + void * jresult ; + float arg1 ; + float arg2 ; + float arg3 ; + float arg4 ; + float arg5 ; + float arg6 ; + float arg7 ; + float arg8 ; + float arg9 ; + aiMatrix3x3t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (float)jarg2; + arg3 = (float)jarg3; + arg4 = (float)jarg4; + arg5 = (float)jarg5; + arg6 = (float)jarg6; + arg7 = (float)jarg7; + arg8 = (float)jarg8; + arg9 = (float)jarg9; + result = (aiMatrix3x3t< float > *)new aiMatrix3x3t< float >(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3___mulnset__(void * jarg1, void * jarg2) { + void * jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + aiMatrix3x3t< float > *arg2 = 0 ; + aiMatrix3x3t< float > *result = 0 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (aiMatrix3x3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3t< float > const & type is null", 0); + return 0; + } + result = (aiMatrix3x3t< float > *) &(arg1)->operator *=((aiMatrix3x3t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3___mul__(void * jarg1, void * jarg2) { + void * jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + aiMatrix3x3t< float > *arg2 = 0 ; + aiMatrix3x3t< float > result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (aiMatrix3x3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3t< float > const & type is null", 0); + return 0; + } + result = ((aiMatrix3x3t< float > const *)arg1)->operator *((aiMatrix3x3t< float > const &)*arg2); + jresult = new aiMatrix3x3t< float >((const aiMatrix3x3t< float > &)result); + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3___idx____SWIG_0(void * jarg1, unsigned int jarg2) { + void * jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + unsigned int arg2 ; + float *result = 0 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (unsigned int)jarg2; + result = (float *)(arg1)->operator [](arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiMatrix3x3___equal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + aiMatrix4x4t< float > arg2 ; + aiMatrix4x4t< float > const *argp2 ; + bool result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + argp2 = (aiMatrix4x4t< float > *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null aiMatrix4x4t< float > const", 0); + return 0; + } + arg2 = *argp2; + result = (bool)((aiMatrix3x3t< float > const *)arg1)->operator ==(arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiMatrix3x3___nequal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + aiMatrix4x4t< float > arg2 ; + aiMatrix4x4t< float > const *argp2 ; + bool result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + argp2 = (aiMatrix4x4t< float > *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null aiMatrix4x4t< float > const", 0); + return 0; + } + arg2 = *argp2; + result = (bool)((aiMatrix3x3t< float > const *)arg1)->operator !=(arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix3x3__SWIG_2(void * jarg1) { + void * jresult ; + aiMatrix4x4t< float > *arg1 = 0 ; + aiMatrix3x3t< float > *result = 0 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > const & type is null", 0); + return 0; + } + result = (aiMatrix3x3t< float > *)new aiMatrix3x3t< float >((aiMatrix4x4t< float > const &)*arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_Transpose(void * jarg1) { + void * jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + aiMatrix3x3t< float > *result = 0 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (aiMatrix3x3t< float > *) &(arg1)->Transpose(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_Inverse(void * jarg1) { + void * jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + aiMatrix3x3t< float > *result = 0 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (aiMatrix3x3t< float > *) &(arg1)->Inverse(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_Determinant(void * jarg1) { + float jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (float)((aiMatrix3x3t< float > const *)arg1)->Determinant(); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_RotationZ(float jarg1, void * jarg2) { + void * jresult ; + float arg1 ; + aiMatrix3x3t< float > *arg2 = 0 ; + aiMatrix3x3t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (aiMatrix3x3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3t< float > & type is null", 0); + return 0; + } + result = (aiMatrix3x3t< float > *) &aiMatrix3x3t< float >::SWIGTEMPLATEDISAMBIGUATOR RotationZ(arg1,*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_Rotation(float jarg1, void * jarg2, void * jarg3) { + void * jresult ; + float arg1 ; + aiVector3t< float > *arg2 = 0 ; + aiMatrix3x3t< float > *arg3 = 0 ; + aiMatrix3x3t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + arg3 = (aiMatrix3x3t< float > *)jarg3; + if (!arg3) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3t< float > & type is null", 0); + return 0; + } + result = (aiMatrix3x3t< float > *) &aiMatrix3x3t< float >::SWIGTEMPLATEDISAMBIGUATOR Rotation(arg1,(aiVector3t< float > const &)*arg2,*arg3); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_Translation(void * jarg1, void * jarg2) { + void * jresult ; + aiVector2t< float > *arg1 = 0 ; + aiMatrix3x3t< float > *arg2 = 0 ; + aiMatrix3x3t< float > *result = 0 ; + + arg1 = (aiVector2t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector2t< float > const & type is null", 0); + return 0; + } + arg2 = (aiMatrix3x3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3t< float > & type is null", 0); + return 0; + } + result = (aiMatrix3x3t< float > *) &aiMatrix3x3t< float >::SWIGTEMPLATEDISAMBIGUATOR Translation((aiVector2t< float > const &)*arg1,*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix3x3_FromToMatrix(void * jarg1, void * jarg2, void * jarg3) { + void * jresult ; + aiVector3t< float > *arg1 = 0 ; + aiVector3t< float > *arg2 = 0 ; + aiMatrix3x3t< float > *arg3 = 0 ; + aiMatrix3x3t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + arg3 = (aiMatrix3x3t< float > *)jarg3; + if (!arg3) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3t< float > & type is null", 0); + return 0; + } + result = (aiMatrix3x3t< float > *) &aiMatrix3x3t< float >::SWIGTEMPLATEDISAMBIGUATOR FromToMatrix((aiVector3t< float > const &)*arg1,(aiVector3t< float > const &)*arg2,*arg3); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_a1_set(void * jarg1, float jarg2) { + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->a1 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_a1_get(void * jarg1) { + float jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (float) ((arg1)->a1); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_a2_set(void * jarg1, float jarg2) { + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->a2 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_a2_get(void * jarg1) { + float jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (float) ((arg1)->a2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_a3_set(void * jarg1, float jarg2) { + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->a3 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_a3_get(void * jarg1) { + float jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (float) ((arg1)->a3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_b1_set(void * jarg1, float jarg2) { + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->b1 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_b1_get(void * jarg1) { + float jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (float) ((arg1)->b1); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_b2_set(void * jarg1, float jarg2) { + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->b2 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_b2_get(void * jarg1) { + float jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (float) ((arg1)->b2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_b3_set(void * jarg1, float jarg2) { + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->b3 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_b3_get(void * jarg1) { + float jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (float) ((arg1)->b3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_c1_set(void * jarg1, float jarg2) { + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->c1 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_c1_get(void * jarg1) { + float jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (float) ((arg1)->c1); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_c2_set(void * jarg1, float jarg2) { + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->c2 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_c2_get(void * jarg1) { + float jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (float) ((arg1)->c2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix3x3_c3_set(void * jarg1, float jarg2) { + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->c3 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix3x3_c3_get(void * jarg1) { + float jresult ; + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + float result; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + result = (float) ((arg1)->c3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiMatrix3x3(void * jarg1) { + aiMatrix3x3t< float > *arg1 = (aiMatrix3x3t< float > *) 0 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + delete arg1; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix4x4__SWIG_0() { + void * jresult ; + aiMatrix4x4t< float > *result = 0 ; + + result = (aiMatrix4x4t< float > *)new aiMatrix4x4t< float >(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix4x4__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9, float jarg10, float jarg11, float jarg12, float jarg13, float jarg14, float jarg15, float jarg16) { + void * jresult ; + float arg1 ; + float arg2 ; + float arg3 ; + float arg4 ; + float arg5 ; + float arg6 ; + float arg7 ; + float arg8 ; + float arg9 ; + float arg10 ; + float arg11 ; + float arg12 ; + float arg13 ; + float arg14 ; + float arg15 ; + float arg16 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (float)jarg2; + arg3 = (float)jarg3; + arg4 = (float)jarg4; + arg5 = (float)jarg5; + arg6 = (float)jarg6; + arg7 = (float)jarg7; + arg8 = (float)jarg8; + arg9 = (float)jarg9; + arg10 = (float)jarg10; + arg11 = (float)jarg11; + arg12 = (float)jarg12; + arg13 = (float)jarg13; + arg14 = (float)jarg14; + arg15 = (float)jarg15; + arg16 = (float)jarg16; + result = (aiMatrix4x4t< float > *)new aiMatrix4x4t< float >(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_aiMatrix4x4__SWIG_2(void * jarg1) { + void * jresult ; + aiMatrix3x3t< float > *arg1 = 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (aiMatrix3x3t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix3x3t< float > const & type is null", 0); + return 0; + } + result = (aiMatrix4x4t< float > *)new aiMatrix4x4t< float >((aiMatrix3x3t< float > const &)*arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4___idx____SWIG_0(void * jarg1, unsigned int jarg2) { + void * jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + unsigned int arg2 ; + float *result = 0 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (unsigned int)jarg2; + result = (float *)(arg1)->operator [](arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiMatrix4x4___equal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + aiMatrix4x4t< float > arg2 ; + aiMatrix4x4t< float > const *argp2 ; + bool result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + argp2 = (aiMatrix4x4t< float > *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null aiMatrix4x4t< float > const", 0); + return 0; + } + arg2 = *argp2; + result = (bool)((aiMatrix4x4t< float > const *)arg1)->operator ==(arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiMatrix4x4___nequal__(void * jarg1, void * jarg2) { + unsigned int jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + aiMatrix4x4t< float > arg2 ; + aiMatrix4x4t< float > const *argp2 ; + bool result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + argp2 = (aiMatrix4x4t< float > *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null aiMatrix4x4t< float > const", 0); + return 0; + } + arg2 = *argp2; + result = (bool)((aiMatrix4x4t< float > const *)arg1)->operator !=(arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4___mulnset__(void * jarg1, void * jarg2) { + void * jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + aiMatrix4x4t< float > *arg2 = 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (aiMatrix4x4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > const & type is null", 0); + return 0; + } + result = (aiMatrix4x4t< float > *) &(arg1)->operator *=((aiMatrix4x4t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4___mul__(void * jarg1, void * jarg2) { + void * jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + aiMatrix4x4t< float > *arg2 = 0 ; + aiMatrix4x4t< float > result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (aiMatrix4x4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > const & type is null", 0); + return 0; + } + result = ((aiMatrix4x4t< float > const *)arg1)->operator *((aiMatrix4x4t< float > const &)*arg2); + jresult = new aiMatrix4x4t< float >((const aiMatrix4x4t< float > &)result); + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_Transpose(void * jarg1) { + void * jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (aiMatrix4x4t< float > *) &(arg1)->Transpose(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_Inverse(void * jarg1) { + void * jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (aiMatrix4x4t< float > *) &(arg1)->Inverse(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_Determinant(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float)((aiMatrix4x4t< float > const *)arg1)->Determinant(); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiMatrix4x4_IsIdentity(void * jarg1) { + unsigned int jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + bool result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (bool)((aiMatrix4x4t< float > const *)arg1)->IsIdentity(); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_Decompose(void * jarg1, void * jarg2, void * jarg3, void * jarg4) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + aiVector3t< float > *arg2 = 0 ; + aiQuaterniont< float > *arg3 = 0 ; + aiVector3t< float > *arg4 = 0 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > & type is null", 0); + return ; + } + arg3 = (aiQuaterniont< float > *)jarg3; + if (!arg3) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaterniont< float > & type is null", 0); + return ; + } + arg4 = (aiVector3t< float > *)jarg4; + if (!arg4) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > & type is null", 0); + return ; + } + ((aiMatrix4x4t< float > const *)arg1)->Decompose(*arg2,*arg3,*arg4); +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_DecomposeNoScaling(void * jarg1, void * jarg2, void * jarg3) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + aiQuaterniont< float > *arg2 = 0 ; + aiVector3t< float > *arg3 = 0 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (aiQuaterniont< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiQuaterniont< float > & type is null", 0); + return ; + } + arg3 = (aiVector3t< float > *)jarg3; + if (!arg3) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > & type is null", 0); + return ; + } + ((aiMatrix4x4t< float > const *)arg1)->DecomposeNoScaling(*arg2,*arg3); +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_FromEulerAnglesXYZ__SWIG_0(void * jarg1, float jarg2, float jarg3, float jarg4) { + void * jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + float arg3 ; + float arg4 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + arg3 = (float)jarg3; + arg4 = (float)jarg4; + result = (aiMatrix4x4t< float > *) &(arg1)->FromEulerAnglesXYZ(arg2,arg3,arg4); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_FromEulerAnglesXYZ__SWIG_1(void * jarg1, void * jarg2) { + void * jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + aiVector3t< float > *arg2 = 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + result = (aiMatrix4x4t< float > *) &(arg1)->FromEulerAnglesXYZ((aiVector3t< float > const &)*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_RotationX(float jarg1, void * jarg2) { + void * jresult ; + float arg1 ; + aiMatrix4x4t< float > *arg2 = 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (aiMatrix4x4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > & type is null", 0); + return 0; + } + result = (aiMatrix4x4t< float > *) &aiMatrix4x4t< float >::SWIGTEMPLATEDISAMBIGUATOR RotationX(arg1,*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_RotationY(float jarg1, void * jarg2) { + void * jresult ; + float arg1 ; + aiMatrix4x4t< float > *arg2 = 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (aiMatrix4x4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > & type is null", 0); + return 0; + } + result = (aiMatrix4x4t< float > *) &aiMatrix4x4t< float >::SWIGTEMPLATEDISAMBIGUATOR RotationY(arg1,*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_RotationZ(float jarg1, void * jarg2) { + void * jresult ; + float arg1 ; + aiMatrix4x4t< float > *arg2 = 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (aiMatrix4x4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > & type is null", 0); + return 0; + } + result = (aiMatrix4x4t< float > *) &aiMatrix4x4t< float >::SWIGTEMPLATEDISAMBIGUATOR RotationZ(arg1,*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_Rotation(float jarg1, void * jarg2, void * jarg3) { + void * jresult ; + float arg1 ; + aiVector3t< float > *arg2 = 0 ; + aiMatrix4x4t< float > *arg3 = 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (float)jarg1; + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + arg3 = (aiMatrix4x4t< float > *)jarg3; + if (!arg3) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > & type is null", 0); + return 0; + } + result = (aiMatrix4x4t< float > *) &aiMatrix4x4t< float >::SWIGTEMPLATEDISAMBIGUATOR Rotation(arg1,(aiVector3t< float > const &)*arg2,*arg3); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_Translation(void * jarg1, void * jarg2) { + void * jresult ; + aiVector3t< float > *arg1 = 0 ; + aiMatrix4x4t< float > *arg2 = 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + arg2 = (aiMatrix4x4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > & type is null", 0); + return 0; + } + result = (aiMatrix4x4t< float > *) &aiMatrix4x4t< float >::SWIGTEMPLATEDISAMBIGUATOR Translation((aiVector3t< float > const &)*arg1,*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_Scaling(void * jarg1, void * jarg2) { + void * jresult ; + aiVector3t< float > *arg1 = 0 ; + aiMatrix4x4t< float > *arg2 = 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + arg2 = (aiMatrix4x4t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > & type is null", 0); + return 0; + } + result = (aiMatrix4x4t< float > *) &aiMatrix4x4t< float >::SWIGTEMPLATEDISAMBIGUATOR Scaling((aiVector3t< float > const &)*arg1,*arg2); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_aiMatrix4x4_FromToMatrix(void * jarg1, void * jarg2, void * jarg3) { + void * jresult ; + aiVector3t< float > *arg1 = 0 ; + aiVector3t< float > *arg2 = 0 ; + aiMatrix4x4t< float > *arg3 = 0 ; + aiMatrix4x4t< float > *result = 0 ; + + arg1 = (aiVector3t< float > *)jarg1; + if (!arg1) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + arg2 = (aiVector3t< float > *)jarg2; + if (!arg2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiVector3t< float > const & type is null", 0); + return 0; + } + arg3 = (aiMatrix4x4t< float > *)jarg3; + if (!arg3) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "aiMatrix4x4t< float > & type is null", 0); + return 0; + } + result = (aiMatrix4x4t< float > *) &aiMatrix4x4t< float >::SWIGTEMPLATEDISAMBIGUATOR FromToMatrix((aiVector3t< float > const &)*arg1,(aiVector3t< float > const &)*arg2,*arg3); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_a1_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->a1 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_a1_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->a1); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_a2_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->a2 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_a2_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->a2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_a3_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->a3 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_a3_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->a3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_a4_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->a4 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_a4_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->a4); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_b1_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->b1 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_b1_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->b1); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_b2_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->b2 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_b2_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->b2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_b3_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->b3 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_b3_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->b3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_b4_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->b4 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_b4_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->b4); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_c1_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->c1 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_c1_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->c1); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_c2_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->c2 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_c2_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->c2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_c3_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->c3 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_c3_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->c3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_c4_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->c4 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_c4_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->c4); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_d1_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->d1 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_d1_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->d1); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_d2_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->d2 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_d2_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->d2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_d3_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->d3 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_d3_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->d3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_aiMatrix4x4_d4_set(void * jarg1, float jarg2) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float arg2 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + arg2 = (float)jarg2; + if (arg1) (arg1)->d4 = arg2; +} + + +SWIGEXPORT float SWIGSTDCALL CSharp_aiMatrix4x4_d4_get(void * jarg1) { + float jresult ; + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + float result; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + result = (float) ((arg1)->d4); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_aiMatrix4x4(void * jarg1) { + aiMatrix4x4t< float > *arg1 = (aiMatrix4x4t< float > *) 0 ; + + arg1 = (aiMatrix4x4t< float > *)jarg1; + delete arg1; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_FloatVector_Clear(void * jarg1) { std::vector< float > *arg1 = (std::vector< float > *) 0 ; @@ -14075,22 +14427,22 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_Clear(void * jarg1) { SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_Add(void * jarg1, void * jarg2) { std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; - std::vector< aiColor4D * > *arg2 = 0 ; + std::vector< aiColor4t< float > * > *arg2 = 0 ; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; - arg2 = (std::vector< aiColor4D * > *)jarg2; + arg2 = (std::vector< aiColor4t< float > * > *)jarg2; if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4D * > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4t< float > * > const & type is null", 0); return ; } - (arg1)->push_back((std::vector< aiColor4D * > const &)*arg2); + (arg1)->push_back((std::vector< aiColor4t< float > * > const &)*arg2); } SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiColor4DVectorVector_size(void * jarg1) { unsigned long jresult ; std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; - std::vector< std::vector< aiColor4D * > >::size_type result; + std::vector< std::vector< aiColor4t< float > * > >::size_type result; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; result = ((std::vector< std::vector< aiColor4D * > > const *)arg1)->size(); @@ -14102,7 +14454,7 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiColor4DVectorVector_size(void * ja SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiColor4DVectorVector_capacity(void * jarg1) { unsigned long jresult ; std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; - std::vector< std::vector< aiColor4D * > >::size_type result; + std::vector< std::vector< aiColor4t< float > * > >::size_type result; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; result = ((std::vector< std::vector< aiColor4D * > > const *)arg1)->capacity(); @@ -14113,10 +14465,10 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiColor4DVectorVector_capacity(void SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_reserve(void * jarg1, unsigned long jarg2) { std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; - std::vector< std::vector< aiColor4D * > >::size_type arg2 ; + std::vector< std::vector< aiColor4t< float > * > >::size_type arg2 ; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; - arg2 = (std::vector< std::vector< aiColor4D * > >::size_type)jarg2; + arg2 = (std::vector< std::vector< aiColor4t< float > * > >::size_type)jarg2; (arg1)->reserve(arg2); } @@ -14170,7 +14522,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVectorVector_getitemcopy(void * ja void * jresult ; std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; int arg2 ; - std::vector< aiColor4D * > result; + std::vector< aiColor4t< float > * > result; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; arg2 = (int)jarg2; @@ -14182,7 +14534,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVectorVector_getitemcopy(void * ja return 0; } - jresult = new std::vector< aiColor4D * >((const std::vector< aiColor4D * > &)result); + jresult = new std::vector< aiColor4t< float > * >((const std::vector< aiColor4t< float > * > &)result); return jresult; } @@ -14191,12 +14543,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVectorVector_getitem(void * jarg1, void * jresult ; std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; int arg2 ; - std::vector< aiColor4D * > *result = 0 ; + std::vector< aiColor4t< float > * > *result = 0 ; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; arg2 = (int)jarg2; try { - result = (std::vector< aiColor4D * > *) &std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__getitem(arg1,arg2); + result = (std::vector< aiColor4t< float > * > *) &std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__getitem(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14211,17 +14563,17 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVectorVector_getitem(void * jarg1, SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_setitem(void * jarg1, int jarg2, void * jarg3) { std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; int arg2 ; - std::vector< aiColor4D * > *arg3 = 0 ; + std::vector< aiColor4t< float > * > *arg3 = 0 ; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; arg2 = (int)jarg2; - arg3 = (std::vector< aiColor4D * > *)jarg3; + arg3 = (std::vector< aiColor4t< float > * > *)jarg3; if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4D * > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4t< float > * > const & type is null", 0); return ; } try { - std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__setitem(arg1,arg2,(std::vector< aiColor4D * > const &)*arg3); + std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__setitem(arg1,arg2,(std::vector< aiColor4t< float > * > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14233,15 +14585,15 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_setitem(void * jarg1, i SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_AddRange(void * jarg1, void * jarg2) { std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; - std::vector< std::vector< aiColor4D * > > *arg2 = 0 ; + std::vector< std::vector< aiColor4t< float > * > > *arg2 = 0 ; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; - arg2 = (std::vector< std::vector< aiColor4D * > > *)jarg2; + arg2 = (std::vector< std::vector< aiColor4t< float > * > > *)jarg2; if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< std::vector< aiColor4D * > > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< std::vector< aiColor4t< float > * > > const & type is null", 0); return ; } - std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__AddRange(arg1,(std::vector< std::vector< aiColor4D * > > const &)*arg2); + std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__AddRange(arg1,(std::vector< std::vector< aiColor4t< float > * > > const &)*arg2); } @@ -14250,13 +14602,13 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVectorVector_GetRange(void * jarg1 std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; int arg2 ; int arg3 ; - std::vector< std::vector< aiColor4D * > > *result = 0 ; + std::vector< std::vector< aiColor4t< float > * > > *result = 0 ; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; arg2 = (int)jarg2; arg3 = (int)jarg3; try { - result = (std::vector< std::vector< aiColor4D * > > *)std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__GetRange(arg1,arg2,arg3); + result = (std::vector< std::vector< aiColor4t< float > * > > *)std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__GetRange(arg1,arg2,arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14275,17 +14627,17 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVectorVector_GetRange(void * jarg1 SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_Insert(void * jarg1, int jarg2, void * jarg3) { std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; int arg2 ; - std::vector< aiColor4D * > *arg3 = 0 ; + std::vector< aiColor4t< float > * > *arg3 = 0 ; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; arg2 = (int)jarg2; - arg3 = (std::vector< aiColor4D * > *)jarg3; + arg3 = (std::vector< aiColor4t< float > * > *)jarg3; if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4D * > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4t< float > * > const & type is null", 0); return ; } try { - std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__Insert(arg1,arg2,(std::vector< aiColor4D * > const &)*arg3); + std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__Insert(arg1,arg2,(std::vector< aiColor4t< float > * > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14298,17 +14650,17 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_Insert(void * jarg1, in SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_InsertRange(void * jarg1, int jarg2, void * jarg3) { std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; int arg2 ; - std::vector< std::vector< aiColor4D * > > *arg3 = 0 ; + std::vector< std::vector< aiColor4t< float > * > > *arg3 = 0 ; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; arg2 = (int)jarg2; - arg3 = (std::vector< std::vector< aiColor4D * > > *)jarg3; + arg3 = (std::vector< std::vector< aiColor4t< float > * > > *)jarg3; if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< std::vector< aiColor4D * > > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< std::vector< aiColor4t< float > * > > const & type is null", 0); return ; } try { - std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__InsertRange(arg1,arg2,(std::vector< std::vector< aiColor4D * > > const &)*arg3); + std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__InsertRange(arg1,arg2,(std::vector< std::vector< aiColor4t< float > * > > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14360,18 +14712,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_RemoveRange(void * jarg SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVectorVector_Repeat(void * jarg1, int jarg2) { void * jresult ; - std::vector< aiColor4D * > *arg1 = 0 ; + std::vector< aiColor4t< float > * > *arg1 = 0 ; int arg2 ; - std::vector< std::vector< aiColor4D * > > *result = 0 ; + std::vector< std::vector< aiColor4t< float > * > > *result = 0 ; - arg1 = (std::vector< aiColor4D * > *)jarg1; + arg1 = (std::vector< aiColor4t< float > * > *)jarg1; if (!arg1) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4D * > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4t< float > * > const & type is null", 0); return 0; } arg2 = (int)jarg2; try { - result = (std::vector< std::vector< aiColor4D * > > *)std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__Repeat((std::vector< aiColor4D * > const &)*arg1,arg2); + result = (std::vector< std::vector< aiColor4t< float > * > > *)std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__Repeat((std::vector< aiColor4t< float > * > const &)*arg1,arg2); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14417,17 +14769,17 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_Reverse__SWIG_1(void * SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVectorVector_SetRange(void * jarg1, int jarg2, void * jarg3) { std::vector< std::vector< aiColor4D * > > *arg1 = (std::vector< std::vector< aiColor4D * > > *) 0 ; int arg2 ; - std::vector< std::vector< aiColor4D * > > *arg3 = 0 ; + std::vector< std::vector< aiColor4t< float > * > > *arg3 = 0 ; arg1 = (std::vector< std::vector< aiColor4D * > > *)jarg1; arg2 = (int)jarg2; - arg3 = (std::vector< std::vector< aiColor4D * > > *)jarg3; + arg3 = (std::vector< std::vector< aiColor4t< float > * > > *)jarg3; if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< std::vector< aiColor4D * > > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< std::vector< aiColor4t< float > * > > const & type is null", 0); return ; } try { - std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__SetRange(arg1,arg2,(std::vector< std::vector< aiColor4D * > > const &)*arg3); + std_vector_Sl_std_vector_Sl_aiColor4D_Sm__Sg__Sg__SetRange(arg1,arg2,(std::vector< std::vector< aiColor4t< float > * > > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14455,20 +14807,20 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_Clear(void * jarg1) { SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_Add(void * jarg1, void * jarg2) { std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; - aiColor4D **arg2 = 0 ; - aiColor4D *temp2 = 0 ; + aiColor4t< float > **arg2 = 0 ; + aiColor4t< float > *temp2 = 0 ; arg1 = (std::vector< aiColor4D * > *)jarg1; - temp2 = (aiColor4D *)jarg2; - arg2 = (aiColor4D **)&temp2; - (arg1)->push_back((aiColor4D *const &)*arg2); + temp2 = (aiColor4t< float > *)jarg2; + arg2 = (aiColor4t< float > **)&temp2; + (arg1)->push_back((aiColor4t< float > *const &)*arg2); } SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiColor4DVector_size(void * jarg1) { unsigned long jresult ; std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; - std::vector< aiColor4D * >::size_type result; + std::vector< aiColor4t< float > * >::size_type result; arg1 = (std::vector< aiColor4D * > *)jarg1; result = ((std::vector< aiColor4D * > const *)arg1)->size(); @@ -14480,7 +14832,7 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiColor4DVector_size(void * jarg1) { SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiColor4DVector_capacity(void * jarg1) { unsigned long jresult ; std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; - std::vector< aiColor4D * >::size_type result; + std::vector< aiColor4t< float > * >::size_type result; arg1 = (std::vector< aiColor4D * > *)jarg1; result = ((std::vector< aiColor4D * > const *)arg1)->capacity(); @@ -14491,10 +14843,10 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiColor4DVector_capacity(void * jarg SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_reserve(void * jarg1, unsigned long jarg2) { std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; - std::vector< aiColor4D * >::size_type arg2 ; + std::vector< aiColor4t< float > * >::size_type arg2 ; arg1 = (std::vector< aiColor4D * > *)jarg1; - arg2 = (std::vector< aiColor4D * >::size_type)jarg2; + arg2 = (std::vector< aiColor4t< float > * >::size_type)jarg2; (arg1)->reserve(arg2); } @@ -14548,12 +14900,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVector_getitemcopy(void * jarg1, i void * jresult ; std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; int arg2 ; - aiColor4D *result = 0 ; + aiColor4t< float > *result = 0 ; arg1 = (std::vector< aiColor4D * > *)jarg1; arg2 = (int)jarg2; try { - result = (aiColor4D *)std_vector_Sl_aiColor4D_Sm__Sg__getitemcopy(arg1,arg2); + result = (aiColor4t< float > *)std_vector_Sl_aiColor4D_Sm__Sg__getitemcopy(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14569,12 +14921,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVector_getitem(void * jarg1, int j void * jresult ; std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; int arg2 ; - aiColor4D **result = 0 ; + aiColor4t< float > **result = 0 ; arg1 = (std::vector< aiColor4D * > *)jarg1; arg2 = (int)jarg2; try { - result = (aiColor4D **) &std_vector_Sl_aiColor4D_Sm__Sg__getitem(arg1,arg2); + result = (aiColor4t< float > **) &std_vector_Sl_aiColor4D_Sm__Sg__getitem(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14589,15 +14941,15 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVector_getitem(void * jarg1, int j SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_setitem(void * jarg1, int jarg2, void * jarg3) { std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; int arg2 ; - aiColor4D **arg3 = 0 ; - aiColor4D *temp3 = 0 ; + aiColor4t< float > **arg3 = 0 ; + aiColor4t< float > *temp3 = 0 ; arg1 = (std::vector< aiColor4D * > *)jarg1; arg2 = (int)jarg2; - temp3 = (aiColor4D *)jarg3; - arg3 = (aiColor4D **)&temp3; + temp3 = (aiColor4t< float > *)jarg3; + arg3 = (aiColor4t< float > **)&temp3; try { - std_vector_Sl_aiColor4D_Sm__Sg__setitem(arg1,arg2,(aiColor4D *const &)*arg3); + std_vector_Sl_aiColor4D_Sm__Sg__setitem(arg1,arg2,(aiColor4t< float > *const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14609,15 +14961,15 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_setitem(void * jarg1, int jar SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_AddRange(void * jarg1, void * jarg2) { std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; - std::vector< aiColor4D * > *arg2 = 0 ; + std::vector< aiColor4t< float > * > *arg2 = 0 ; arg1 = (std::vector< aiColor4D * > *)jarg1; - arg2 = (std::vector< aiColor4D * > *)jarg2; + arg2 = (std::vector< aiColor4t< float > * > *)jarg2; if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4D * > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4t< float > * > const & type is null", 0); return ; } - std_vector_Sl_aiColor4D_Sm__Sg__AddRange(arg1,(std::vector< aiColor4D * > const &)*arg2); + std_vector_Sl_aiColor4D_Sm__Sg__AddRange(arg1,(std::vector< aiColor4t< float > * > const &)*arg2); } @@ -14626,13 +14978,13 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVector_GetRange(void * jarg1, int std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; int arg2 ; int arg3 ; - std::vector< aiColor4D * > *result = 0 ; + std::vector< aiColor4t< float > * > *result = 0 ; arg1 = (std::vector< aiColor4D * > *)jarg1; arg2 = (int)jarg2; arg3 = (int)jarg3; try { - result = (std::vector< aiColor4D * > *)std_vector_Sl_aiColor4D_Sm__Sg__GetRange(arg1,arg2,arg3); + result = (std::vector< aiColor4t< float > * > *)std_vector_Sl_aiColor4D_Sm__Sg__GetRange(arg1,arg2,arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14651,15 +15003,15 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVector_GetRange(void * jarg1, int SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_Insert(void * jarg1, int jarg2, void * jarg3) { std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; int arg2 ; - aiColor4D **arg3 = 0 ; - aiColor4D *temp3 = 0 ; + aiColor4t< float > **arg3 = 0 ; + aiColor4t< float > *temp3 = 0 ; arg1 = (std::vector< aiColor4D * > *)jarg1; arg2 = (int)jarg2; - temp3 = (aiColor4D *)jarg3; - arg3 = (aiColor4D **)&temp3; + temp3 = (aiColor4t< float > *)jarg3; + arg3 = (aiColor4t< float > **)&temp3; try { - std_vector_Sl_aiColor4D_Sm__Sg__Insert(arg1,arg2,(aiColor4D *const &)*arg3); + std_vector_Sl_aiColor4D_Sm__Sg__Insert(arg1,arg2,(aiColor4t< float > *const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14672,17 +15024,17 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_Insert(void * jarg1, int jarg SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_InsertRange(void * jarg1, int jarg2, void * jarg3) { std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; int arg2 ; - std::vector< aiColor4D * > *arg3 = 0 ; + std::vector< aiColor4t< float > * > *arg3 = 0 ; arg1 = (std::vector< aiColor4D * > *)jarg1; arg2 = (int)jarg2; - arg3 = (std::vector< aiColor4D * > *)jarg3; + arg3 = (std::vector< aiColor4t< float > * > *)jarg3; if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4D * > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4t< float > * > const & type is null", 0); return ; } try { - std_vector_Sl_aiColor4D_Sm__Sg__InsertRange(arg1,arg2,(std::vector< aiColor4D * > const &)*arg3); + std_vector_Sl_aiColor4D_Sm__Sg__InsertRange(arg1,arg2,(std::vector< aiColor4t< float > * > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14734,16 +15086,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_RemoveRange(void * jarg1, int SWIGEXPORT void * SWIGSTDCALL CSharp_aiColor4DVector_Repeat(void * jarg1, int jarg2) { void * jresult ; - aiColor4D **arg1 = 0 ; + aiColor4t< float > **arg1 = 0 ; int arg2 ; - aiColor4D *temp1 = 0 ; - std::vector< aiColor4D * > *result = 0 ; + aiColor4t< float > *temp1 = 0 ; + std::vector< aiColor4t< float > * > *result = 0 ; - temp1 = (aiColor4D *)jarg1; - arg1 = (aiColor4D **)&temp1; + temp1 = (aiColor4t< float > *)jarg1; + arg1 = (aiColor4t< float > **)&temp1; arg2 = (int)jarg2; try { - result = (std::vector< aiColor4D * > *)std_vector_Sl_aiColor4D_Sm__Sg__Repeat((aiColor4D *const &)*arg1,arg2); + result = (std::vector< aiColor4t< float > * > *)std_vector_Sl_aiColor4D_Sm__Sg__Repeat((aiColor4t< float > *const &)*arg1,arg2); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14789,17 +15141,17 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_Reverse__SWIG_1(void * jarg1, SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_SetRange(void * jarg1, int jarg2, void * jarg3) { std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; int arg2 ; - std::vector< aiColor4D * > *arg3 = 0 ; + std::vector< aiColor4t< float > * > *arg3 = 0 ; arg1 = (std::vector< aiColor4D * > *)jarg1; arg2 = (int)jarg2; - arg3 = (std::vector< aiColor4D * > *)jarg3; + arg3 = (std::vector< aiColor4t< float > * > *)jarg3; if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4D * > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiColor4t< float > * > const & type is null", 0); return ; } try { - std_vector_Sl_aiColor4D_Sm__Sg__SetRange(arg1,arg2,(std::vector< aiColor4D * > const &)*arg3); + std_vector_Sl_aiColor4D_Sm__Sg__SetRange(arg1,arg2,(std::vector< aiColor4t< float > * > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -14812,14 +15164,14 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiColor4DVector_SetRange(void * jarg1, int ja SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiColor4DVector_Contains(void * jarg1, void * jarg2) { unsigned int jresult ; std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; - aiColor4D **arg2 = 0 ; - aiColor4D *temp2 = 0 ; + aiColor4t< float > **arg2 = 0 ; + aiColor4t< float > *temp2 = 0 ; bool result; arg1 = (std::vector< aiColor4D * > *)jarg1; - temp2 = (aiColor4D *)jarg2; - arg2 = (aiColor4D **)&temp2; - result = (bool)std_vector_Sl_aiColor4D_Sm__Sg__Contains(arg1,(aiColor4D *const &)*arg2); + temp2 = (aiColor4t< float > *)jarg2; + arg2 = (aiColor4t< float > **)&temp2; + result = (bool)std_vector_Sl_aiColor4D_Sm__Sg__Contains(arg1,(aiColor4t< float > *const &)*arg2); jresult = result; return jresult; } @@ -14828,14 +15180,14 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiColor4DVector_Contains(void * jarg1 SWIGEXPORT int SWIGSTDCALL CSharp_aiColor4DVector_IndexOf(void * jarg1, void * jarg2) { int jresult ; std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; - aiColor4D **arg2 = 0 ; - aiColor4D *temp2 = 0 ; + aiColor4t< float > **arg2 = 0 ; + aiColor4t< float > *temp2 = 0 ; int result; arg1 = (std::vector< aiColor4D * > *)jarg1; - temp2 = (aiColor4D *)jarg2; - arg2 = (aiColor4D **)&temp2; - result = (int)std_vector_Sl_aiColor4D_Sm__Sg__IndexOf(arg1,(aiColor4D *const &)*arg2); + temp2 = (aiColor4t< float > *)jarg2; + arg2 = (aiColor4t< float > **)&temp2; + result = (int)std_vector_Sl_aiColor4D_Sm__Sg__IndexOf(arg1,(aiColor4t< float > *const &)*arg2); jresult = result; return jresult; } @@ -14844,14 +15196,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_aiColor4DVector_IndexOf(void * jarg1, void * j SWIGEXPORT int SWIGSTDCALL CSharp_aiColor4DVector_LastIndexOf(void * jarg1, void * jarg2) { int jresult ; std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; - aiColor4D **arg2 = 0 ; - aiColor4D *temp2 = 0 ; + aiColor4t< float > **arg2 = 0 ; + aiColor4t< float > *temp2 = 0 ; int result; arg1 = (std::vector< aiColor4D * > *)jarg1; - temp2 = (aiColor4D *)jarg2; - arg2 = (aiColor4D **)&temp2; - result = (int)std_vector_Sl_aiColor4D_Sm__Sg__LastIndexOf(arg1,(aiColor4D *const &)*arg2); + temp2 = (aiColor4t< float > *)jarg2; + arg2 = (aiColor4t< float > **)&temp2; + result = (int)std_vector_Sl_aiColor4D_Sm__Sg__LastIndexOf(arg1,(aiColor4t< float > *const &)*arg2); jresult = result; return jresult; } @@ -14860,14 +15212,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_aiColor4DVector_LastIndexOf(void * jarg1, void SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiColor4DVector_Remove(void * jarg1, void * jarg2) { unsigned int jresult ; std::vector< aiColor4D * > *arg1 = (std::vector< aiColor4D * > *) 0 ; - aiColor4D **arg2 = 0 ; - aiColor4D *temp2 = 0 ; + aiColor4t< float > **arg2 = 0 ; + aiColor4t< float > *temp2 = 0 ; bool result; arg1 = (std::vector< aiColor4D * > *)jarg1; - temp2 = (aiColor4D *)jarg2; - arg2 = (aiColor4D **)&temp2; - result = (bool)std_vector_Sl_aiColor4D_Sm__Sg__Remove(arg1,(aiColor4D *const &)*arg2); + temp2 = (aiColor4t< float > *)jarg2; + arg2 = (aiColor4t< float > **)&temp2; + result = (bool)std_vector_Sl_aiColor4D_Sm__Sg__Remove(arg1,(aiColor4t< float > *const &)*arg2); jresult = result; return jresult; } @@ -19251,20 +19603,20 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_Clear(void * jarg1) { SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_Add(void * jarg1, void * jarg2) { std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; - aiVector3D **arg2 = 0 ; - aiVector3D *temp2 = 0 ; + aiVector3t< float > **arg2 = 0 ; + aiVector3t< float > *temp2 = 0 ; arg1 = (std::vector< aiVector3D * > *)jarg1; - temp2 = (aiVector3D *)jarg2; - arg2 = (aiVector3D **)&temp2; - (arg1)->push_back((aiVector3D *const &)*arg2); + temp2 = (aiVector3t< float > *)jarg2; + arg2 = (aiVector3t< float > **)&temp2; + (arg1)->push_back((aiVector3t< float > *const &)*arg2); } SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiVector3DVector_size(void * jarg1) { unsigned long jresult ; std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; - std::vector< aiVector3D * >::size_type result; + std::vector< aiVector3t< float > * >::size_type result; arg1 = (std::vector< aiVector3D * > *)jarg1; result = ((std::vector< aiVector3D * > const *)arg1)->size(); @@ -19276,7 +19628,7 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiVector3DVector_size(void * jarg1) SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiVector3DVector_capacity(void * jarg1) { unsigned long jresult ; std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; - std::vector< aiVector3D * >::size_type result; + std::vector< aiVector3t< float > * >::size_type result; arg1 = (std::vector< aiVector3D * > *)jarg1; result = ((std::vector< aiVector3D * > const *)arg1)->capacity(); @@ -19287,10 +19639,10 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiVector3DVector_capacity(void * jar SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_reserve(void * jarg1, unsigned long jarg2) { std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; - std::vector< aiVector3D * >::size_type arg2 ; + std::vector< aiVector3t< float > * >::size_type arg2 ; arg1 = (std::vector< aiVector3D * > *)jarg1; - arg2 = (std::vector< aiVector3D * >::size_type)jarg2; + arg2 = (std::vector< aiVector3t< float > * >::size_type)jarg2; (arg1)->reserve(arg2); } @@ -19344,12 +19696,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3DVector_getitemcopy(void * jarg1, void * jresult ; std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; int arg2 ; - aiVector3D *result = 0 ; + aiVector3t< float > *result = 0 ; arg1 = (std::vector< aiVector3D * > *)jarg1; arg2 = (int)jarg2; try { - result = (aiVector3D *)std_vector_Sl_aiVector3D_Sm__Sg__getitemcopy(arg1,arg2); + result = (aiVector3t< float > *)std_vector_Sl_aiVector3D_Sm__Sg__getitemcopy(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19365,12 +19717,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3DVector_getitem(void * jarg1, int void * jresult ; std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; int arg2 ; - aiVector3D **result = 0 ; + aiVector3t< float > **result = 0 ; arg1 = (std::vector< aiVector3D * > *)jarg1; arg2 = (int)jarg2; try { - result = (aiVector3D **) &std_vector_Sl_aiVector3D_Sm__Sg__getitem(arg1,arg2); + result = (aiVector3t< float > **) &std_vector_Sl_aiVector3D_Sm__Sg__getitem(arg1,arg2); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19385,15 +19737,15 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3DVector_getitem(void * jarg1, int SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_setitem(void * jarg1, int jarg2, void * jarg3) { std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; int arg2 ; - aiVector3D **arg3 = 0 ; - aiVector3D *temp3 = 0 ; + aiVector3t< float > **arg3 = 0 ; + aiVector3t< float > *temp3 = 0 ; arg1 = (std::vector< aiVector3D * > *)jarg1; arg2 = (int)jarg2; - temp3 = (aiVector3D *)jarg3; - arg3 = (aiVector3D **)&temp3; + temp3 = (aiVector3t< float > *)jarg3; + arg3 = (aiVector3t< float > **)&temp3; try { - std_vector_Sl_aiVector3D_Sm__Sg__setitem(arg1,arg2,(aiVector3D *const &)*arg3); + std_vector_Sl_aiVector3D_Sm__Sg__setitem(arg1,arg2,(aiVector3t< float > *const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19405,15 +19757,15 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_setitem(void * jarg1, int ja SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_AddRange(void * jarg1, void * jarg2) { std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; - std::vector< aiVector3D * > *arg2 = 0 ; + std::vector< aiVector3t< float > * > *arg2 = 0 ; arg1 = (std::vector< aiVector3D * > *)jarg1; - arg2 = (std::vector< aiVector3D * > *)jarg2; + arg2 = (std::vector< aiVector3t< float > * > *)jarg2; if (!arg2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiVector3D * > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiVector3t< float > * > const & type is null", 0); return ; } - std_vector_Sl_aiVector3D_Sm__Sg__AddRange(arg1,(std::vector< aiVector3D * > const &)*arg2); + std_vector_Sl_aiVector3D_Sm__Sg__AddRange(arg1,(std::vector< aiVector3t< float > * > const &)*arg2); } @@ -19422,13 +19774,13 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3DVector_GetRange(void * jarg1, int std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; int arg2 ; int arg3 ; - std::vector< aiVector3D * > *result = 0 ; + std::vector< aiVector3t< float > * > *result = 0 ; arg1 = (std::vector< aiVector3D * > *)jarg1; arg2 = (int)jarg2; arg3 = (int)jarg3; try { - result = (std::vector< aiVector3D * > *)std_vector_Sl_aiVector3D_Sm__Sg__GetRange(arg1,arg2,arg3); + result = (std::vector< aiVector3t< float > * > *)std_vector_Sl_aiVector3D_Sm__Sg__GetRange(arg1,arg2,arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19447,15 +19799,15 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3DVector_GetRange(void * jarg1, int SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_Insert(void * jarg1, int jarg2, void * jarg3) { std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; int arg2 ; - aiVector3D **arg3 = 0 ; - aiVector3D *temp3 = 0 ; + aiVector3t< float > **arg3 = 0 ; + aiVector3t< float > *temp3 = 0 ; arg1 = (std::vector< aiVector3D * > *)jarg1; arg2 = (int)jarg2; - temp3 = (aiVector3D *)jarg3; - arg3 = (aiVector3D **)&temp3; + temp3 = (aiVector3t< float > *)jarg3; + arg3 = (aiVector3t< float > **)&temp3; try { - std_vector_Sl_aiVector3D_Sm__Sg__Insert(arg1,arg2,(aiVector3D *const &)*arg3); + std_vector_Sl_aiVector3D_Sm__Sg__Insert(arg1,arg2,(aiVector3t< float > *const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19468,17 +19820,17 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_Insert(void * jarg1, int jar SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_InsertRange(void * jarg1, int jarg2, void * jarg3) { std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; int arg2 ; - std::vector< aiVector3D * > *arg3 = 0 ; + std::vector< aiVector3t< float > * > *arg3 = 0 ; arg1 = (std::vector< aiVector3D * > *)jarg1; arg2 = (int)jarg2; - arg3 = (std::vector< aiVector3D * > *)jarg3; + arg3 = (std::vector< aiVector3t< float > * > *)jarg3; if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiVector3D * > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiVector3t< float > * > const & type is null", 0); return ; } try { - std_vector_Sl_aiVector3D_Sm__Sg__InsertRange(arg1,arg2,(std::vector< aiVector3D * > const &)*arg3); + std_vector_Sl_aiVector3D_Sm__Sg__InsertRange(arg1,arg2,(std::vector< aiVector3t< float > * > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19530,16 +19882,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_RemoveRange(void * jarg1, in SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3DVector_Repeat(void * jarg1, int jarg2) { void * jresult ; - aiVector3D **arg1 = 0 ; + aiVector3t< float > **arg1 = 0 ; int arg2 ; - aiVector3D *temp1 = 0 ; - std::vector< aiVector3D * > *result = 0 ; + aiVector3t< float > *temp1 = 0 ; + std::vector< aiVector3t< float > * > *result = 0 ; - temp1 = (aiVector3D *)jarg1; - arg1 = (aiVector3D **)&temp1; + temp1 = (aiVector3t< float > *)jarg1; + arg1 = (aiVector3t< float > **)&temp1; arg2 = (int)jarg2; try { - result = (std::vector< aiVector3D * > *)std_vector_Sl_aiVector3D_Sm__Sg__Repeat((aiVector3D *const &)*arg1,arg2); + result = (std::vector< aiVector3t< float > * > *)std_vector_Sl_aiVector3D_Sm__Sg__Repeat((aiVector3t< float > *const &)*arg1,arg2); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19585,17 +19937,17 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_Reverse__SWIG_1(void * jarg1 SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_SetRange(void * jarg1, int jarg2, void * jarg3) { std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; int arg2 ; - std::vector< aiVector3D * > *arg3 = 0 ; + std::vector< aiVector3t< float > * > *arg3 = 0 ; arg1 = (std::vector< aiVector3D * > *)jarg1; arg2 = (int)jarg2; - arg3 = (std::vector< aiVector3D * > *)jarg3; + arg3 = (std::vector< aiVector3t< float > * > *)jarg3; if (!arg3) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiVector3D * > const & type is null", 0); + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< aiVector3t< float > * > const & type is null", 0); return ; } try { - std_vector_Sl_aiVector3D_Sm__Sg__SetRange(arg1,arg2,(std::vector< aiVector3D * > const &)*arg3); + std_vector_Sl_aiVector3D_Sm__Sg__SetRange(arg1,arg2,(std::vector< aiVector3t< float > * > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19608,14 +19960,14 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVector_SetRange(void * jarg1, int j SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector3DVector_Contains(void * jarg1, void * jarg2) { unsigned int jresult ; std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; - aiVector3D **arg2 = 0 ; - aiVector3D *temp2 = 0 ; + aiVector3t< float > **arg2 = 0 ; + aiVector3t< float > *temp2 = 0 ; bool result; arg1 = (std::vector< aiVector3D * > *)jarg1; - temp2 = (aiVector3D *)jarg2; - arg2 = (aiVector3D **)&temp2; - result = (bool)std_vector_Sl_aiVector3D_Sm__Sg__Contains(arg1,(aiVector3D *const &)*arg2); + temp2 = (aiVector3t< float > *)jarg2; + arg2 = (aiVector3t< float > **)&temp2; + result = (bool)std_vector_Sl_aiVector3D_Sm__Sg__Contains(arg1,(aiVector3t< float > *const &)*arg2); jresult = result; return jresult; } @@ -19624,14 +19976,14 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector3DVector_Contains(void * jarg SWIGEXPORT int SWIGSTDCALL CSharp_aiVector3DVector_IndexOf(void * jarg1, void * jarg2) { int jresult ; std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; - aiVector3D **arg2 = 0 ; - aiVector3D *temp2 = 0 ; + aiVector3t< float > **arg2 = 0 ; + aiVector3t< float > *temp2 = 0 ; int result; arg1 = (std::vector< aiVector3D * > *)jarg1; - temp2 = (aiVector3D *)jarg2; - arg2 = (aiVector3D **)&temp2; - result = (int)std_vector_Sl_aiVector3D_Sm__Sg__IndexOf(arg1,(aiVector3D *const &)*arg2); + temp2 = (aiVector3t< float > *)jarg2; + arg2 = (aiVector3t< float > **)&temp2; + result = (int)std_vector_Sl_aiVector3D_Sm__Sg__IndexOf(arg1,(aiVector3t< float > *const &)*arg2); jresult = result; return jresult; } @@ -19640,14 +19992,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_aiVector3DVector_IndexOf(void * jarg1, void * SWIGEXPORT int SWIGSTDCALL CSharp_aiVector3DVector_LastIndexOf(void * jarg1, void * jarg2) { int jresult ; std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; - aiVector3D **arg2 = 0 ; - aiVector3D *temp2 = 0 ; + aiVector3t< float > **arg2 = 0 ; + aiVector3t< float > *temp2 = 0 ; int result; arg1 = (std::vector< aiVector3D * > *)jarg1; - temp2 = (aiVector3D *)jarg2; - arg2 = (aiVector3D **)&temp2; - result = (int)std_vector_Sl_aiVector3D_Sm__Sg__LastIndexOf(arg1,(aiVector3D *const &)*arg2); + temp2 = (aiVector3t< float > *)jarg2; + arg2 = (aiVector3t< float > **)&temp2; + result = (int)std_vector_Sl_aiVector3D_Sm__Sg__LastIndexOf(arg1,(aiVector3t< float > *const &)*arg2); jresult = result; return jresult; } @@ -19656,14 +20008,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_aiVector3DVector_LastIndexOf(void * jarg1, voi SWIGEXPORT unsigned int SWIGSTDCALL CSharp_aiVector3DVector_Remove(void * jarg1, void * jarg2) { unsigned int jresult ; std::vector< aiVector3D * > *arg1 = (std::vector< aiVector3D * > *) 0 ; - aiVector3D **arg2 = 0 ; - aiVector3D *temp2 = 0 ; + aiVector3t< float > **arg2 = 0 ; + aiVector3t< float > *temp2 = 0 ; bool result; arg1 = (std::vector< aiVector3D * > *)jarg1; - temp2 = (aiVector3D *)jarg2; - arg2 = (aiVector3D **)&temp2; - result = (bool)std_vector_Sl_aiVector3D_Sm__Sg__Remove(arg1,(aiVector3D *const &)*arg2); + temp2 = (aiVector3t< float > *)jarg2; + arg2 = (aiVector3t< float > **)&temp2; + result = (bool)std_vector_Sl_aiVector3D_Sm__Sg__Remove(arg1,(aiVector3t< float > *const &)*arg2); jresult = result; return jresult; } @@ -19702,7 +20054,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVectorVector_Add(void * jarg1, void SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiVector3DVectorVector_size(void * jarg1) { unsigned long jresult ; std::vector< std::vector< aiVector3D * > > *arg1 = (std::vector< std::vector< aiVector3D * > > *) 0 ; - std::vector< std::vector< aiVector3D * > >::size_type result; + std::vector< std::vector< aiVector3t< float > * > >::size_type result; arg1 = (std::vector< std::vector< aiVector3D * > > *)jarg1; result = ((std::vector< std::vector< aiVector3D * > > const *)arg1)->size(); @@ -19714,7 +20066,7 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiVector3DVectorVector_size(void * j SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiVector3DVectorVector_capacity(void * jarg1) { unsigned long jresult ; std::vector< std::vector< aiVector3D * > > *arg1 = (std::vector< std::vector< aiVector3D * > > *) 0 ; - std::vector< std::vector< aiVector3D * > >::size_type result; + std::vector< std::vector< aiVector3t< float > * > >::size_type result; arg1 = (std::vector< std::vector< aiVector3D * > > *)jarg1; result = ((std::vector< std::vector< aiVector3D * > > const *)arg1)->capacity(); @@ -19725,10 +20077,10 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_aiVector3DVectorVector_capacity(void SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVectorVector_reserve(void * jarg1, unsigned long jarg2) { std::vector< std::vector< aiVector3D * > > *arg1 = (std::vector< std::vector< aiVector3D * > > *) 0 ; - std::vector< std::vector< aiVector3D * > >::size_type arg2 ; + std::vector< std::vector< aiVector3t< float > * > >::size_type arg2 ; arg1 = (std::vector< std::vector< aiVector3D * > > *)jarg1; - arg2 = (std::vector< std::vector< aiVector3D * > >::size_type)jarg2; + arg2 = (std::vector< std::vector< aiVector3t< float > * > >::size_type)jarg2; (arg1)->reserve(arg2); } @@ -19833,7 +20185,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVectorVector_setitem(void * jarg1, return ; } try { - std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__setitem(arg1,arg2,(std::vector< aiVector3D * > const &)*arg3); + std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__setitem(arg1,arg2,(std::vector< aiVector3t< float > * > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19853,7 +20205,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVectorVector_AddRange(void * jarg1, SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "std::vector< std::vector< aiVector3D * > > const & type is null", 0); return ; } - std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__AddRange(arg1,(std::vector< std::vector< aiVector3D * > > const &)*arg2); + std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__AddRange(arg1,(std::vector< std::vector< aiVector3t< float > * > > const &)*arg2); } @@ -19897,7 +20249,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVectorVector_Insert(void * jarg1, i return ; } try { - std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__Insert(arg1,arg2,(std::vector< aiVector3D * > const &)*arg3); + std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__Insert(arg1,arg2,(std::vector< aiVector3t< float > * > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19920,7 +20272,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVectorVector_InsertRange(void * jar return ; } try { - std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__InsertRange(arg1,arg2,(std::vector< std::vector< aiVector3D * > > const &)*arg3); + std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__InsertRange(arg1,arg2,(std::vector< std::vector< aiVector3t< float > * > > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -19983,7 +20335,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_aiVector3DVectorVector_Repeat(void * jarg1, } arg2 = (int)jarg2; try { - result = (std::vector< std::vector< aiVector3D * > > *)std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__Repeat((std::vector< aiVector3D * > const &)*arg1,arg2); + result = (std::vector< std::vector< aiVector3D * > > *)std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__Repeat((std::vector< aiVector3t< float > * > const &)*arg1,arg2); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); @@ -20039,7 +20391,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_aiVector3DVectorVector_SetRange(void * jarg1, return ; } try { - std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__SetRange(arg1,arg2,(std::vector< std::vector< aiVector3D * > > const &)*arg3); + std_vector_Sl_std_vector_Sl_aiVector3D_Sm__Sg__Sg__SetRange(arg1,arg2,(std::vector< std::vector< aiVector3t< float > * > > const &)*arg3); } catch(std::out_of_range &_e) { SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, 0, (&_e)->what()); diff --git a/port/Assimp.NET/Assimp.NET_CS/Assimp.NET_CS.csproj b/port/Assimp.NET/Assimp.NET_CS/Assimp.NET_CS.csproj index 00722fa93..68cf68760 100644 --- a/port/Assimp.NET/Assimp.NET_CS/Assimp.NET_CS.csproj +++ b/port/Assimp.NET/Assimp.NET_CS/Assimp.NET_CS.csproj @@ -3,7 +3,7 @@ Debug AnyCPU - 9.0.30729 + 9.0.21022 2.0 {A0CE9ED2-A27E-40AE-95F5-FEF94BB7E131} Library @@ -142,9 +142,24 @@ + + Code + + + Code + + + Code + + + Code + Code + + Code + diff --git a/port/Assimp.NET/Assimp.NET_CS/Assimp.cs b/port/Assimp.NET/Assimp.NET_CS/Assimp.cs index 4e64ed430..26ebf63a4 100644 --- a/port/Assimp.NET/Assimp.NET_CS/Assimp.cs +++ b/port/Assimp.NET/Assimp.NET_CS/Assimp.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -43,60 +43,6 @@ public class Assimp { return ret; } - public static aiVector2D __add__(aiVector2D v1, aiVector2D v2) { - aiVector2D ret = new aiVector2D(AssimpPINVOKE.__add__(aiVector2D.getCPtr(v1), aiVector2D.getCPtr(v2)), true); - if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static aiVector2D __sub__(aiVector2D v1, aiVector2D v2) { - aiVector2D ret = new aiVector2D(AssimpPINVOKE.__sub____SWIG_0(aiVector2D.getCPtr(v1), aiVector2D.getCPtr(v2)), true); - if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static float __mul__(aiVector2D v1, aiVector2D v2) { - float ret = AssimpPINVOKE.__mul____SWIG_0(aiVector2D.getCPtr(v1), aiVector2D.getCPtr(v2)); - if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static aiVector2D __mul__(float f, aiVector2D v) { - aiVector2D ret = new aiVector2D(AssimpPINVOKE.__mul____SWIG_1(f, aiVector2D.getCPtr(v)), true); - if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static aiVector2D __mul__(aiVector2D v, float f) { - aiVector2D ret = new aiVector2D(AssimpPINVOKE.__mul____SWIG_2(aiVector2D.getCPtr(v), f), true); - if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static aiVector2D __div__(aiVector2D v, float f) { - aiVector2D ret = new aiVector2D(AssimpPINVOKE.__div____SWIG_0(aiVector2D.getCPtr(v), f), true); - if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static aiVector2D __div__(aiVector2D v, aiVector2D v2) { - aiVector2D ret = new aiVector2D(AssimpPINVOKE.__div____SWIG_1(aiVector2D.getCPtr(v), aiVector2D.getCPtr(v2)), true); - if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static aiVector2D __sub__(aiVector2D v) { - aiVector2D ret = new aiVector2D(AssimpPINVOKE.__sub____SWIG_1(aiVector2D.getCPtr(v)), true); - if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static aiScene aiImportFileFromMemory(string arg0, uint arg1, uint arg2, string arg3) { - IntPtr cPtr = AssimpPINVOKE.aiImportFileFromMemory(arg0, arg1, arg2, arg3); - aiScene ret = (cPtr == IntPtr.Zero) ? null : new aiScene(cPtr, false); - return ret; - } - public static readonly double AI_MATH_PI = AssimpPINVOKE.AI_MATH_PI_get(); public static readonly double AI_MATH_TWO_PI = AssimpPINVOKE.AI_MATH_TWO_PI_get(); public static readonly double AI_MATH_HALF_PI = AssimpPINVOKE.AI_MATH_HALF_PI_get(); @@ -104,7 +50,10 @@ public class Assimp { public static readonly double AI_MATH_TWO_PI_F = AssimpPINVOKE.AI_MATH_TWO_PI_F_get(); public static readonly double AI_MATH_HALF_PI_F = AssimpPINVOKE.AI_MATH_HALF_PI_F_get(); public static readonly string AI_CONFIG_GLOB_MEASURE_TIME = AssimpPINVOKE.AI_CONFIG_GLOB_MEASURE_TIME_get(); + public static readonly string AI_CONFIG_PP_SBBC_MAX_BONES = AssimpPINVOKE.AI_CONFIG_PP_SBBC_MAX_BONES_get(); + public static readonly int AI_SBBC_DEFAULT_MAX_BONES = AssimpPINVOKE.AI_SBBC_DEFAULT_MAX_BONES_get(); public static readonly string AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE = AssimpPINVOKE.AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE_get(); + public static readonly string AI_CONFIG_PP_CT_TEXTURE_CHANNEL_INDEX = AssimpPINVOKE.AI_CONFIG_PP_CT_TEXTURE_CHANNEL_INDEX_get(); public static readonly string AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE = AssimpPINVOKE.AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE_get(); public static readonly string AI_CONFIG_IMPORT_MDL_COLORMAP = AssimpPINVOKE.AI_CONFIG_IMPORT_MDL_COLORMAP_get(); public static readonly string AI_CONFIG_PP_RRM_EXCLUDE_LIST = AssimpPINVOKE.AI_CONFIG_PP_RRM_EXCLUDE_LIST_get(); @@ -118,6 +67,9 @@ public class Assimp { public static readonly int AI_SLM_DEFAULT_MAX_VERTICES = AssimpPINVOKE.AI_SLM_DEFAULT_MAX_VERTICES_get(); public static readonly string AI_CONFIG_PP_LBW_MAX_WEIGHTS = AssimpPINVOKE.AI_CONFIG_PP_LBW_MAX_WEIGHTS_get(); public static readonly int AI_LMW_MAX_WEIGHTS = AssimpPINVOKE.AI_LMW_MAX_WEIGHTS_get(); + public static readonly string AI_CONFIG_PP_DB_THRESHOLD = AssimpPINVOKE.AI_CONFIG_PP_DB_THRESHOLD_get(); + public static readonly double AI_DEBONE_THRESHOLD = AssimpPINVOKE.AI_DEBONE_THRESHOLD_get(); + public static readonly string AI_CONFIG_PP_DB_ALL_OR_NONE = AssimpPINVOKE.AI_CONFIG_PP_DB_ALL_OR_NONE_get(); public static readonly int PP_ICL_PTCACHE_SIZE = AssimpPINVOKE.PP_ICL_PTCACHE_SIZE_get(); public static readonly string AI_CONFIG_PP_ICL_PTCACHE_SIZE = AssimpPINVOKE.AI_CONFIG_PP_ICL_PTCACHE_SIZE_get(); public static readonly string AI_CONFIG_PP_RVC_FLAGS = AssimpPINVOKE.AI_CONFIG_PP_RVC_FLAGS_get(); @@ -150,6 +102,10 @@ public class Assimp { public static readonly string AI_CONFIG_IMPORT_LWS_ANIM_END = AssimpPINVOKE.AI_CONFIG_IMPORT_LWS_ANIM_END_get(); public static readonly string AI_CONFIG_IMPORT_IRR_ANIM_FPS = AssimpPINVOKE.AI_CONFIG_IMPORT_IRR_ANIM_FPS_get(); public static readonly string AI_CONFIG_IMPORT_OGRE_MATERIAL_FILE = AssimpPINVOKE.AI_CONFIG_IMPORT_OGRE_MATERIAL_FILE_get(); + public static readonly string AI_CONFIG_IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME = AssimpPINVOKE.AI_CONFIG_IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME_get(); + public static readonly string AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS = AssimpPINVOKE.AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS_get(); + public static readonly string AI_CONFIG_IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS = AssimpPINVOKE.AI_CONFIG_IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS_get(); + public static readonly string AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION = AssimpPINVOKE.AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION_get(); public static readonly int ASSIMP_CFLAGS_SHARED = AssimpPINVOKE.ASSIMP_CFLAGS_SHARED_get(); public static readonly int ASSIMP_CFLAGS_STLPORT = AssimpPINVOKE.ASSIMP_CFLAGS_STLPORT_get(); public static readonly int ASSIMP_CFLAGS_DEBUG = AssimpPINVOKE.ASSIMP_CFLAGS_DEBUG_get(); @@ -162,7 +118,6 @@ public class Assimp { public static readonly int AI_MAX_NUMBER_OF_COLOR_SETS = AssimpPINVOKE.AI_MAX_NUMBER_OF_COLOR_SETS_get(); public static readonly int AI_MAX_NUMBER_OF_TEXTURECOORDS = AssimpPINVOKE.AI_MAX_NUMBER_OF_TEXTURECOORDS_get(); public static readonly string AI_DEFAULT_MATERIAL_NAME = AssimpPINVOKE.AI_DEFAULT_MATERIAL_NAME_get(); - public static readonly string AI_DEFAULT_TEXTURED_MATERIAL_NAME = AssimpPINVOKE.AI_DEFAULT_TEXTURED_MATERIAL_NAME_get(); public static readonly string _AI_MATKEY_TEXTURE_BASE = AssimpPINVOKE._AI_MATKEY_TEXTURE_BASE_get(); public static readonly string _AI_MATKEY_UVWSRC_BASE = AssimpPINVOKE._AI_MATKEY_UVWSRC_BASE_get(); public static readonly string _AI_MATKEY_TEXOP_BASE = AssimpPINVOKE._AI_MATKEY_TEXOP_BASE_get(); diff --git a/port/Assimp.NET/Assimp.NET_CS/AssimpPINVOKE.cs b/port/Assimp.NET/Assimp.NET_CS/AssimpPINVOKE.cs index 188d5a976..6fc33db12 100644 --- a/port/Assimp.NET/Assimp.NET_CS/AssimpPINVOKE.cs +++ b/port/Assimp.NET/Assimp.NET_CS/AssimpPINVOKE.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -209,9 +209,18 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_GLOB_MEASURE_TIME_get")] public static extern string AI_CONFIG_GLOB_MEASURE_TIME_get(); + [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_PP_SBBC_MAX_BONES_get")] + public static extern string AI_CONFIG_PP_SBBC_MAX_BONES_get(); + + [DllImport("Assimp", EntryPoint="CSharp_AI_SBBC_DEFAULT_MAX_BONES_get")] + public static extern int AI_SBBC_DEFAULT_MAX_BONES_get(); + [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE_get")] public static extern string AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE_get(); + [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_PP_CT_TEXTURE_CHANNEL_INDEX_get")] + public static extern string AI_CONFIG_PP_CT_TEXTURE_CHANNEL_INDEX_get(); + [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE_get")] public static extern string AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE_get(); @@ -251,6 +260,15 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_AI_LMW_MAX_WEIGHTS_get")] public static extern int AI_LMW_MAX_WEIGHTS_get(); + [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_PP_DB_THRESHOLD_get")] + public static extern string AI_CONFIG_PP_DB_THRESHOLD_get(); + + [DllImport("Assimp", EntryPoint="CSharp_AI_DEBONE_THRESHOLD_get")] + public static extern double AI_DEBONE_THRESHOLD_get(); + + [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_PP_DB_ALL_OR_NONE_get")] + public static extern string AI_CONFIG_PP_DB_ALL_OR_NONE_get(); + [DllImport("Assimp", EntryPoint="CSharp_PP_ICL_PTCACHE_SIZE_get")] public static extern int PP_ICL_PTCACHE_SIZE_get(); @@ -347,6 +365,18 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_IMPORT_OGRE_MATERIAL_FILE_get")] public static extern string AI_CONFIG_IMPORT_OGRE_MATERIAL_FILE_get(); + [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME_get")] + public static extern string AI_CONFIG_IMPORT_OGRE_TEXTURETYPE_FROM_FILENAME_get(); + + [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS_get")] + public static extern string AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS_get(); + + [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS_get")] + public static extern string AI_CONFIG_IMPORT_IFC_SKIP_CURVE_REPRESENTATIONS_get(); + + [DllImport("Assimp", EntryPoint="CSharp_AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION_get")] + public static extern string AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION_get(); + [DllImport("Assimp", EntryPoint="CSharp_MAXLEN_get")] public static extern uint MAXLEN_get(); @@ -485,6 +515,9 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_aiString___nequal__")] public static extern bool aiString___nequal__(HandleRef jarg1, HandleRef jarg2); + [DllImport("Assimp", EntryPoint="CSharp_aiString_C_Str")] + public static extern string aiString_C_Str(HandleRef jarg1); + [DllImport("Assimp", EntryPoint="CSharp_aiString_Length_set")] public static extern void aiString_Length_set(HandleRef jarg1, uint jarg2); @@ -584,474 +617,6 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_aiGetCompileFlags")] public static extern uint aiGetCompileFlags(); - [DllImport("Assimp", EntryPoint="CSharp_new_aiVector2D__SWIG_0")] - public static extern IntPtr new_aiVector2D__SWIG_0(); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiVector2D__SWIG_1")] - public static extern IntPtr new_aiVector2D__SWIG_1(float jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiVector2D__SWIG_2")] - public static extern IntPtr new_aiVector2D__SWIG_2(float jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiVector2D__SWIG_3")] - public static extern IntPtr new_aiVector2D__SWIG_3(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_Set")] - public static extern void aiVector2D_Set(HandleRef jarg1, float jarg2, float jarg3); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_SquareLength")] - public static extern float aiVector2D_SquareLength(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_Length")] - public static extern float aiVector2D_Length(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_Normalize")] - public static extern IntPtr aiVector2D_Normalize(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___addnset__")] - public static extern IntPtr aiVector2D___addnset__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___subnset__")] - public static extern IntPtr aiVector2D___subnset__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___mulnset__")] - public static extern IntPtr aiVector2D___mulnset__(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___divnset__")] - public static extern IntPtr aiVector2D___divnset__(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___idx____SWIG_0")] - public static extern float aiVector2D___idx____SWIG_0(HandleRef jarg1, uint jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___equal__")] - public static extern bool aiVector2D___equal__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___nequal__")] - public static extern bool aiVector2D___nequal__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___set__")] - public static extern IntPtr aiVector2D___set__(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_SymMul")] - public static extern IntPtr aiVector2D_SymMul(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_x_set")] - public static extern void aiVector2D_x_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_x_get")] - public static extern float aiVector2D_x_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_y_set")] - public static extern void aiVector2D_y_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_y_get")] - public static extern float aiVector2D_y_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_delete_aiVector2D")] - public static extern void delete_aiVector2D(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp___add__")] - public static extern IntPtr __add__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp___sub____SWIG_0")] - public static extern IntPtr __sub____SWIG_0(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp___mul____SWIG_0")] - public static extern float __mul____SWIG_0(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp___mul____SWIG_1")] - public static extern IntPtr __mul____SWIG_1(float jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp___mul____SWIG_2")] - public static extern IntPtr __mul____SWIG_2(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp___div____SWIG_0")] - public static extern IntPtr __div____SWIG_0(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp___div____SWIG_1")] - public static extern IntPtr __div____SWIG_1(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp___sub____SWIG_1")] - public static extern IntPtr __sub____SWIG_1(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiVector3D__SWIG_0")] - public static extern IntPtr new_aiVector3D__SWIG_0(); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiVector3D__SWIG_1")] - public static extern IntPtr new_aiVector3D__SWIG_1(float jarg1, float jarg2, float jarg3); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiVector3D__SWIG_2")] - public static extern IntPtr new_aiVector3D__SWIG_2(float jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiVector3D__SWIG_3")] - public static extern IntPtr new_aiVector3D__SWIG_3(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___addnset__")] - public static extern IntPtr aiVector3D___addnset__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___subnset__")] - public static extern IntPtr aiVector3D___subnset__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___mulnset____SWIG_0")] - public static extern IntPtr aiVector3D___mulnset____SWIG_0(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___divnset__")] - public static extern IntPtr aiVector3D___divnset__(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___mulnset____SWIG_1")] - public static extern IntPtr aiVector3D___mulnset____SWIG_1(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___mulnset____SWIG_2")] - public static extern IntPtr aiVector3D___mulnset____SWIG_2(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___idx____SWIG_0")] - public static extern float aiVector3D___idx____SWIG_0(HandleRef jarg1, uint jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___equal__")] - public static extern bool aiVector3D___equal__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___nequal__")] - public static extern bool aiVector3D___nequal__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_Set")] - public static extern void aiVector3D_Set(HandleRef jarg1, float jarg2, float jarg3, float jarg4); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_SquareLength")] - public static extern float aiVector3D_SquareLength(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_Length")] - public static extern float aiVector3D_Length(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_Normalize")] - public static extern IntPtr aiVector3D_Normalize(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_SymMul")] - public static extern IntPtr aiVector3D_SymMul(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_x_set")] - public static extern void aiVector3D_x_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_x_get")] - public static extern float aiVector3D_x_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_y_set")] - public static extern void aiVector3D_y_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_y_get")] - public static extern float aiVector3D_y_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_z_set")] - public static extern void aiVector3D_z_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_z_get")] - public static extern float aiVector3D_z_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_delete_aiVector3D")] - public static extern void delete_aiVector3D(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiColor4D__SWIG_0")] - public static extern IntPtr new_aiColor4D__SWIG_0(); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiColor4D__SWIG_1")] - public static extern IntPtr new_aiColor4D__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiColor4D__SWIG_2")] - public static extern IntPtr new_aiColor4D__SWIG_2(float jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiColor4D__SWIG_3")] - public static extern IntPtr new_aiColor4D__SWIG_3(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___addnset__")] - public static extern IntPtr aiColor4D___addnset__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___subnset__")] - public static extern IntPtr aiColor4D___subnset__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___mulnset__")] - public static extern IntPtr aiColor4D___mulnset__(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___divnset__")] - public static extern IntPtr aiColor4D___divnset__(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___equal__")] - public static extern bool aiColor4D___equal__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___nequal__")] - public static extern bool aiColor4D___nequal__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___idx____SWIG_0")] - public static extern float aiColor4D___idx____SWIG_0(HandleRef jarg1, uint jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_IsBlack")] - public static extern bool aiColor4D_IsBlack(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_r_set")] - public static extern void aiColor4D_r_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_r_get")] - public static extern float aiColor4D_r_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_g_set")] - public static extern void aiColor4D_g_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_g_get")] - public static extern float aiColor4D_g_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_b_set")] - public static extern void aiColor4D_b_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_b_get")] - public static extern float aiColor4D_b_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_a_set")] - public static extern void aiColor4D_a_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_a_get")] - public static extern float aiColor4D_a_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_delete_aiColor4D")] - public static extern void delete_aiColor4D(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix3x3__SWIG_0")] - public static extern IntPtr new_aiMatrix3x3__SWIG_0(); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix3x3__SWIG_1")] - public static extern IntPtr new_aiMatrix3x3__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix3x3__SWIG_2")] - public static extern IntPtr new_aiMatrix3x3__SWIG_2(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_Transpose")] - public static extern IntPtr aiMatrix3x3_Transpose(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_Inverse")] - public static extern IntPtr aiMatrix3x3_Inverse(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_Determinant")] - public static extern float aiMatrix3x3_Determinant(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_RotationZ")] - public static extern IntPtr aiMatrix3x3_RotationZ(float jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_Rotation")] - public static extern IntPtr aiMatrix3x3_Rotation(float jarg1, HandleRef jarg2, HandleRef jarg3); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_Translation")] - public static extern IntPtr aiMatrix3x3_Translation(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_FromToMatrix")] - public static extern IntPtr aiMatrix3x3_FromToMatrix(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a1_set")] - public static extern void aiMatrix3x3_a1_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a1_get")] - public static extern float aiMatrix3x3_a1_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a2_set")] - public static extern void aiMatrix3x3_a2_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a2_get")] - public static extern float aiMatrix3x3_a2_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a3_set")] - public static extern void aiMatrix3x3_a3_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a3_get")] - public static extern float aiMatrix3x3_a3_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b1_set")] - public static extern void aiMatrix3x3_b1_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b1_get")] - public static extern float aiMatrix3x3_b1_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b2_set")] - public static extern void aiMatrix3x3_b2_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b2_get")] - public static extern float aiMatrix3x3_b2_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b3_set")] - public static extern void aiMatrix3x3_b3_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b3_get")] - public static extern float aiMatrix3x3_b3_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c1_set")] - public static extern void aiMatrix3x3_c1_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c1_get")] - public static extern float aiMatrix3x3_c1_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c2_set")] - public static extern void aiMatrix3x3_c2_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c2_get")] - public static extern float aiMatrix3x3_c2_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c3_set")] - public static extern void aiMatrix3x3_c3_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c3_get")] - public static extern float aiMatrix3x3_c3_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_delete_aiMatrix3x3")] - public static extern void delete_aiMatrix3x3(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix4x4__SWIG_0")] - public static extern IntPtr new_aiMatrix4x4__SWIG_0(); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix4x4__SWIG_1")] - public static extern IntPtr new_aiMatrix4x4__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9, float jarg10, float jarg11, float jarg12, float jarg13, float jarg14, float jarg15, float jarg16); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix4x4__SWIG_2")] - public static extern IntPtr new_aiMatrix4x4__SWIG_2(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Transpose")] - public static extern IntPtr aiMatrix4x4_Transpose(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Inverse")] - public static extern IntPtr aiMatrix4x4_Inverse(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Determinant")] - public static extern float aiMatrix4x4_Determinant(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_IsIdentity")] - public static extern bool aiMatrix4x4_IsIdentity(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Decompose")] - public static extern void aiMatrix4x4_Decompose(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_DecomposeNoScaling")] - public static extern void aiMatrix4x4_DecomposeNoScaling(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_FromEulerAnglesXYZ__SWIG_0")] - public static extern IntPtr aiMatrix4x4_FromEulerAnglesXYZ__SWIG_0(HandleRef jarg1, float jarg2, float jarg3, float jarg4); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_FromEulerAnglesXYZ__SWIG_1")] - public static extern IntPtr aiMatrix4x4_FromEulerAnglesXYZ__SWIG_1(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_RotationX")] - public static extern IntPtr aiMatrix4x4_RotationX(float jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_RotationY")] - public static extern IntPtr aiMatrix4x4_RotationY(float jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_RotationZ")] - public static extern IntPtr aiMatrix4x4_RotationZ(float jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Rotation")] - public static extern IntPtr aiMatrix4x4_Rotation(float jarg1, HandleRef jarg2, HandleRef jarg3); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Translation")] - public static extern IntPtr aiMatrix4x4_Translation(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Scaling")] - public static extern IntPtr aiMatrix4x4_Scaling(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_FromToMatrix")] - public static extern IntPtr aiMatrix4x4_FromToMatrix(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a1_set")] - public static extern void aiMatrix4x4_a1_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a1_get")] - public static extern float aiMatrix4x4_a1_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a2_set")] - public static extern void aiMatrix4x4_a2_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a2_get")] - public static extern float aiMatrix4x4_a2_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a3_set")] - public static extern void aiMatrix4x4_a3_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a3_get")] - public static extern float aiMatrix4x4_a3_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a4_set")] - public static extern void aiMatrix4x4_a4_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a4_get")] - public static extern float aiMatrix4x4_a4_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b1_set")] - public static extern void aiMatrix4x4_b1_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b1_get")] - public static extern float aiMatrix4x4_b1_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b2_set")] - public static extern void aiMatrix4x4_b2_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b2_get")] - public static extern float aiMatrix4x4_b2_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b3_set")] - public static extern void aiMatrix4x4_b3_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b3_get")] - public static extern float aiMatrix4x4_b3_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b4_set")] - public static extern void aiMatrix4x4_b4_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b4_get")] - public static extern float aiMatrix4x4_b4_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c1_set")] - public static extern void aiMatrix4x4_c1_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c1_get")] - public static extern float aiMatrix4x4_c1_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c2_set")] - public static extern void aiMatrix4x4_c2_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c2_get")] - public static extern float aiMatrix4x4_c2_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c3_set")] - public static extern void aiMatrix4x4_c3_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c3_get")] - public static extern float aiMatrix4x4_c3_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c4_set")] - public static extern void aiMatrix4x4_c4_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c4_get")] - public static extern float aiMatrix4x4_c4_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d1_set")] - public static extern void aiMatrix4x4_d1_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d1_get")] - public static extern float aiMatrix4x4_d1_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d2_set")] - public static extern void aiMatrix4x4_d2_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d2_get")] - public static extern float aiMatrix4x4_d2_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d3_set")] - public static extern void aiMatrix4x4_d3_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d3_get")] - public static extern float aiMatrix4x4_d3_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d4_set")] - public static extern void aiMatrix4x4_d4_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d4_get")] - public static extern float aiMatrix4x4_d4_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_delete_aiMatrix4x4")] - public static extern void delete_aiMatrix4x4(HandleRef jarg1); - [DllImport("Assimp", EntryPoint="CSharp_aiCamera_mName_set")] public static extern void aiCamera_mName_set(HandleRef jarg1, HandleRef jarg2); @@ -1637,9 +1202,6 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_AI_DEFAULT_MATERIAL_NAME_get")] public static extern string AI_DEFAULT_MATERIAL_NAME_get(); - [DllImport("Assimp", EntryPoint="CSharp_AI_DEFAULT_TEXTURED_MATERIAL_NAME_get")] - public static extern string AI_DEFAULT_TEXTURED_MATERIAL_NAME_get(); - [DllImport("Assimp", EntryPoint="CSharp_aiUVTransform_mTranslation_set")] public static extern void aiUVTransform_mTranslation_set(HandleRef jarg1, HandleRef jarg2); @@ -1715,6 +1277,33 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_GetTextureCount")] public static extern uint aiMaterial_GetTextureCount(HandleRef jarg1, int jarg2); + [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_AddBinaryProperty")] + public static extern int aiMaterial_AddBinaryProperty(HandleRef jarg1, HandleRef jarg2, uint jarg3, string jarg4, uint jarg5, uint jarg6, int jarg7); + + [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_AddProperty__SWIG_0")] + public static extern int aiMaterial_AddProperty__SWIG_0(HandleRef jarg1, HandleRef jarg2, string jarg3, uint jarg4, uint jarg5); + + [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_AddProperty__SWIG_1")] + public static extern int aiMaterial_AddProperty__SWIG_1(HandleRef jarg1, HandleRef jarg2, string jarg3, uint jarg4); + + [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_AddProperty__SWIG_2")] + public static extern int aiMaterial_AddProperty__SWIG_2(HandleRef jarg1, HandleRef jarg2, string jarg3); + + [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_RemoveProperty__SWIG_0")] + public static extern int aiMaterial_RemoveProperty__SWIG_0(HandleRef jarg1, string jarg2, uint jarg3, uint jarg4); + + [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_RemoveProperty__SWIG_1")] + public static extern int aiMaterial_RemoveProperty__SWIG_1(HandleRef jarg1, string jarg2, uint jarg3); + + [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_RemoveProperty__SWIG_2")] + public static extern int aiMaterial_RemoveProperty__SWIG_2(HandleRef jarg1, string jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_Clear")] + public static extern void aiMaterial_Clear(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_CopyPropertyList")] + public static extern void aiMaterial_CopyPropertyList(HandleRef jarg1, HandleRef jarg2); + [DllImport("Assimp", EntryPoint="CSharp_aiMaterial_GetDiffuse")] public static extern bool aiMaterial_GetDiffuse(HandleRef jarg1, HandleRef jarg2); @@ -1808,75 +1397,6 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp__AI_MATKEY_TEXFLAGS_BASE_get")] public static extern string _AI_MATKEY_TEXFLAGS_BASE_get(); - [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_0")] - public static extern IntPtr new_aiQuaternion__SWIG_0(); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_1")] - public static extern IntPtr new_aiQuaternion__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_2")] - public static extern IntPtr new_aiQuaternion__SWIG_2(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_3")] - public static extern IntPtr new_aiQuaternion__SWIG_3(float jarg1, float jarg2, float jarg3); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_4")] - public static extern IntPtr new_aiQuaternion__SWIG_4(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_5")] - public static extern IntPtr new_aiQuaternion__SWIG_5(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_GetMatrix")] - public static extern IntPtr aiQuaternion_GetMatrix(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion___equal__")] - public static extern bool aiQuaternion___equal__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion___nequal__")] - public static extern bool aiQuaternion___nequal__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_Normalize")] - public static extern IntPtr aiQuaternion_Normalize(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_Conjugate")] - public static extern IntPtr aiQuaternion_Conjugate(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_Rotate")] - public static extern IntPtr aiQuaternion_Rotate(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion___mul__")] - public static extern IntPtr aiQuaternion___mul__(HandleRef jarg1, HandleRef jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_Interpolate")] - public static extern void aiQuaternion_Interpolate(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, float jarg4); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_w_set")] - public static extern void aiQuaternion_w_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_w_get")] - public static extern float aiQuaternion_w_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_x_set")] - public static extern void aiQuaternion_x_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_x_get")] - public static extern float aiQuaternion_x_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_y_set")] - public static extern void aiQuaternion_y_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_y_get")] - public static extern float aiQuaternion_y_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_z_set")] - public static extern void aiQuaternion_z_set(HandleRef jarg1, float jarg2); - - [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_z_get")] - public static extern float aiQuaternion_z_get(HandleRef jarg1); - - [DllImport("Assimp", EntryPoint="CSharp_delete_aiQuaternion")] - public static extern void delete_aiQuaternion(HandleRef jarg1); - [DllImport("Assimp", EntryPoint="CSharp_aiNode_mName_set")] public static extern void aiNode_mName_set(HandleRef jarg1, HandleRef jarg2); @@ -2015,6 +1535,12 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_aiScene_HasAnimations")] public static extern bool aiScene_HasAnimations(HandleRef jarg1); + [DllImport("Assimp", EntryPoint="CSharp_aiScene_mPrivate_set")] + public static extern void aiScene_mPrivate_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiScene_mPrivate_get")] + public static extern IntPtr aiScene_mPrivate_get(HandleRef jarg1); + [DllImport("Assimp", EntryPoint="CSharp_aiScene_GetmAnimations")] public static extern IntPtr aiScene_GetmAnimations(HandleRef jarg1); @@ -2105,9 +1631,6 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_AI_PROPERTY_WAS_NOT_EXISTING_get")] public static extern int AI_PROPERTY_WAS_NOT_EXISTING_get(); - [DllImport("Assimp", EntryPoint="CSharp_aiImportFileFromMemory")] - public static extern IntPtr aiImportFileFromMemory(string jarg1, uint jarg2, uint jarg3, string jarg4); - [DllImport("Assimp", EntryPoint="CSharp_new_Importer__SWIG_0")] public static extern IntPtr new_Importer__SWIG_0(); @@ -2165,6 +1688,12 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_Importer_GetErrorString")] public static extern string Importer_GetErrorString(HandleRef jarg1); + [DllImport("Assimp", EntryPoint="CSharp_Importer_GetScene")] + public static extern IntPtr Importer_GetScene(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_Importer_GetOrphanedScene")] + public static extern IntPtr Importer_GetOrphanedScene(HandleRef jarg1); + [DllImport("Assimp", EntryPoint="CSharp_Importer_IsExtensionSupported__SWIG_0")] public static extern bool Importer_IsExtensionSupported__SWIG_0(HandleRef jarg1, string jarg2); @@ -2174,11 +1703,20 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_Importer_GetExtensionList__SWIG_1")] public static extern void Importer_GetExtensionList__SWIG_1(HandleRef jarg1, HandleRef jarg2); - [DllImport("Assimp", EntryPoint="CSharp_Importer_GetScene")] - public static extern IntPtr Importer_GetScene(HandleRef jarg1); + [DllImport("Assimp", EntryPoint="CSharp_Importer_GetImporterCount")] + public static extern uint Importer_GetImporterCount(HandleRef jarg1); - [DllImport("Assimp", EntryPoint="CSharp_Importer_GetOrphanedScene")] - public static extern IntPtr Importer_GetOrphanedScene(HandleRef jarg1); + [DllImport("Assimp", EntryPoint="CSharp_Importer_GetImporterInfo")] + public static extern IntPtr Importer_GetImporterInfo(HandleRef jarg1, uint jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_Importer_GetImporter__SWIG_0")] + public static extern IntPtr Importer_GetImporter__SWIG_0(HandleRef jarg1, uint jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_Importer_GetImporter__SWIG_1")] + public static extern IntPtr Importer_GetImporter__SWIG_1(HandleRef jarg1, string jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_Importer_GetImporterIndex")] + public static extern uint Importer_GetImporterIndex(HandleRef jarg1, string jarg2); [DllImport("Assimp", EntryPoint="CSharp_Importer_GetMemoryRequirements")] public static extern void Importer_GetMemoryRequirements(HandleRef jarg1, HandleRef jarg2); @@ -2186,6 +1724,9 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_Importer_SetExtraVerbose")] public static extern void Importer_SetExtraVerbose(HandleRef jarg1, bool jarg2); + [DllImport("Assimp", EntryPoint="CSharp_Importer_Pimpl__SWIG_0")] + public static extern IntPtr Importer_Pimpl__SWIG_0(HandleRef jarg1); + [DllImport("Assimp", EntryPoint="CSharp_Importer_GetExtensionList__SWIG_2")] public static extern string Importer_GetExtensionList__SWIG_2(HandleRef jarg1); @@ -2198,6 +1739,549 @@ class AssimpPINVOKE { [DllImport("Assimp", EntryPoint="CSharp_ProgressHandler_Update__SWIG_1")] public static extern bool ProgressHandler_Update__SWIG_1(HandleRef jarg1); + [DllImport("Assimp", EntryPoint="CSharp_new_aiColor4D__SWIG_0")] + public static extern IntPtr new_aiColor4D__SWIG_0(); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiColor4D__SWIG_1")] + public static extern IntPtr new_aiColor4D__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiColor4D__SWIG_2")] + public static extern IntPtr new_aiColor4D__SWIG_2(float jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiColor4D__SWIG_3")] + public static extern IntPtr new_aiColor4D__SWIG_3(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___addnset__")] + public static extern IntPtr aiColor4D___addnset__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___subnset__")] + public static extern IntPtr aiColor4D___subnset__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___mulnset__")] + public static extern IntPtr aiColor4D___mulnset__(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___divnset__")] + public static extern IntPtr aiColor4D___divnset__(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___equal__")] + public static extern bool aiColor4D___equal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___nequal__")] + public static extern bool aiColor4D___nequal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D___idx____SWIG_0")] + public static extern float aiColor4D___idx____SWIG_0(HandleRef jarg1, uint jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_IsBlack")] + public static extern bool aiColor4D_IsBlack(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_r_set")] + public static extern void aiColor4D_r_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_r_get")] + public static extern float aiColor4D_r_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_g_set")] + public static extern void aiColor4D_g_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_g_get")] + public static extern float aiColor4D_g_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_b_set")] + public static extern void aiColor4D_b_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_b_get")] + public static extern float aiColor4D_b_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_a_set")] + public static extern void aiColor4D_a_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiColor4D_a_get")] + public static extern float aiColor4D_a_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_delete_aiColor4D")] + public static extern void delete_aiColor4D(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiVector3D__SWIG_0")] + public static extern IntPtr new_aiVector3D__SWIG_0(); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiVector3D__SWIG_1")] + public static extern IntPtr new_aiVector3D__SWIG_1(float jarg1, float jarg2, float jarg3); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiVector3D__SWIG_2")] + public static extern IntPtr new_aiVector3D__SWIG_2(float jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiVector3D__SWIG_3")] + public static extern IntPtr new_aiVector3D__SWIG_3(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___addnset__")] + public static extern IntPtr aiVector3D___addnset__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___subnset__")] + public static extern IntPtr aiVector3D___subnset__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___mulnset____SWIG_0")] + public static extern IntPtr aiVector3D___mulnset____SWIG_0(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___divnset__")] + public static extern IntPtr aiVector3D___divnset__(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___mulnset____SWIG_1")] + public static extern IntPtr aiVector3D___mulnset____SWIG_1(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___mulnset____SWIG_2")] + public static extern IntPtr aiVector3D___mulnset____SWIG_2(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___idx____SWIG_0")] + public static extern float aiVector3D___idx____SWIG_0(HandleRef jarg1, uint jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___equal__")] + public static extern bool aiVector3D___equal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D___nequal__")] + public static extern bool aiVector3D___nequal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_Set")] + public static extern void aiVector3D_Set(HandleRef jarg1, float jarg2, float jarg3, float jarg4); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_SquareLength")] + public static extern float aiVector3D_SquareLength(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_Length")] + public static extern float aiVector3D_Length(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_Normalize")] + public static extern IntPtr aiVector3D_Normalize(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_SymMul")] + public static extern IntPtr aiVector3D_SymMul(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_x_set")] + public static extern void aiVector3D_x_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_x_get")] + public static extern float aiVector3D_x_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_y_set")] + public static extern void aiVector3D_y_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_y_get")] + public static extern float aiVector3D_y_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_z_set")] + public static extern void aiVector3D_z_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector3D_z_get")] + public static extern float aiVector3D_z_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_delete_aiVector3D")] + public static extern void delete_aiVector3D(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiVector2D__SWIG_0")] + public static extern IntPtr new_aiVector2D__SWIG_0(); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiVector2D__SWIG_1")] + public static extern IntPtr new_aiVector2D__SWIG_1(float jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiVector2D__SWIG_2")] + public static extern IntPtr new_aiVector2D__SWIG_2(float jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiVector2D__SWIG_3")] + public static extern IntPtr new_aiVector2D__SWIG_3(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_Set")] + public static extern void aiVector2D_Set(HandleRef jarg1, float jarg2, float jarg3); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_SquareLength")] + public static extern float aiVector2D_SquareLength(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_Length")] + public static extern float aiVector2D_Length(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_Normalize")] + public static extern IntPtr aiVector2D_Normalize(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___addnset__")] + public static extern IntPtr aiVector2D___addnset__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___subnset__")] + public static extern IntPtr aiVector2D___subnset__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___mulnset__")] + public static extern IntPtr aiVector2D___mulnset__(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___divnset__")] + public static extern IntPtr aiVector2D___divnset__(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___idx____SWIG_0")] + public static extern float aiVector2D___idx____SWIG_0(HandleRef jarg1, uint jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___equal__")] + public static extern bool aiVector2D___equal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___nequal__")] + public static extern bool aiVector2D___nequal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D___set__")] + public static extern IntPtr aiVector2D___set__(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_SymMul")] + public static extern IntPtr aiVector2D_SymMul(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_x_set")] + public static extern void aiVector2D_x_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_x_get")] + public static extern float aiVector2D_x_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_y_set")] + public static extern void aiVector2D_y_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiVector2D_y_get")] + public static extern float aiVector2D_y_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_delete_aiVector2D")] + public static extern void delete_aiVector2D(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_0")] + public static extern IntPtr new_aiQuaternion__SWIG_0(); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_1")] + public static extern IntPtr new_aiQuaternion__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_2")] + public static extern IntPtr new_aiQuaternion__SWIG_2(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_3")] + public static extern IntPtr new_aiQuaternion__SWIG_3(float jarg1, float jarg2, float jarg3); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_4")] + public static extern IntPtr new_aiQuaternion__SWIG_4(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiQuaternion__SWIG_5")] + public static extern IntPtr new_aiQuaternion__SWIG_5(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_GetMatrix")] + public static extern IntPtr aiQuaternion_GetMatrix(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion___equal__")] + public static extern bool aiQuaternion___equal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion___nequal__")] + public static extern bool aiQuaternion___nequal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_Normalize")] + public static extern IntPtr aiQuaternion_Normalize(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_Conjugate")] + public static extern IntPtr aiQuaternion_Conjugate(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_Rotate")] + public static extern IntPtr aiQuaternion_Rotate(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion___mul__")] + public static extern IntPtr aiQuaternion___mul__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_Interpolate")] + public static extern void aiQuaternion_Interpolate(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, float jarg4); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_w_set")] + public static extern void aiQuaternion_w_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_w_get")] + public static extern float aiQuaternion_w_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_x_set")] + public static extern void aiQuaternion_x_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_x_get")] + public static extern float aiQuaternion_x_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_y_set")] + public static extern void aiQuaternion_y_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_y_get")] + public static extern float aiQuaternion_y_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_z_set")] + public static extern void aiQuaternion_z_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiQuaternion_z_get")] + public static extern float aiQuaternion_z_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_delete_aiQuaternion")] + public static extern void delete_aiQuaternion(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix3x3__SWIG_0")] + public static extern IntPtr new_aiMatrix3x3__SWIG_0(); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix3x3__SWIG_1")] + public static extern IntPtr new_aiMatrix3x3__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3___mulnset__")] + public static extern IntPtr aiMatrix3x3___mulnset__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3___mul__")] + public static extern IntPtr aiMatrix3x3___mul__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3___idx____SWIG_0")] + public static extern IntPtr aiMatrix3x3___idx____SWIG_0(HandleRef jarg1, uint jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3___equal__")] + public static extern bool aiMatrix3x3___equal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3___nequal__")] + public static extern bool aiMatrix3x3___nequal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix3x3__SWIG_2")] + public static extern IntPtr new_aiMatrix3x3__SWIG_2(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_Transpose")] + public static extern IntPtr aiMatrix3x3_Transpose(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_Inverse")] + public static extern IntPtr aiMatrix3x3_Inverse(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_Determinant")] + public static extern float aiMatrix3x3_Determinant(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_RotationZ")] + public static extern IntPtr aiMatrix3x3_RotationZ(float jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_Rotation")] + public static extern IntPtr aiMatrix3x3_Rotation(float jarg1, HandleRef jarg2, HandleRef jarg3); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_Translation")] + public static extern IntPtr aiMatrix3x3_Translation(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_FromToMatrix")] + public static extern IntPtr aiMatrix3x3_FromToMatrix(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a1_set")] + public static extern void aiMatrix3x3_a1_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a1_get")] + public static extern float aiMatrix3x3_a1_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a2_set")] + public static extern void aiMatrix3x3_a2_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a2_get")] + public static extern float aiMatrix3x3_a2_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a3_set")] + public static extern void aiMatrix3x3_a3_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_a3_get")] + public static extern float aiMatrix3x3_a3_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b1_set")] + public static extern void aiMatrix3x3_b1_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b1_get")] + public static extern float aiMatrix3x3_b1_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b2_set")] + public static extern void aiMatrix3x3_b2_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b2_get")] + public static extern float aiMatrix3x3_b2_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b3_set")] + public static extern void aiMatrix3x3_b3_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_b3_get")] + public static extern float aiMatrix3x3_b3_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c1_set")] + public static extern void aiMatrix3x3_c1_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c1_get")] + public static extern float aiMatrix3x3_c1_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c2_set")] + public static extern void aiMatrix3x3_c2_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c2_get")] + public static extern float aiMatrix3x3_c2_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c3_set")] + public static extern void aiMatrix3x3_c3_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix3x3_c3_get")] + public static extern float aiMatrix3x3_c3_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_delete_aiMatrix3x3")] + public static extern void delete_aiMatrix3x3(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix4x4__SWIG_0")] + public static extern IntPtr new_aiMatrix4x4__SWIG_0(); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix4x4__SWIG_1")] + public static extern IntPtr new_aiMatrix4x4__SWIG_1(float jarg1, float jarg2, float jarg3, float jarg4, float jarg5, float jarg6, float jarg7, float jarg8, float jarg9, float jarg10, float jarg11, float jarg12, float jarg13, float jarg14, float jarg15, float jarg16); + + [DllImport("Assimp", EntryPoint="CSharp_new_aiMatrix4x4__SWIG_2")] + public static extern IntPtr new_aiMatrix4x4__SWIG_2(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4___idx____SWIG_0")] + public static extern IntPtr aiMatrix4x4___idx____SWIG_0(HandleRef jarg1, uint jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4___equal__")] + public static extern bool aiMatrix4x4___equal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4___nequal__")] + public static extern bool aiMatrix4x4___nequal__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4___mulnset__")] + public static extern IntPtr aiMatrix4x4___mulnset__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4___mul__")] + public static extern IntPtr aiMatrix4x4___mul__(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Transpose")] + public static extern IntPtr aiMatrix4x4_Transpose(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Inverse")] + public static extern IntPtr aiMatrix4x4_Inverse(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Determinant")] + public static extern float aiMatrix4x4_Determinant(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_IsIdentity")] + public static extern bool aiMatrix4x4_IsIdentity(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Decompose")] + public static extern void aiMatrix4x4_Decompose(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_DecomposeNoScaling")] + public static extern void aiMatrix4x4_DecomposeNoScaling(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_FromEulerAnglesXYZ__SWIG_0")] + public static extern IntPtr aiMatrix4x4_FromEulerAnglesXYZ__SWIG_0(HandleRef jarg1, float jarg2, float jarg3, float jarg4); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_FromEulerAnglesXYZ__SWIG_1")] + public static extern IntPtr aiMatrix4x4_FromEulerAnglesXYZ__SWIG_1(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_RotationX")] + public static extern IntPtr aiMatrix4x4_RotationX(float jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_RotationY")] + public static extern IntPtr aiMatrix4x4_RotationY(float jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_RotationZ")] + public static extern IntPtr aiMatrix4x4_RotationZ(float jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Rotation")] + public static extern IntPtr aiMatrix4x4_Rotation(float jarg1, HandleRef jarg2, HandleRef jarg3); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Translation")] + public static extern IntPtr aiMatrix4x4_Translation(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_Scaling")] + public static extern IntPtr aiMatrix4x4_Scaling(HandleRef jarg1, HandleRef jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_FromToMatrix")] + public static extern IntPtr aiMatrix4x4_FromToMatrix(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a1_set")] + public static extern void aiMatrix4x4_a1_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a1_get")] + public static extern float aiMatrix4x4_a1_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a2_set")] + public static extern void aiMatrix4x4_a2_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a2_get")] + public static extern float aiMatrix4x4_a2_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a3_set")] + public static extern void aiMatrix4x4_a3_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a3_get")] + public static extern float aiMatrix4x4_a3_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a4_set")] + public static extern void aiMatrix4x4_a4_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_a4_get")] + public static extern float aiMatrix4x4_a4_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b1_set")] + public static extern void aiMatrix4x4_b1_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b1_get")] + public static extern float aiMatrix4x4_b1_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b2_set")] + public static extern void aiMatrix4x4_b2_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b2_get")] + public static extern float aiMatrix4x4_b2_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b3_set")] + public static extern void aiMatrix4x4_b3_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b3_get")] + public static extern float aiMatrix4x4_b3_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b4_set")] + public static extern void aiMatrix4x4_b4_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_b4_get")] + public static extern float aiMatrix4x4_b4_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c1_set")] + public static extern void aiMatrix4x4_c1_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c1_get")] + public static extern float aiMatrix4x4_c1_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c2_set")] + public static extern void aiMatrix4x4_c2_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c2_get")] + public static extern float aiMatrix4x4_c2_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c3_set")] + public static extern void aiMatrix4x4_c3_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c3_get")] + public static extern float aiMatrix4x4_c3_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c4_set")] + public static extern void aiMatrix4x4_c4_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_c4_get")] + public static extern float aiMatrix4x4_c4_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d1_set")] + public static extern void aiMatrix4x4_d1_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d1_get")] + public static extern float aiMatrix4x4_d1_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d2_set")] + public static extern void aiMatrix4x4_d2_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d2_get")] + public static extern float aiMatrix4x4_d2_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d3_set")] + public static extern void aiMatrix4x4_d3_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d3_get")] + public static extern float aiMatrix4x4_d3_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d4_set")] + public static extern void aiMatrix4x4_d4_set(HandleRef jarg1, float jarg2); + + [DllImport("Assimp", EntryPoint="CSharp_aiMatrix4x4_d4_get")] + public static extern float aiMatrix4x4_d4_get(HandleRef jarg1); + + [DllImport("Assimp", EntryPoint="CSharp_delete_aiMatrix4x4")] + public static extern void delete_aiMatrix4x4(HandleRef jarg1); + [DllImport("Assimp", EntryPoint="CSharp_FloatVector_Clear")] public static extern void FloatVector_Clear(HandleRef jarg1); diff --git a/port/Assimp.NET/Assimp.NET_CS/FloatVector.cs b/port/Assimp.NET/Assimp.NET_CS/FloatVector.cs index 5fb6144ee..d8e9f212f 100644 --- a/port/Assimp.NET/Assimp.NET_CS/FloatVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/FloatVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/Importer.cs b/port/Assimp.NET/Assimp.NET_CS/Importer.cs index 111c70622..9709b38c2 100644 --- a/port/Assimp.NET/Assimp.NET_CS/Importer.cs +++ b/port/Assimp.NET/Assimp.NET_CS/Importer.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -128,6 +128,18 @@ public class Importer : IDisposable { return ret; } + public aiScene GetScene() { + IntPtr cPtr = AssimpPINVOKE.Importer_GetScene(swigCPtr); + aiScene ret = (cPtr == IntPtr.Zero) ? null : new aiScene(cPtr, false); + return ret; + } + + public aiScene GetOrphanedScene() { + IntPtr cPtr = AssimpPINVOKE.Importer_GetOrphanedScene(swigCPtr); + aiScene ret = (cPtr == IntPtr.Zero) ? null : new aiScene(cPtr, false); + return ret; + } + public bool IsExtensionSupported(string szExtension) { bool ret = AssimpPINVOKE.Importer_IsExtensionSupported__SWIG_0(swigCPtr, szExtension); return ret; @@ -143,15 +155,31 @@ public class Importer : IDisposable { if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); } - public aiScene GetScene() { - IntPtr cPtr = AssimpPINVOKE.Importer_GetScene(swigCPtr); - aiScene ret = (cPtr == IntPtr.Zero) ? null : new aiScene(cPtr, false); + public uint GetImporterCount() { + uint ret = AssimpPINVOKE.Importer_GetImporterCount(swigCPtr); return ret; } - public aiScene GetOrphanedScene() { - IntPtr cPtr = AssimpPINVOKE.Importer_GetOrphanedScene(swigCPtr); - aiScene ret = (cPtr == IntPtr.Zero) ? null : new aiScene(cPtr, false); + public SWIGTYPE_p_aiImporterDesc GetImporterInfo(uint index) { + IntPtr cPtr = AssimpPINVOKE.Importer_GetImporterInfo(swigCPtr, index); + SWIGTYPE_p_aiImporterDesc ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_aiImporterDesc(cPtr, false); + return ret; + } + + public SWIGTYPE_p_Assimp__BaseImporter GetImporter(uint index) { + IntPtr cPtr = AssimpPINVOKE.Importer_GetImporter__SWIG_0(swigCPtr, index); + SWIGTYPE_p_Assimp__BaseImporter ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_Assimp__BaseImporter(cPtr, false); + return ret; + } + + public SWIGTYPE_p_Assimp__BaseImporter GetImporter(string szExtension) { + IntPtr cPtr = AssimpPINVOKE.Importer_GetImporter__SWIG_1(swigCPtr, szExtension); + SWIGTYPE_p_Assimp__BaseImporter ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_Assimp__BaseImporter(cPtr, false); + return ret; + } + + public uint GetImporterIndex(string szExtension) { + uint ret = AssimpPINVOKE.Importer_GetImporterIndex(swigCPtr, szExtension); return ret; } @@ -164,6 +192,12 @@ public class Importer : IDisposable { AssimpPINVOKE.Importer_SetExtraVerbose(swigCPtr, bDo); } + public SWIGTYPE_p_Assimp__ImporterPimpl Pimpl() { + IntPtr cPtr = AssimpPINVOKE.Importer_Pimpl__SWIG_0(swigCPtr); + SWIGTYPE_p_Assimp__ImporterPimpl ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_Assimp__ImporterPimpl(cPtr, false); + return ret; + } + public string GetExtensionList() { string ret = AssimpPINVOKE.Importer_GetExtensionList__SWIG_2(swigCPtr); return ret; diff --git a/port/Assimp.NET/Assimp.NET_CS/ProgressHandler.cs b/port/Assimp.NET/Assimp.NET_CS/ProgressHandler.cs index e27527f92..4493930f3 100644 --- a/port/Assimp.NET/Assimp.NET_CS/ProgressHandler.cs +++ b/port/Assimp.NET/Assimp.NET_CS/ProgressHandler.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_Assimp__BaseImporter.cs b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_Assimp__BaseImporter.cs new file mode 100644 index 000000000..a6b0c4d74 --- /dev/null +++ b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_Assimp__BaseImporter.cs @@ -0,0 +1,27 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.8 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + + +using System; +using System.Runtime.InteropServices; + +public class SWIGTYPE_p_Assimp__BaseImporter { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_Assimp__BaseImporter(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_Assimp__BaseImporter() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_Assimp__BaseImporter obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} diff --git a/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_Assimp__ImporterPimpl.cs b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_Assimp__ImporterPimpl.cs new file mode 100644 index 000000000..45900e9ec --- /dev/null +++ b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_Assimp__ImporterPimpl.cs @@ -0,0 +1,27 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.8 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + + +using System; +using System.Runtime.InteropServices; + +public class SWIGTYPE_p_Assimp__ImporterPimpl { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_Assimp__ImporterPimpl(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_Assimp__ImporterPimpl() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_Assimp__ImporterPimpl obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} diff --git a/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_aiImporterDesc.cs b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_aiImporterDesc.cs new file mode 100644 index 000000000..90e310079 --- /dev/null +++ b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_aiImporterDesc.cs @@ -0,0 +1,27 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.8 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + + +using System; +using System.Runtime.InteropServices; + +public class SWIGTYPE_p_aiImporterDesc { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_aiImporterDesc(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_aiImporterDesc() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_aiImporterDesc obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} diff --git a/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_float.cs b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_float.cs new file mode 100644 index 000000000..7d117d2a7 --- /dev/null +++ b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_float.cs @@ -0,0 +1,27 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.8 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + + +using System; +using System.Runtime.InteropServices; + +public class SWIGTYPE_p_float { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_float(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_float() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_float obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} diff --git a/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_std__string.cs b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_std__string.cs index bcc27ba4d..e539303f1 100644 --- a/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_std__string.cs +++ b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_std__string.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_void.cs b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_void.cs new file mode 100644 index 000000000..f87f7e5ee --- /dev/null +++ b/port/Assimp.NET/Assimp.NET_CS/SWIGTYPE_p_void.cs @@ -0,0 +1,27 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.8 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + + +using System; +using System.Runtime.InteropServices; + +public class SWIGTYPE_p_void { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_void(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_void() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_void obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} diff --git a/port/Assimp.NET/Assimp.NET_CS/UintVector.cs b/port/Assimp.NET/Assimp.NET_CS/UintVector.cs index 11cd9944a..def1a50de 100644 --- a/port/Assimp.NET/Assimp.NET_CS/UintVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/UintVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiAnimBehaviour.cs b/port/Assimp.NET/Assimp.NET_CS/aiAnimBehaviour.cs index a0cbecbc7..0483fd585 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiAnimBehaviour.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiAnimBehaviour.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiAnimMesh.cs b/port/Assimp.NET/Assimp.NET_CS/aiAnimMesh.cs index 2e0b25f60..b61b4da19 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiAnimMesh.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiAnimMesh.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiAnimMeshVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiAnimMeshVector.cs index 5ad7bbaa9..0a4445949 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiAnimMeshVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiAnimMeshVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiAnimation.cs b/port/Assimp.NET/Assimp.NET_CS/aiAnimation.cs index 375a4e1ab..e9b30800f 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiAnimation.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiAnimation.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiAnimationVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiAnimationVector.cs index 6e5a0c899..6a21f1242 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiAnimationVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiAnimationVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiBlendMode.cs b/port/Assimp.NET/Assimp.NET_CS/aiBlendMode.cs index 2aa7c59dd..ab8e563a6 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiBlendMode.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiBlendMode.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiBone.cs b/port/Assimp.NET/Assimp.NET_CS/aiBone.cs index df3aa5904..226ce943e 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiBone.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiBone.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiBoneVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiBoneVector.cs index 077d05f28..a6feb46ff 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiBoneVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiBoneVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiCamera.cs b/port/Assimp.NET/Assimp.NET_CS/aiCamera.cs index 5bfda016e..3c96d0d21 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiCamera.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiCamera.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiCameraVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiCameraVector.cs index 66a12d5d6..1cbc857e1 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiCameraVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiCameraVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiColor3D.cs b/port/Assimp.NET/Assimp.NET_CS/aiColor3D.cs index 3c87df89d..8590b614f 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiColor3D.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiColor3D.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiColor4D.cs b/port/Assimp.NET/Assimp.NET_CS/aiColor4D.cs index c8e0110ea..435ec505a 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiColor4D.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiColor4D.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiColor4DVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiColor4DVector.cs index 0608bac52..3b1b76920 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiColor4DVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiColor4DVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiColor4DVectorVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiColor4DVectorVector.cs index 8440965be..ffe291d0e 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiColor4DVectorVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiColor4DVectorVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiComponent.cs b/port/Assimp.NET/Assimp.NET_CS/aiComponent.cs index 5daf83b2c..63e94d36a 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiComponent.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiComponent.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiDefaultLogStream.cs b/port/Assimp.NET/Assimp.NET_CS/aiDefaultLogStream.cs index 1d1dd7bfa..a39efdbd3 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiDefaultLogStream.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiDefaultLogStream.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiFace.cs b/port/Assimp.NET/Assimp.NET_CS/aiFace.cs index 71eb36fcf..5d2a2528f 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiFace.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiFace.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiFaceVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiFaceVector.cs index 416733bc8..9c612e6e0 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiFaceVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiFaceVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiLight.cs b/port/Assimp.NET/Assimp.NET_CS/aiLight.cs index 9ff95c11b..8207ef21a 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiLight.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiLight.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiLightSourceType.cs b/port/Assimp.NET/Assimp.NET_CS/aiLightSourceType.cs index 1b022d756..aedc03417 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiLightSourceType.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiLightSourceType.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiLightVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiLightVector.cs index a87e8a7f6..6bf566e1e 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiLightVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiLightVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMaterial.cs b/port/Assimp.NET/Assimp.NET_CS/aiMaterial.cs index 58c951829..11e9354c3 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMaterial.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMaterial.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -76,6 +76,49 @@ public class aiMaterial : IDisposable { return ret; } + public aiReturn AddBinaryProperty(SWIGTYPE_p_void pInput, uint pSizeInBytes, string pKey, uint type, uint index, aiPropertyTypeInfo pType) { + aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_AddBinaryProperty(swigCPtr, SWIGTYPE_p_void.getCPtr(pInput), pSizeInBytes, pKey, type, index, (int)pType); + return ret; + } + + public aiReturn AddProperty(aiString pInput, string pKey, uint type, uint index) { + aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_AddProperty__SWIG_0(swigCPtr, aiString.getCPtr(pInput), pKey, type, index); + return ret; + } + + public aiReturn AddProperty(aiString pInput, string pKey, uint type) { + aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_AddProperty__SWIG_1(swigCPtr, aiString.getCPtr(pInput), pKey, type); + return ret; + } + + public aiReturn AddProperty(aiString pInput, string pKey) { + aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_AddProperty__SWIG_2(swigCPtr, aiString.getCPtr(pInput), pKey); + return ret; + } + + public aiReturn RemoveProperty(string pKey, uint type, uint index) { + aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_RemoveProperty__SWIG_0(swigCPtr, pKey, type, index); + return ret; + } + + public aiReturn RemoveProperty(string pKey, uint type) { + aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_RemoveProperty__SWIG_1(swigCPtr, pKey, type); + return ret; + } + + public aiReturn RemoveProperty(string pKey) { + aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_RemoveProperty__SWIG_2(swigCPtr, pKey); + return ret; + } + + public void Clear() { + AssimpPINVOKE.aiMaterial_Clear(swigCPtr); + } + + public static void CopyPropertyList(aiMaterial pcDest, aiMaterial pcSrc) { + AssimpPINVOKE.aiMaterial_CopyPropertyList(aiMaterial.getCPtr(pcDest), aiMaterial.getCPtr(pcSrc)); + } + public bool GetDiffuse(aiColor4D INOUT) { bool ret = AssimpPINVOKE.aiMaterial_GetDiffuse(swigCPtr, aiColor4D.getCPtr(INOUT)); return ret; diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMaterialProperty.cs b/port/Assimp.NET/Assimp.NET_CS/aiMaterialProperty.cs index 3d72905c5..b32e11a6b 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMaterialProperty.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMaterialProperty.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMaterialVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiMaterialVector.cs index b3a2e97ec..13c19ce1a 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMaterialVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMaterialVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMatrix3x3.cs b/port/Assimp.NET/Assimp.NET_CS/aiMatrix3x3.cs index cc4cb6506..633f06721 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMatrix3x3.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMatrix3x3.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -46,6 +46,36 @@ public class aiMatrix3x3 : IDisposable { public aiMatrix3x3(float _a1, float _a2, float _a3, float _b1, float _b2, float _b3, float _c1, float _c2, float _c3) : this(AssimpPINVOKE.new_aiMatrix3x3__SWIG_1(_a1, _a2, _a3, _b1, _b2, _b3, _c1, _c2, _c3), true) { } + public aiMatrix3x3 __mulnset__(aiMatrix3x3 m) { + aiMatrix3x3 ret = new aiMatrix3x3(AssimpPINVOKE.aiMatrix3x3___mulnset__(swigCPtr, aiMatrix3x3.getCPtr(m)), false); + if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public aiMatrix3x3 __mul__(aiMatrix3x3 m) { + aiMatrix3x3 ret = new aiMatrix3x3(AssimpPINVOKE.aiMatrix3x3___mul__(swigCPtr, aiMatrix3x3.getCPtr(m)), true); + if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public SWIGTYPE_p_float __idx__(uint p_iIndex) { + IntPtr cPtr = AssimpPINVOKE.aiMatrix3x3___idx____SWIG_0(swigCPtr, p_iIndex); + SWIGTYPE_p_float ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false); + return ret; + } + + public bool __equal__(aiMatrix4x4 m) { + bool ret = AssimpPINVOKE.aiMatrix3x3___equal__(swigCPtr, aiMatrix4x4.getCPtr(m)); + if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public bool __nequal__(aiMatrix4x4 m) { + bool ret = AssimpPINVOKE.aiMatrix3x3___nequal__(swigCPtr, aiMatrix4x4.getCPtr(m)); + if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + public aiMatrix3x3(aiMatrix4x4 pMatrix) : this(AssimpPINVOKE.new_aiMatrix3x3__SWIG_2(aiMatrix4x4.getCPtr(pMatrix)), true) { if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); } diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMatrix4x4.cs b/port/Assimp.NET/Assimp.NET_CS/aiMatrix4x4.cs index f01a413b1..aae451646 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMatrix4x4.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMatrix4x4.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -50,6 +50,36 @@ public class aiMatrix4x4 : IDisposable { if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); } + public SWIGTYPE_p_float __idx__(uint p_iIndex) { + IntPtr cPtr = AssimpPINVOKE.aiMatrix4x4___idx____SWIG_0(swigCPtr, p_iIndex); + SWIGTYPE_p_float ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false); + return ret; + } + + public bool __equal__(aiMatrix4x4 m) { + bool ret = AssimpPINVOKE.aiMatrix4x4___equal__(swigCPtr, aiMatrix4x4.getCPtr(m)); + if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public bool __nequal__(aiMatrix4x4 m) { + bool ret = AssimpPINVOKE.aiMatrix4x4___nequal__(swigCPtr, aiMatrix4x4.getCPtr(m)); + if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public aiMatrix4x4 __mulnset__(aiMatrix4x4 m) { + aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4___mulnset__(swigCPtr, aiMatrix4x4.getCPtr(m)), false); + if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public aiMatrix4x4 __mul__(aiMatrix4x4 m) { + aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4___mul__(swigCPtr, aiMatrix4x4.getCPtr(m)), true); + if (AssimpPINVOKE.SWIGPendingException.Pending) throw AssimpPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + public aiMatrix4x4 Transpose() { aiMatrix4x4 ret = new aiMatrix4x4(AssimpPINVOKE.aiMatrix4x4_Transpose(swigCPtr), false); return ret; diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMemoryInfo.cs b/port/Assimp.NET/Assimp.NET_CS/aiMemoryInfo.cs index cc60edbab..734f00606 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMemoryInfo.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMemoryInfo.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMesh.cs b/port/Assimp.NET/Assimp.NET_CS/aiMesh.cs index 2f640d8e4..bf55782ce 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMesh.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMesh.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMeshAnim.cs b/port/Assimp.NET/Assimp.NET_CS/aiMeshAnim.cs index 4e0a28285..78237a555 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMeshAnim.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMeshAnim.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMeshAnimVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiMeshAnimVector.cs index 2d7ae7b5b..c862c258c 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMeshAnimVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMeshAnimVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMeshKey.cs b/port/Assimp.NET/Assimp.NET_CS/aiMeshKey.cs index b1f72533f..af16589ff 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMeshKey.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMeshKey.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMeshKeyVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiMeshKeyVector.cs index 7a37dbd2a..73039be46 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMeshKeyVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMeshKeyVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiMeshVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiMeshVector.cs index 35153ca0d..8ea841cf2 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiMeshVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiMeshVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiNode.cs b/port/Assimp.NET/Assimp.NET_CS/aiNode.cs index c830734e2..0e650c0d4 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiNode.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiNode.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiNodeAnim.cs b/port/Assimp.NET/Assimp.NET_CS/aiNodeAnim.cs index 5fcd60adf..629f4f2a9 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiNodeAnim.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiNodeAnim.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiNodeAnimVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiNodeAnimVector.cs index d34f0078c..08ba41850 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiNodeAnimVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiNodeAnimVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiNodeVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiNodeVector.cs index 66eafbf6b..5f7e0c7fd 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiNodeVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiNodeVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiOrigin.cs b/port/Assimp.NET/Assimp.NET_CS/aiOrigin.cs index 8e43dbdbe..8dded0e55 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiOrigin.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiOrigin.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiPlane.cs b/port/Assimp.NET/Assimp.NET_CS/aiPlane.cs index dafd23abe..e19fd572a 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiPlane.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiPlane.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiPostProcessSteps.cs b/port/Assimp.NET/Assimp.NET_CS/aiPostProcessSteps.cs index 65bf020e8..e5e0d18a8 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiPostProcessSteps.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiPostProcessSteps.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31,7 +31,9 @@ public enum aiPostProcessSteps { aiProcess_OptimizeMeshes = 0x200000, aiProcess_OptimizeGraph = 0x400000, aiProcess_FlipUVs = 0x800000, - aiProcess_FlipWindingOrder = 0x1000000 + aiProcess_FlipWindingOrder = 0x1000000, + aiProcess_SplitByBoneCount = 0x2000000, + aiProcess_Debone = 0x4000000 , aiProcess_ConvertToLeftHanded = aiProcess_MakeLeftHanded|aiProcess_FlipUVs|aiProcess_FlipWindingOrder, } diff --git a/port/Assimp.NET/Assimp.NET_CS/aiPrimitiveType.cs b/port/Assimp.NET/Assimp.NET_CS/aiPrimitiveType.cs index bf1421f04..7c1411611 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiPrimitiveType.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiPrimitiveType.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiPropertyTypeInfo.cs b/port/Assimp.NET/Assimp.NET_CS/aiPropertyTypeInfo.cs index 478846059..efac6be5e 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiPropertyTypeInfo.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiPropertyTypeInfo.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiQuatKey.cs b/port/Assimp.NET/Assimp.NET_CS/aiQuatKey.cs index 01ada5475..62c31f803 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiQuatKey.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiQuatKey.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiQuatKeyVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiQuatKeyVector.cs index 902b031c3..eac1fde9c 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiQuatKeyVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiQuatKeyVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiQuaternion.cs b/port/Assimp.NET/Assimp.NET_CS/aiQuaternion.cs index 0e9a186ec..2a0ebccf4 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiQuaternion.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiQuaternion.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -43,7 +43,7 @@ public class aiQuaternion : IDisposable { public aiQuaternion() : this(AssimpPINVOKE.new_aiQuaternion__SWIG_0(), true) { } - public aiQuaternion(float _w, float _x, float _y, float _z) : this(AssimpPINVOKE.new_aiQuaternion__SWIG_1(_w, _x, _y, _z), true) { + public aiQuaternion(float w, float x, float y, float z) : this(AssimpPINVOKE.new_aiQuaternion__SWIG_1(w, x, y, z), true) { } public aiQuaternion(aiMatrix3x3 pRotMatrix) : this(AssimpPINVOKE.new_aiQuaternion__SWIG_2(aiMatrix3x3.getCPtr(pRotMatrix)), true) { diff --git a/port/Assimp.NET/Assimp.NET_CS/aiRay.cs b/port/Assimp.NET/Assimp.NET_CS/aiRay.cs index ebf9d74ab..85a1c986e 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiRay.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiRay.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiReturn.cs b/port/Assimp.NET/Assimp.NET_CS/aiReturn.cs index 7805d24a3..4e4fde423 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiReturn.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiReturn.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiScene.cs b/port/Assimp.NET/Assimp.NET_CS/aiScene.cs index 0e3542f37..d7048cbc1 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiScene.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiScene.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -161,6 +161,17 @@ public class aiScene : IDisposable { return ret; } + public SWIGTYPE_p_void mPrivate { + set { + AssimpPINVOKE.aiScene_mPrivate_set(swigCPtr, SWIGTYPE_p_void.getCPtr(value)); + } + get { + IntPtr cPtr = AssimpPINVOKE.aiScene_mPrivate_get(swigCPtr); + SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false); + return ret; + } + } + private aiAnimationVector GetmAnimations() { IntPtr cPtr = AssimpPINVOKE.aiScene_GetmAnimations(swigCPtr); aiAnimationVector ret = (cPtr == IntPtr.Zero) ? null : new aiAnimationVector(cPtr, true); diff --git a/port/Assimp.NET/Assimp.NET_CS/aiShadingMode.cs b/port/Assimp.NET/Assimp.NET_CS/aiShadingMode.cs index 261eb4158..775417918 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiShadingMode.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiShadingMode.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiString.cs b/port/Assimp.NET/Assimp.NET_CS/aiString.cs index 9706533a0..f55ea8197 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiString.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiString.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -70,6 +70,11 @@ public class aiString : IDisposable { return ret; } + public string C_Str() { + string ret = AssimpPINVOKE.aiString_C_Str(swigCPtr); + return ret; + } + public uint Length { set { AssimpPINVOKE.aiString_Length_set(swigCPtr, value); diff --git a/port/Assimp.NET/Assimp.NET_CS/aiTexel.cs b/port/Assimp.NET/Assimp.NET_CS/aiTexel.cs index 98b6c8fbf..bfd42ce84 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiTexel.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiTexel.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiTexture.cs b/port/Assimp.NET/Assimp.NET_CS/aiTexture.cs index 12be87b0f..87f756edc 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiTexture.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiTexture.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiTextureFlags.cs b/port/Assimp.NET/Assimp.NET_CS/aiTextureFlags.cs index 6618e5582..7f58f533b 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiTextureFlags.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiTextureFlags.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiTextureMapMode.cs b/port/Assimp.NET/Assimp.NET_CS/aiTextureMapMode.cs index 43feda716..dfd7c8821 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiTextureMapMode.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiTextureMapMode.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiTextureMapping.cs b/port/Assimp.NET/Assimp.NET_CS/aiTextureMapping.cs index 0f9830b92..f1f58d416 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiTextureMapping.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiTextureMapping.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiTextureOp.cs b/port/Assimp.NET/Assimp.NET_CS/aiTextureOp.cs index cbef3f0eb..bf844aacf 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiTextureOp.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiTextureOp.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiTextureType.cs b/port/Assimp.NET/Assimp.NET_CS/aiTextureType.cs index 012dbf1a0..0b9ffb14f 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiTextureType.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiTextureType.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiTextureVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiTextureVector.cs index 4ebca3840..745a44ec8 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiTextureVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiTextureVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiUVTransform.cs b/port/Assimp.NET/Assimp.NET_CS/aiUVTransform.cs index 18391e899..0452ee461 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiUVTransform.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiUVTransform.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiVector2D.cs b/port/Assimp.NET/Assimp.NET_CS/aiVector2D.cs index c7b96a878..98074e6d1 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiVector2D.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiVector2D.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiVector3D.cs b/port/Assimp.NET/Assimp.NET_CS/aiVector3D.cs index 9fde01f51..c09201dbf 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiVector3D.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiVector3D.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiVector3DVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiVector3DVector.cs index 6b8b028cf..19e6c958c 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiVector3DVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiVector3DVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiVector3DVectorVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiVector3DVectorVector.cs index e962738a7..6326be345 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiVector3DVectorVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiVector3DVectorVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiVectorKey.cs b/port/Assimp.NET/Assimp.NET_CS/aiVectorKey.cs index e83573dba..13eb78c8f 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiVectorKey.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiVectorKey.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiVectorKeyVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiVectorKeyVector.cs index 0054a8f7b..aee1d002e 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiVectorKeyVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiVectorKeyVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiVertexWeight.cs b/port/Assimp.NET/Assimp.NET_CS/aiVertexWeight.cs index f19c9bd5a..ddb2c4efb 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiVertexWeight.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiVertexWeight.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_CS/aiVertexWeightVector.cs b/port/Assimp.NET/Assimp.NET_CS/aiVertexWeightVector.cs index 1abebdd2b..bcdb1ca92 100644 --- a/port/Assimp.NET/Assimp.NET_CS/aiVertexWeightVector.cs +++ b/port/Assimp.NET/Assimp.NET_CS/aiVertexWeightVector.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.1 + * Version 2.0.8 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/port/Assimp.NET/Assimp.NET_DEMO/AssimpView.cs b/port/Assimp.NET/Assimp.NET_DEMO/AssimpView.cs index bff7e9574..270494fa4 100644 --- a/port/Assimp.NET/Assimp.NET_DEMO/AssimpView.cs +++ b/port/Assimp.NET/Assimp.NET_DEMO/AssimpView.cs @@ -184,7 +184,7 @@ namespace Assimp.Viewer (aiPostProcessSteps)0); // default model - var path = "../../../../../../test/models/3DS/test1.3ds"; + var path = "../../../../../test/models/3DS/test1.3ds"; importer = new Importer(); string[] args = Environment.GetCommandLineArgs(); From 81aef90f4a5e4773984af05e38947fcbf6adaa38 Mon Sep 17 00:00:00 2001 From: ulfjorensen Date: Mon, 5 Nov 2012 09:13:09 +0000 Subject: [PATCH 36/51] - manually pulled the three smaller change requests from Github. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1331 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- CMakeLists.txt | 2 +- code/Q3BSPFileImporter.cpp | 9 +++++---- include/assimp/types.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bc39f27d..eac24cab2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ ELSE ( ASSIMP_ENABLE_BOOST_WORKAROUND ) MESSAGE( FATAL_ERROR "Boost libraries (http://www.boost.org/) not found. " "You can build a non-boost version of Assimp with slightly reduced " - "functionality by specifying -DENABLE_BOOST_WORKAROUND=ON." + "functionality by specifying -DASSIMP_ENABLE_BOOST_WORKAROUND=ON." ) ENDIF ( NOT Boost_FOUND ) diff --git a/code/Q3BSPFileImporter.cpp b/code/Q3BSPFileImporter.cpp index 28b04a59b..6ea67305a 100644 --- a/code/Q3BSPFileImporter.cpp +++ b/code/Q3BSPFileImporter.cpp @@ -640,6 +640,7 @@ bool Q3BSPFileImporter::importTextureFromArchive( const Q3BSP::Q3BSPModel *pMode std::vector supportedExtensions; supportedExtensions.push_back( ".jpg" ); supportedExtensions.push_back( ".png" ); + supportedExtensions.push_back( ".tga" ); if ( NULL == pArchive || NULL == pArchive || NULL == pMatHelper ) { return false; @@ -670,10 +671,10 @@ bool Q3BSPFileImporter::importTextureFromArchive( const Q3BSP::Q3BSPModel *pMode (void)readSize; ai_assert( readSize == pTexture->mWidth ); pTexture->pcData = reinterpret_cast( pData ); - pTexture->achFormatHint[ 0 ] = ext[ 0 ]; - pTexture->achFormatHint[ 1 ] = ext[ 1 ]; - pTexture->achFormatHint[ 2 ] = ext[ 2 ]; - pTexture->achFormatHint[ 2 ] = '\0'; + pTexture->achFormatHint[ 0 ] = ext[ 1 ]; + pTexture->achFormatHint[ 1 ] = ext[ 2 ]; + pTexture->achFormatHint[ 2 ] = ext[ 3 ]; + pTexture->achFormatHint[ 3 ] = '\0'; res = true; aiString name; diff --git a/include/assimp/types.h b/include/assimp/types.h index dc75f4db4..3afb66ef8 100644 --- a/include/assimp/types.h +++ b/include/assimp/types.h @@ -314,7 +314,7 @@ struct aiString /** Append a string to the string */ void Append (const char* app) { - const size_t len = strlen(app); + const size_t len = ::strlen(app); if (!len) { return; } From 4286c72e6089f42df209c089fa347701373eaba2 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Fri, 9 Nov 2012 11:39:34 +0000 Subject: [PATCH 37/51] merge severin-lemaignan:for-upstream from github. This is a full rewrite of pyassimp, rendering it much easier to use. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1332 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- port/PyAssimp/README | 66 - port/PyAssimp/gen/structsgen.py | 23 +- port/PyAssimp/pyassimp/__init__.py | 1 - port/PyAssimp/pyassimp/helper.py | 57 +- port/PyAssimp/pyassimp/pyassimp.py | 276 ----- port/PyAssimp/pyassimp/structs.py | 1279 +++++++++++++------- port/PyAssimp/quicktest.py | 45 - port/PyAssimp/sample.py | 52 +- port/PyAssimp3/README | 65 - port/PyAssimp3/pyassimp/__init__.py | 1 - port/PyAssimp3/pyassimp/errors.py | 11 - port/PyAssimp3/pyassimp/helper.py | 119 -- port/PyAssimp3/pyassimp/pyassimp.py | 314 ----- port/PyAssimp3/pyassimp/structs.py | 424 ------- port/PyAssimp3/quicktest.py | 45 - port/PyAssimp3/sample.py | 71 -- samples/SimpleOpenGL/Sample_SimpleOpenGL.c | 13 + 17 files changed, 976 insertions(+), 1886 deletions(-) delete mode 100644 port/PyAssimp/README delete mode 100644 port/PyAssimp/pyassimp/pyassimp.py delete mode 100755 port/PyAssimp/quicktest.py mode change 100644 => 100755 port/PyAssimp/sample.py delete mode 100644 port/PyAssimp3/README delete mode 100644 port/PyAssimp3/pyassimp/__init__.py delete mode 100644 port/PyAssimp3/pyassimp/errors.py delete mode 100644 port/PyAssimp3/pyassimp/helper.py delete mode 100644 port/PyAssimp3/pyassimp/pyassimp.py delete mode 100644 port/PyAssimp3/pyassimp/structs.py delete mode 100644 port/PyAssimp3/quicktest.py delete mode 100644 port/PyAssimp3/sample.py diff --git a/port/PyAssimp/README b/port/PyAssimp/README deleted file mode 100644 index 1d4a71487..000000000 --- a/port/PyAssimp/README +++ /dev/null @@ -1,66 +0,0 @@ - PyAssimp Readme - --------------- - - --- a simple Python wrapper for Assimp using ctypes to access -the library. Tested for Python 2.6. Known not to work with -Python 2.4. - - -Note that pyassimp is by no means considered mature. It works, -but it is far away from wrapping Assimp perfectly. - - -USAGE -===== - -To get started with pyAssimp, examine the sample.py script, which -illustrates the basic usage. All Assimp data structures are -wrapped using ctypes. All the data+length fields in Assimp's -data structures (such as 'aiMesh::mNumVertices','aiMesh::mVertices') -are replaced by simple python lists, so you can call len() on -them to get their respective size and access members using -[]. - -For example, to load a file named 'hello.3ds' and print the first -vertex of the first mesh, you would do (proper error handling -substituted by assertions ...): - -> from pyassimp import pyassimp, errors -> -> try: -> scene = pyassimp.load('hello.3ds') -> except AssimpError, msg: -> print(msg) -> return - -> assert len(scene.meshes) -> mesh = scene.meshes[0] - -> assert len(mesh.vertices) -> print(mesh.vertices[0]) - -> # don't forget this one, or you will leak! -> pyassimp.release(scene) - - -INSTALL -======= - -PyAssimp requires a assimp dynamic library (DLL on windows, -so on linux :-) in order to work. The default search directories -are: - -- the current directory -- on linux additionally: /usr/local/lib - -To build that library, refer to the Assimp master INSTALL -instructions. To look in more places, edit ./pyassimp/helper.py. -There's an 'additional_dirs' list waiting for your entries. - - - - - - - diff --git a/port/PyAssimp/gen/structsgen.py b/port/PyAssimp/gen/structsgen.py index 8c356b0ba..f2ee95eb5 100644 --- a/port/PyAssimp/gen/structsgen.py +++ b/port/PyAssimp/gen/structsgen.py @@ -41,7 +41,11 @@ # --------------------------------------------------------------------------- """Update PyAssimp's data structures to keep up with the -C/C++ headers.""" +C/C++ headers. + +This script is meant to be executed in the source tree, directly from +port/PyAssimp/gen +""" import os import re @@ -96,7 +100,7 @@ def GetType(type, prefix='c_'): return None t = t.strip() - types = {'unsigned int':'uint', 'unsigned char':'ubyte', 'size_t':'uint',} + types = {'unsigned int':'uint', 'unsigned char':'ubyte',} if t in types: t = types[t] t = prefix + t @@ -210,9 +214,11 @@ def Structify(fileName): # Restructure text = RErestruc.sub(restructure, text) - # Replace comments - text = RErpcom.sub('#\g', text) + text = RErpcom.sub('# \g', text) + text = text.replace("),#", "),\n#") + text = text.replace("#", "\n#") + text = "".join([l for l in text.splitlines(True) if not l.strip().endswith("#")]) # remove empty comment lines # Whether it's selfreferencing: ex. struct Node { Node* parent; }; selfreferencing = text.find('POINTER('+name+')') != -1 @@ -245,20 +251,21 @@ def Structify(fileName): text = text.replace('$DEFINES$', defines) else: text = text.replace('$DEFINES$', '') + result.append((primitive, selfreferencing, complex, text)) return result text = "#-*- coding: UTF-8 -*-\n\n" -text += "from ctypes import POINTER, c_int, c_uint, c_char, c_float, Structure, c_char_p, c_double, c_ubyte\n\n" +text += "from ctypes import POINTER, c_int, c_uint, c_size_t, c_char, c_float, Structure, c_char_p, c_double, c_ubyte\n\n" structs1 = "" structs2 = "" structs3 = "" structs4 = "" -path = '../include/' +path = '../../../include/assimp' files = os.listdir (path) #files = ["aiScene.h", "aiTypes.h"] for fileName in files: @@ -276,6 +283,8 @@ for fileName in files: text += structs1 + structs2 + structs3 + structs4 -file = open('structs.txt', 'w') +file = open('structs.py', 'w') file.write(text) file.close() + +print("Generation done. You can now review the file 'structs.py' and merge it.") diff --git a/port/PyAssimp/pyassimp/__init__.py b/port/PyAssimp/pyassimp/__init__.py index 229d2296c..e69de29bb 100644 --- a/port/PyAssimp/pyassimp/__init__.py +++ b/port/PyAssimp/pyassimp/__init__.py @@ -1 +0,0 @@ -#-*- coding: UTF-8 -*- diff --git a/port/PyAssimp/pyassimp/helper.py b/port/PyAssimp/pyassimp/helper.py index ca7bd5d99..a01da375c 100644 --- a/port/PyAssimp/pyassimp/helper.py +++ b/port/PyAssimp/pyassimp/helper.py @@ -6,17 +6,20 @@ Some fancy helper functions. import os import ctypes -import structs -import operator - -from errors import AssimpError from ctypes import POINTER +import operator +import numpy + +import logging;logger = logging.getLogger("pyassimp") + +from .errors import AssimpError additional_dirs, ext_whitelist = [],[] # populate search directories and lists of allowed file extensions # depending on the platform we're running on. if os.name=='posix': + additional_dirs.append('/usr/lib/') additional_dirs.append('/usr/local/lib/') # note - this won't catch libassimp.so.N.n, but @@ -27,11 +30,43 @@ if os.name=='posix': elif os.name=='nt': ext_whitelist.append('.dll') -print(additional_dirs) +#print(additional_dirs) def vec2tuple(x): """ Converts a VECTOR3D to a Tuple """ return (x.x, x.y, x.z) +def transform(vector3, matrix4x4): + """ Apply a transformation matrix on a 3D vector. + + :param vector3: a numpy array with 3 elements + :param matrix4x4: a numpy 4x4 matrix + """ + return numpy.dot(matrix4x4, numpy.append(vector3, 1.)) + + +def get_bounding_box(scene): + bb_min = [1e10, 1e10, 1e10] # x,y,z + bb_max = [-1e10, -1e10, -1e10] # x,y,z + return get_bounding_box_for_node(scene.rootnode, bb_min, bb_max) + +def get_bounding_box_for_node(node, bb_min, bb_max): + for mesh in node.meshes: + for v in mesh.vertices: + v = transform(v, node.transformation) + bb_min[0] = min(bb_min[0], v[0]) + bb_min[1] = min(bb_min[1], v[1]) + bb_min[2] = min(bb_min[2], v[2]) + bb_max[0] = max(bb_max[0], v[0]) + bb_max[1] = max(bb_max[1], v[1]) + bb_max[2] = max(bb_max[2], v[2]) + + + for child in node.children: + bb_min, bb_max = get_bounding_box_for_node(child, bb_min, bb_max) + + return bb_min, bb_max + + def try_load_functions(library,dll,candidates): """try to functbind to aiImportFile and aiReleaseImport @@ -54,7 +89,8 @@ def try_load_functions(library,dll,candidates): pass else: #Library found! - load.restype = POINTER(structs.Scene) + from .structs import Scene + load.restype = POINTER(Scene) candidates.append((library, load, release, dll)) @@ -88,10 +124,11 @@ def search_library(): continue library = os.path.join(curfolder, filename) - print 'Try ',library + logger.debug('Try ' + library) try: dll = ctypes.cdll.LoadLibrary(library) - except: + except Exception as e: + logger.warning(str(e)) # OK, this except is evil. But different OSs will throw different # errors. So just ignore any errors. continue @@ -100,12 +137,12 @@ def search_library(): if not candidates: # no library found - raise AssimpError, "assimp library not found" + raise AssimpError("assimp library not found") else: # get the newest library candidates = map(lambda x: (os.lstat(x[0])[-2], x), candidates) res = max(candidates, key=operator.itemgetter(0))[1] - print 'Taking ',res[0] + logger.debug('Using assimp library located at ' + res[0]) # XXX: if there are 1000 dll/so files containing 'assimp' # in their name, do we have all of them in our address diff --git a/port/PyAssimp/pyassimp/pyassimp.py b/port/PyAssimp/pyassimp/pyassimp.py deleted file mode 100644 index 36ecf22c3..000000000 --- a/port/PyAssimp/pyassimp/pyassimp.py +++ /dev/null @@ -1,276 +0,0 @@ -#-*- coding: UTF-8 -*- - -""" -PyAssimp - -This is the main-module of PyAssimp. -""" - -import sys -if sys.version_info < (2,5): - raise 'pyassimp: need python 2.5 or newer' - -import structs -import ctypes -import os -import helper -from errors import AssimpError - -class aiArray: - """ - A python class to 'safely' access C arrays. - For m and mNum assimp class members. - """ - def __init__(self, instance, dataName, sizeName, i=None): - self.instance = instance - self.dataName = dataName - self.sizeName = sizeName - self.i = i - self.count = 0 - - def _GetSize(self): - return getattr(self.instance, self.sizeName) - - def _GetData(self, index): - if self.i != None: - if not bool(getattr(self.instance, self.dataName)[self.i]): - return None - item = getattr(self.instance, self.dataName)[self.i][index] - else: - item = getattr(self.instance, self.dataName)[index] - if hasattr(item, 'contents'): - return item.contents._init() - elif hasattr(item, '_init'): - return item._init() - else: - return item - - def next(self): - if self.count >= self._GetSize(): - self.count = 0 - raise StopIteration - else: - c = self.count - self.count += 1 - return self._GetData(c) - - def __getitem__(self, index): - if isinstance(index, slice): - indices = index.indices(len(self)) - return [self.__getitem__(i) for i in range(*indices)] - - if index < 0 or index >= self._GetSize(): - raise IndexError("aiArray index out of range") - return self._GetData(index) - - def __iter__(self): - return self - - def __len__(self): - return int(self._GetSize()) - - def __str__(self): - return str([x for x in self]) - - def __repr__(self): - return str([x for x in self]) - -class aiTuple: - """ - A python class to 'safely' access C structs in a python tuple fashion. - For C structs like vectors, matrices, colors, ... - """ - def __init__(self, instance): - self.instance = instance - self.count = 0 - - def _GetSize(self): - return len(self.instance._fields_) - - def _GetData(self, index): - return getattr(self.instance, self.instance._fields_[index][0]) - - def next(self): - if self.count >= self._GetSize(): - self.count = 0 - raise StopIteration - else: - c = self.count - self.count += 1 - return self._GetData(c) - - def __getitem__(self, index): - if isinstance(index, slice): - indices = index.indices(len(self)) - return [self.__getitem__(i) for i in range(*indices)] - - if index < 0 or index >= self._GetSize(): - raise IndexError("aiTuple index out of range") - return self._GetData(index) - - def __iter__(self): - return self - - def __len__(self): - return int(self._GetSize()) - - def __str__(self): - return str([x for x in self]) - - def __repr__(self): - return str([x for x in self]) - -def _init(self): - """ - Custom initialize() for C structs, adds safely accessable member functionality. - """ - if hasattr(self, '_is_init'): - return self - self._is_init = True - - if str(self.__class__.__name__) == "MaterialProperty": - self.mKey._init() - - for m in self.__class__.__dict__.keys(): - if m.startswith('mNum'): - name = m.split('mNum')[1] - if 'm'+name in self.__class__.__dict__.keys(): - setattr(self.__class__, name.lower(), aiArray(self, 'm'+name , m)) - if name.lower() == "vertices": - setattr(self.__class__, "normals", aiArray(self, 'mNormals' , m)) - setattr(self.__class__, "tangents", aiArray(self, 'mTangents' , m)) - setattr(self.__class__, "bitangets", aiArray(self, 'mBitangents' , m)) - setattr(self.__class__, "colors", [aiArray(self, 'mColors' , m, o) for o in xrange(len(self.mColors))]) - setattr(self.__class__, "texcoords", [aiArray(self, 'mTextureCoords' , m, o) for o in xrange(len(self.mColors))]) - - elif m == "x" or m == "a1" or m == "b": # Vector, matrix, quat, color - self._tuple = aiTuple(self) - setattr(self.__class__, '__getitem__', lambda x, y: x._tuple.__getitem__(y)) - setattr(self.__class__, '__iter__', lambda x: x._tuple) - setattr(self.__class__, 'next', lambda x: x._tuple.next) - setattr(self.__class__, '__repr__', lambda x: str([c for c in x])) - break - elif m == "data": #String - setattr(self.__class__, '__repr__', lambda x: str(x.data)) - setattr(self.__class__, '__str__', lambda x: str(x.data)) - break - - if hasattr(getattr(self, m), '_init'): - getattr(self, m)._init() - - return self - -""" -Python magic to add the _init() function to all C struct classes. -""" -for struct in dir(structs): - if not (struct.startswith('_') or struct.startswith('c_') or struct == "Structure" or struct == "POINTER") and not isinstance(getattr(structs, struct),int): - setattr(getattr(structs, struct), '_init', _init) - - -class AssimpLib(object): - """ - Assimp-Singleton - """ - load, release, dll = helper.search_library() - -#the loader as singleton -_assimp_lib = AssimpLib() - - -def load(filename, processing=0): - """ - Loads the model with some specific processing parameters. - - filename - file to load model from - processing - processing parameters - - result Scene-object with model-data - - throws AssimpError - could not open file - """ - #read pure data - model = _assimp_lib.load(filename, processing) - if not model: - #Uhhh, something went wrong! - raise AssimpError, ("could not import file: %s" % filename) - - return model.contents._init() - -def release(scene): - from ctypes import pointer - _assimp_lib.release(pointer(scene)) - -def aiGetMaterialFloatArray(material, key): - AI_SUCCESS = 0 - from ctypes import byref, pointer, cast, c_float, POINTER, sizeof, c_uint - out = structs.Color4D() - max = c_uint(sizeof(structs.Color4D)) - r=_assimp_lib.dll.aiGetMaterialFloatArray(pointer(material), - key[0], - key[1], - key[2], - byref(out), - byref(max)) - - if (r != AI_SUCCESS): - raise AssimpError("aiGetMaterialFloatArray failed!") - - out._init() - return [out[i] for i in xrange(max.value)] - -def aiGetMaterialString(material, key): - AI_SUCCESS = 0 - from ctypes import byref, pointer, cast, c_float, POINTER, sizeof, c_uint - out = structs.String() - r=_assimp_lib.dll.aiGetMaterialString(pointer(material), - key[0], - key[1], - key[2], - byref(out)) - - if (r != AI_SUCCESS): - raise AssimpError("aiGetMaterialString failed!") - - return str(out.data) - -def GetMaterialProperties(material): - """ - Convenience Function to get the material properties as a dict - and values in a python format. - """ - result = {} - #read all properties - for p in material.properties: - #the name - key = p.mKey.data - - #the data - from ctypes import POINTER, cast, c_int, c_float, sizeof - if p.mType == 1: - arr = cast(p.mData, POINTER(c_float*(p.mDataLength/sizeof(c_float)) )).contents - value = [x for x in arr] - elif p.mType == 3: #string can't be an array - value = cast(p.mData, POINTER(structs.String)).contents.data - elif p.mType == 4: - arr = cast(p.mData, POINTER(c_int*(p.mDataLength/sizeof(c_int)) )).contents - value = [x for x in arr] - else: - value = p.mData[:p.mDataLength] - - result[key] = value - - return result - - -def aiDecomposeMatrix(matrix): - if not isinstance(matrix, structs.Matrix4x4): - raise AssimpError("aiDecomposeMatrix failed: Not a aiMatrix4x4!") - - scaling = structs.Vector3D() - rotation = structs.Quaternion() - position = structs.Vector3D() - - from ctypes import byref, pointer - _assimp_lib.dll.aiDecomposeMatrix(pointer(matrix), byref(scaling), byref(rotation), byref(position)) - return scaling._init(), rotation._init(), position._init() diff --git a/port/PyAssimp/pyassimp/structs.py b/port/PyAssimp/pyassimp/structs.py index 54c02a2b8..fb98ee53d 100644 --- a/port/PyAssimp/pyassimp/structs.py +++ b/port/PyAssimp/pyassimp/structs.py @@ -1,424 +1,879 @@ -#-*- coding: UTF-8 -*- - -from ctypes import POINTER, c_int, c_uint, c_char, c_float, Structure, c_char_p, c_double, c_ubyte, c_size_t - - -class Vector2D(Structure): - """ - See 'aiVector2D.h' for details. - """ - - - _fields_ = [ - ("x", c_float),("y", c_float), - ] - -class Texel(Structure): - """ - See 'aiTexture.h' for details. - """ - - _fields_ = [ - ("b", c_ubyte),("g", c_ubyte),("r", c_ubyte),("a", c_ubyte), - ] - -class Plane(Structure): - """ - See 'aiTypes.h' for details. - """ - - _fields_ = [ - # Plane equation - ("a", c_float),("b", c_float),("c", c_float),("d", c_float), - ] - -class Color3D(Structure): - """ - See 'aiTypes.h' for details. - """ - - _fields_ = [ - # Red, green and blue color values - ("r", c_float),("g", c_float),("b", c_float), - ] - -class String(Structure): - """ - See 'aiTypes.h' for details. - """ - +#-*- coding: UTF-8 -*- + +from ctypes import POINTER, c_void_p, c_int, c_uint, c_char, c_float, Structure, c_char_p, c_double, c_ubyte, c_size_t + + +class Vector2D(Structure): + """ + See 'aiVector2D.h' for details. + """ + + + _fields_ = [ + ("x", c_float),("y", c_float), + ] + +class Matrix3x3(Structure): + """ + See 'aiMatrix3x3.h' for details. + """ + + + _fields_ = [ + ("a1", c_float),("a2", c_float),("a3", c_float), + ("b1", c_float),("b2", c_float),("b3", c_float), + ("c1", c_float),("c2", c_float),("c3", c_float), + ] + +class Texel(Structure): + """ + See 'aiTexture.h' for details. + """ + + _fields_ = [ + ("b", c_ubyte),("g", c_ubyte),("r", c_ubyte),("a", c_ubyte), + ] + +class Color4D(Structure): + """ + See 'aiColor4D.h' for details. + """ + + + _fields_ = [ + # Red, green, blue and alpha color values + ("r", c_float),("g", c_float),("b", c_float),("a", c_float), + ] + +class Plane(Structure): + """ + See 'aiTypes.h' for details. + """ + + _fields_ = [ + # Plane equation + ("a", c_float),("b", c_float),("c", c_float),("d", c_float), + ] + +class Color3D(Structure): + """ + See 'aiTypes.h' for details. + """ + + _fields_ = [ + # Red, green and blue color values + ("r", c_float),("g", c_float),("b", c_float), + ] + +class String(Structure): + """ + See 'aiTypes.h' for details. + """ + MAXLEN = 1024 - - _fields_ = [ - #Binary length of the string excluding the terminal 0. This is NOT the# logical length of strings containing UTF-8 multibyte sequences! It's# the number of bytes from the beginning of the string to its end.# - ("length", c_size_t),#String buffer. Size limit is MAXLEN# - ("data", c_char*MAXLEN), - ] - -class MemoryInfo(Structure): - """ - See 'aiTypes.h' for details. - """ - - _fields_ = [ - #Storage allocated for texture data# - ("textures", c_uint),#Storage allocated for material data# - ("materials", c_uint),#Storage allocated for mesh data# - ("meshes", c_uint),#Storage allocated for node data# - ("nodes", c_uint),#Storage allocated for animation data# - ("animations", c_uint),#Storage allocated for camera data# - ("cameras", c_uint),#Storage allocated for light data# - ("lights", c_uint),#Total storage allocated for the full import.# - ("total", c_uint), - ] - -class Matrix3x3(Structure): - """ - See 'aiMatrix3x3.h' for details. - """ - - - _fields_ = [ - ("a1", c_float),("a2", c_float),("a3", c_float), - ("b1", c_float),("b2", c_float),("b3", c_float), - ("c1", c_float),("c2", c_float),("c3", c_float), - ] - -class Color4D(Structure): - """ - See 'aiColor4D.h' for details. - """ - - - _fields_ = [ - # Red, green, blue and alpha color values - ("r", c_float),("g", c_float),("b", c_float),("a", c_float), - ] - -class ExportFormatDesc(Structure): - """ - See 'export.h' for details. - """ - - _fields_ = [ - # a short string ID to uniquely identify the export format. Use this ID string to# specify which file format you want to export to when calling aiExportScene().# Example: "dae" or "obj" - ("id", POINTER(c_char)),# A short description of the file format to present to users. Useful if you want# to allow the user to select an export format. - ("description", POINTER(c_char)),# Recommended file extension for the exported file in lower case. - ("fileExtension", POINTER(c_char)), - ] - -class Quaternion(Structure): - """ - See 'aiQuaternion.h' for details. - """ - - - _fields_ = [ - # w,x,y,z components of the quaternion - ("w", c_float),("x", c_float),("y", c_float),("z", c_float), - ] - -class Vector3D(Structure): - """ - See 'aiVector3D.h' for details. - """ - - - _fields_ = [ - ("x", c_float),("y", c_float),("z", c_float), - ] - -class Face(Structure): - """ - See 'aiMesh.h' for details. - """ - - _fields_ = [ - # Number of indices defining this face.# The maximum value for this member is #AI_MAX_FACE_INDICES. - ("mNumIndices", c_uint),# Pointer to the indices array. Size of the array is given in numIndices. - ("mIndices", POINTER(c_uint)), - ] - -class VertexWeight(Structure): - """ - See 'aiMesh.h' for details. - """ - - _fields_ = [ - # Index of the vertex which is influenced by the bone. - ("mVertexId", c_uint),# The strength of the influence in the range (0...1).# The influence from all bones at one vertex amounts to 1. - ("mWeight", c_float), - ] - -class MeshKey(Structure): - """ - See 'aiAnim.h' for details. - """ - - _fields_ = [ - #The time of this key# - ("mTime", c_double),#Index into the aiMesh::mAnimMeshes array of the# mesh coresponding to the #aiMeshAnim hosting this# key frame. The referenced anim mesh is evaluated# according to the rules defined in the docs for #aiAnimMesh.# - ("mValue", c_uint), - ] - -class Matrix4x4(Structure): - """ - See 'aiMatrix4x4.h' for details. - """ - - - _fields_ = [ - ("a1", c_float),("a2", c_float),("a3", c_float),("a4", c_float), - ("b1", c_float),("b2", c_float),("b3", c_float),("b4", c_float), - ("c1", c_float),("c2", c_float),("c3", c_float),("c4", c_float), - ("d1", c_float),("d2", c_float),("d3", c_float),("d4", c_float), - ] - -class Node(Structure): - """ - See 'aiScene.h' for details. - """ - - -Node._fields_ = [ - #The name of the node.##The name might be empty (length of zero) but all nodes which#need to be accessed afterwards by bones or anims are usually named.#Multiple nodes may have the same name, but nodes which are accessed#by bones (see #aiBone and #aiMesh::mBones) *must* be unique.##Cameras and lights are assigned to a specific node name - if there#are multiple nodes with this name, they're assigned to each of them.#
#There are no limitations regarding the characters contained in#this text. You should be able to handle stuff like whitespace, tabs,#linefeeds, quotation marks, ampersands, ... .# - ("mName", String),#The transformation relative to the node's parent.# - ("mTransformation", Matrix4x4),#Parent node. NULL if this node is the root node.# - ("mParent", POINTER(Node)),#The number of child nodes of this node.# - ("mNumChildren", c_uint),#The child nodes of this node. NULL if mNumChildren is 0.# - ("mChildren", POINTER(POINTER(Node))),#The number of meshes of this node.# - ("mNumMeshes", c_uint),#The meshes of this node. Each entry is an index into the mesh# - ("mMeshes", POINTER(c_uint)), - ] - -class Camera(Structure): - """ - See 'aiCamera.h' for details. - """ - - - _fields_ = [ - #The name of the camera.## There must be a node in the scenegraph with the same name.# This node specifies the position of the camera in the scene# hierarchy and can be animated.# - ("mName", String),#Position of the camera relative to the coordinate space# defined by the corresponding node.## The default value is 0|0|0.# - ("mPosition", Vector3D),#'Up' - vector of the camera coordinate system relative to# the coordinate space defined by the corresponding node.## The 'right' vector of the camera coordinate system is# the cross product of the up and lookAt vectors.# The default value is 0|1|0. The vector# may be normalized, but it needn't.# - ("mUp", Vector3D),#'LookAt' - vector of the camera coordinate system relative to# the coordinate space defined by the corresponding node.## This is the viewing direction of the user.# The default value is 0|0|1. The vector# may be normalized, but it needn't.# - ("mLookAt", Vector3D),#Half horizontal field of view angle, in radians.## The field of view angle is the angle between the center# line of the screen and the left or right border.# The default value is 1/4PI.# - ("mHorizontalFOV", c_float),#Distance of the near clipping plane from the camera.##The value may not be 0.f (for arithmetic reasons to prevent#a division through zero). The default value is 0.1f.# - ("mClipPlaneNear", c_float),#Distance of the far clipping plane from the camera.##The far clipping plane must, of course, be further away than the#near clipping plane. The default value is 1000.f. The ratio#between the near and the far plane should not be too#large (between 1000-10000 should be ok) to avoid floating-point#inaccuracies which could lead to z-fighting.# - ("mClipPlaneFar", c_float),#Screen aspect ratio.##This is the ration between the width and the height of the#screen. Typical values are 4/3, 1/2 or 1/1. This value is#0 if the aspect ratio is not defined in the source file.#0 is also the default value.# - ("mAspect", c_float), - ] - -class Texture(Structure): - """ - See 'aiTexture.h' for details. - """ - - - _fields_ = [ - #Width of the texture, in pixels##If mHeight is zero the texture is compressed in a format#like JPEG. In this case mWidth specifies the size of the#memory area pcData is pointing to, in bytes.# - ("mWidth", c_uint),#Height of the texture, in pixels##If this value is zero, pcData points to an compressed texture#in any format (e.g. JPEG).# - ("mHeight", c_uint),#A hint from the loader to make it easier for applications# to determine the type of embedded compressed textures.##If mHeight != 0 this member is undefined. Otherwise it#is set set to '\\0\\0\\0\\0' if the loader has no additional#information about the texture file format used OR the#file extension of the format without a trailing dot. If there#are multiple file extensions for a format, the shortest#extension is chosen (JPEG maps to 'jpg', not to 'jpeg').#E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case.#The fourth character will always be '\\0'.# - ("achFormatHint", c_char*4),#Data of the texture.##Points to an array of mWidth#mHeight aiTexel's.#The format of the texture data is always ARGB8888 to#make the implementation for user of the library as easy#as possible. If mHeight = 0 this is a pointer to a memory#buffer of size mWidth containing the compressed texture#data. Good luck, have fun!# - ("pcData", POINTER(Texel)), - ] - -class Ray(Structure): - """ - See 'aiTypes.h' for details. - """ - - _fields_ = [ - # Position and direction of the ray - ("pos", Vector3D),("dir", Vector3D), - ] - -class Light(Structure): - """ - See 'aiLight.h' for details. - """ - - - _fields_ = [ - #The name of the light source.## There must be a node in the scenegraph with the same name.# This node specifies the position of the light in the scene# hierarchy and can be animated.# - ("mName", String),#The type of the light source.##aiLightSource_UNDEFINED is not a valid value for this member.# - ("mType", c_uint),#Position of the light source in space. Relative to the# transformation of the node corresponding to the light.## The position is undefined for directional lights.# - ("mPosition", Vector3D),#Direction of the light source in space. Relative to the# transformation of the node corresponding to the light.## The direction is undefined for point lights. The vector# may be normalized, but it needn't.# - ("mDirection", Vector3D),#Constant light attenuation factor.## The intensity of the light source at a given distance 'd' from# the light's position is# @code# Atten = 1/( att0 + att1#d + att2#d*d)# @endcode# This member corresponds to the att0 variable in the equation.# Naturally undefined for directional lights.# - ("mAttenuationConstant", c_float),#Linear light attenuation factor.## The intensity of the light source at a given distance 'd' from# the light's position is# @code# Atten = 1/( att0 + att1#d + att2#d*d)# @endcode# This member corresponds to the att1 variable in the equation.# Naturally undefined for directional lights.# - ("mAttenuationLinear", c_float),#Quadratic light attenuation factor.## The intensity of the light source at a given distance 'd' from# the light's position is# @code# Atten = 1/( att0 + att1#d + att2#d*d)# @endcode# This member corresponds to the att2 variable in the equation.# Naturally undefined for directional lights.# - ("mAttenuationQuadratic", c_float),#Diffuse color of the light source## The diffuse light color is multiplied with the diffuse# material color to obtain the final color that contributes# to the diffuse shading term.# - ("mColorDiffuse", Color3D),#Specular color of the light source## The specular light color is multiplied with the specular# material color to obtain the final color that contributes# to the specular shading term.# - ("mColorSpecular", Color3D),#Ambient color of the light source## The ambient light color is multiplied with the ambient# material color to obtain the final color that contributes# to the ambient shading term. Most renderers will ignore# this value it, is just a remaining of the fixed-function pipeline# that is still supported by quite many file formats.# - ("mColorAmbient", Color3D),#Inner angle of a spot light's light cone.## The spot light has maximum influence on objects inside this# angle. The angle is given in radians. It is 2PI for point# lights and undefined for directional lights.# - ("mAngleInnerCone", c_float),#Outer angle of a spot light's light cone.## The spot light does not affect objects outside this angle.# The angle is given in radians. It is 2PI for point lights and# undefined for directional lights. The outer angle must be# greater than or equal to the inner angle.# It is assumed that the application uses a smooth# interpolation between the inner and the outer cone of the# spot light.# - ("mAngleOuterCone", c_float), - ] - -class Bone(Structure): - """ - See 'aiMesh.h' for details. - """ - - _fields_ = [ - # The name of the bone. - ("mName", String),# The number of vertices affected by this bone# The maximum value for this member is #AI_MAX_BONE_WEIGHTS. - ("mNumWeights", c_uint),# The vertices affected by this bone - ("mWeights", POINTER(VertexWeight)),# Matrix that transforms from mesh space to bone space in bind pose - ("mOffsetMatrix", Matrix4x4), - ] - -class Mesh(Structure): - """ - See 'aiMesh.h' for details. - """ - + + _fields_ = [ + # Binary length of the string excluding the terminal 0. This is NOT the + # logical length of strings containing UTF-8 multibyte sequences! It's + # the number of bytes from the beginning of the string to its end. + ("length", c_size_t), + + # String buffer. Size limit is MAXLEN + ("data", c_char*MAXLEN), + ] + +class MemoryInfo(Structure): + """ + See 'aiTypes.h' for details. + """ + + _fields_ = [ + # Storage allocated for texture data + ("textures", c_uint), + + # Storage allocated for material data + ("materials", c_uint), + + # Storage allocated for mesh data + ("meshes", c_uint), + + # Storage allocated for node data + ("nodes", c_uint), + + # Storage allocated for animation data + ("animations", c_uint), + + # Storage allocated for camera data + ("cameras", c_uint), + + # Storage allocated for light data + ("lights", c_uint), + + # Total storage allocated for the full import. + ("total", c_uint), + ] + +class Quaternion(Structure): + """ + See 'aiQuaternion.h' for details. + """ + + + _fields_ = [ + # w,x,y,z components of the quaternion + ("w", c_float),("x", c_float),("y", c_float),("z", c_float), + ] + +class Face(Structure): + """ + See 'aiMesh.h' for details. + """ + + _fields_ = [ + # Number of indices defining this face. + # The maximum value for this member is + #AI_MAX_FACE_INDICES. + ("mNumIndices", c_uint), + + # Pointer to the indices array. Size of the array is given in numIndices. + ("mIndices", POINTER(c_uint)), + ] + +class VertexWeight(Structure): + """ + See 'aiMesh.h' for details. + """ + + _fields_ = [ + # Index of the vertex which is influenced by the bone. + ("mVertexId", c_uint), + + # The strength of the influence in the range (0...1). + # The influence from all bones at one vertex amounts to 1. + ("mWeight", c_float), + ] + +class Matrix4x4(Structure): + """ + See 'aiMatrix4x4.h' for details. + """ + + + _fields_ = [ + ("a1", c_float),("a2", c_float),("a3", c_float),("a4", c_float), + ("b1", c_float),("b2", c_float),("b3", c_float),("b4", c_float), + ("c1", c_float),("c2", c_float),("c3", c_float),("c4", c_float), + ("d1", c_float),("d2", c_float),("d3", c_float),("d4", c_float), + ] + +class Vector3D(Structure): + """ + See 'aiVector3D.h' for details. + """ + + + _fields_ = [ + ("x", c_float),("y", c_float),("z", c_float), + ] + +class MeshKey(Structure): + """ + See 'aiAnim.h' for details. + """ + + _fields_ = [ + # The time of this key + ("mTime", c_double), + + # Index into the aiMesh::mAnimMeshes array of the + # mesh coresponding to the + #aiMeshAnim hosting this + # key frame. The referenced anim mesh is evaluated + # according to the rules defined in the docs for + #aiAnimMesh. + ("mValue", c_uint), + ] + +class Node(Structure): + """ + See 'aiScene.h' for details. + """ + + +Node._fields_ = [ + # The name of the node. + # The name might be empty (length of zero) but all nodes which + # need to be accessed afterwards by bones or anims are usually named. + # Multiple nodes may have the same name, but nodes which are accessed + # by bones (see + #aiBone and + #aiMesh::mBones) *must* be unique. + # Cameras and lights are assigned to a specific node name - if there + # are multiple nodes with this name, they're assigned to each of them. + #
+ # There are no limitations regarding the characters contained in + # this text. You should be able to handle stuff like whitespace, tabs, + # linefeeds, quotation marks, ampersands, ... . + ("mName", String), + + # The transformation relative to the node's parent. + ("mTransformation", Matrix4x4), + + # Parent node. NULL if this node is the root node. + ("mParent", POINTER(Node)), + + # The number of child nodes of this node. + ("mNumChildren", c_uint), + + # The child nodes of this node. NULL if mNumChildren is 0. + ("mChildren", POINTER(POINTER(Node))), + + # The number of meshes of this node. + ("mNumMeshes", c_uint), + + # The meshes of this node. Each entry is an index into the mesh + ("mMeshes", POINTER(c_uint)), + ] + +class Light(Structure): + """ + See 'aiLight.h' for details. + """ + + + _fields_ = [ + # The name of the light source. + # There must be a node in the scenegraph with the same name. + # This node specifies the position of the light in the scene + # hierarchy and can be animated. + ("mName", String), + + # The type of the light source. + # aiLightSource_UNDEFINED is not a valid value for this member. + ("mType", c_uint), + + # Position of the light source in space. Relative to the + # transformation of the node corresponding to the light. + # The position is undefined for directional lights. + ("mPosition", Vector3D), + + # Direction of the light source in space. Relative to the + # transformation of the node corresponding to the light. + # The direction is undefined for point lights. The vector + # may be normalized, but it needn't. + ("mDirection", Vector3D), + + # Constant light attenuation factor. + # The intensity of the light source at a given distance 'd' from + # the light's position is + # @code + # Atten = 1/( att0 + att1 + # d + att2 + # d*d) + # @endcode + # This member corresponds to the att0 variable in the equation. + # Naturally undefined for directional lights. + ("mAttenuationConstant", c_float), + + # Linear light attenuation factor. + # The intensity of the light source at a given distance 'd' from + # the light's position is + # @code + # Atten = 1/( att0 + att1 + # d + att2 + # d*d) + # @endcode + # This member corresponds to the att1 variable in the equation. + # Naturally undefined for directional lights. + ("mAttenuationLinear", c_float), + + # Quadratic light attenuation factor. + # The intensity of the light source at a given distance 'd' from + # the light's position is + # @code + # Atten = 1/( att0 + att1 + # d + att2 + # d*d) + # @endcode + # This member corresponds to the att2 variable in the equation. + # Naturally undefined for directional lights. + ("mAttenuationQuadratic", c_float), + + # Diffuse color of the light source + # The diffuse light color is multiplied with the diffuse + # material color to obtain the final color that contributes + # to the diffuse shading term. + ("mColorDiffuse", Color3D), + + # Specular color of the light source + # The specular light color is multiplied with the specular + # material color to obtain the final color that contributes + # to the specular shading term. + ("mColorSpecular", Color3D), + + # Ambient color of the light source + # The ambient light color is multiplied with the ambient + # material color to obtain the final color that contributes + # to the ambient shading term. Most renderers will ignore + # this value it, is just a remaining of the fixed-function pipeline + # that is still supported by quite many file formats. + ("mColorAmbient", Color3D), + + # Inner angle of a spot light's light cone. + # The spot light has maximum influence on objects inside this + # angle. The angle is given in radians. It is 2PI for point + # lights and undefined for directional lights. + ("mAngleInnerCone", c_float), + + # Outer angle of a spot light's light cone. + # The spot light does not affect objects outside this angle. + # The angle is given in radians. It is 2PI for point lights and + # undefined for directional lights. The outer angle must be + # greater than or equal to the inner angle. + # It is assumed that the application uses a smooth + # interpolation between the inner and the outer cone of the + # spot light. + ("mAngleOuterCone", c_float), + ] + +class Texture(Structure): + """ + See 'aiTexture.h' for details. + """ + + + _fields_ = [ + # Width of the texture, in pixels + # If mHeight is zero the texture is compressed in a format + # like JPEG. In this case mWidth specifies the size of the + # memory area pcData is pointing to, in bytes. + ("mWidth", c_uint), + + # Height of the texture, in pixels + # If this value is zero, pcData points to an compressed texture + # in any format (e.g. JPEG). + ("mHeight", c_uint), + + # A hint from the loader to make it easier for applications + # to determine the type of embedded compressed textures. + # If mHeight != 0 this member is undefined. Otherwise it + # is set set to '\\0\\0\\0\\0' if the loader has no additional + # information about the texture file format used OR the + # file extension of the format without a trailing dot. If there + # are multiple file extensions for a format, the shortest + # extension is chosen (JPEG maps to 'jpg', not to 'jpeg'). + # E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case. + # The fourth character will always be '\\0'. + ("achFormatHint", c_char*4), + + # Data of the texture. + # Points to an array of mWidth + # mHeight aiTexel's. + # The format of the texture data is always ARGB8888 to + # make the implementation for user of the library as easy + # as possible. If mHeight = 0 this is a pointer to a memory + # buffer of size mWidth containing the compressed texture + # data. Good luck, have fun! + ("pcData", POINTER(Texel)), + ] + +class Ray(Structure): + """ + See 'aiTypes.h' for details. + """ + + _fields_ = [ + # Position and direction of the ray + ("pos", Vector3D),("dir", Vector3D), + ] + +class UVTransform(Structure): + """ + See 'aiMaterial.h' for details. + """ + + _fields_ = [ + # Translation on the u and v axes. + # The default value is (0|0). + ("mTranslation", Vector2D), + + # Scaling on the u and v axes. + # The default value is (1|1). + ("mScaling", Vector2D), + + # Rotation - in counter-clockwise direction. + # The rotation angle is specified in radians. The + # rotation center is 0.5f|0.5f. The default value + # 0.f. + ("mRotation", c_float), + ] + +class MaterialProperty(Structure): + """ + See 'aiMaterial.h' for details. + """ + + _fields_ = [ + # Specifies the name of the property (key) + # Keys are generally case insensitive. + ("mKey", String), + + # Textures: Specifies their exact usage semantic. + # For non-texture properties, this member is always 0 + # (or, better-said, + #aiTextureType_NONE). + ("mSemantic", c_uint), + + # Textures: Specifies the index of the texture. + # For non-texture properties, this member is always 0. + ("mIndex", c_uint), + + # Size of the buffer mData is pointing to, in bytes. + # This value may not be 0. + ("mDataLength", c_uint), + + # Type information for the property. + # Defines the data layout inside the data buffer. This is used + # by the library internally to perform debug checks and to + # utilize proper type conversions. + # (It's probably a hacky solution, but it works.) + ("mType", c_uint), + + # Binary buffer to hold the property's value. + # The size of the buffer is always mDataLength. + ("mData", POINTER(c_char)), + ] + +class Material(Structure): + """ + See 'aiMaterial.h' for details. + """ + + _fields_ = [ + # List of all material properties loaded. + ("mProperties", POINTER(POINTER(MaterialProperty))), + + # Number of properties in the data base + ("mNumProperties", c_uint), + + # Storage allocated + ("mNumAllocated", c_uint), + ] + +class Bone(Structure): + """ + See 'aiMesh.h' for details. + """ + + _fields_ = [ + # The name of the bone. + ("mName", String), + + # The number of vertices affected by this bone + # The maximum value for this member is + #AI_MAX_BONE_WEIGHTS. + ("mNumWeights", c_uint), + + # The vertices affected by this bone + ("mWeights", POINTER(VertexWeight)), + + # Matrix that transforms from mesh space to bone space in bind pose + ("mOffsetMatrix", Matrix4x4), + ] + +class Mesh(Structure): + """ + See 'aiMesh.h' for details. + """ + AI_MAX_FACE_INDICES = 0x7fff AI_MAX_BONE_WEIGHTS = 0x7fffffff AI_MAX_VERTICES = 0x7fffffff AI_MAX_FACES = 0x7fffffff AI_MAX_NUMBER_OF_COLOR_SETS = 0x8 AI_MAX_NUMBER_OF_TEXTURECOORDS = 0x8 - - _fields_ = [ - #Bitwise combination of the members of the #aiPrimitiveType enum.#This specifies which types of primitives are present in the mesh.#The "SortByPrimitiveType"-Step can be used to make sure the#output meshes consist of one primitive type each.# - ("mPrimitiveTypes", c_uint),#The number of vertices in this mesh.#This is also the size of all of the per-vertex data arrays.#The maximum value for this member is #AI_MAX_VERTICES.# - ("mNumVertices", c_uint),#The number of primitives (triangles, polygons, lines) in this mesh.#This is also the size of the mFaces array.#The maximum value for this member is #AI_MAX_FACES.# - ("mNumFaces", c_uint),#Vertex positions.#This array is always present in a mesh. The array is#mNumVertices in size.# - ("mVertices", POINTER(Vector3D)),#Vertex normals.#The array contains normalized vectors, NULL if not present.#The array is mNumVertices in size. Normals are undefined for#point and line primitives. A mesh consisting of points and#lines only may not have normal vectors. Meshes with mixed#primitive types (i.e. lines and triangles) may have normals,#but the normals for vertices that are only referenced by#point or line primitives are undefined and set to QNaN (WARN:#qNaN compares to inequal to *everything*, even to qNaN itself.#Using code like this to check whether a field is qnan is:#@code##define IS_QNAN(f) (f != f)#@endcode#still dangerous because even 1.f == 1.f could evaluate to false! (#remember the subtleties of IEEE754 artithmetics). Use stuff like#@c fpclassify instead.#@note Normal vectors computed by Assimp are always unit-length.#However, this needn't apply for normals that have been taken# directly from the model file.# - ("mNormals", POINTER(Vector3D)),#Vertex tangents.#The tangent of a vertex points in the direction of the positive#X texture axis. The array contains normalized vectors, NULL if#not present. The array is mNumVertices in size. A mesh consisting#of points and lines only may not have normal vectors. Meshes with#mixed primitive types (i.e. lines and triangles) may have#normals, but the normals for vertices that are only referenced by#point or line primitives are undefined and set to qNaN. See#the #mNormals member for a detailled discussion of qNaNs.#@note If the mesh contains tangents, it automatically also#contains bitangents.# - ("mTangents", POINTER(Vector3D)),#Vertex bitangents.#The bitangent of a vertex points in the direction of the positive#Y texture axis. The array contains normalized vectors, NULL if not#present. The array is mNumVertices in size.#@note If the mesh contains tangents, it automatically also contains#bitangents.# - ("mBitangents", POINTER(Vector3D)),#Vertex color sets.#A mesh may contain 0 to #AI_MAX_NUMBER_OF_COLOR_SETS vertex#colors per vertex. NULL if not present. Each array is#mNumVertices in size if present.# - ("mColors", POINTER(Color4D)*AI_MAX_NUMBER_OF_COLOR_SETS),#Vertex texture coords, also known as UV channels.#A mesh may contain 0 to AI_MAX_NUMBER_OF_TEXTURECOORDS per#vertex. NULL if not present. The array is mNumVertices in size.# - ("mTextureCoords", POINTER(Vector3D)*AI_MAX_NUMBER_OF_TEXTURECOORDS),#Specifies the number of components for a given UV channel.#Up to three channels are supported (UVW, for accessing volume#or cube maps). If the value is 2 for a given channel n, the#component p.z of mTextureCoords[n][p] is set to 0.0f.#If the value is 1 for a given channel, p.y is set to 0.0f, too.#@note 4D coords are not supported# - ("mNumUVComponents", c_uint*AI_MAX_NUMBER_OF_TEXTURECOORDS),#The faces the mesh is constructed from.#Each face refers to a number of vertices by their indices.#This array is always present in a mesh, its size is given#in mNumFaces. If the #AI_SCENE_FLAGS_NON_VERBOSE_FORMAT#is NOT set each face references an unique set of vertices.# - ("mFaces", POINTER(Face)),#The number of bones this mesh contains.#Can be 0, in which case the mBones array is NULL.# - ("mNumBones", c_uint),#The bones of this mesh.#A bone consists of a name by which it can be found in the#frame hierarchy and a set of vertex weights.# - ("mBones", POINTER(POINTER(Bone))),#The material used by this mesh.#A mesh does use only a single material. If an imported model uses#multiple materials, the import splits up the mesh. Use this value#as index into the scene's material list.# - ("mMaterialIndex", c_uint),#Name of the mesh. Meshes can be named, but this is not a# requirement and leaving this field empty is totally fine.# There are mainly three uses for mesh names:# - some formats name nodes and meshes independently.# - importers tend to split meshes up to meet the# one-material-per-mesh requirement. Assigning# the same (dummy) name to each of the result meshes# aids the caller at recovering the original mesh# partitioning.# - Vertex animations refer to meshes by their names.# - ("mName", String),#NOT CURRENTLY IN USE. The number of attachment meshes# - ("mNumAnimMeshes", c_uint),#NOT CURRENTLY IN USE. Attachment meshes for this mesh, for vertex-based animation.# Attachment meshes carry replacement data for some of the# mesh'es vertex components (usually positions, normals).# - ] - -class VectorKey(Structure): - """ - See 'aiAnim.h' for details. - """ - - _fields_ = [ - #The time of this key# - ("mTime", c_double),#The value of this key# - ("mValue", Vector3D), - ] - -class QuatKey(Structure): - """ - See 'aiAnim.h' for details. - """ - - _fields_ = [ - #The time of this key# - ("mTime", c_double),#The value of this key# - ("mValue", Quaternion), - ] - -class NodeAnim(Structure): - """ - See 'aiAnim.h' for details. - """ - - _fields_ = [ - #The name of the node affected by this animation. The node# must exist and it must be unique.# - ("mNodeName", String),#The number of position keys# - ("mNumPositionKeys", c_uint),#The position keys of this animation channel. Positions are#specified as 3D vector. The array is mNumPositionKeys in size.##If there are position keys, there will also be at least one#scaling and one rotation key.# - ("mPositionKeys", POINTER(VectorKey)),#The number of rotation keys# - ("mNumRotationKeys", c_uint),#The rotation keys of this animation channel. Rotations are# given as quaternions, which are 4D vectors. The array is# mNumRotationKeys in size.##If there are rotation keys, there will also be at least one#scaling and one position key.# - ("mRotationKeys", POINTER(QuatKey)),#The number of scaling keys# - ("mNumScalingKeys", c_uint),#The scaling keys of this animation channel. Scalings are# specified as 3D vector. The array is mNumScalingKeys in size.##If there are scaling keys, there will also be at least one#position and one rotation key.# - ("mScalingKeys", POINTER(VectorKey)),#Defines how the animation behaves before the first# key is encountered.## The default value is aiAnimBehaviour_DEFAULT (the original# transformation matrix of the affected node is used).# - ("mPreState", c_uint),#Defines how the animation behaves after the last# key was processed.## The default value is aiAnimBehaviour_DEFAULT (the original# transformation matrix of the affected node is taken).# - ("mPostState", c_uint), - ] - -class Animation(Structure): - """ - See 'aiAnim.h' for details. - """ - - _fields_ = [ - #The name of the animation. If the modeling package this data was# exported from does support only a single animation channel, this# name is usually empty (length is zero).# - ("mName", String),#Duration of the animation in ticks.# - ("mDuration", c_double),#Ticks per second. 0 if not specified in the imported file# - ("mTicksPerSecond", c_double),#The number of bone animation channels. Each channel affects# a single node.# - ("mNumChannels", c_uint),#The node animation channels. Each channel affects a single node.# The array is mNumChannels in size.# - ("mChannels", POINTER(POINTER(NodeAnim))),#The number of mesh animation channels. Each channel affects# a single mesh and defines vertex-based animation.# - ("mNumMeshChannels", c_uint),#The mesh animation channels. Each channel affects a single mesh.# The array is mNumMeshChannels in size.# - ] - -class UVTransform(Structure): - """ - See 'aiMaterial.h' for details. - """ - - _fields_ = [ - #Translation on the u and v axes.## The default value is (0|0).# - ("mTranslation", Vector2D),#Scaling on the u and v axes.## The default value is (1|1).# - ("mScaling", Vector2D),#Rotation - in counter-clockwise direction.## The rotation angle is specified in radians. The# rotation center is 0.5f|0.5f. The default value# 0.f.# - ("mRotation", c_float), - ] - -class MaterialProperty(Structure): - """ - See 'aiMaterial.h' for details. - """ - - _fields_ = [ - #Specifies the name of the property (key)# Keys are generally case insensitive.# - ("mKey", String),#Textures: Specifies their exact usage semantic.#For non-texture properties, this member is always 0#(or, better-said, #aiTextureType_NONE).# - ("mSemantic", c_uint),#Textures: Specifies the index of the texture.# For non-texture properties, this member is always 0.# - ("mIndex", c_uint),#Size of the buffer mData is pointing to, in bytes.# This value may not be 0.# - ("mDataLength", c_uint),#Type information for the property.##Defines the data layout inside the data buffer. This is used#by the library internally to perform debug checks and to#utilize proper type conversions.#(It's probably a hacky solution, but it works.)# - ("mType", c_uint),#Binary buffer to hold the property's value.#The size of the buffer is always mDataLength.# - ("mData", POINTER(c_char)), - ] - -class Material(Structure): - """ - See 'aiMaterial.h' for details. - """ - - _fields_ = [ - #List of all material properties loaded.# - ("mProperties", POINTER(POINTER(MaterialProperty))),#Number of properties in the data base# - ("mNumProperties", c_uint),#Storage allocated# - ("mNumAllocated", c_uint), - ] - -class Scene(Structure): - """ - See 'aiScene.h' for details. - """ - + + _fields_ = [ + # Bitwise combination of the members of the + #aiPrimitiveType enum. + # This specifies which types of primitives are present in the mesh. + # The "SortByPrimitiveType"-Step can be used to make sure the + # output meshes consist of one primitive type each. + ("mPrimitiveTypes", c_uint), + + # The number of vertices in this mesh. + # This is also the size of all of the per-vertex data arrays. + # The maximum value for this member is + #AI_MAX_VERTICES. + ("mNumVertices", c_uint), + + # The number of primitives (triangles, polygons, lines) in this mesh. + # This is also the size of the mFaces array. + # The maximum value for this member is + #AI_MAX_FACES. + ("mNumFaces", c_uint), + + # Vertex positions. + # This array is always present in a mesh. The array is + # mNumVertices in size. + ("mVertices", POINTER(Vector3D)), + + # Vertex normals. + # The array contains normalized vectors, NULL if not present. + # The array is mNumVertices in size. Normals are undefined for + # point and line primitives. A mesh consisting of points and + # lines only may not have normal vectors. Meshes with mixed + # primitive types (i.e. lines and triangles) may have normals, + # but the normals for vertices that are only referenced by + # point or line primitives are undefined and set to QNaN (WARN: + # qNaN compares to inequal to *everything*, even to qNaN itself. + # Using code like this to check whether a field is qnan is: + # @code + #define IS_QNAN(f) (f != f) + # @endcode + # still dangerous because even 1.f == 1.f could evaluate to false! ( + # remember the subtleties of IEEE754 artithmetics). Use stuff like + # @c fpclassify instead. + # @note Normal vectors computed by Assimp are always unit-length. + # However, this needn't apply for normals that have been taken + # directly from the model file. + ("mNormals", POINTER(Vector3D)), + + # Vertex tangents. + # The tangent of a vertex points in the direction of the positive + # X texture axis. The array contains normalized vectors, NULL if + # not present. The array is mNumVertices in size. A mesh consisting + # of points and lines only may not have normal vectors. Meshes with + # mixed primitive types (i.e. lines and triangles) may have + # normals, but the normals for vertices that are only referenced by + # point or line primitives are undefined and set to qNaN. See + # the + #mNormals member for a detailled discussion of qNaNs. + # @note If the mesh contains tangents, it automatically also + # contains bitangents (the bitangent is just the cross product of + # tangent and normal vectors). + ("mTangents", POINTER(Vector3D)), + + # Vertex bitangents. + # The bitangent of a vertex points in the direction of the positive + # Y texture axis. The array contains normalized vectors, NULL if not + # present. The array is mNumVertices in size. + # @note If the mesh contains tangents, it automatically also contains + # bitangents. + ("mBitangents", POINTER(Vector3D)), + + # Vertex color sets. + # A mesh may contain 0 to + #AI_MAX_NUMBER_OF_COLOR_SETS vertex + # colors per vertex. NULL if not present. Each array is + # mNumVertices in size if present. + ("mColors", POINTER(Color4D)*AI_MAX_NUMBER_OF_COLOR_SETS), + + # Vertex texture coords, also known as UV channels. + # A mesh may contain 0 to AI_MAX_NUMBER_OF_TEXTURECOORDS per + # vertex. NULL if not present. The array is mNumVertices in size. + ("mTextureCoords", POINTER(Vector3D)*AI_MAX_NUMBER_OF_TEXTURECOORDS), + + # Specifies the number of components for a given UV channel. + # Up to three channels are supported (UVW, for accessing volume + # or cube maps). If the value is 2 for a given channel n, the + # component p.z of mTextureCoords[n][p] is set to 0.0f. + # If the value is 1 for a given channel, p.y is set to 0.0f, too. + # @note 4D coords are not supported + ("mNumUVComponents", c_uint*AI_MAX_NUMBER_OF_TEXTURECOORDS), + + # The faces the mesh is constructed from. + # Each face refers to a number of vertices by their indices. + # This array is always present in a mesh, its size is given + # in mNumFaces. If the + #AI_SCENE_FLAGS_NON_VERBOSE_FORMAT + # is NOT set each face references an unique set of vertices. + ("mFaces", POINTER(Face)), + + # The number of bones this mesh contains. + # Can be 0, in which case the mBones array is NULL. + ("mNumBones", c_uint), + + # The bones of this mesh. + # A bone consists of a name by which it can be found in the + # frame hierarchy and a set of vertex weights. + ("mBones", POINTER(POINTER(Bone))), + + # The material used by this mesh. + # A mesh does use only a single material. If an imported model uses + # multiple materials, the import splits up the mesh. Use this value + # as index into the scene's material list. + ("mMaterialIndex", c_uint), + + # Name of the mesh. Meshes can be named, but this is not a + # requirement and leaving this field empty is totally fine. + # There are mainly three uses for mesh names: + # - some formats name nodes and meshes independently. + # - importers tend to split meshes up to meet the + # one-material-per-mesh requirement. Assigning + # the same (dummy) name to each of the result meshes + # aids the caller at recovering the original mesh + # partitioning. + # - Vertex animations refer to meshes by their names. + ("mName", String), + + # NOT CURRENTLY IN USE. The number of attachment meshes + ("mNumAnimMeshes", c_uint), + + # NOT CURRENTLY IN USE. Attachment meshes for this mesh, for vertex-based animation. + # Attachment meshes carry replacement data for some of the + # mesh'es vertex components (usually positions, normals). + ] + +class Camera(Structure): + """ + See 'aiCamera.h' for details. + """ + + + _fields_ = [ + # The name of the camera. + # There must be a node in the scenegraph with the same name. + # This node specifies the position of the camera in the scene + # hierarchy and can be animated. + ("mName", String), + + # Position of the camera relative to the coordinate space + # defined by the corresponding node. + # The default value is 0|0|0. + ("mPosition", Vector3D), + + # 'Up' - vector of the camera coordinate system relative to + # the coordinate space defined by the corresponding node. + # The 'right' vector of the camera coordinate system is + # the cross product of the up and lookAt vectors. + # The default value is 0|1|0. The vector + # may be normalized, but it needn't. + ("mUp", Vector3D), + + # 'LookAt' - vector of the camera coordinate system relative to + # the coordinate space defined by the corresponding node. + # This is the viewing direction of the user. + # The default value is 0|0|1. The vector + # may be normalized, but it needn't. + ("mLookAt", Vector3D), + + # Half horizontal field of view angle, in radians. + # The field of view angle is the angle between the center + # line of the screen and the left or right border. + # The default value is 1/4PI. + ("mHorizontalFOV", c_float), + + # Distance of the near clipping plane from the camera. + # The value may not be 0.f (for arithmetic reasons to prevent + # a division through zero). The default value is 0.1f. + ("mClipPlaneNear", c_float), + + # Distance of the far clipping plane from the camera. + # The far clipping plane must, of course, be further away than the + # near clipping plane. The default value is 1000.f. The ratio + # between the near and the far plane should not be too + # large (between 1000-10000 should be ok) to avoid floating-point + # inaccuracies which could lead to z-fighting. + ("mClipPlaneFar", c_float), + + # Screen aspect ratio. + # This is the ration between the width and the height of the + # screen. Typical values are 4/3, 1/2 or 1/1. This value is + # 0 if the aspect ratio is not defined in the source file. + # 0 is also the default value. + ("mAspect", c_float), + ] + +class VectorKey(Structure): + """ + See 'aiAnim.h' for details. + """ + + _fields_ = [ + # The time of this key + ("mTime", c_double), + + # The value of this key + ("mValue", Vector3D), + ] + +class QuatKey(Structure): + """ + See 'aiAnim.h' for details. + """ + + _fields_ = [ + # The time of this key + ("mTime", c_double), + + # The value of this key + ("mValue", Quaternion), + ] + +class NodeAnim(Structure): + """ + See 'aiAnim.h' for details. + """ + + _fields_ = [ + # The name of the node affected by this animation. The node + # must exist and it must be unique. + ("mNodeName", String), + + # The number of position keys + ("mNumPositionKeys", c_uint), + + # The position keys of this animation channel. Positions are + # specified as 3D vector. The array is mNumPositionKeys in size. + # If there are position keys, there will also be at least one + # scaling and one rotation key. + ("mPositionKeys", POINTER(VectorKey)), + + # The number of rotation keys + ("mNumRotationKeys", c_uint), + + # The rotation keys of this animation channel. Rotations are + # given as quaternions, which are 4D vectors. The array is + # mNumRotationKeys in size. + # If there are rotation keys, there will also be at least one + # scaling and one position key. + ("mRotationKeys", POINTER(QuatKey)), + + # The number of scaling keys + ("mNumScalingKeys", c_uint), + + # The scaling keys of this animation channel. Scalings are + # specified as 3D vector. The array is mNumScalingKeys in size. + # If there are scaling keys, there will also be at least one + # position and one rotation key. + ("mScalingKeys", POINTER(VectorKey)), + + # Defines how the animation behaves before the first + # key is encountered. + # The default value is aiAnimBehaviour_DEFAULT (the original + # transformation matrix of the affected node is used). + ("mPreState", c_uint), + + # Defines how the animation behaves after the last + # key was processed. + # The default value is aiAnimBehaviour_DEFAULT (the original + # transformation matrix of the affected node is taken). + ("mPostState", c_uint), + ] + +class Animation(Structure): + """ + See 'aiAnim.h' for details. + """ + + _fields_ = [ + # The name of the animation. If the modeling package this data was + # exported from does support only a single animation channel, this + # name is usually empty (length is zero). + ("mName", String), + + # Duration of the animation in ticks. + ("mDuration", c_double), + + # Ticks per second. 0 if not specified in the imported file + ("mTicksPerSecond", c_double), + + # The number of bone animation channels. Each channel affects + # a single node. + ("mNumChannels", c_uint), + + # The node animation channels. Each channel affects a single node. + # The array is mNumChannels in size. + ("mChannels", POINTER(POINTER(NodeAnim))), + + # The number of mesh animation channels. Each channel affects + # a single mesh and defines vertex-based animation. + ("mNumMeshChannels", c_uint), + + # The mesh animation channels. Each channel affects a single mesh. + # The array is mNumMeshChannels in size. + ] + +class Scene(Structure): + """ + See 'aiScene.h' for details. + """ + AI_SCENE_FLAGS_INCOMPLETE = 0x1 AI_SCENE_FLAGS_VALIDATED = 0x2 AI_SCENE_FLAGS_VALIDATION_WARNING = 0x4 AI_SCENE_FLAGS_NON_VERBOSE_FORMAT = 0x8 AI_SCENE_FLAGS_TERRAIN = 0x10 - - _fields_ = [ - #Any combination of the AI_SCENE_FLAGS_XXX flags. By default#this value is 0, no flags are set. Most applications will#want to reject all scenes with the AI_SCENE_FLAGS_INCOMPLETE#bit set.# - ("mFlags", c_uint),#The root node of the hierarchy.##There will always be at least the root node if the import#was successful (and no special flags have been set).#Presence of further nodes depends on the format and content#of the imported file.# - ("mRootNode", POINTER(Node)),#The number of meshes in the scene.# - ("mNumMeshes", c_uint),#The array of meshes.##Use the indices given in the aiNode structure to access#this array. The array is mNumMeshes in size. If the#AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always#be at least ONE material.# - ("mMeshes", POINTER(POINTER(Mesh))),#The number of materials in the scene.# - ("mNumMaterials", c_uint),#The array of materials.##Use the index given in each aiMesh structure to access this#array. The array is mNumMaterials in size. If the#AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always#be at least ONE material.# - ("mMaterials", POINTER(POINTER(Material))),#The number of animations in the scene.# - ("mNumAnimations", c_uint),#The array of animations.##All animations imported from the given file are listed here.#The array is mNumAnimations in size.# - ("mAnimations", POINTER(POINTER(Animation))),#The number of textures embedded into the file# - ("mNumTextures", c_uint),#The array of embedded textures.##Not many file formats embed their textures into the file.#An example is Quake's MDL format (which is also used by#some GameStudio versions)# - ("mTextures", POINTER(POINTER(Texture))),#The number of light sources in the scene. Light sources#are fully optional, in most cases this attribute will be 0# - ("mNumLights", c_uint),#The array of light sources.##All light sources imported from the given file are#listed here. The array is mNumLights in size.# - ("mLights", POINTER(POINTER(Light))),#The number of cameras in the scene. Cameras#are fully optional, in most cases this attribute will be 0# - ("mNumCameras", c_uint),#The array of cameras.##All cameras imported from the given file are listed here.#The array is mNumCameras in size. The first camera in the#array (if existing) is the default camera view into#the scene.# - ("mCameras", POINTER(POINTER(Camera))), - ] + + _fields_ = [ + # Any combination of the AI_SCENE_FLAGS_XXX flags. By default + # this value is 0, no flags are set. Most applications will + # want to reject all scenes with the AI_SCENE_FLAGS_INCOMPLETE + # bit set. + ("mFlags", c_uint), + + # The root node of the hierarchy. + # There will always be at least the root node if the import + # was successful (and no special flags have been set). + # Presence of further nodes depends on the format and content + # of the imported file. + ("mRootNode", POINTER(Node)), + + # The number of meshes in the scene. + ("mNumMeshes", c_uint), + + # The array of meshes. + # Use the indices given in the aiNode structure to access + # this array. The array is mNumMeshes in size. If the + # AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always + # be at least ONE material. + ("mMeshes", POINTER(POINTER(Mesh))), + + # The number of materials in the scene. + ("mNumMaterials", c_uint), + + # The array of materials. + # Use the index given in each aiMesh structure to access this + # array. The array is mNumMaterials in size. If the + # AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always + # be at least ONE material. + ("mMaterials", POINTER(POINTER(Material))), + + # The number of animations in the scene. + ("mNumAnimations", c_uint), + + # The array of animations. + # All animations imported from the given file are listed here. + # The array is mNumAnimations in size. + ("mAnimations", POINTER(POINTER(Animation))), + + # The number of textures embedded into the file + ("mNumTextures", c_uint), + + # The array of embedded textures. + # Not many file formats embed their textures into the file. + # An example is Quake's MDL format (which is also used by + # some GameStudio versions) + ("mTextures", POINTER(POINTER(Texture))), + + # The number of light sources in the scene. Light sources + # are fully optional, in most cases this attribute will be 0 + ("mNumLights", c_uint), + + # The array of light sources. + # All light sources imported from the given file are + # listed here. The array is mNumLights in size. + ("mLights", POINTER(POINTER(Light))), + + # The number of cameras in the scene. Cameras + # are fully optional, in most cases this attribute will be 0 + ("mNumCameras", c_uint), + + # The array of cameras. + # All cameras imported from the given file are listed here. + # The array is mNumCameras in size. The first camera in the + # array (if existing) is the default camera view into + # the scene. + ("mCameras", POINTER(POINTER(Camera))), + ] diff --git a/port/PyAssimp/quicktest.py b/port/PyAssimp/quicktest.py deleted file mode 100755 index e01a49fa5..000000000 --- a/port/PyAssimp/quicktest.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -#-*- coding: UTF-8 -*- - -""" -This module uses the sample.py script to load all test models it finds. - -Note: this is not an exhaustive test suite, it does not check the -data structures in detail. It just verifies whether basic -loading and querying of 3d models using pyassimp works. -""" - - -import sys,os -import sample -from pyassimp import pyassimp,errors - -# paths to be walkd recursively -basepaths = [os.path.join('..','..','test','models'), os.path.join('..','..','test','models-nonbsd')] - -# file extensions to be considered -extensions = ['.3ds','.x','.lwo','.obj','.md5mesh','.dxf','.ply','.stl','.dae','.md5anim','.lws','.irrmesh','.nff','.off','.blend'] - -def run_tests(): - ok,err = 0,0 - for path in basepaths: - for root, dirs, files in os.walk(path): - for afile in files: - base,ext = os.path.splitext(afile) - if ext in extensions: - try: - sample.main(os.path.join(root,afile)) - ok += 1 - except errors.AssimpError as error: - # assimp error is fine, this is a controlled case - print error - err += 1 - print '** Loaded %s models, got controlled errors for %s files' % (ok,err) - - -if __name__ == '__main__': - run_tests() - - - - diff --git a/port/PyAssimp/sample.py b/port/PyAssimp/sample.py old mode 100644 new mode 100755 index 626b142f0..3788bd065 --- a/port/PyAssimp/sample.py +++ b/port/PyAssimp/sample.py @@ -6,7 +6,7 @@ This module demonstrates the functionality of PyAssimp. """ -from pyassimp import pyassimp +import pyassimp import os, sys #get a model out of assimp's test-data if none is provided on the command line @@ -14,6 +14,12 @@ DEFAULT_MODEL = os.path.join(os.path.dirname(__file__), "..", "..", "test", "models", "MDL", "MDL3 (3DGS A4)", "minigun.MDL") +def recur_node(node,level = 0): + print(" " + "\t" * level + "- " + str(node)) + for child in node.children: + recur_node(child, level + 1) + + def main(filename=None): filename = filename or DEFAULT_MODEL scene = pyassimp.load(filename) @@ -29,40 +35,48 @@ def main(filename=None): print " textures:", len(scene.textures) print + print "NODES:" + recur_node(scene.rootnode) + + print print "MESHES:" for index, mesh in enumerate(scene.meshes): print " MESH", index+1 - print " material:", mesh.mMaterialIndex+1 + print " material id:", mesh.materialindex+1 print " vertices:", len(mesh.vertices) print " first 3 verts:", mesh.vertices[:3] - #if len(mesh.normals): - # print " first 3 normals:", mesh.normals[:3] + if mesh.normals: + print " first 3 normals:", mesh.normals[:3] + else: + print " no normals" print " colors:", len(mesh.colors) - tc = mesh.texcoords - print " texture-coords 1:", len(tc[0]), "first3:", tc[0][:3] - print " texture-coords 2:", len(tc[1]), "first3:", tc[1][:3] - print " texture-coords 3:", len(tc[2]), "first3:", tc[2][:3] - print " texture-coords 4:", len(tc[3]), "first3:", tc[3][:3] - print " uv-component-count:", len(mesh.mNumUVComponents) + tc = mesh.texturecoords + if tc: + print " texture-coords 1:", len(tc[0]), "first3:", tc[0][:3] + print " texture-coords 2:", len(tc[1]), "first3:", tc[1][:3] + print " texture-coords 3:", len(tc[2]), "first3:", tc[2][:3] + print " texture-coords 4:", len(tc[3]), "first3:", tc[3][:3] + else: + print " no texture coordinates" + print " uv-component-count:", len(mesh.numuvcomponents) print " faces:", len(mesh.faces), "first:", [f.indices for f in mesh.faces[:3]] - print " bones:", len(mesh.bones), "first:", [b.mName for b in mesh.bones[:3]] + print " bones:", len(mesh.bones), "first:", [str(b) for b in mesh.bones[:3]] print print "MATERIALS:" for index, material in enumerate(scene.materials): - print " MATERIAL", index+1 - properties = pyassimp.GetMaterialProperties(material) - for key in properties: - print " %s: %s" % (key, properties[key]) + print(" MATERIAL (id:" + str(index+1) + ")") + for key, value in material.properties.items(): + print " %s: %s" % (key, value) print print "TEXTURES:" for index, texture in enumerate(scene.textures): print " TEXTURE", index+1 - print " width:", texture.mWidth - print " height:", texture.mHeight - print " hint:", texture.achFormatHint - print " data (size):", texture.mWidth*texture.mHeight + print " width:", texture.width + print " height:", texture.height + print " hint:", texture.achformathint + print " data (size):", len(texture.data) # Finally release the model pyassimp.release(scene) diff --git a/port/PyAssimp3/README b/port/PyAssimp3/README deleted file mode 100644 index bba16e4bb..000000000 --- a/port/PyAssimp3/README +++ /dev/null @@ -1,65 +0,0 @@ - PyAssimp3 Readme - --------------- - - --- a simple Python3 wrapper for Assimp using ctypes to access -the library. Works with Python 3 upwards. - - -Note that pyassimp is by no means considered mature. It works, -but it is far away from wrapping Assimp perfectly. - - -USAGE -===== - -To get started with pyAssimp, examine the sample.py script, which -illustrates the basic usage. All Assimp data structures are -wrapped using ctypes. All the data+length fields in Assimp's -data structures (such as 'aiMesh::mNumVertices','aiMesh::mVertices') -are replaced by simple python lists, so you can call len() on -them to get their respective size and access members using -[]. - -For example, to load a file named 'hello.3ds' and print the first -vertex of the first mesh, you would do (proper error handling -substituted by assertions ...): - -> from pyassimp import pyassimp, errors -> -> try: -> scene = pyassimp.load('hello.3ds') -> except AssimpError, msg: -> print(msg) -> return - -> assert len(scene.meshes) -> mesh = scene.meshes[0] - -> assert len(mesh.vertices) -> print(mesh.vertices[0]) - -> # don't forget this one, or you will leak! -> pyassimp.release(scene) - - -INSTALL -======= - -PyAssimp requires a assimp dynamic library (DLL on windows, -so on linux :-) in order to work. The default search directories -are: - -- the current directory -- on linux additionally: /usr/local/lib - -To build that library, refer to the Assimp master INSTALL -instructions. To look in more places, edit ./pyassimp/helper.py. -There's an 'additional_dirs' list waiting for your entries. - - - - - - - diff --git a/port/PyAssimp3/pyassimp/__init__.py b/port/PyAssimp3/pyassimp/__init__.py deleted file mode 100644 index 229d2296c..000000000 --- a/port/PyAssimp3/pyassimp/__init__.py +++ /dev/null @@ -1 +0,0 @@ -#-*- coding: UTF-8 -*- diff --git a/port/PyAssimp3/pyassimp/errors.py b/port/PyAssimp3/pyassimp/errors.py deleted file mode 100644 index 37db3c08a..000000000 --- a/port/PyAssimp3/pyassimp/errors.py +++ /dev/null @@ -1,11 +0,0 @@ -#-*- coding: UTF-8 -*- - -""" -All possible errors. -""" - -class AssimpError(BaseException): - """ - If an internal error occures. - """ - pass \ No newline at end of file diff --git a/port/PyAssimp3/pyassimp/helper.py b/port/PyAssimp3/pyassimp/helper.py deleted file mode 100644 index 540aa210f..000000000 --- a/port/PyAssimp3/pyassimp/helper.py +++ /dev/null @@ -1,119 +0,0 @@ -#-*- coding: UTF-8 -*- - -""" -Some fancy helper functions. -""" - -import os, sys -import ctypes -from . import structs -import operator - -from .errors import AssimpError -from ctypes import POINTER - -additional_dirs, ext_whitelist = [],[] - -# populate search directories and lists of allowed file extensions -# depending on the platform we're running on. -if os.name=='posix': - additional_dirs.append('/usr/local/lib/') - - if sys.platform.lower() == 'darwin': - ext_whitelist.append('.dylib') - - # note - this won't catch libassimp.so.N.n, but - # currently there's always a symlink called - # libassimp.so in /usr/local/lib. - ext_whitelist.append('.so') - -elif os.name=='nt': - ext_whitelist.append('.dll') - -def vec2tuple(x): - """ Converts a VECTOR3D to a Tuple """ - return (x.x, x.y, x.z) - - -def try_load_functions(library,dll,candidates): - """try to functbind to aiImportFile and aiReleaseImport - - library - path to current lib - dll - ctypes handle to it - candidates - receives matching candidates - - They serve as signal functions to detect assimp, - also they're currently the only functions we need. - insert (library,aiImportFile,aiReleaseImport,dll) - into 'candidates' if successful. - - """ - try: - load = dll.aiImportFile - release = dll.aiReleaseImport - except AttributeError: - #OK, this is a library, but it has not the functions we need - pass - else: - #Library found! - load.restype = POINTER(structs.Scene) - candidates.append((library, load, release, dll)) - - -def search_library(): - """Loads the assimp-Library. - - result (load-function, release-function) - exception AssimpError if no library is found - - """ - #this path - folder = os.path.dirname(__file__) - - # silence 'DLL not found' message boxes on win - try: - ctypes.windll.kernel32.SetErrorMode(0x8007) - except AttributeError: - pass - - candidates = [] - - # test every file - for curfolder in [folder]+additional_dirs: - for filename in os.listdir(curfolder): - # our minimum requirement for candidates is that - # they should contain 'assimp' somewhere in - # their name - if filename.lower().find('assimp')==-1 or\ - os.path.splitext(filename)[-1].lower() not in ext_whitelist: - continue - - library = os.path.join(curfolder, filename) - print('PyAssimp3: trying ',library) - try: - dll = ctypes.cdll.LoadLibrary(library) - except: - # OK, this except is evil. But different OSs will throw different - # errors. So just ignore any errors. - continue - - try_load_functions(library,dll,candidates) - - if not candidates: - # no library found - raise AssimpError("assimp library not found") - else: - # get the newest library - candidates = [(os.lstat(x[0])[-2], x) for x in candidates] - res = max(candidates, key=operator.itemgetter(0))[1] - print('PyAssimp3: taking ',res[0]) - - # XXX: if there are 1000 dll/so files containing 'assimp' - # in their name, do we have all of them in our address - # space now until gc kicks in? - - # XXX: take version postfix of the .so on linux? - return res[1:] - - - diff --git a/port/PyAssimp3/pyassimp/pyassimp.py b/port/PyAssimp3/pyassimp/pyassimp.py deleted file mode 100644 index 3c253764a..000000000 --- a/port/PyAssimp3/pyassimp/pyassimp.py +++ /dev/null @@ -1,314 +0,0 @@ -#-*- coding: UTF-8 -*- - -""" -PyAssimp - -This is the main-module of PyAssimp. -""" - -import sys -if sys.version_info < (3,0): - raise Exception('pyassimp: need python 3.0 or newer') - -from . import structs -import ctypes -import os -from . import helper -from .errors import AssimpError - -class aiArray: - """ - A python class to 'safely' access C arrays. - For m and mNum assimp class members. - """ - def __init__(self, instance, dataName, sizeName, i=None): - self.instance = instance - self.dataName = dataName - self.sizeName = sizeName - self.i = i - self.count = 0 - - def _GetSize(self): - return getattr(self.instance, self.sizeName) - - def _GetData(self, index): - if self.i != None: - if not bool(getattr(self.instance, self.dataName)[self.i]): - return None - item = getattr(self.instance, self.dataName)[self.i][index] - else: - item = getattr(self.instance, self.dataName)[index] - if hasattr(item, 'contents'): - return item.contents._init() - elif hasattr(item, '_init'): - return item._init() - else: - return item - - def __next__(self): - if self.count >= self._GetSize(): - self.count = 0 - raise StopIteration - else: - c = self.count - self.count += 1 - return self._GetData(c) - - def __getitem__(self, index): - if isinstance(index, slice): - indices = index.indices(len(self)) - return [self.__getitem__(i) for i in range(*indices)] - - if index < 0 or index >= self._GetSize(): - raise IndexError("aiArray index out of range") - return self._GetData(index) - - def __iter__(self): - return self - - def __len__(self): - return int(self._GetSize()) - - def __str__(self): - return str([x for x in self]) - - def __repr__(self): - return str([x for x in self]) - -class aiTuple: - """ - A python class to 'safely' access C structs in a python tuple fashion. - For C structs like vectors, matrices, colors, ... - """ - def __init__(self, instance): - self.instance = instance - self.count = 0 - - def _GetSize(self): - return len(self.instance._fields_) - - def _GetData(self, index): - return getattr(self.instance, self.instance._fields_[index][0]) - - def __next__(self): - if self.count >= self._GetSize(): - self.count = 0 - raise StopIteration - else: - c = self.count - self.count += 1 - return self._GetData(c) - - def __getitem__(self, index): - if isinstance(index, slice): - indices = index.indices(len(self)) - return [self.__getitem__(i) for i in range(*indices)] - - if index < 0 or index >= self._GetSize(): - raise IndexError("aiTuple index out of range") - return self._GetData(index) - - def __iter__(self): - return self - - def __len__(self): - return int(self._GetSize()) - - def __str__(self): - return str([x for x in self]) - - def __repr__(self): - return str([x for x in self]) - -class StringUInt32(ctypes.Structure): - """ - A ctypes structure used for material strings. - This is a workaround for a type mismatch for the length field between strings used for materials and elsewhere. - """ - - MAXLEN = 1024 - - _fields_ = [ - ("length", ctypes.c_uint32), - ("data", ctypes.c_char*MAXLEN), - ] - -def _init(self): - """ - Custom initialize() for C structs, adds safely accessable member functionality. - """ - if hasattr(self, '_is_init'): - return self - self._is_init = True - - if str(self.__class__.__name__) == "MaterialProperty": - self.mKey._init() - - for m in list(self.__class__.__dict__.keys()): - if m.startswith('mNum'): - name = m.split('mNum')[1] - if 'm'+name in list(self.__class__.__dict__.keys()): - setattr(self.__class__, name.lower(), aiArray(self, 'm'+name , m)) - if name.lower() == "vertices": - setattr(self.__class__, "normals", aiArray(self, 'mNormals' , m)) - setattr(self.__class__, "tangents", aiArray(self, 'mTangents' , m)) - setattr(self.__class__, "bitangets", aiArray(self, 'mBitangents' , m)) - setattr(self.__class__, "colors", [aiArray(self, 'mColors' , m, o) for o in range(len(self.mColors))]) - setattr(self.__class__, "texcoords", [aiArray(self, 'mTextureCoords' , m, o) for o in range(len(self.mColors))]) - - elif m == "x" or m == "a1" or m == "b": # Vector, matrix, quat, color - self._tuple = aiTuple(self) - setattr(self.__class__, '__getitem__', lambda x, y: x._tuple.__getitem__(y)) - setattr(self.__class__, '__iter__', lambda x: x._tuple) - setattr(self.__class__, 'next', lambda x: x._tuple.__next__) - setattr(self.__class__, '__repr__', lambda x: str([c for c in x])) - break - elif m == "data": #String - setattr(self.__class__, '__repr__', lambda x: str(x.data)) - setattr(self.__class__, '__str__', lambda x: str(x.data)) - break - - if hasattr(getattr(self, m), '_init'): - getattr(self, m)._init() - - return self - -""" -Python magic to add the _init() function to all C struct classes. -""" -for struct in dir(structs): - if not (struct.startswith('_') or struct.startswith('c_') or struct == "Structure" or struct == "POINTER") and not isinstance(getattr(structs, struct),int): - setattr(getattr(structs, struct), '_init', _init) - - -class AssimpLib(object): - """ - Assimp-Singleton - """ - load, release, dll = helper.search_library() - -#the loader as singleton -_assimp_lib = AssimpLib() - - -def load(filename, processing=0): - """ - Loads the model with some specific processing parameters. - - filename - file to load model from - processing - processing parameters - - result Scene-object with model-data - - throws AssimpError - could not open file - """ - #read pure data - from ctypes import c_char_p, c_uint - model = _assimp_lib.load(c_char_p(filename), c_uint(processing)) - if not model: - #Uhhh, something went wrong! - raise AssimpError("could not import file: %s" % filename) - - return model.contents._init() - -def release(scene): - from ctypes import pointer - _assimp_lib.release(pointer(scene)) - -def aiGetMaterialFloatArray(material, key): - AI_SUCCESS = 0 - from ctypes import byref, pointer, cast, c_float, POINTER, sizeof, c_uint - out = structs.Color4D() - max = c_uint(sizeof(structs.Color4D)) - r=_assimp_lib.dll.aiGetMaterialFloatArray(pointer(material), - key[0], - key[1], - key[2], - byref(out), - byref(max)) - - if (r != AI_SUCCESS): - raise AssimpError("aiGetMaterialFloatArray failed!") - - out._init() - return [out[i] for i in range(max.value)] - -def aiGetMaterialString(material, key): - AI_SUCCESS = 0 - from ctypes import byref, pointer, cast, c_float, POINTER, sizeof, c_uint - out = structs.String() - r=_assimp_lib.dll.aiGetMaterialString(pointer(material), - key[0], - key[1], - key[2], - byref(out)) - - if (r != AI_SUCCESS): - raise AssimpError("aiGetMaterialString failed!") - - return str(out.data) - -def GetMaterialProperties(material): - """ - Convenience Function to get the material properties. - This function returns the following tuple: (name, clr, mat, tex) where: - name: is the name of the material - clr: is a dictionary of color parameters - mat: is a dictionary of material parameters - tex: is a triply nested dictionary than can be indexed by index, semantic, and then key: - tex[index][semantic][key] - """ - name = "" - clr = {} - mat = {} - tex = {} - #read all properties - for p in material.properties: - #the name - key = p.mKey.data - - #the data - from ctypes import POINTER, cast, c_int, c_float, sizeof - if p.mType == 1: - arr = cast(p.mData, POINTER(c_float*(p.mDataLength//sizeof(c_float)) )).contents - value = [x for x in arr] - elif p.mType == 3: #string can't be an array - try: - value = cast(p.mData, POINTER(StringUInt32)).contents.data - except UnicodeDecodeError: - print('UnicodeDecodeError reading material property, ignoring.') - continue - elif p.mType == 4: - arr = cast(p.mData, POINTER(c_int*(p.mDataLength//sizeof(c_int)) )).contents - value = [x for x in arr] - else: - value = p.mData[:p.mDataLength] - - #store in the appropriate dict - if key == b'?mat.name': - name = value - elif key[:5] == b'$mat.': - mat[key[5:]] = value - elif key[:5] == b'$clr.': - clr[key[5:]] = value - elif key[:5] == b'$tex.': - if p.mIndex not in tex: - tex[p.mIndex] = {} - if p.mSemantic not in tex[p.mIndex]: - tex[p.mIndex][p.mSemantic] = {} - tex[p.mIndex][p.mSemantic][key[5:]] = value - - return (name, clr, mat, tex) - - -def aiDecomposeMatrix(matrix): - if not isinstance(matrix, structs.Matrix4x4): - raise AssimpError("aiDecomposeMatrix failed: Not a aiMatrix4x4!") - - scaling = structs.Vector3D() - rotation = structs.Quaternion() - position = structs.Vector3D() - - from ctypes import byref, pointer - _assimp_lib.dll.aiDecomposeMatrix(pointer(matrix), byref(scaling), byref(rotation), byref(position)) - return scaling._init(), rotation._init(), position._init() diff --git a/port/PyAssimp3/pyassimp/structs.py b/port/PyAssimp3/pyassimp/structs.py deleted file mode 100644 index 54c02a2b8..000000000 --- a/port/PyAssimp3/pyassimp/structs.py +++ /dev/null @@ -1,424 +0,0 @@ -#-*- coding: UTF-8 -*- - -from ctypes import POINTER, c_int, c_uint, c_char, c_float, Structure, c_char_p, c_double, c_ubyte, c_size_t - - -class Vector2D(Structure): - """ - See 'aiVector2D.h' for details. - """ - - - _fields_ = [ - ("x", c_float),("y", c_float), - ] - -class Texel(Structure): - """ - See 'aiTexture.h' for details. - """ - - _fields_ = [ - ("b", c_ubyte),("g", c_ubyte),("r", c_ubyte),("a", c_ubyte), - ] - -class Plane(Structure): - """ - See 'aiTypes.h' for details. - """ - - _fields_ = [ - # Plane equation - ("a", c_float),("b", c_float),("c", c_float),("d", c_float), - ] - -class Color3D(Structure): - """ - See 'aiTypes.h' for details. - """ - - _fields_ = [ - # Red, green and blue color values - ("r", c_float),("g", c_float),("b", c_float), - ] - -class String(Structure): - """ - See 'aiTypes.h' for details. - """ - - MAXLEN = 1024 - - _fields_ = [ - #Binary length of the string excluding the terminal 0. This is NOT the# logical length of strings containing UTF-8 multibyte sequences! It's# the number of bytes from the beginning of the string to its end.# - ("length", c_size_t),#String buffer. Size limit is MAXLEN# - ("data", c_char*MAXLEN), - ] - -class MemoryInfo(Structure): - """ - See 'aiTypes.h' for details. - """ - - _fields_ = [ - #Storage allocated for texture data# - ("textures", c_uint),#Storage allocated for material data# - ("materials", c_uint),#Storage allocated for mesh data# - ("meshes", c_uint),#Storage allocated for node data# - ("nodes", c_uint),#Storage allocated for animation data# - ("animations", c_uint),#Storage allocated for camera data# - ("cameras", c_uint),#Storage allocated for light data# - ("lights", c_uint),#Total storage allocated for the full import.# - ("total", c_uint), - ] - -class Matrix3x3(Structure): - """ - See 'aiMatrix3x3.h' for details. - """ - - - _fields_ = [ - ("a1", c_float),("a2", c_float),("a3", c_float), - ("b1", c_float),("b2", c_float),("b3", c_float), - ("c1", c_float),("c2", c_float),("c3", c_float), - ] - -class Color4D(Structure): - """ - See 'aiColor4D.h' for details. - """ - - - _fields_ = [ - # Red, green, blue and alpha color values - ("r", c_float),("g", c_float),("b", c_float),("a", c_float), - ] - -class ExportFormatDesc(Structure): - """ - See 'export.h' for details. - """ - - _fields_ = [ - # a short string ID to uniquely identify the export format. Use this ID string to# specify which file format you want to export to when calling aiExportScene().# Example: "dae" or "obj" - ("id", POINTER(c_char)),# A short description of the file format to present to users. Useful if you want# to allow the user to select an export format. - ("description", POINTER(c_char)),# Recommended file extension for the exported file in lower case. - ("fileExtension", POINTER(c_char)), - ] - -class Quaternion(Structure): - """ - See 'aiQuaternion.h' for details. - """ - - - _fields_ = [ - # w,x,y,z components of the quaternion - ("w", c_float),("x", c_float),("y", c_float),("z", c_float), - ] - -class Vector3D(Structure): - """ - See 'aiVector3D.h' for details. - """ - - - _fields_ = [ - ("x", c_float),("y", c_float),("z", c_float), - ] - -class Face(Structure): - """ - See 'aiMesh.h' for details. - """ - - _fields_ = [ - # Number of indices defining this face.# The maximum value for this member is #AI_MAX_FACE_INDICES. - ("mNumIndices", c_uint),# Pointer to the indices array. Size of the array is given in numIndices. - ("mIndices", POINTER(c_uint)), - ] - -class VertexWeight(Structure): - """ - See 'aiMesh.h' for details. - """ - - _fields_ = [ - # Index of the vertex which is influenced by the bone. - ("mVertexId", c_uint),# The strength of the influence in the range (0...1).# The influence from all bones at one vertex amounts to 1. - ("mWeight", c_float), - ] - -class MeshKey(Structure): - """ - See 'aiAnim.h' for details. - """ - - _fields_ = [ - #The time of this key# - ("mTime", c_double),#Index into the aiMesh::mAnimMeshes array of the# mesh coresponding to the #aiMeshAnim hosting this# key frame. The referenced anim mesh is evaluated# according to the rules defined in the docs for #aiAnimMesh.# - ("mValue", c_uint), - ] - -class Matrix4x4(Structure): - """ - See 'aiMatrix4x4.h' for details. - """ - - - _fields_ = [ - ("a1", c_float),("a2", c_float),("a3", c_float),("a4", c_float), - ("b1", c_float),("b2", c_float),("b3", c_float),("b4", c_float), - ("c1", c_float),("c2", c_float),("c3", c_float),("c4", c_float), - ("d1", c_float),("d2", c_float),("d3", c_float),("d4", c_float), - ] - -class Node(Structure): - """ - See 'aiScene.h' for details. - """ - - -Node._fields_ = [ - #The name of the node.##The name might be empty (length of zero) but all nodes which#need to be accessed afterwards by bones or anims are usually named.#Multiple nodes may have the same name, but nodes which are accessed#by bones (see #aiBone and #aiMesh::mBones) *must* be unique.##Cameras and lights are assigned to a specific node name - if there#are multiple nodes with this name, they're assigned to each of them.#
#There are no limitations regarding the characters contained in#this text. You should be able to handle stuff like whitespace, tabs,#linefeeds, quotation marks, ampersands, ... .# - ("mName", String),#The transformation relative to the node's parent.# - ("mTransformation", Matrix4x4),#Parent node. NULL if this node is the root node.# - ("mParent", POINTER(Node)),#The number of child nodes of this node.# - ("mNumChildren", c_uint),#The child nodes of this node. NULL if mNumChildren is 0.# - ("mChildren", POINTER(POINTER(Node))),#The number of meshes of this node.# - ("mNumMeshes", c_uint),#The meshes of this node. Each entry is an index into the mesh# - ("mMeshes", POINTER(c_uint)), - ] - -class Camera(Structure): - """ - See 'aiCamera.h' for details. - """ - - - _fields_ = [ - #The name of the camera.## There must be a node in the scenegraph with the same name.# This node specifies the position of the camera in the scene# hierarchy and can be animated.# - ("mName", String),#Position of the camera relative to the coordinate space# defined by the corresponding node.## The default value is 0|0|0.# - ("mPosition", Vector3D),#'Up' - vector of the camera coordinate system relative to# the coordinate space defined by the corresponding node.## The 'right' vector of the camera coordinate system is# the cross product of the up and lookAt vectors.# The default value is 0|1|0. The vector# may be normalized, but it needn't.# - ("mUp", Vector3D),#'LookAt' - vector of the camera coordinate system relative to# the coordinate space defined by the corresponding node.## This is the viewing direction of the user.# The default value is 0|0|1. The vector# may be normalized, but it needn't.# - ("mLookAt", Vector3D),#Half horizontal field of view angle, in radians.## The field of view angle is the angle between the center# line of the screen and the left or right border.# The default value is 1/4PI.# - ("mHorizontalFOV", c_float),#Distance of the near clipping plane from the camera.##The value may not be 0.f (for arithmetic reasons to prevent#a division through zero). The default value is 0.1f.# - ("mClipPlaneNear", c_float),#Distance of the far clipping plane from the camera.##The far clipping plane must, of course, be further away than the#near clipping plane. The default value is 1000.f. The ratio#between the near and the far plane should not be too#large (between 1000-10000 should be ok) to avoid floating-point#inaccuracies which could lead to z-fighting.# - ("mClipPlaneFar", c_float),#Screen aspect ratio.##This is the ration between the width and the height of the#screen. Typical values are 4/3, 1/2 or 1/1. This value is#0 if the aspect ratio is not defined in the source file.#0 is also the default value.# - ("mAspect", c_float), - ] - -class Texture(Structure): - """ - See 'aiTexture.h' for details. - """ - - - _fields_ = [ - #Width of the texture, in pixels##If mHeight is zero the texture is compressed in a format#like JPEG. In this case mWidth specifies the size of the#memory area pcData is pointing to, in bytes.# - ("mWidth", c_uint),#Height of the texture, in pixels##If this value is zero, pcData points to an compressed texture#in any format (e.g. JPEG).# - ("mHeight", c_uint),#A hint from the loader to make it easier for applications# to determine the type of embedded compressed textures.##If mHeight != 0 this member is undefined. Otherwise it#is set set to '\\0\\0\\0\\0' if the loader has no additional#information about the texture file format used OR the#file extension of the format without a trailing dot. If there#are multiple file extensions for a format, the shortest#extension is chosen (JPEG maps to 'jpg', not to 'jpeg').#E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case.#The fourth character will always be '\\0'.# - ("achFormatHint", c_char*4),#Data of the texture.##Points to an array of mWidth#mHeight aiTexel's.#The format of the texture data is always ARGB8888 to#make the implementation for user of the library as easy#as possible. If mHeight = 0 this is a pointer to a memory#buffer of size mWidth containing the compressed texture#data. Good luck, have fun!# - ("pcData", POINTER(Texel)), - ] - -class Ray(Structure): - """ - See 'aiTypes.h' for details. - """ - - _fields_ = [ - # Position and direction of the ray - ("pos", Vector3D),("dir", Vector3D), - ] - -class Light(Structure): - """ - See 'aiLight.h' for details. - """ - - - _fields_ = [ - #The name of the light source.## There must be a node in the scenegraph with the same name.# This node specifies the position of the light in the scene# hierarchy and can be animated.# - ("mName", String),#The type of the light source.##aiLightSource_UNDEFINED is not a valid value for this member.# - ("mType", c_uint),#Position of the light source in space. Relative to the# transformation of the node corresponding to the light.## The position is undefined for directional lights.# - ("mPosition", Vector3D),#Direction of the light source in space. Relative to the# transformation of the node corresponding to the light.## The direction is undefined for point lights. The vector# may be normalized, but it needn't.# - ("mDirection", Vector3D),#Constant light attenuation factor.## The intensity of the light source at a given distance 'd' from# the light's position is# @code# Atten = 1/( att0 + att1#d + att2#d*d)# @endcode# This member corresponds to the att0 variable in the equation.# Naturally undefined for directional lights.# - ("mAttenuationConstant", c_float),#Linear light attenuation factor.## The intensity of the light source at a given distance 'd' from# the light's position is# @code# Atten = 1/( att0 + att1#d + att2#d*d)# @endcode# This member corresponds to the att1 variable in the equation.# Naturally undefined for directional lights.# - ("mAttenuationLinear", c_float),#Quadratic light attenuation factor.## The intensity of the light source at a given distance 'd' from# the light's position is# @code# Atten = 1/( att0 + att1#d + att2#d*d)# @endcode# This member corresponds to the att2 variable in the equation.# Naturally undefined for directional lights.# - ("mAttenuationQuadratic", c_float),#Diffuse color of the light source## The diffuse light color is multiplied with the diffuse# material color to obtain the final color that contributes# to the diffuse shading term.# - ("mColorDiffuse", Color3D),#Specular color of the light source## The specular light color is multiplied with the specular# material color to obtain the final color that contributes# to the specular shading term.# - ("mColorSpecular", Color3D),#Ambient color of the light source## The ambient light color is multiplied with the ambient# material color to obtain the final color that contributes# to the ambient shading term. Most renderers will ignore# this value it, is just a remaining of the fixed-function pipeline# that is still supported by quite many file formats.# - ("mColorAmbient", Color3D),#Inner angle of a spot light's light cone.## The spot light has maximum influence on objects inside this# angle. The angle is given in radians. It is 2PI for point# lights and undefined for directional lights.# - ("mAngleInnerCone", c_float),#Outer angle of a spot light's light cone.## The spot light does not affect objects outside this angle.# The angle is given in radians. It is 2PI for point lights and# undefined for directional lights. The outer angle must be# greater than or equal to the inner angle.# It is assumed that the application uses a smooth# interpolation between the inner and the outer cone of the# spot light.# - ("mAngleOuterCone", c_float), - ] - -class Bone(Structure): - """ - See 'aiMesh.h' for details. - """ - - _fields_ = [ - # The name of the bone. - ("mName", String),# The number of vertices affected by this bone# The maximum value for this member is #AI_MAX_BONE_WEIGHTS. - ("mNumWeights", c_uint),# The vertices affected by this bone - ("mWeights", POINTER(VertexWeight)),# Matrix that transforms from mesh space to bone space in bind pose - ("mOffsetMatrix", Matrix4x4), - ] - -class Mesh(Structure): - """ - See 'aiMesh.h' for details. - """ - - AI_MAX_FACE_INDICES = 0x7fff - AI_MAX_BONE_WEIGHTS = 0x7fffffff - AI_MAX_VERTICES = 0x7fffffff - AI_MAX_FACES = 0x7fffffff - AI_MAX_NUMBER_OF_COLOR_SETS = 0x8 - AI_MAX_NUMBER_OF_TEXTURECOORDS = 0x8 - - _fields_ = [ - #Bitwise combination of the members of the #aiPrimitiveType enum.#This specifies which types of primitives are present in the mesh.#The "SortByPrimitiveType"-Step can be used to make sure the#output meshes consist of one primitive type each.# - ("mPrimitiveTypes", c_uint),#The number of vertices in this mesh.#This is also the size of all of the per-vertex data arrays.#The maximum value for this member is #AI_MAX_VERTICES.# - ("mNumVertices", c_uint),#The number of primitives (triangles, polygons, lines) in this mesh.#This is also the size of the mFaces array.#The maximum value for this member is #AI_MAX_FACES.# - ("mNumFaces", c_uint),#Vertex positions.#This array is always present in a mesh. The array is#mNumVertices in size.# - ("mVertices", POINTER(Vector3D)),#Vertex normals.#The array contains normalized vectors, NULL if not present.#The array is mNumVertices in size. Normals are undefined for#point and line primitives. A mesh consisting of points and#lines only may not have normal vectors. Meshes with mixed#primitive types (i.e. lines and triangles) may have normals,#but the normals for vertices that are only referenced by#point or line primitives are undefined and set to QNaN (WARN:#qNaN compares to inequal to *everything*, even to qNaN itself.#Using code like this to check whether a field is qnan is:#@code##define IS_QNAN(f) (f != f)#@endcode#still dangerous because even 1.f == 1.f could evaluate to false! (#remember the subtleties of IEEE754 artithmetics). Use stuff like#@c fpclassify instead.#@note Normal vectors computed by Assimp are always unit-length.#However, this needn't apply for normals that have been taken# directly from the model file.# - ("mNormals", POINTER(Vector3D)),#Vertex tangents.#The tangent of a vertex points in the direction of the positive#X texture axis. The array contains normalized vectors, NULL if#not present. The array is mNumVertices in size. A mesh consisting#of points and lines only may not have normal vectors. Meshes with#mixed primitive types (i.e. lines and triangles) may have#normals, but the normals for vertices that are only referenced by#point or line primitives are undefined and set to qNaN. See#the #mNormals member for a detailled discussion of qNaNs.#@note If the mesh contains tangents, it automatically also#contains bitangents.# - ("mTangents", POINTER(Vector3D)),#Vertex bitangents.#The bitangent of a vertex points in the direction of the positive#Y texture axis. The array contains normalized vectors, NULL if not#present. The array is mNumVertices in size.#@note If the mesh contains tangents, it automatically also contains#bitangents.# - ("mBitangents", POINTER(Vector3D)),#Vertex color sets.#A mesh may contain 0 to #AI_MAX_NUMBER_OF_COLOR_SETS vertex#colors per vertex. NULL if not present. Each array is#mNumVertices in size if present.# - ("mColors", POINTER(Color4D)*AI_MAX_NUMBER_OF_COLOR_SETS),#Vertex texture coords, also known as UV channels.#A mesh may contain 0 to AI_MAX_NUMBER_OF_TEXTURECOORDS per#vertex. NULL if not present. The array is mNumVertices in size.# - ("mTextureCoords", POINTER(Vector3D)*AI_MAX_NUMBER_OF_TEXTURECOORDS),#Specifies the number of components for a given UV channel.#Up to three channels are supported (UVW, for accessing volume#or cube maps). If the value is 2 for a given channel n, the#component p.z of mTextureCoords[n][p] is set to 0.0f.#If the value is 1 for a given channel, p.y is set to 0.0f, too.#@note 4D coords are not supported# - ("mNumUVComponents", c_uint*AI_MAX_NUMBER_OF_TEXTURECOORDS),#The faces the mesh is constructed from.#Each face refers to a number of vertices by their indices.#This array is always present in a mesh, its size is given#in mNumFaces. If the #AI_SCENE_FLAGS_NON_VERBOSE_FORMAT#is NOT set each face references an unique set of vertices.# - ("mFaces", POINTER(Face)),#The number of bones this mesh contains.#Can be 0, in which case the mBones array is NULL.# - ("mNumBones", c_uint),#The bones of this mesh.#A bone consists of a name by which it can be found in the#frame hierarchy and a set of vertex weights.# - ("mBones", POINTER(POINTER(Bone))),#The material used by this mesh.#A mesh does use only a single material. If an imported model uses#multiple materials, the import splits up the mesh. Use this value#as index into the scene's material list.# - ("mMaterialIndex", c_uint),#Name of the mesh. Meshes can be named, but this is not a# requirement and leaving this field empty is totally fine.# There are mainly three uses for mesh names:# - some formats name nodes and meshes independently.# - importers tend to split meshes up to meet the# one-material-per-mesh requirement. Assigning# the same (dummy) name to each of the result meshes# aids the caller at recovering the original mesh# partitioning.# - Vertex animations refer to meshes by their names.# - ("mName", String),#NOT CURRENTLY IN USE. The number of attachment meshes# - ("mNumAnimMeshes", c_uint),#NOT CURRENTLY IN USE. Attachment meshes for this mesh, for vertex-based animation.# Attachment meshes carry replacement data for some of the# mesh'es vertex components (usually positions, normals).# - ] - -class VectorKey(Structure): - """ - See 'aiAnim.h' for details. - """ - - _fields_ = [ - #The time of this key# - ("mTime", c_double),#The value of this key# - ("mValue", Vector3D), - ] - -class QuatKey(Structure): - """ - See 'aiAnim.h' for details. - """ - - _fields_ = [ - #The time of this key# - ("mTime", c_double),#The value of this key# - ("mValue", Quaternion), - ] - -class NodeAnim(Structure): - """ - See 'aiAnim.h' for details. - """ - - _fields_ = [ - #The name of the node affected by this animation. The node# must exist and it must be unique.# - ("mNodeName", String),#The number of position keys# - ("mNumPositionKeys", c_uint),#The position keys of this animation channel. Positions are#specified as 3D vector. The array is mNumPositionKeys in size.##If there are position keys, there will also be at least one#scaling and one rotation key.# - ("mPositionKeys", POINTER(VectorKey)),#The number of rotation keys# - ("mNumRotationKeys", c_uint),#The rotation keys of this animation channel. Rotations are# given as quaternions, which are 4D vectors. The array is# mNumRotationKeys in size.##If there are rotation keys, there will also be at least one#scaling and one position key.# - ("mRotationKeys", POINTER(QuatKey)),#The number of scaling keys# - ("mNumScalingKeys", c_uint),#The scaling keys of this animation channel. Scalings are# specified as 3D vector. The array is mNumScalingKeys in size.##If there are scaling keys, there will also be at least one#position and one rotation key.# - ("mScalingKeys", POINTER(VectorKey)),#Defines how the animation behaves before the first# key is encountered.## The default value is aiAnimBehaviour_DEFAULT (the original# transformation matrix of the affected node is used).# - ("mPreState", c_uint),#Defines how the animation behaves after the last# key was processed.## The default value is aiAnimBehaviour_DEFAULT (the original# transformation matrix of the affected node is taken).# - ("mPostState", c_uint), - ] - -class Animation(Structure): - """ - See 'aiAnim.h' for details. - """ - - _fields_ = [ - #The name of the animation. If the modeling package this data was# exported from does support only a single animation channel, this# name is usually empty (length is zero).# - ("mName", String),#Duration of the animation in ticks.# - ("mDuration", c_double),#Ticks per second. 0 if not specified in the imported file# - ("mTicksPerSecond", c_double),#The number of bone animation channels. Each channel affects# a single node.# - ("mNumChannels", c_uint),#The node animation channels. Each channel affects a single node.# The array is mNumChannels in size.# - ("mChannels", POINTER(POINTER(NodeAnim))),#The number of mesh animation channels. Each channel affects# a single mesh and defines vertex-based animation.# - ("mNumMeshChannels", c_uint),#The mesh animation channels. Each channel affects a single mesh.# The array is mNumMeshChannels in size.# - ] - -class UVTransform(Structure): - """ - See 'aiMaterial.h' for details. - """ - - _fields_ = [ - #Translation on the u and v axes.## The default value is (0|0).# - ("mTranslation", Vector2D),#Scaling on the u and v axes.## The default value is (1|1).# - ("mScaling", Vector2D),#Rotation - in counter-clockwise direction.## The rotation angle is specified in radians. The# rotation center is 0.5f|0.5f. The default value# 0.f.# - ("mRotation", c_float), - ] - -class MaterialProperty(Structure): - """ - See 'aiMaterial.h' for details. - """ - - _fields_ = [ - #Specifies the name of the property (key)# Keys are generally case insensitive.# - ("mKey", String),#Textures: Specifies their exact usage semantic.#For non-texture properties, this member is always 0#(or, better-said, #aiTextureType_NONE).# - ("mSemantic", c_uint),#Textures: Specifies the index of the texture.# For non-texture properties, this member is always 0.# - ("mIndex", c_uint),#Size of the buffer mData is pointing to, in bytes.# This value may not be 0.# - ("mDataLength", c_uint),#Type information for the property.##Defines the data layout inside the data buffer. This is used#by the library internally to perform debug checks and to#utilize proper type conversions.#(It's probably a hacky solution, but it works.)# - ("mType", c_uint),#Binary buffer to hold the property's value.#The size of the buffer is always mDataLength.# - ("mData", POINTER(c_char)), - ] - -class Material(Structure): - """ - See 'aiMaterial.h' for details. - """ - - _fields_ = [ - #List of all material properties loaded.# - ("mProperties", POINTER(POINTER(MaterialProperty))),#Number of properties in the data base# - ("mNumProperties", c_uint),#Storage allocated# - ("mNumAllocated", c_uint), - ] - -class Scene(Structure): - """ - See 'aiScene.h' for details. - """ - - AI_SCENE_FLAGS_INCOMPLETE = 0x1 - AI_SCENE_FLAGS_VALIDATED = 0x2 - AI_SCENE_FLAGS_VALIDATION_WARNING = 0x4 - AI_SCENE_FLAGS_NON_VERBOSE_FORMAT = 0x8 - AI_SCENE_FLAGS_TERRAIN = 0x10 - - _fields_ = [ - #Any combination of the AI_SCENE_FLAGS_XXX flags. By default#this value is 0, no flags are set. Most applications will#want to reject all scenes with the AI_SCENE_FLAGS_INCOMPLETE#bit set.# - ("mFlags", c_uint),#The root node of the hierarchy.##There will always be at least the root node if the import#was successful (and no special flags have been set).#Presence of further nodes depends on the format and content#of the imported file.# - ("mRootNode", POINTER(Node)),#The number of meshes in the scene.# - ("mNumMeshes", c_uint),#The array of meshes.##Use the indices given in the aiNode structure to access#this array. The array is mNumMeshes in size. If the#AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always#be at least ONE material.# - ("mMeshes", POINTER(POINTER(Mesh))),#The number of materials in the scene.# - ("mNumMaterials", c_uint),#The array of materials.##Use the index given in each aiMesh structure to access this#array. The array is mNumMaterials in size. If the#AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always#be at least ONE material.# - ("mMaterials", POINTER(POINTER(Material))),#The number of animations in the scene.# - ("mNumAnimations", c_uint),#The array of animations.##All animations imported from the given file are listed here.#The array is mNumAnimations in size.# - ("mAnimations", POINTER(POINTER(Animation))),#The number of textures embedded into the file# - ("mNumTextures", c_uint),#The array of embedded textures.##Not many file formats embed their textures into the file.#An example is Quake's MDL format (which is also used by#some GameStudio versions)# - ("mTextures", POINTER(POINTER(Texture))),#The number of light sources in the scene. Light sources#are fully optional, in most cases this attribute will be 0# - ("mNumLights", c_uint),#The array of light sources.##All light sources imported from the given file are#listed here. The array is mNumLights in size.# - ("mLights", POINTER(POINTER(Light))),#The number of cameras in the scene. Cameras#are fully optional, in most cases this attribute will be 0# - ("mNumCameras", c_uint),#The array of cameras.##All cameras imported from the given file are listed here.#The array is mNumCameras in size. The first camera in the#array (if existing) is the default camera view into#the scene.# - ("mCameras", POINTER(POINTER(Camera))), - ] diff --git a/port/PyAssimp3/quicktest.py b/port/PyAssimp3/quicktest.py deleted file mode 100644 index e8494493c..000000000 --- a/port/PyAssimp3/quicktest.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: UTF-8 -*- - -""" -This module uses the sample.py script to load all test models it finds. - -Note: this is not an exhaustive test suite, it does not check the -data structures in detail. It just verifies whether basic -loading and querying of 3d models using pyassimp works. -""" - - -import sys,os -import sample -from pyassimp import pyassimp,errors - -# paths to be walkd recursively -basepaths = [os.path.join('..','..','test','models'), os.path.join('..','..','test','models-nonbsd')] - -# file extensions to be considered -extensions = ['.3ds','.x','.lwo','.obj','.md5mesh','.dxf','.ply','.stl','.dae','.md5anim','.lws','.irrmesh','.nff','.off','.blend'] - -def run_tests(): - ok,err = 0,0 - for path in basepaths: - for root, dirs, files in os.walk(path): - for afile in files: - base,ext = os.path.splitext(afile) - if ext in extensions: - try: - sample.main(os.path.join(root,afile)) - ok += 1 - except errors.AssimpError as error: - # assimp error is fine, this is a controlled case - print(error) - err += 1 - print(('** Loaded %s models, got controlled errors for %s files' % (ok,err))) - - -if __name__ == '__main__': - run_tests() - - - - diff --git a/port/PyAssimp3/sample.py b/port/PyAssimp3/sample.py deleted file mode 100644 index 02332ecb5..000000000 --- a/port/PyAssimp3/sample.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python3 -#-*- coding: UTF-8 -*- - -""" -This module demonstrates the functionality of PyAssimp. -""" - - -from pyassimp import pyassimp -import os, sys - -#get a model out of assimp's test-data if none is provided on the command line -DEFAULT_MODEL = os.path.join(os.path.dirname(__file__), - "..", "..", - "test", "models", "Collada", "duck.dae") - -def main(filename=None): - filename = filename or DEFAULT_MODEL - scene = pyassimp.load(filename) - - #the model we load - print("MODEL:", filename) - print() - - #write some statistics - print("SCENE:") - print(" meshes:", len(scene.meshes)) - print(" materials:", len(scene.materials)) - print(" textures:", len(scene.textures)) - print() - - print("MESHES:") - for index, mesh in enumerate(scene.meshes): - print(" MESH", index+1) - print(" material:", mesh.mMaterialIndex+1) - print(" vertices:", len(mesh.vertices)) - print(" first 3 verts:", mesh.vertices[:3]) - #if len(mesh.normals): - # print " first 3 normals:", mesh.normals[:3] - print(" colors:", len(mesh.colors)) - tc = mesh.texcoords - print(" texture-coords 1:", len(tc[0]), "first3:", tc[0][:3]) - print(" texture-coords 2:", len(tc[1]), "first3:", tc[1][:3]) - print(" texture-coords 3:", len(tc[2]), "first3:", tc[2][:3]) - print(" texture-coords 4:", len(tc[3]), "first3:", tc[3][:3]) - print(" uv-component-count:", len(mesh.mNumUVComponents)) - print(" faces:", len(mesh.faces), "first:", [f.indices for f in mesh.faces[:3]]) - print(" bones:", len(mesh.bones), "first:", [b.mName for b in mesh.bones[:3]]) - print() - - print("MATERIALS:") - for index, material in enumerate(scene.materials): - print(" MATERIAL", index+1) - properties = pyassimp.GetMaterialProperties(material) - for key in properties: - print(" %s: %s" % (key, properties[key])) - print() - - print("TEXTURES:") - for index, texture in enumerate(scene.textures): - print(" TEXTURE", index+1) - print(" width:", texture.mWidth) - print(" height:", texture.mHeight) - print(" hint:", texture.achFormatHint) - print(" data (size):", texture.mWidth*texture.mHeight) - - # Finally release the model - pyassimp.release(scene) - -if __name__ == "__main__": - main(sys.argv[1] if len(sys.argv)>1 else None) diff --git a/samples/SimpleOpenGL/Sample_SimpleOpenGL.c b/samples/SimpleOpenGL/Sample_SimpleOpenGL.c index a2b4502e2..921046a44 100644 --- a/samples/SimpleOpenGL/Sample_SimpleOpenGL.c +++ b/samples/SimpleOpenGL/Sample_SimpleOpenGL.c @@ -11,6 +11,7 @@ // ---------------------------------------------------------------------------- #include +#include #include @@ -235,11 +236,23 @@ void recursive_render (const struct aiScene *sc, const struct aiNode* nd) void do_motion (void) { static GLint prev_time = 0; + static GLint prev_fps_time = 0; + static int frames = 0; int time = glutGet(GLUT_ELAPSED_TIME); angle += (time-prev_time)*0.01; prev_time = time; + frames += 1; + if ((time - prev_fps_time) > 1000) // update every seconds + { + int current_fps = frames * 1000 / (time - prev_fps_time); + printf("%d fps\n", current_fps); + frames = 0; + prev_fps_time = time; + } + + glutPostRedisplay (); } From 0313e5b5b40c72de276ace0390106e92774e0dde Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Fri, 9 Nov 2012 11:43:57 +0000 Subject: [PATCH 38/51] =?UTF-8?q?-=20add=20S=C3=A9verin=20Lemaignan=20to?= =?UTF-8?q?=20CREDITS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1333 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- CREDITS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index a46aa2332..a14d587b8 100644 --- a/CREDITS +++ b/CREDITS @@ -135,4 +135,7 @@ Several LWO and LWS fixes (pivoting). GCC/Linux fixes for the SimpleOpenGL sample. - Brian Miller -Bugfix for a compiler fix for iOS on arm. \ No newline at end of file +Bugfix for a compiler fix for iOS on arm. + +- Séverin Lemaignan +Rewrite of PyAssimp, distutils and Python3 support \ No newline at end of file From 6d3cedc0b16fa030dfceff28aa75640b2cba33ea Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sat, 10 Nov 2012 16:01:55 +0000 Subject: [PATCH 39/51] - add missing files from the last commit git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1334 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- port/PyAssimp/README.md | 74 ++++ port/PyAssimp/pyassimp/core.py | 415 +++++++++++++++++++ port/PyAssimp/pyassimp/postprocess.py | 529 +++++++++++++++++++++++++ port/PyAssimp/scripts/opengl_viewer.py | 421 ++++++++++++++++++++ port/PyAssimp/scripts/quicktest.py | 45 +++ port/PyAssimp/scripts/sample.py | 81 ++++ port/PyAssimp/setup.py | 13 + 7 files changed, 1578 insertions(+) create mode 100644 port/PyAssimp/README.md create mode 100644 port/PyAssimp/pyassimp/core.py create mode 100644 port/PyAssimp/pyassimp/postprocess.py create mode 100755 port/PyAssimp/scripts/opengl_viewer.py create mode 100755 port/PyAssimp/scripts/quicktest.py create mode 100755 port/PyAssimp/scripts/sample.py create mode 100644 port/PyAssimp/setup.py diff --git a/port/PyAssimp/README.md b/port/PyAssimp/README.md new file mode 100644 index 000000000..5bec88711 --- /dev/null +++ b/port/PyAssimp/README.md @@ -0,0 +1,74 @@ +PyAssimp Readme +=============== + +-- a simple Python wrapper for Assimp using ctypes to access +the library. Requires Python >= 2.6. + +Python 3 support is mostly here, but not well tested. + +Note that pyassimp is not complete. Many ASSIMP features are missing. In +particular, only loading of models is currently supported (no export). + +USAGE +----- + +To get started with pyAssimp, examine the sample.py script in scripts/, which +illustrates the basic usage. All Assimp data structures are wrapped using +ctypes. All the data+length fields in Assimp's data structures (such as +'aiMesh::mNumVertices','aiMesh::mVertices') are replaced by simple python +lists, so you can call len() on them to get their respective size and access +members using []. + +For example, to load a file named 'hello.3ds' and print the first +vertex of the first mesh, you would do (proper error handling +substituted by assertions ...): + +```python + +from pyassimp.core import * +scene = load('hello.3ds') + +assert len(scene.meshes) +mesh = scene.meshes[0] + +assert len(mesh.vertices) +print(mesh.vertices[0]) + +# don't forget this one, or you will leak! +release(scene) + +``` + +Another example to list the 'top nodes' in a +scene: + +```python + +from pyassimp.core import * +scene = load('hello.3ds') + +for c in scene.rootnode.children: + print(str(c)) + +release(scene) + +``` + +INSTALL +------- + +Install pyassimp by running: + +> python setup.py install + +PyAssimp requires a assimp dynamic library (DLL on windows, +so on linux :-) in order to work. The default search directories +are: + +- the current directory +- on linux additionally: /usr/lib and /usr/local/lib + +To build that library, refer to the Assimp master INSTALL +instructions. To look in more places, edit ./pyassimp/helper.py. +There's an 'additional_dirs' list waiting for your entries. + diff --git a/port/PyAssimp/pyassimp/core.py b/port/PyAssimp/pyassimp/core.py new file mode 100644 index 000000000..731dcd5a3 --- /dev/null +++ b/port/PyAssimp/pyassimp/core.py @@ -0,0 +1,415 @@ +#-*- coding: UTF-8 -*- + +""" +PyAssimp + +This is the main-module of PyAssimp. +""" + +import sys +if sys.version_info < (2,6): + raise 'pyassimp: need python 2.6 or newer' + + +import ctypes +import os +import numpy + +import logging; logger = logging.getLogger("pyassimp") + +# Attach a default, null handler, to the logger. +# applications can easily get log messages from pyassimp +# by calling for instance +# >>> logging.basicConfig(level=logging.DEBUG) +# before importing pyassimp +class NullHandler(logging.Handler): + def emit(self, record): + pass +h = NullHandler() +logger.addHandler(h) + +from . import structs +from .errors import AssimpError +from . import helper + + +assimp_structs_as_tuple = ( + structs.Matrix4x4, + structs.Matrix3x3, + structs.Vector2D, + structs.Vector3D, + structs.Color3D, + structs.Color4D, + structs.Quaternion, + structs.Plane, + structs.Texel) + +def make_tuple(ai_obj, type = None): + res = None + + if isinstance(ai_obj, structs.Matrix4x4): + res = numpy.array([getattr(ai_obj, e[0]) for e in ai_obj._fields_]).reshape((4,4)) + #import pdb;pdb.set_trace() + elif isinstance(ai_obj, structs.Matrix3x3): + res = numpy.array([getattr(ai_obj, e[0]) for e in ai_obj._fields_]).reshape((3,3)) + else: + res = numpy.array([getattr(ai_obj, e[0]) for e in ai_obj._fields_]) + + return res + +def call_init(obj, caller = None): + # init children + if hasattr(obj, '_init'): + obj._init(parent = caller) + + # pointers + elif hasattr(obj, 'contents'): + if hasattr(obj.contents, '_init'): + obj.contents._init(target = obj, parent = caller) + + + +def _init(self, target = None, parent = None): + """ + Custom initialize() for C structs, adds safely accessable member functionality. + + :param target: set the object which receive the added methods. Useful when manipulating + pointers, to skip the intermediate 'contents' deferencing. + """ + if hasattr(self, '_is_init'): + return self + self._is_init = True + + if not target: + target = self + + for m in dir(self): + + name = m[1:].lower() + + if m.startswith("_"): + continue + + obj = getattr(self, m) + + if m.startswith('mNum'): + if 'm' + m[4:] in dir(self): + continue # will be processed later on + else: + setattr(target, name, obj) + + + + # Create tuples + if isinstance(obj, assimp_structs_as_tuple): + setattr(target, name, make_tuple(obj)) + logger.debug(str(self) + ": Added array " + str(getattr(target, name)) + " as self." + name.lower()) + continue + + + if isinstance(obj, structs.String): + setattr(target, 'name', str(obj.data)) + setattr(target.__class__, '__repr__', lambda x: str(x.__class__) + "(" + x.name + ")") + setattr(target.__class__, '__str__', lambda x: x.name) + continue + + + if m.startswith('m'): + + if name == "parent": + setattr(target, name, parent) + logger.debug("Added a parent as self." + name) + continue + + if hasattr(self, 'mNum' + m[1:]): + + length = getattr(self, 'mNum' + m[1:]) + + # -> special case: properties are + # stored as a dict. + if m == 'mProperties': + setattr(target, name, _get_properties(obj, length)) + continue + + + if not length: # empty! + setattr(target, name, []) + logger.debug(str(self) + ": " + name + " is an empty list.") + continue + + + try: + if obj._type_ in assimp_structs_as_tuple: + setattr(target, name, numpy.array([make_tuple(obj[i]) for i in range(length)], dtype=numpy.float32)) + + logger.debug(str(self) + ": Added an array of numpy arrays (type "+ str(type(obj)) + ") as self." + name) + + else: + setattr(target, name, [obj[i] for i in range(length)]) #TODO: maybe not necessary to recreate an array? + + logger.debug(str(self) + ": Added list of " + str(obj) + " " + name + " as self." + name + " (type: " + str(type(obj)) + ")") + + # initialize array elements + for e in getattr(target, name): + call_init(e, caller = target) + + + except IndexError: + logger.error("in " + str(self) +" : mismatch between mNum" + name + " and the actual amount of data in m" + name + ". This may be due to version mismatch between libassimp and pyassimp. Quitting now.") + sys.exit(1) + + except ValueError as e: + + logger.error("In " + str(self) + "->" + name + ": " + str(e) + ". Quitting now.") + if "setting an array element with a sequence" in str(e): + logger.error("Note that pyassimp does not currently " + "support meshes with mixed triangles " + "and quads. Try to load your mesh with" + " a post-processing to triangulate your" + " faces.") + sys.exit(1) + + + else: # starts with 'm' but not iterable + + setattr(target, name, obj) + logger.debug("Added " + name + " as self." + name + " (type: " + str(type(obj)) + ")") + + call_init(obj, caller = target) + + + + + if isinstance(self, structs.Mesh): + _finalize_mesh(self, target) + + if isinstance(self, structs.Texture): + _finalize_texture(self, target) + + + return self + + +""" +Python magic to add the _init() function to all C struct classes. +""" +for struct in dir(structs): + if not (struct.startswith('_') or struct.startswith('c_') or struct == "Structure" or struct == "POINTER") and not isinstance(getattr(structs, struct),int): + + setattr(getattr(structs, struct), '_init', _init) + + +class AssimpLib(object): + """ + Assimp-Singleton + """ + load, release, dll = helper.search_library() + +#the loader as singleton +_assimp_lib = AssimpLib() + +def pythonize_assimp(type, obj, scene): + """ This method modify the Assimp data structures + to make them easier to work with in Python. + + Supported operations: + - MESH: replace a list of mesh IDs by reference to these meshes + - ADDTRANSFORMATION: add a reference to an object's transformation taken from their associated node. + + :param type: the type of modification to operate (cf above) + :param obj: the input object to modify + :param scene: a reference to the whole scene + """ + + if type == "MESH": + meshes = [] + for i in obj: + meshes.append(scene.meshes[i]) + return meshes + + if type == "ADDTRANSFORMATION": + + def getnode(node, name): + if node.name == name: return node + for child in node.children: + n = getnode(child, name) + if n: return n + + node = getnode(scene.rootnode, obj.name) + if not node: + raise AssimpError("Object " + str(obj) + " has no associated node!") + setattr(obj, "transformation", node.transformation) + + +def recur_pythonize(node, scene): + """ Recursively call pythonize_assimp on + nodes tree to apply several post-processing to + pythonize the assimp datastructures. + """ + + node.meshes = pythonize_assimp("MESH", node.meshes, scene) + + for mesh in node.meshes: + mesh.material = scene.materials[mesh.materialindex] + + for cam in scene.cameras: + pythonize_assimp("ADDTRANSFORMATION", cam, scene) + + #for light in scene.lights: + # pythonize_assimp("ADDTRANSFORMATION", light, scene) + + for c in node.children: + recur_pythonize(c, scene) + + +def load(filename, processing=0): + """ + Loads the model with some specific processing parameters. + + filename - file to load model from + processing - processing parameters + + result Scene-object with model-data + + throws AssimpError - could not open file + """ + #read pure data + #from ctypes import c_char_p, c_uint + #model = _assimp_lib.load(c_char_p(filename), c_uint(processing)) + model = _assimp_lib.load(filename.encode("ascii"), processing) + if not model: + #Uhhh, something went wrong! + raise AssimpError("could not import file: %s" % filename) + + scene = model.contents._init() + + recur_pythonize(scene.rootnode, scene) + + return scene + +def release(scene): + from ctypes import pointer + _assimp_lib.release(pointer(scene)) + +def _finalize_texture(tex, target): + setattr(target, "achformathint", tex.achFormatHint) + data = numpy.array([make_tuple(getattr(tex, pcData)[i]) for i in range(tex.mWidth * tex.mHeight)]) + setattr(target, "data", data) + + + +def _finalize_mesh(mesh, target): + """ Building of meshes is a bit specific. + + We override here the various datasets that can + not be process as regular fields. + + For instance, the length of the normals array is + mNumVertices (no mNumNormals is available) + """ + nb_vertices = getattr(mesh, "mNumVertices") + + def fill(name): + mAttr = getattr(mesh, name) + if mAttr: + data = numpy.array([make_tuple(getattr(mesh, name)[i]) for i in range(nb_vertices)], dtype=numpy.float32) + setattr(target, name[1:].lower(), data) + else: + setattr(target, name[1:].lower(), []) + + def fillarray(name): + mAttr = getattr(mesh, name) + + data = [] + for index, mSubAttr in enumerate(mAttr): + if mSubAttr: + data.append([make_tuple(getattr(mesh, name)[index][i]) for i in range(nb_vertices)]) + + setattr(target, name[1:].lower(), numpy.array(data, dtype=numpy.float32)) + + fill("mNormals") + fill("mTangents") + fill("mBitangents") + + fillarray("mColors") + fillarray("mTextureCoords") + + # prepare faces + faces = numpy.array([f.indices for f in target.faces], dtype=numpy.int32) + setattr(target, 'faces', faces) + +def _get_properties(properties, length): + """ + Convenience Function to get the material properties as a dict + and values in a python format. + """ + result = {} + #read all properties + for p in [properties[i] for i in range(length)]: + #the name + p = p.contents + key = str(p.mKey.data) + + #the data + from ctypes import POINTER, cast, c_int, c_float, sizeof + if p.mType == 1: + arr = cast(p.mData, POINTER(c_float * int(p.mDataLength/sizeof(c_float)) )).contents + value = numpy.array([x for x in arr]) + elif p.mType == 3: #string can't be an array + value = cast(p.mData, POINTER(structs.String)).contents.data + elif p.mType == 4: + arr = cast(p.mData, POINTER(c_int * int(p.mDataLength/sizeof(c_int)) )).contents + value = numpy.array([x for x in arr]) + else: + value = p.mData[:p.mDataLength] + + result[key] = value + + return result + +def aiGetMaterialFloatArray(material, key): + AI_SUCCESS = 0 + from ctypes import byref, pointer, cast, c_float, POINTER, sizeof, c_uint + out = structs.Color4D() + max = c_uint(sizeof(structs.Color4D)) + r=_assimp_lib.dll.aiGetMaterialFloatArray(pointer(material), + key[0], + key[1], + key[2], + byref(out), + byref(max)) + + if (r != AI_SUCCESS): + raise AssimpError("aiGetMaterialFloatArray failed!") + + out._init() + return [out[i] for i in range(max.value)] + +def aiGetMaterialString(material, key): + AI_SUCCESS = 0 + from ctypes import byref, pointer, cast, c_float, POINTER, sizeof, c_uint + out = structs.String() + r=_assimp_lib.dll.aiGetMaterialString(pointer(material), + key[0], + key[1], + key[2], + byref(out)) + + if (r != AI_SUCCESS): + raise AssimpError("aiGetMaterialString failed!") + + return str(out.data) + + + +def decompose_matrix(matrix): + if not isinstance(matrix, structs.Matrix4x4): + raise AssimpError("pyassimp.decompose_matrix failed: Not a Matrix4x4!") + + scaling = structs.Vector3D() + rotation = structs.Quaternion() + position = structs.Vector3D() + + from ctypes import byref, pointer + _assimp_lib.dll.aiDecomposeMatrix(pointer(matrix), byref(scaling), byref(rotation), byref(position)) + return scaling._init(), rotation._init(), position._init() diff --git a/port/PyAssimp/pyassimp/postprocess.py b/port/PyAssimp/pyassimp/postprocess.py new file mode 100644 index 000000000..932c7c660 --- /dev/null +++ b/port/PyAssimp/pyassimp/postprocess.py @@ -0,0 +1,529 @@ +#


Calculates the tangents and bitangents for the imported meshes. +# +# Does nothing if a mesh does not have normals. You might want this post +# processing step to be executed if you plan to use tangent space calculations +# such as normal mapping applied to the meshes. There's a config setting, +# #AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE, which allows you to specify +# a maximum smoothing angle for the algorithm. However, usually you'll +# want to leave it at the default value. +# +aiProcess_CalcTangentSpace = 0x1 + +##
Identifies and joins identical vertex data sets within all +# imported meshes. +# +# After this step is run, each mesh contains unique vertices, +# so a vertex may be used by multiple faces. You usually want +# to use this post processing step. If your application deals with +# indexed geometry, this step is compulsory or you'll just waste rendering +# time. If this flag is not specified, no vertices are referenced by +# more than one face and no index buffer is required for rendering. +# +aiProcess_JoinIdenticalVertices = 0x2 + +##
Converts all the imported data to a left-handed coordinate space. +# +# By default the data is returned in a right-handed coordinate space (which +# OpenGL prefers). In this space, +X points to the right, +# +Z points towards the viewer, and +Y points upwards. In the DirectX +# coordinate space +X points to the right, +Y points upwards, and +Z points +# away from the viewer. +# +# You'll probably want to consider this flag if you use Direct3D for +# rendering. The #aiProcess_ConvertToLeftHanded flag supersedes this +# setting and bundles all conversions typically required for D3D-based +# applications. +# +aiProcess_MakeLeftHanded = 0x4 + +##
Triangulates all faces of all meshes. +# +# By default the imported mesh data might contain faces with more than 3 +# indices. For rendering you'll usually want all faces to be triangles. +# This post processing step splits up faces with more than 3 indices into +# triangles. Line and point primitives are #not# modified! If you want +# 'triangles only' with no other kinds of primitives, try the following +# solution: +#