OpenModelA

This function opens the model via an array.
References inside to other ontologies will be included.
A handle to the model will be returned, or 0 in case something went wrong.

Syntax

//   Visual Studio for Windows
public:
__int64 __declspec(dllexport) __stdcall OpenModelA(
            const unsigned char * content,
            __int64             size
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
int64_t OpenModelA(
            const unsigned char * content,
            int64_t             size
        );    

Property content

Size: 32 bit / 4 byte (reference)
The content of this IO call, the size of the content is defined by attribute size.

Property size

Size: 64 bit / 8 byte (value)
The size of the content as defined in number of bytes.

Example

Here you can find code snippits that show how the API call OpenModelA can be used.

#include "engine/include/engine.h"
#include <assert.h>

int64_t OpenModelByArray(wchar_t * fileName)
{
    FILE    * myFileRead = nullptr;

    _wfopen_s(&myFileRead, fileName, L"rb");
    if (&myFileRead) {
        fseek(myFileRead, 0L, SEEK_END);
        int_t   size = ftell(myFileRead);
        rewind(myFileRead);

        int64_t model;
        if (size) {
            unsigned char   * content = new unsigned char[size];
            size = fread(content, 1, size, myFileRead);

            model = OpenModelA(content, (int64_t) size);
            delete[] content;
        }
        else {
            assert(false);

            model = OpenModelA(0, 0);
        }

        fclose(myFileRead);
        myFileRead = nullptr;

        return  model;
    }

    assert(false);
    return  0;
}