|
ML Reference
|
#include <ThirdPartyWarningsDisable.h>#include <windows.h>#include <ThirdPartyWarningsRestore.h>#include "mlInitSystemML.h"#include "mlUtilsAPI.h"#include "mlVersion.h"Go to the source code of this file.
Functions | |
ML and ML Host: Initialization, Destruction, and callbacks. | |
| MLEXPORT MLint32 | MLInit (MLint32 majorVersion, MLint32 majorCAPIVersion, MLint32 revCAPI) |
| MLEXPORT MLint32 | MLDestroy () |
| MLEXPORT void | MLHostSetProgressCB (void *userData, MLHostProgressCB *callback) |
| Sets a callback to provide feedback of the host calculation progress. | |
| MLEXPORT void | MLHostUpdateProgress (const char *info1, const char *info2) |
| MLEXPORT void | MLHostSetBreakCheckCB (void *userData, MLHostBreakCheckCB *callback) |
| Sets a callback to provide break checking of current calculation. | |
Library loading, unloading, runtime state changes. | |
| MLEXPORT MLErrorCode | MLLoadLibraryWOErrorExt (const char *name, MLLibraryHandle *libHandle) |
| MLEXPORT MLErrorCode | MLLoadLibraryWOError (const char *name) |
| Same as MLLoadLibraryWOErrorExt with libHandle=NULL. | |
| MLEXPORT MLint32 | MLLoadLibrary (const char *name) |
| MLEXPORT MLuint32 | MLIsCurrentlyUnloadingLibrary () |
| MLEXPORT MLuint32 | MLSetIsCurrentlyUnloadingLibrary (MLuint32 enable) |
| MLEXPORT MLErrorCode | MLUnLoadLibrary (const char *name, MLLibraryHandle libHandle, char **errStr) |
Management of ML modules | |
| MLEXPORT mlModule * | MLCreateModuleFromName (const char *className) |
| MLEXPORT void | MLDeleteModule (mlModule *module) |
| MLEXPORT MLint32 | MLBaseIsDerivedFrom (mlBase *base, const char *superClassName) |
| MLEXPORT const char * | MLBaseGetType (mlBase *base) |
| MLEXPORT mlType * | MLBaseGetTypeObject (mlBase *base) |
| MLEXPORT const char * | MLBaseGetParentType (mlBase *base) |
| MLEXPORT mlModule * | MLCreateModuleFromType (mlType *type) |
| MLEXPORT mlType * | MLTypeFromName (const char *name) |
Returns the type object for given name. 0 will be returned if the type described by name is unknown. | |
| MLEXPORT MLint32 | MLTypeIsAbstract (mlType *type) |
| MLEXPORT const char * | MLTypeGetName (mlType *type) |
| MLEXPORT const char * | MLTypeGetDllName (mlType *type) |
| MLEXPORT const char * | MLTypeGetParentName (mlType *type) |
| MLEXPORT mlType * | MLTypeGetParentType (mlType *type) |
| MLEXPORT MLint32 | MLTypeIsDerivedFrom (mlType *type, const char *parent) |
Access to field interface of module | |
| MLEXPORT mlField * | MLModuleGetField (mlModule *module, const char *name) |
| MLEXPORT size_t | MLModuleGetNumFields (mlModule *module) |
| MLEXPORT mlField * | MLModuleGetIndexedField (mlModule *module, MLint32 n) |
| MLEXPORT void | MLModuleSetFieldValue (mlModule *module, char *fieldName, char *value) |
Activate/deactivate loading/saving state for modules. | |
| MLEXPORT void | MLBeginLoadFields (mlModule *module) |
| MLEXPORT void | MLEndLoadFields (mlModule *module) |
| MLEXPORT void | MLBeginSaveFields (mlModule *module) |
| MLEXPORT void | MLEndSaveFields (mlModule *module) |
Access to field values and properties. | |
| MLEXPORT const char * | MLFieldGetName (mlField *field) |
Returns the name of field field. | |
| MLEXPORT const char * | MLFieldGetType (mlField *field) |
Returns the runtime data type of field field as string. | |
| MLEXPORT void | MLFieldSetValue (mlField *field, const char *value) |
Sets the value of field field to value. | |
| MLEXPORT size_t | MLFieldGetValueSize (mlField *field) |
Returns the string length of field value coded as string of field field. | |
| MLEXPORT size_t | MLFieldGetValue (mlField *field, char *value, size_t bufferSize) |
| MLEXPORT void | MLFieldSetFloatValue (mlField *field, MLfloat value) |
| MLEXPORT MLfloat | MLFieldGetFloatValue (mlField *field) |
| MLEXPORT void | MLFieldSetDoubleValue (mlField *field, MLdouble value) |
| MLEXPORT MLdouble | MLFieldGetDoubleValue (mlField *field) |
| MLEXPORT void | MLFieldSetIntValue (mlField *field, MLint32 value) |
| MLEXPORT void | MLFieldSetIntValue64 (mlField *field, MLint64 value) |
| MLEXPORT MLint32 | MLFieldGetIntValue (mlField *field) |
| MLEXPORT MLint64 | MLFieldGetIntValue64 (mlField *field) |
Access to enum fields | |
| MLEXPORT int | MLFieldGetEnumValue (mlField *field) |
| MLEXPORT void | MLFieldSetEnumValue (mlField *field, int val) |
| MLEXPORT size_t | MLFieldGetNumEnums (mlField *field) |
| MLEXPORT const char * | MLFieldGetEnumName (mlField *field, MLint32 i, int *value) |
Connecting of input and output fields | |
| MLEXPORT MLint32 | MLFieldConnectFrom (mlField *inField, mlField *outField) |
| MLEXPORT MLint32 | MLImageFieldConnectFromNoNotify (mlField *inField, mlField *outField) |
| MLEXPORT void | MLFieldDisconnect (mlField *inField) |
| MLEXPORT void | MLFieldTouch (mlField *field) |
Requesting and freeing of image data via output connector fields | |
| MLEXPORT MLErrorCode | MLImageGetTile6D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint c, MLint t, MLint u, MLint nx, MLint ny, MLint nz, MLint nc, MLint nt, MLint nu, MLDataType datatype) |
| MLEXPORT MLErrorCode | MLImageGetTile4D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint c, MLint nx, MLint ny, MLint nz, MLint nc, MLDataType datatype) |
| Like MLImageGetTile6D(), only for four dimensional regions (i.e., t=u=0 and nt=nt=1). | |
| MLEXPORT MLErrorCode | MLImageGetTile3D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint nx, MLint ny, MLint nz, MLDataType datatype) |
| Like MLImageGetTile6D(), only for three dimensional regions (i.e., c=t=u=0 and nc=nt=nu=1). | |
| MLEXPORT MLErrorCode | MLImageGetTile (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint nx, MLint ny, MLint nz, MLDataType datatype) |
| Exactly like MLImageGetTile3D(). | |
| MLEXPORT MLErrorCode | MLImageGetScaledTile6D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint c, MLint t, MLint u, MLint nx, MLint ny, MLint nz, MLint nc, MLint nt, MLint nu, MLDataType datatype, MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax) |
| MLEXPORT MLErrorCode | MLImageGetScaledTile4D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint c, MLint nx, MLint ny, MLint nz, MLint nc, MLDataType datatype, MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax) |
| Like MLImageGetScaledTile6D(), only for four dimensional regions (i.e., t=u=0 and nt=nt=1). | |
| MLEXPORT MLErrorCode | MLImageGetScaledTile3D (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint nx, MLint ny, MLint nz, MLDataType datatype, MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax) |
| Like MLImageGetScaledTile6D(), only for three dimensional regions (i.e., t=u=0 and nt=nt=1). | |
| MLEXPORT MLErrorCode | MLImageGetScaledTile (mlField *outField, void **memory, MLint x, MLint y, MLint z, MLint nx, MLint ny, MLint nz, MLDataType datatype, MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax) |
| Exactly like MLImageGetScaledTile3D(). | |
| MLEXPORT void | MLImageFreeTile (void *data) |
Cache management. | |
| MLEXPORT MLuint64 | MLCacheGetCurrentSizeKB () |
| Returns the number of kilobytes currently allocated within the ML cache. | |
| MLEXPORT MLuint64 | MLCacheGetMaxSizeKB () |
| MLEXPORT void | MLCacheSetMaxSizeKB (MLuint64 size) |
| MLEXPORT MLErrorCode | MLClearPagesAndMemoryImg (mlField *outField) |
| MLEXPORT MLErrorCode | MLClearPages (mlField *outField) |
| MLEXPORT MLErrorCode | MLClearMemoryImg (mlField *outField) |
| MLEXPORT MLErrorCode | MLGetPageMemorySize (mlField *outField, size_t *numBytes) |
| MLEXPORT MLErrorCode | MLGetMemoryImgSize (mlField *outField, size_t *numBytes) |
| MLEXPORT void | MLClearCache () |
| Removes all cached pages from all module outputs. | |
Access to image properties via output connector fields | |
| MLEXPORT MLErrorCode | MLGetImageState (mlField *outField) |
| MLEXPORT const char * | MLGetImageStateString (mlField *outField) |
| MLEXPORT MLErrorCode | MLImageGetSize6D (mlField *outField, int *x, int *y, int *z, int *c, int *t, int *u) |
| MLEXPORT MLErrorCode | MLImageGetPageSize6D (mlField *outField, int *x, int *y, int *z, int *c, int *t, int *u) |
| MLEXPORT MLErrorCode | MLImageGetSize (mlField *outField, int *x, int *y, int *z, int *c) |
| Like MLImageGetSize6D, only for 4D. The last two extents are ignored. | |
| MLEXPORT MLErrorCode | MLImageGetType (mlField *outField, MLDataType *dtype, size_t *dsize) |
| MLEXPORT MLErrorCode | MLImageGetVoxelSize (mlField *outField, MLfloat *x, MLfloat *y, MLfloat *z) |
| MLEXPORT MLErrorCode | MLImageGetVoxelSizeInDoubles (mlField *outField, MLdouble *x, MLdouble *y, MLdouble *z) |
| MLEXPORT MLErrorCode | MLImageGetFirstImagePropertyExtensionByType (mlField *outField, const char *imagePropertyTypeClassName, void **imagePropertyExtension) |
| MLEXPORT MLErrorCode | MLImageGetMinValue (mlField *outField, MLdouble *minValue) |
Returns the minimum voxel value minValue of the image represented by output field outField. | |
| MLEXPORT MLErrorCode | MLImageGetMaxValue (mlField *outField, MLdouble *maxValue) |
Returns the maximum voxel value maxValue of the image represented by output field outField. | |
| MLEXPORT MLErrorCode | MLImageGetVoxelToWorldMatrix (mlField *outField, MLfloat[16]) |
Returns the VoxelToWorldMatrix of the image represented by output field outField. | |
| MLEXPORT MLErrorCode | MLImageGetVoxelToWorldMatrixInDoubles (mlField *outField, MLdouble[16]) |
Returns the VoxelToWorldMatrix of the image represented by output field outField. | |
| MLEXPORT MLErrorCode | MLImageGetWorldToVoxelMatrix (mlField *outField, MLfloat[16]) |
Returns the WorldToVoxelMatrix of the image represented by output field outField. | |
| MLEXPORT MLErrorCode | MLImageGetWorldToVoxelMatrixInDoubles (mlField *outField, MLdouble[16]) |
Returns the WorldToVoxelMatrix of the image represented by output field outField. | |
| MLEXPORT MLErrorCode | MLImageMapVoxelToWorld (mlField *outField, MLfloat srcX, MLfloat srcY, MLfloat srcZ, MLfloat *dstX, MLfloat *dstY, MLfloat *dstZ) |
| MLEXPORT MLErrorCode | MLImageMapVoxelToWorldInDoubles (mlField *outField, MLdouble srcX, MLdouble srcY, MLdouble srcZ, MLdouble *dstX, MLdouble *dstY, MLdouble *dstZ) |
| MLEXPORT MLErrorCode | MLImageMapWorldToVoxel (mlField *outField, MLfloat srcX, MLfloat srcY, MLfloat srcZ, MLfloat *dstX, MLfloat *dstY, MLfloat *dstZ) |
| MLEXPORT MLErrorCode | MLImageMapWorldToVoxelInDoubles (mlField *outField, MLdouble srcX, MLdouble srcY, MLdouble srcZ, MLdouble *dstX, MLdouble *dstY, MLdouble *dstZ) |
Base field management | |
| MLEXPORT const char * | MLBaseFieldGetPersistentState (mlField *baseField) |
| MLEXPORT void | MLBaseFieldSetPersistentState (mlField *baseField, const char *state) |
| MLEXPORT void | MLBaseFieldClearPersistentState (mlField *baseField, char *state) |
| MLEXPORT void * | MLBaseFieldGetPtr (mlField *field) |
| MLEXPORT void | MLBaseFieldSetPtr (mlField *baseField, const void *value) |
SoNode and Pointer field management | |
| MLEXPORT void * | MLSoNodeFieldGetPtr (mlField *field) |
| MLEXPORT void | MLSoNodeFieldSetPtr (mlField *field, const void *value) |
| MLEXPORT void * | MLPointerFieldGetPtr (mlField *field) |
| MLEXPORT void | MLPointerFieldSetPtr (mlField *field, const void *value) |
Field sensor management. | |
| MLEXPORT mlSensor * | MLCreateFieldSensor (void *userData, MLSensorCB *callback) |
| MLEXPORT void | MLDeleteFieldSensor (mlSensor *sensor) |
| MLEXPORT mlField * | MLFieldSensorGetField (mlSensor *sensor) |
| MLEXPORT void | MLFieldSensorAttach (mlSensor *sensor, mlField *field) |
| MLEXPORT void | MLFieldSensorDetach (mlSensor *sensor) |
Sending of messages to std::cout or std::cerr. | |
| MLEXPORT MLint32 | MLAreMessagesSentToCout () |
| MLEXPORT void | MLSendMessagesToCout (MLint32 on) |
| MLEXPORT MLint32 | MLAreMessagesSentToCerr () |
| MLEXPORT void | MLSendMessagesToCerr (MLint32 on) |
Set/Get the number of threads the ML may use. | |
| MLEXPORT MLErrorCode | MLSetMaxNumThreads (MLuint32 numThreads) |
| MLEXPORT MLuint32 | MLGetMaxNumThreads () |
Macro definitions for void pointers to make the API readable. | |
Disable all C++-specific features in mlInitSystemML for this C-API. Defines a C-Application Programming Interface (API) to the ML, see also mlUtilsAPI.h. It provides control to most parts of the ML and offers much higher binary compatibility than the C++ binary interface. It also can be used to link the ML to other programming languages. All functions of this interface are highly (however not completely) protected with exception handlers and tested to guarantee high security when using this functions. All detected errors will be handled by the ErrorOutput class if not explicitly returned by returned error codes. Include ML library initialization code and system dependencies. Undefine macro to avoid macro space pollution. Include all non ML includes that shall be available generally. Include ML version information. | |
| #define | mlField void |
| A macro name for a void pointer to a field in the ML to make the pointer more readable. | |
| #define | mlSensor void |
| A macro name for a void pointer to a sensor in the ML to make the pointer more readable. | |
| #define | mlModule void |
| A macro name for a void pointer to an ml::Module in the ML to make the pointer more readable. | |
| #define | mlBase void |
| A macro name for a void pointer to a base object in the ML to make the pointer more readable. | |
| #define | mlType void |
| A macro name for a void pointer to a runtime type in the ML to make the pointer more readable. | |
| typedef HMODULE | MLLibraryHandle |
| #define mlBase void |
A macro name for a void pointer to a base object in the ML to make the pointer more readable.
Definition at line 63 of file mlAPI.h.
Referenced by MLBaseGetParentType(), MLBaseGetType(), MLBaseGetTypeObject(), and MLBaseIsDerivedFrom().
| #define mlField void |
A macro name for a void pointer to a field in the ML to make the pointer more readable.
Definition at line 54 of file mlAPI.h.
Referenced by MLBaseFieldClearPersistentState(), MLBaseFieldGetPersistentState(), MLBaseFieldGetPtr(), MLBaseFieldSetPersistentState(), MLBaseFieldSetPtr(), MLClearMemoryImg(), MLClearPages(), MLClearPagesAndMemoryImg(), MLFieldConnectFrom(), MLFieldDisconnect(), MLFieldGetDoubleValue(), MLFieldGetEnumName(), MLFieldGetEnumValue(), MLFieldGetFloatValue(), MLFieldGetIntValue(), MLFieldGetIntValue64(), MLFieldGetName(), MLFieldGetNumEnums(), MLFieldGetType(), MLFieldGetValue(), MLFieldGetValueSize(), MLFieldSensorAttach(), MLFieldSensorGetField(), MLFieldSetDoubleValue(), MLFieldSetEnumValue(), MLFieldSetFloatValue(), MLFieldSetIntValue(), MLFieldSetIntValue64(), MLFieldSetValue(), MLFieldTouch(), MLGetImageState(), MLGetImageStateString(), MLGetMemoryImgSize(), MLGetPageMemorySize(), MLImageFieldConnectFromNoNotify(), MLImageGetFirstImagePropertyExtensionByType(), MLImageGetMaxValue(), MLImageGetMinValue(), MLImageGetPageSize6D(), MLImageGetScaledTile(), MLImageGetScaledTile3D(), MLImageGetScaledTile4D(), MLImageGetScaledTile6D(), MLImageGetSize(), MLImageGetSize6D(), MLImageGetTile(), MLImageGetTile3D(), MLImageGetTile4D(), MLImageGetTile6D(), MLImageGetType(), MLImageGetVoxelSize(), MLImageGetVoxelSizeInDoubles(), MLImageGetVoxelToWorldMatrix(), MLImageGetVoxelToWorldMatrixInDoubles(), MLImageGetWorldToVoxelMatrix(), MLImageGetWorldToVoxelMatrixInDoubles(), MLImageMapVoxelToWorld(), MLImageMapVoxelToWorldInDoubles(), MLImageMapWorldToVoxel(), MLImageMapWorldToVoxelInDoubles(), MLModuleGetField(), MLModuleGetIndexedField(), MLPointerFieldGetPtr(), MLPointerFieldSetPtr(), MLSoNodeFieldGetPtr(), and MLSoNodeFieldSetPtr().
| #define mlModule void |
A macro name for a void pointer to an ml::Module in the ML to make the pointer more readable.
Definition at line 60 of file mlAPI.h.
Referenced by MLBeginLoadFields(), MLBeginSaveFields(), MLCreateModuleFromName(), MLCreateModuleFromType(), MLDeleteModule(), MLEndLoadFields(), MLEndSaveFields(), MLModuleGetField(), MLModuleGetIndexedField(), MLModuleGetNumFields(), and MLModuleSetFieldValue().
| #define mlSensor void |
A macro name for a void pointer to a sensor in the ML to make the pointer more readable.
Definition at line 57 of file mlAPI.h.
Referenced by MLCreateFieldSensor(), MLDeleteFieldSensor(), MLFieldSensorAttach(), MLFieldSensorDetach(), and MLFieldSensorGetField().
| #define mlType void |
A macro name for a void pointer to a runtime type in the ML to make the pointer more readable.
Definition at line 66 of file mlAPI.h.
Referenced by MLBaseGetTypeObject(), MLCreateModuleFromType(), MLTypeFromName(), MLTypeGetDllName(), MLTypeGetName(), MLTypeGetParentName(), MLTypeGetParentType(), MLTypeIsAbstract(), and MLTypeIsDerivedFrom().
| typedef HMODULE MLLibraryHandle |
Defines the platform-specific handle for a dynamically linked library. It requires a Windows include and, therefore, cannot be placed in mlTypeDefs.h.
Returns 1 (=true) if the ML messages are sent to std::cerr, otherwise 0 (=false). Default is 0.
References MLEXPORT.
Returns 1 (=true) if the ML messages are sent to std::cout, otherwise 0 (=false). Default is 1.
References MLEXPORT.
Returns a character string that contains the object state of the base object represented by the base field baseField. The string memory is allocated in the function and must be released with MLBaseFieldClearPersistentState().
Returns 1 (=true) if base is derived from class with name superClassName and 0 (=false) if not. base must be a valid pointer to a Base object and superClassName a non-NULL pointer to a NULL-terminated non-empty string. Otherwise, it will be handled as a ML_BAD_PARAMETER error and 0 will be returned.
Notifies the begin of the loading process in which the fields of the module are set/initialized. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and call will be ignored.
Notifies the begin of the saving process in which the fields of the module are read/saved. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and call will be ignored.
Returns the number of kilobytes currently allocated within the ML cache.
References MLEXPORT.
Returns the maximum number of kilobytes used by the ML cache. Note that this limit can be exceeded by the ML if not possible in another way.
References MLEXPORT.
Sets the maximum number of kilobytes used by the ML cache. Note that this limit can be exceeded by the ML if not possible in another way.
References MLEXPORT.
| MLEXPORT void MLClearCache | ( | ) |
Removes all cached pages from all module outputs.
References MLEXPORT.
| MLEXPORT MLErrorCode MLClearMemoryImg | ( | mlField * | outField | ) |
Clears the memory image in OutputConnectorField outField if it is handled by the ML. A manually controlled memory image is not changed. No memory will be cleared on invalid or wrongly typed outField pointers. They will be handled as errors and ML_BAD_TYPE will be returned. On successful operation, ML_RESULT_OK will be returned.
| MLEXPORT MLErrorCode MLClearPages | ( | mlField * | outField | ) |
Removes all pages of the page image from the memory at output image field outField. No pages will be cleared on invalid or wrong typed outField pointers. They will be handled as errors and ML_BAD_TYPE will be returned. On successful operation, ML_RESULT_OK will be returned.
| MLEXPORT MLErrorCode MLClearPagesAndMemoryImg | ( | mlField * | outField | ) |
Removes all pages of the page image from the memory at OutputConnectorField outField. Also clears the memoryImg if the memoryImg mode is adequate. No pages will be cleared on invalid or wrongly typed outField pointers. They will be handled as errors and ML_BAD_TYPE will be returned. On successful operation, ML_RESULT_OK is returned.
| MLEXPORT mlSensor * MLCreateFieldSensor | ( | void * | userData, |
| MLSensorCB * | callback ) |
Returns a field sensor. It will call callback with user data userData if the field is notified. callback must be a valid pointer to an MLSensorCB function. An invalid pointer will be handled as a non-fatal error and a sensor creation without callback. The created sensor must be destroyed/removed with MLDeleteFieldSensor().
Notifies the end of the loading process in which the fields of the module are set/initialized. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and call will be ignored.
Notifies the end of the saving process in which the fields of the module are read/saved. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and call will be ignored.
If inField is an input connector field and outField is an output connector field, the field inField is connected with the field outField and returns true (=1) if connecting was successful, false (=0) otherwise. inField and outField must be valid field pointers. Otherwise, a ML_BAD_FIELD error occurs and 0 is returned.
IMPORTANT: In contrast to connecting normal fields, the MLFieldConnectFrom() call from an input to an output connector field does not cause a notification for optimized network build and historical reasons. It is recommended to use MLFieldTouch() on the input connector field afterwards to assure that the module correctly gets the notification about the connection.
Returns the value of the IntegerField field. field must be a valid IntegerField pointer. Otherwise, it will be handled as a ML_BAD_FIELD error and 0 will be returned. This version returns the field value as 64-bit integers if the ML is compiled to support 64-bit integers on 32-bit systems; the normal MLFieldGetIntValue routine remains for backward compatibility.
Attach the sensor sensor to the field field; any value change will be notified by the call of the callback. sensor must be a valid pointer to a sensor, field a valid pointer to a field. Invalid pointers will be handled as non-fatal errors and the call is ignored. A previously attached field will automatically be detached before attaching the new one.
Sets the value of IntegerField field to the integer value value. field must be a valid IntegerField pointer. Otherwise, it will be handled as a ML_BAD_FIELD error and the call will be ignored. This version accepts the field value as 64-bit integers if the ML is compiled to support 64-bit integers on 32-bit systems; the normal MLFieldSetIntValue routine remains for backward compatibility.
|
nodiscard |
Requests the state string from an output field outField. It attempts to update the output image and then it returns a NULL-terminated string describing the state of the output connector. This description is either the error code description of an MLErrorCode or the user-defined state string when invalidating the output of a module. Passing NULL as outField will result in MLGetErrorCodeDescription(ML_DISCONNECTED_GRAPH);
Returns the currently set number of parallel threads that the ML might use. If 1 is set, multithreading is disabled.
References MLEXPORT.
| MLEXPORT MLErrorCode MLGetMemoryImgSize | ( | mlField * | outField, |
| size_t * | numBytes ) |
Returns the currently used size of memory image of OutputConnectorField outField in bytes. *numBytes will be 0 on invalid or wrongly typed outField pointers. They will be handled as errors and ML_BAD_TYPE will be returned. On successful operation, ML_RESULT_OK will be returned.
| MLEXPORT MLErrorCode MLGetPageMemorySize | ( | mlField * | outField, |
| size_t * | numBytes ) |
Returns the currently used cache size for pages of the image in OutputConnectorField outField in bytes. *numBytes will be 0 on invalid or wrongly typed outField pointers. They will be handled as errors and ML_BAD_TYPE will be returned. On successful operation, ML_RESULT_OK will be returned.
| MLEXPORT void MLHostSetBreakCheckCB | ( | void * | userData, |
| MLHostBreakCheckCB * | callback ) |
Sets a callback to provide break checking of current calculation.
References MLEXPORT.
| MLEXPORT void MLHostSetProgressCB | ( | void * | userData, |
| MLHostProgressCB * | callback ) |
Sets a callback to provide feedback of the host calculation progress.
References MLEXPORT.
| MLEXPORT void MLHostUpdateProgress | ( | const char * | info1, |
| const char * | info2 ) |
Calls the callback set MLHostSetProgressCB manually. This is used by the InventorWrapper module.
References MLEXPORT.
Connects connectors of input connector field inField with the connector of the output connector field outField and returns true (=1) if connection is successful, otherwise false (=0). Note that this connection is NOT a field connection and so notifications are not propagated through this connection. Only a data transfer connection is established. This is used for macro module connections. inField must be a non-NULL InputConnectorField pointer and outField must be a non-NULL OutputConnectorField pointer. Otherwise, ML_BAD_FIELD errors will occur and 0 will be returned.
| MLEXPORT void MLImageFreeTile | ( | void * | data | ) |
Frees the memory created/allocated by any of the functions MLImageGetTile*() or MLImageGetScaledTile*().
References MLEXPORT.
|
nodiscard |
| MLEXPORT MLErrorCode MLImageGetMaxValue | ( | mlField * | outField, |
| MLdouble * | maxValue ) |
| MLEXPORT MLErrorCode MLImageGetMinValue | ( | mlField * | outField, |
| MLdouble * | minValue ) |
| MLEXPORT MLErrorCode MLImageGetPageSize6D | ( | mlField * | outField, |
| int * | x, | ||
| int * | y, | ||
| int * | z, | ||
| int * | c, | ||
| int * | t, | ||
| int * | u ) |
Determines the page size of the image represented by output field outField. The return values are: x, y, z - the spacial resolution, c - the number of color channels, t - the number of time points, and u - the extent of an additional dimension for arbitrary purposes. On any failure, the result values are x=y=z=c=t=u=0. The return value will be ML_RESULT_OK on success and the corresponding error code otherwise.
|
nodiscard |
Exactly like MLImageGetScaledTile3D().
|
nodiscard |
Like MLImageGetScaledTile6D(), only for three dimensional regions (i.e., t=u=0 and nt=nt=1).
|
nodiscard |
Like MLImageGetScaledTile6D(), only for four dimensional regions (i.e., t=u=0 and nt=nt=1).
|
nodiscard |
Like MLImageGetTile6D(). The resulting memory can be scaled to another interval. It is assumed that the input image data range is from [ srcMin, srcMax ] and will be scaled to [ dstMin, dstMax ].
| MLEXPORT MLErrorCode MLImageGetSize | ( | mlField * | outField, |
| int * | x, | ||
| int * | y, | ||
| int * | z, | ||
| int * | c ) |
| MLEXPORT MLErrorCode MLImageGetSize6D | ( | mlField * | outField, |
| int * | x, | ||
| int * | y, | ||
| int * | z, | ||
| int * | c, | ||
| int * | t, | ||
| int * | u ) |
Determines the size of the image represented by output field outField. The return values are: x, y, z - the spacial resolution, c - the number of color channels, t - the number of time points, and u - the extent of an additional dimension for arbitrary purposes. On any failure, the result values are x=y=z=c=t=u=0. The return value will be ML_RESULT_OK on success and the corresponding error code otherwise.
|
nodiscard |
Exactly like MLImageGetTile3D().
|
nodiscard |
Like MLImageGetTile6D(), only for three dimensional regions (i.e., c=t=u=0 and nc=nt=nu=1).
|
nodiscard |
Like MLImageGetTile6D(), only for four dimensional regions (i.e., t=u=0 and nt=nt=1).
|
nodiscard |
Calculates a 6D rectangular region of the input image given by output field outField and returns a pointer to calculated data in *memory. outField must be a non-NULL pointer to a OutputConnectorField. Otherwise, a ML_BAD_FIELD error will occur, the call will be ignored and ML_BAD_FIELD will be returned. The origin coordinate of the region to be calculated is x, y, z, c, t, and u, the extents are nx, ny, nz, nc, nt, and nu, and the data type is specified by data type. Note that the specified region may reach outside the valid image ranges. The data calculated from those regions will be supplied normally in *memory, but the content will be undefined. If *memory is a NULL pointer, then the memory needed for the image region is allocated automatically and *memory is set to the memory area. It must be freed with the function MLImageFreeTile(). On successful operation ML_RESULT_OK is returned; otherwise, an error describing code.
| MLEXPORT MLErrorCode MLImageGetType | ( | mlField * | outField, |
| MLDataType * | dtype, | ||
| size_t * | dsize ) |
Determines the data type dtype and its size dsize in bytes of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and dtype and dsize will be undefined.
| MLEXPORT MLErrorCode MLImageGetVoxelToWorldMatrix | ( | mlField * | outField, |
| MLfloat | [16] ) |
| MLEXPORT MLErrorCode MLImageGetVoxelToWorldMatrixInDoubles | ( | mlField * | outField, |
| MLdouble | [16] ) |
| MLEXPORT MLErrorCode MLImageGetWorldToVoxelMatrix | ( | mlField * | outField, |
| MLfloat | [16] ) |
| MLEXPORT MLErrorCode MLImageGetWorldToVoxelMatrixInDoubles | ( | mlField * | outField, |
| MLdouble | [16] ) |
| MLEXPORT MLErrorCode MLImageMapVoxelToWorld | ( | mlField * | outField, |
| MLfloat | srcX, | ||
| MLfloat | srcY, | ||
| MLfloat | srcZ, | ||
| MLfloat * | dstX, | ||
| MLfloat * | dstY, | ||
| MLfloat * | dstZ ) |
Transforms the given position (srcX, srcY, scrZ) from voxel to world coordinates (dstX, dstY, dstZ) by using the transformation matrix of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and an error will be printed.
| MLEXPORT MLErrorCode MLImageMapVoxelToWorldInDoubles | ( | mlField * | outField, |
| MLdouble | srcX, | ||
| MLdouble | srcY, | ||
| MLdouble | srcZ, | ||
| MLdouble * | dstX, | ||
| MLdouble * | dstY, | ||
| MLdouble * | dstZ ) |
Transforms the given position (srcX, srcY, scrZ) from voxel to world coordinates (dstX, dstY, dstZ) by using the transformation matrix of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and an error will be printed.
| MLEXPORT MLErrorCode MLImageMapWorldToVoxel | ( | mlField * | outField, |
| MLfloat | srcX, | ||
| MLfloat | srcY, | ||
| MLfloat | srcZ, | ||
| MLfloat * | dstX, | ||
| MLfloat * | dstY, | ||
| MLfloat * | dstZ ) |
Transforms the given position (srcX, srcY, scrZ) from world to voxel coordinates (dstX, dstY, dstZ) by using the transformation matrix of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and an error will be printed.
| MLEXPORT MLErrorCode MLImageMapWorldToVoxelInDoubles | ( | mlField * | outField, |
| MLdouble | srcX, | ||
| MLdouble | srcY, | ||
| MLdouble | srcZ, | ||
| MLdouble * | dstX, | ||
| MLdouble * | dstY, | ||
| MLdouble * | dstZ ) |
Transforms the given position (srcX, srcY, scrZ) from world to voxel coordinates (dstX, dstY, dstZ) by using the transformation matrix of the image represented by the output field outField. On success, the return value will be ML_RESULT_OK. Otherwise, the return value will be the corresponding error code and an error will be printed.
Calls the C++ initialization of the ML. Must be called before any ML or mlAPI usage.
| majorVersion | Should always be ML_MAJOR_VERSION. |
| majorCAPIVersion | Should always be ML_MAJOR_CAPI_VERSION. |
| revCAPI | Should always be ML_CAPI_REVISION. |
Multiple calls are legal but will not change any previous initialization. Note that this call does not check C++-compatibility of the ML since this call is typically used by applications that only require C-API compatibility. C++-applications should also check MLIsCPPAPILinkCompatible for a non-0 return value.
References MLEXPORT.
This function returns true (=1) if an ML library is currently unloaded, otherwise false (=0).
References MLEXPORT.
Loads the given shared library. name must be a non-NULL pointer to a non-empty NULL terminated string. Otherwise, a fatal error will occur. On successful library load, true (=1) is returned; on error, false (=0) is returned. Any error will be posted to the ML error handler. As a side effect, the most recently loaded library name is updated to the library name (see Runtime::setRecentlyLoadedDllName for more information) and the initialization of the loaded library is called implicitly.
References MLEXPORT.
|
nodiscard |
Same as MLLoadLibraryWOErrorExt with libHandle=NULL.
References MLEXPORT.
|
nodiscard |
Loads the given shared library. name must be a non-NULL pointer to a non-empty NULL terminated string. Otherwise, a fatal error will occur.
Returns ML_RESULT_OK in case of successful library load or an error code describing the error (e.g., ML_LIBRARY_LOAD_ERROR if the library is not found or not linked).
As a side effect, the most recently loaded library name is updated to the library name (see Runtime::setRecentlyLoadedDllName for more information), and the initialization of the loaded library is called implicitly. Errors are posted only on invalid parameters, crashes on library initialization, but not if the library is not found or not loadable. This way, this library can be used to check for a library and to handle unloadable libraries without errors. If libHandle is passed as a NULL pointer, then it is ignored; otherwise, *libHandle is set to the return value of the library load function. It will be needed to unload the library with MLUnLoadLibrary.
References MLEXPORT.
Returns the field with name name of module. Returns 0 (NULL) if it does not exist. module must be a valid pointer to an ml::Module object and name must be a non-NULL pointer to a NULL-terminated non-empty string. Otherwise, it will be handled as a ML_BAD_PARAMETER error and 0 will be returned.
Returns the field with an index n from [0..getNumFields-1] of module if field exists; otherwise, 0 (NULL) is returned. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and 0 will be returned.
Returns the number of fields contained in module. module must be a valid pointer to an ml::Module object. Otherwise, it will be handled as a ML_BAD_PARAMETER error and 0 will be returned.
Sets the field with name fieldName of module to value value. module must be a valid pointer to an ml::Module object and fieldName and value must be pointers to NULL-terminated strings where fieldName also must must be non-empty. Otherwise, they will be handled as a ML_BAD_PARAMETER errors and call will be ignored.
If 0 is passed as on, message sending to std::cerr is disabled. Otherwise, all messages are printed to std::cerr.
References MLEXPORT.
If 0 is passed as on, message sending to std::cout is disabled. Otherwise, all messages are printed to std::cout.
References MLEXPORT.
This function allows to set the MLIsCurrentlyUnloadingLibrary state and returns the previously set unloading state. It may be used when library unloading is triggered by an external program instead of using MLUnLoadLibrary.
References MLEXPORT.
| MLEXPORT MLErrorCode MLSetMaxNumThreads | ( | MLuint32 | numThreads | ) |
Sets the number of parallel threads that the ML might use. Legal values for numThreads are positive numbers > 0, otherwise a ML_BAD_PARAMETER error will occur. If 1 is set, multithreading is disabled.
References MLEXPORT.
Returns a pointer to a NULL-terminated string containing the string name of the DLL probably containing the code and/or the init function of the class represented by type. type must be a non-NULL pointer to a valid mlRuntimeType object. Otherwise, a ML_BAD_PARAMETER error will occur and NULL is returned.
Returns a pointer to a NULL-terminated string containing the name of the parent class of that represented by type. A pointer to 'No parent' is returned if there is no such class. type must be a non-NULL pointer to a valid mlRuntimeType object. Otherwise, a ML_BAD_PARAMETER error will occur and NULL is returned.
Returns a pointer to the RuntimeType instance representing the type of the parent class of that represented by type. A NULL pointer is returned if there is no such class. type must be a non-NULL pointer to a valid RuntimeType object. Otherwise, a ML_BAD_PARAMETER error will occur and NULL is returned.
Returns true (=1) if runtime type type is derived from the parent class with the name given by parent. The return value is false (=0) if not, or on errors, or if any of type or parent is NULL (which is legal to pass to the call). The non-NULL type must be a pointer to a valid RuntimeType object and parent a pointer to a NULL-terminated string containing the name of the parent class.
|
nodiscard |
Unloads the given shared library. name must be a non-NULL pointer to a non-empty NULL terminated string. Otherwise, a fatal error will occur. Returns ML_RESULT_OK in case of successful library unload or an error code describing the error.
The libHandle parameter must be the corresponding library handle created by MLLoadLibraryWOErrorExt for successful operation. The responsibility for safe removal of the library is completely up to the application - the ML cannot check completely whether, for example, other libraries depend on the unloaded one. If errStr is passed as a non-NULL pointer, then it is set to a string describing the error. *errStr must always be freed with MLFree(). Note that detection of references is limited to ML type; it does not cover all possible link references, etc.
Note that library unloading has a number of side effects:
References MLEXPORT.