| Customize Help
| Save Settings

MmodRestore



Function Map
Synopsis
Restore a Model Finder context from disk.
Syntax
MIL_ID MmodRestore(
MIL_CONST_TEXT_PTR FileName, //in
MIL_ID SystemId, //in
MIL_INT64 ControlFlag, //in
MIL_ID *ContextIdPtr //out
)
Description

This function restores a Model Finder context that was previously saved to a file, using MmodSave() or MmodStream(). This function restores all of the Model Finder context's settings that were in effect when the Model Finder context was saved. A restored Model Finder context is not preprocessed, therefore you must call MmodPreprocess() before performing a search with MmodFind().

If you had associated camera calibration contexts with the models in your Model Finder context and you did not save them with the context, you must re-associate the camera calibration contexts, using MmodControl() with M_ASSOCIATED_CALIBRATION. Moreover, if you had previously set drawing control types, using MgraControl() with M_DRAW_..., then you must reset them since they were not saved with the context.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
FileName

Specifies the name and path of the file from which to restore the Model Finder context. The function handles (internally) the opening and closing of the file.

This parameter can be set to one of the following:

function map For specifying the file name and path
Click to summarizeValue Description
Click to summarize M_INTERACTIVE
[This is only applicable to Windows]

Opens the File Open dialog box from which you can interactively specify the drive, directory, and name of the file.

Click to summarize MIL_TEXT("FileName") 1

Specifies the drive, directory, and name of the file (for example, "C:\mydirectory\myfile"). Typically, Model Finder context files have an MMF extension.

To specify a file on a remote computer (under Distributed MIL), prefix the specified file name string with "remote:///" (for example, "remote:///C:\mydirectory\myfile").

(summarize)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

SystemId

Specifies the system on which to restore the Model Finder context.

This parameter should be set to one of the following values:

function map For specifying the system identifier
Click to summarizeValue Description
Click to summarize M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

Click to summarize MIL system identifier

Specifies a valid system identifier, previously allocated using MsysAlloc().

ControlFlag

Specifies whether to restore, from the Model Finder context, the camera calibration contexts associated with the models.

function map For specifying whether to restore the camera calibration contexts associated with the models
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies that the camera calibration contexts are not restored.

Click to summarize M_WITH_CALIBRATION

Specifies that the camera calibration contexts are restored. In this case, the camera calibration contexts must have been previously saved with the context, using MmodSave() or MmodStream() with M_WITH_CALIBRATION. Note that the camera calibration contexts associated with synthetic models are not saved or restored.

The camera calibration information is restored from the same file as the Model Finder context. The camera calibration cannot be managed independently from the Model Finder context. When the Model Finder context is freed, the camera calibration is automatically freed as well.

(summarize)
ContextIdPtr

Specifies the address of the variable in which to write the Model Finder context identifier. Since this function also returns the Model Finder context identifier, you can set this parameter to M_NULL. If allocation fails, M_NULL is written as the identifier.

Return value
The returned value is the Model Finder context identifier. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib; milmod.lib.
DLL Requires mil.dll; milmod.dll.
INTERACTIVE DEFAULT HOST DEFAULT WITH CALIBRATION