ML Reference
MeVis/Foundation/Sources/ML/include/mlAPI.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //-----------------------------------------------------------------------------------
00016 //-----------------------------------------------------------------------------------
00017 
00018 #ifdef WIN32
00019   #include "mlSystemWarningsDisable.h"
00020   #include <windows.h>
00021   #include "mlSystemWarningsRestore.h"
00022 #endif
00023 
00024 // Attention: All includes must be pure C!
00025 
00027 #ifndef ML_DISABLE_CPP
00028 #define ML_DISABLE_CPP
00029 #endif
00030 
00032 #ifndef __mlInitSystemML_H_PURE_C
00033 #include "mlInitSystemML.h"
00034 #endif
00035 
00037 #undef ML_DISABLE_CPP
00038 
00040 #ifndef __mlUtilsAPI_H_PURE_C
00041 #include "mlUtilsAPI.h"
00042 #endif
00043 
00045 #ifndef __mlVersion_H
00046 #include "mlVersion.h"
00047 #endif
00048 
00049 
00050 //-----------------------------------------------------------------------------------
00052 
00053 //-----------------------------------------------------------------------------------
00055 #define mlField  void
00056 
00058 #define mlSensor void
00059 
00061 #define mlModule void
00062 
00064 #define mlBase   void
00065 
00067 #define mlType   void
00068 
00069 #ifdef WIN32
00070 
00071 
00072   typedef HMODULE MLLibraryHandle;
00073 #else
00074 
00075   typedef void*   MLLibraryHandle;
00076 #endif
00077 
00078 
00080 
00081 #ifdef __cplusplus
00082 extern "C" {
00083 #endif
00084 
00085 
00086 //-----------------------------------------------------------------------------------
00088 
00089 //-----------------------------------------------------------------------------------
00106 MLEXPORT MLint32     MLInit(MLint32 majorVersion, MLint32 majorCAPIVersion, MLint32 revCAPI);
00107 
00111 MLEXPORT MLint32     MLDestroy();
00112 
00114 MLEXPORT void        MLHostSetProgressCB(void* userData, MLHostProgressCB* callback);
00115 
00118 MLEXPORT void        MLHostUpdateProgress(const char* info1, const char* info2);
00119 
00121 MLEXPORT void        MLHostSetBreakCheckCB(void* userData, MLHostBreakCheckCB* callback);
00123 
00124 //-----------------------------------------------------------------------------------
00126 
00127 //-----------------------------------------------------------------------------------
00147 MLEXPORT MLErrorCode MLLoadLibraryWOErrorExt(const char* name, MLLibraryHandle* libHandle) ML_RETURN_VALUE_SHOULD_BE_USED;
00148 
00150 MLEXPORT MLErrorCode MLLoadLibraryWOError(const char* name) ML_RETURN_VALUE_SHOULD_BE_USED;
00151 
00159 MLEXPORT MLint32     MLLoadLibrary(const char* name);
00160 
00163 MLEXPORT MLuint32    MLIsCurrentlyUnloadingLibrary();
00164 
00168 MLEXPORT MLuint32    MLSetIsCurrentlyUnloadingLibrary(MLuint32 enable);
00169 
00202 MLEXPORT MLErrorCode MLUnLoadLibrary(const char* name,
00203                                      MLLibraryHandle libHandle,
00204                                      char** errStr) ML_RETURN_VALUE_SHOULD_BE_USED;
00205 
00207 
00208 
00209 
00210 //-----------------------------------------------------------------------------------
00212 
00213 //-----------------------------------------------------------------------------------
00217 MLEXPORT mlModule*   MLCreateModuleFromName(const char* className);
00218 
00221 MLEXPORT void        MLDeleteModule(mlModule* module);
00222 
00228 MLEXPORT MLint32     MLBaseIsDerivedFrom(mlBase* base, const char* superClassName);
00229 
00232 MLEXPORT const char* MLBaseGetType(mlBase* base);
00233 
00236 MLEXPORT mlType*     MLBaseGetTypeObject(mlBase* base);
00237 
00241 MLEXPORT const char* MLBaseGetParentType(mlBase* base);
00242 
00244 MLEXPORT mlType*     MLRuntimeGetFirstModuleType();
00245 
00247 MLEXPORT mlType*     MLRuntimeGetNextModuleType();
00248 
00252 MLEXPORT mlModule*   MLCreateModuleFromType(mlType* type);
00253 
00255 MLEXPORT mlType*     MLTypeFromName(const char* name);
00256 
00260 MLEXPORT MLint32     MLTypeIsAbstract(mlType* type);
00261 
00266 MLEXPORT const char* MLTypeGetName(mlType* type);
00267 
00272 MLEXPORT const char* MLTypeGetDllName(mlType* type);
00273 
00279 MLEXPORT const char* MLTypeGetParentName(mlType* type);
00280 
00285 MLEXPORT mlType*     MLTypeGetParentType(mlType* type);
00286 
00293 MLEXPORT MLint32     MLTypeIsDerivedFrom(mlType* type, const char* parent);
00295 
00296 
00297 
00298 //-----------------------------------------------------------------------------------
00300 
00301 //-----------------------------------------------------------------------------------
00307 MLEXPORT mlField*    MLModuleGetField(mlModule* module, const char* name);
00308 
00312 MLEXPORT size_t      MLModuleGetNumFields(mlModule* module);
00313 
00318 MLEXPORT mlField*    MLModuleGetIndexedField(mlModule* module, MLint32 n);
00319 
00325 MLEXPORT void        MLModuleSetFieldValue(mlModule* module, char* fieldName, char* value);
00327 
00328 
00329 
00330 //-----------------------------------------------------------------------------------
00332 
00333 //-----------------------------------------------------------------------------------
00338 MLEXPORT void        MLBeginLoadFields(mlModule* module);
00339 
00344 MLEXPORT void        MLEndLoadFields(mlModule* module);
00345 
00350 MLEXPORT void        MLBeginSaveFields(mlModule* module);
00351 
00356 MLEXPORT void        MLEndSaveFields(mlModule* module);
00358 
00359 
00360 
00361 //-----------------------------------------------------------------------------------
00363 
00364 //-----------------------------------------------------------------------------------
00366 MLEXPORT const char* MLFieldGetName(mlField* field);
00367 
00369 MLEXPORT const char* MLFieldGetType(mlField* field);
00370 
00372 MLEXPORT void        MLFieldSetValue(mlField* field, const char* value);
00373 
00375 MLEXPORT MLint32     MLFieldGetValueSize(mlField* field);
00376 
00380 MLEXPORT MLint32     MLFieldGetValue(mlField* field, char* value, MLint32 bufferSize);
00381 
00385 MLEXPORT void        MLFieldSetFloatValue(mlField* field, MLfloat value);
00386 
00390 MLEXPORT MLfloat     MLFieldGetFloatValue(mlField* field);
00391 
00395 MLEXPORT void        MLFieldSetDoubleValue(mlField* field, MLdouble value);
00396 
00400 MLEXPORT MLdouble    MLFieldGetDoubleValue(mlField* field);
00401 
00405 MLEXPORT void        MLFieldSetIntValue(mlField* field, MLint32 value);
00406 
00413 MLEXPORT void        MLFieldSetIntValue64(mlField* field, MLint64 value);
00414 
00418 MLEXPORT MLint32     MLFieldGetIntValue(mlField* field);
00419 
00426 MLEXPORT MLint64     MLFieldGetIntValue64(mlField* field);
00428 
00429 
00430 
00431 //-----------------------------------------------------------------------------------
00433 
00434 //-----------------------------------------------------------------------------------
00438 MLEXPORT int       MLFieldGetEnumValue(mlField* field);
00439 
00443 MLEXPORT void      MLFieldSetEnumValue(mlField* field, int val);
00444 
00448 MLEXPORT size_t    MLFieldGetNumEnums(mlField* field);
00449 
00454 MLEXPORT const char* MLFieldGetEnumName(mlField* field, MLint32 i, int* value);
00456 
00457 
00458 
00459 //-----------------------------------------------------------------------------------
00461 
00462 //-----------------------------------------------------------------------------------
00475 MLEXPORT MLint32 MLFieldConnectFrom(mlField* inField, mlField* outField);
00476 
00486 MLEXPORT MLint32 MLImageFieldConnectFromNoNotify(mlField* inField, mlField* outField);
00487 
00492 MLEXPORT void  MLFieldDisconnect(mlField* inField);
00493 
00497 MLEXPORT void  MLFieldTouch(mlField* field);
00499 
00500 
00501 
00502 //-----------------------------------------------------------------------------------
00504 
00505 //-----------------------------------------------------------------------------------
00520 MLEXPORT MLErrorCode MLImageGetTile6D(mlField* outField, void** memory,
00521                                       int x,  int y,  int z,  int c,  int t,  int u, 
00522                                       int nx, int ny, int nz, int nc, int nt, int nu, 
00523                                       MLDataType datatype) ML_RETURN_VALUE_SHOULD_BE_USED;
00524 
00525   
00527 MLEXPORT MLErrorCode MLImageGetTile4D(mlField* outField, void** memory,
00528                                       int x,  int y,  int z,  int c, 
00529                                       int nx, int ny, int nz, int nc, 
00530                                       MLDataType datatype) ML_RETURN_VALUE_SHOULD_BE_USED;
00531   
00532 
00534 MLEXPORT MLErrorCode MLImageGetTile3D(mlField* outField, void** memory,
00535                                       int x,  int y,  int z, 
00536                                       int nx, int ny, int nz, 
00537                                       MLDataType datatype) ML_RETURN_VALUE_SHOULD_BE_USED;
00538   
00539 
00541 MLEXPORT MLErrorCode MLImageGetTile(mlField* outField, void** memory,
00542                                     int x,  int y,  int z, 
00543                                     int nx, int ny, int nz, 
00544                                     MLDataType datatype) ML_RETURN_VALUE_SHOULD_BE_USED;
00545   
00546 
00547 
00551 MLEXPORT MLErrorCode MLImageGetScaledTile6D(mlField* outField, void** memory,
00552                                             int x,  int y,  int z,  int c,  int t,  int u, 
00553                                             int nx, int ny, int nz, int nc, int nt, int nu, 
00554                                             MLDataType datatype,
00555                                             MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax) ML_RETURN_VALUE_SHOULD_BE_USED;
00556 
00557 
00559 MLEXPORT MLErrorCode MLImageGetScaledTile4D(mlField* outField, void** memory,
00560                                             int x,  int y,  int z,  int c,  
00561                                             int nx, int ny, int nz, int nc, 
00562                                             MLDataType datatype,
00563                                             MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax) ML_RETURN_VALUE_SHOULD_BE_USED;
00564  
00565 
00567 MLEXPORT MLErrorCode MLImageGetScaledTile3D(mlField* outField, void** memory,
00568                                             int x,  int y,  int z,  
00569                                             int nx, int ny, int nz, 
00570                                             MLDataType datatype,
00571                                             MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax) ML_RETURN_VALUE_SHOULD_BE_USED;
00572 
00573 
00575 MLEXPORT MLErrorCode MLImageGetScaledTile(mlField* outField, void** memory,
00576                                           int x,  int y,  int z,  
00577                                           int nx, int ny, int nz, 
00578                                           MLDataType datatype,
00579                                           MLdouble srcMin, MLdouble srcMax, MLdouble dstMin, MLdouble dstMax) ML_RETURN_VALUE_SHOULD_BE_USED;
00580 
00583 MLEXPORT void  MLImageFreeTile(void *data);
00585 
00586 
00587 //-----------------------------------------------------------------------------------
00589 
00590 //-----------------------------------------------------------------------------------
00591 
00593 MLEXPORT MLuint64 MLCacheGetCurrentSizeKB();
00594 
00597 MLEXPORT MLuint64 MLCacheGetMaxSizeKB();
00598 
00601 MLEXPORT void  MLCacheSetMaxSizeKB(MLuint64 size);
00602 
00608 MLEXPORT MLErrorCode MLClearPagesAndMemoryImg(mlField* outField);
00609 
00615 MLEXPORT MLErrorCode MLClearPages(mlField* outField);
00616 
00622 MLEXPORT MLErrorCode MLClearMemoryImg(mlField* outField);
00623 
00628 MLEXPORT MLErrorCode MLGetPageMemorySize(mlField* outField, size_t* numBytes);
00629 
00634 MLEXPORT MLErrorCode MLGetMemoryImgSize(mlField* outField, size_t *numBytes);
00635 
00637 MLEXPORT void MLClearCache();
00639 
00640 
00641 
00642 
00643 //-----------------------------------------------------------------------------------
00645 
00646 //-----------------------------------------------------------------------------------
00650 MLEXPORT MLErrorCode MLGetImageState(mlField* outField) ML_RETURN_VALUE_SHOULD_BE_USED;
00651 
00660 MLEXPORT const char* MLGetImageStateString(mlField* outField) ML_RETURN_VALUE_SHOULD_BE_USED;
00661 
00670 MLEXPORT MLErrorCode MLImageGetSize6D(mlField* outField, int *x, int *y, int *z, int *c, int *t, int *u);
00671 
00680 MLEXPORT MLErrorCode MLImageGetPageSize6D(mlField* outField, int *x, int *y, int *z, int *c, int *t, int *u);
00681 
00682 
00684 MLEXPORT MLErrorCode MLImageGetSize(mlField* outField, int *x, int *y, int *z, int *c);
00685 
00690 MLEXPORT MLErrorCode MLImageGetType(mlField* outField, MLDataType* dtype, size_t* dsize);
00691 
00696 MLEXPORT MLErrorCode MLImageGetVoxelSize(mlField* outField, MLfloat *x, MLfloat *y, MLfloat *z);
00697 
00700 MLEXPORT MLErrorCode MLImageGetFirstImagePropertyExtensionByType(mlField*    outField,
00701                                                                  const char* imagePropertyTypeClassName,
00702                                                                  void**      imagePropertyExtension) ML_RETURN_VALUE_SHOULD_BE_USED;
00703 
00705 MLEXPORT MLErrorCode MLImageGetMinValue(mlField* outField, MLdouble* minValue);
00706 
00708 MLEXPORT MLErrorCode MLImageGetMaxValue(mlField* outField, MLdouble* maxValue);
00709 
00711 MLEXPORT MLErrorCode MLImageGetVoxelToWorldMatrix(mlField* outField, MLfloat [16]);
00712 
00714 MLEXPORT MLErrorCode MLImageGetWorldToVoxelMatrix(mlField* outField, MLfloat [16]);
00715 
00721 MLEXPORT MLErrorCode MLImageMapVoxelToWorld(mlField* outField, MLfloat srcX, MLfloat srcY, MLfloat srcZ, 
00722                                             MLfloat *dstX, MLfloat *dstY, MLfloat *dstZ);
00723 
00729 MLEXPORT MLErrorCode MLImageMapWorldToVoxel(mlField* outField, MLfloat srcX, MLfloat srcY, MLfloat srcZ, 
00730                                             MLfloat *dstX, MLfloat *dstY, MLfloat *dstZ);
00732 
00733 
00734 
00735 //-----------------------------------------------------------------------------------
00737 
00738 //-----------------------------------------------------------------------------------
00739 
00744 MLEXPORT char* MLBaseFieldGetPersistentState(mlField* baseField);
00745 
00748 MLEXPORT void  MLBaseFieldSetPersistentState(mlField* baseField, const char* state);
00749 
00753 MLEXPORT void  MLBaseFieldClearPersistentState(mlField* baseField, char* state);
00754 
00757 MLEXPORT void* MLBaseFieldGetPtr(mlField* field);
00758 
00761 MLEXPORT void  MLBaseFieldSetPtr(mlField* baseField, const void *value);
00763 
00764 
00765 
00766 //-----------------------------------------------------------------------------------
00768 
00769 //-----------------------------------------------------------------------------------
00770 
00774 MLEXPORT void* MLSoNodeFieldGetPtr(mlField* field);
00775 
00780 MLEXPORT void  MLSoNodeFieldSetPtr(mlField* field, const void* value);
00781 
00782 
00786 MLEXPORT void* MLPointerFieldGetPtr(mlField* field);
00787 
00792 MLEXPORT void  MLPointerFieldSetPtr(mlField* field, const void* value);
00793 
00795 
00796 
00797 
00798 //-----------------------------------------------------------------------------------
00800 
00801 //-----------------------------------------------------------------------------------
00807 MLEXPORT mlSensor* MLCreateFieldSensor(void* userData, MLSensorCB* callback);
00808 
00813 MLEXPORT void  MLDeleteFieldSensor(mlSensor* sensor);
00814 
00818 MLEXPORT mlField* MLFieldSensorGetField(mlSensor* sensor);
00819 
00825 MLEXPORT void  MLFieldSensorAttach(mlSensor* sensor, mlField* field);
00826 
00831 MLEXPORT void  MLFieldSensorDetach(mlSensor* sensor);
00833 
00834 
00835 //---------------------------------------------------------------------------------------------
00837 
00838 //---------------------------------------------------------------------------------------------
00841 MLEXPORT MLint32       MLAreMessagesSentToCout();
00842 
00845 MLEXPORT void          MLSendMessagesToCout(MLint32 on);
00846 
00849 MLEXPORT MLint32       MLAreMessagesSentToCerr();
00850 
00853 MLEXPORT void          MLSendMessagesToCerr(MLint32 on);
00855 
00856 
00857 //-----------------------------------------------------------------------------------
00859 
00860 //-----------------------------------------------------------------------------------
00864 MLEXPORT MLErrorCode   MLSetMaxNumThreads(MLuint32 numThreads);
00865 
00868 MLEXPORT MLuint32      MLGetMaxNumThreads();
00870 
00871 
00872 //-----------------------------------------------------------------------------------
00874 
00875 //-----------------------------------------------------------------------------------
00880 MLEXPORT MLErrorCode   MLPushState(MLint32 readEnvVars) ML_RETURN_VALUE_SHOULD_BE_USED;
00881 
00884 MLEXPORT MLErrorCode   MLPopState();
00886 
00887 
00888 #ifdef __cplusplus
00889 }
00890 #endif
00891 
00892 
00893