Class AIImporterDesc

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer


    public class AIImporterDesc
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Meta information about a particular importer. Importers need to fill this structure, but they can freely decide how talkative they are. A common use case for loader meta info is a user interface in which the user can choose between various import/export file formats. Building such an UI by hand means a lot of maintenance as importers / exporters are added to Assimp, so it might be useful to have a common mechanism to query some rough importer characteristics.

    Member documentation

    • mName – Full name of the importer (i.e. Blender3D importer)
    • mAuthor – Original author (left blank if unknown or whole assimp team)
    • mMaintainer – Current maintainer, left blank if the author maintains
    • mComments – Implementation comments, i.e. unimplemented features
    • mFlags – These flags indicate some characteristics common to many importers.
    • mMinMajor – Minimum major format that can be loaded in major.minor style.
    • mMinMinor – Minimum minor format that can be loaded in major.minor style.
    • mMaxMajor – Maximum major format that can be loaded in major.minor style.
    • mMaxMinor – Maximum minor format that can be loaded in major.minor style.
    • mFileExtensions – List of file extensions this importer can handle. List entries are separated by space characters. All entries are lower case without a leading dot (i.e. "xml dae" would be a valid value. Note that multiple importers may respond to the same file extension - assimp calls all importers in the order in which they are registered and each importer gets the opportunity to load the file until one importer "claims" the file. Apart from file extension checks, importers typically use other methods to quickly reject files (i.e. magic words) so this does not mean that common or generic file extensions such as XML would be tediously slow.

    Layout

     struct aiImporterDesc {
         const char * mName;
         const char * mAuthor;
         const char * mMaintainer;
         const char * mComments;
         unsigned int mFlags;
         unsigned int mMinMajor;
         unsigned int mMinMinor;
         unsigned int mMaxMajor;
         unsigned int mMaxMinor;
         const char * mFileExtensions;
     }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • Constructor Detail

      • AIImporterDesc

        public AIImporterDesc(java.nio.ByteBuffer container)
        Creates a AIImporterDesc instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • mName

        public java.nio.ByteBuffer mName()
        Returns a ByteBuffer view of the null-terminated string pointed to by the mName field.
      • mNameString

        public java.lang.String mNameString()
        Decodes the null-terminated string pointed to by the mName field.
      • mAuthor

        public java.nio.ByteBuffer mAuthor()
        Returns a ByteBuffer view of the null-terminated string pointed to by the mAuthor field.
      • mAuthorString

        public java.lang.String mAuthorString()
        Decodes the null-terminated string pointed to by the mAuthor field.
      • mMaintainer

        public java.nio.ByteBuffer mMaintainer()
        Returns a ByteBuffer view of the null-terminated string pointed to by the mMaintainer field.
      • mMaintainerString

        public java.lang.String mMaintainerString()
        Decodes the null-terminated string pointed to by the mMaintainer field.
      • mComments

        public java.nio.ByteBuffer mComments()
        Returns a ByteBuffer view of the null-terminated string pointed to by the mComments field.
      • mCommentsString

        public java.lang.String mCommentsString()
        Decodes the null-terminated string pointed to by the mComments field.
      • mFlags

        public int mFlags()
        Returns the value of the mFlags field.
      • mMinMajor

        public int mMinMajor()
        Returns the value of the mMinMajor field.
      • mMinMinor

        public int mMinMinor()
        Returns the value of the mMinMinor field.
      • mMaxMajor

        public int mMaxMajor()
        Returns the value of the mMaxMajor field.
      • mMaxMinor

        public int mMaxMinor()
        Returns the value of the mMaxMinor field.
      • mFileExtensions

        public java.nio.ByteBuffer mFileExtensions()
        Returns a ByteBuffer view of the null-terminated string pointed to by the mFileExtensions field.
      • mFileExtensionsString

        public java.lang.String mFileExtensionsString()
        Decodes the null-terminated string pointed to by the mFileExtensions field.
      • mName

        public AIImporterDesc mName(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the mName field.
      • mAuthor

        public AIImporterDesc mAuthor(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the mAuthor field.
      • mMaintainer

        public AIImporterDesc mMaintainer(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the mMaintainer field.
      • mComments

        public AIImporterDesc mComments(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the mComments field.
      • mFlags

        public AIImporterDesc mFlags(int value)
        Sets the specified value to the mFlags field.
      • mMinMajor

        public AIImporterDesc mMinMajor(int value)
        Sets the specified value to the mMinMajor field.
      • mMinMinor

        public AIImporterDesc mMinMinor(int value)
        Sets the specified value to the mMinMinor field.
      • mMaxMajor

        public AIImporterDesc mMaxMajor(int value)
        Sets the specified value to the mMaxMajor field.
      • mMaxMinor

        public AIImporterDesc mMaxMinor(int value)
        Sets the specified value to the mMaxMinor field.
      • mFileExtensions

        public AIImporterDesc mFileExtensions(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the mFileExtensions field.
      • set

        public AIImporterDesc set(java.nio.ByteBuffer mName,
                                  java.nio.ByteBuffer mAuthor,
                                  java.nio.ByteBuffer mMaintainer,
                                  java.nio.ByteBuffer mComments,
                                  int mFlags,
                                  int mMinMajor,
                                  int mMinMinor,
                                  int mMaxMajor,
                                  int mMaxMinor,
                                  java.nio.ByteBuffer mFileExtensions)
        Initializes this struct with the specified values.
      • set

        public AIImporterDesc set(AIImporterDesc src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

        public static AIImporterDesc malloc()
        Returns a new AIImporterDesc instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static AIImporterDesc calloc()
        Returns a new AIImporterDesc instance allocated with memCalloc. The instance must be explicitly freed.
      • createSafe

        @Nullable
        public static AIImporterDesc createSafe(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static AIImporterDesc.Buffer malloc(int capacity)
        Returns a new AIImporterDesc.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static AIImporterDesc.Buffer calloc(int capacity)
        Returns a new AIImporterDesc.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static AIImporterDesc.Buffer create(long address,
                                                   int capacity)
        Create a AIImporterDesc.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static AIImporterDesc.Buffer createSafe(long address,
                                                       int capacity)
        Like create, but returns null if address is NULL.
      • callocStack

        public static AIImporterDesc callocStack()
        Returns a new AIImporterDesc instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static AIImporterDesc mallocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new AIImporterDesc instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static AIImporterDesc callocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new AIImporterDesc instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static AIImporterDesc.Buffer callocStack(int capacity)
        Returns a new AIImporterDesc.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static AIImporterDesc.Buffer mallocStack(int capacity,
                                                        org.lwjgl.system.MemoryStack stack)
        Returns a new AIImporterDesc.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static AIImporterDesc.Buffer callocStack(int capacity,
                                                        org.lwjgl.system.MemoryStack stack)
        Returns a new AIImporterDesc.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • validate

        public static void validate(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate(long array,
                                    int count)
        Calls AIImporterDesc.validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array