OpenModelS

This function opens the model via a stream.
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 OpenModelS(
            const void          * callback
        );

//   Linux, OS-X and non-Visual Studio Windows solutions
public:
int64_t OpenModelS(
            const void          * callback
        );    

Property callback

Size: 32 bit / 4 byte (reference)
The pointer to the function that will be called within this function. Please look at the examples how to create the callback function and how it will be called. In case this is not possible or complex there is an array call, technically the same call, however the callback function is embedded within the library.

Example

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

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

const int_t BLOCK_LENGTH_READ = 65535; // MAX: 65535
FILE        * myFileRead = nullptr;

int_t   __stdcall   ReadCallBackFunction(unsigned char * content)
{
    if (myFileRead == nullptr || feof(myFileRead)) {
        return  -1;
    }

    int_t   size = fread(content, 1, BLOCK_LENGTH_READ, myFileRead);

    return  size;
}

int64_t OpenModelByStream(wchar_t * fileName)
{
    assert(myFileRead == nullptr);

    _wfopen_s(&myFileRead, fileName, L"rb");
    if (&myFileRead) {
        int64_t model = OpenModelS(&ReadCallBackFunction);

        fclose(myFileRead);
        myFileRead = nullptr;

        return  model;
    }

    assert(false);
    return  0;
}