3.7. Module Handling

3.7.1. Module Context Menu

Right-click modules to open the module context menu. Its contents slightly depend on the module type. Available groups of entries:

Figure 3.12. Module Context Menu

Module Context Menu

3.7.1.1. Show Window

Figure 3.13. Module Context Menu — Show Window

Module Context Menu — Show Window

Each module has at least one panel, the automatic panel which is a list of all fields and parameters of the module. Use it for an overview or for editing the parameters (see also Section 10.1, “Fields”).

[Tip]Tip

Refer to chapter Section 23.3, “Module and Network Handling — Shortcuts and Tricks (All Platforms)” for a shortcut for opening a module's automatic panel.

Figure 3.14. Automatic Panel

Automatic Panel

The automatic panel lists all fields of the module in order of their initialization in the C++ code. It also shows the data type of the field, whether it is an input or output field, and its current value. The value can be edited directly on the automatic panel.

Typically, another type of panel is also available, which shows the parameter fields in a layouted style. It is written in MDL. Important points:

  • It is possible to add fields that are not in the C++ code.

  • It is possible to add field listeners that can trigger script code.

  • It is possible to keep rarely used fields out of the layouted panel. This way, the panel usability might be enhanced. (Fields can always be edited in the automatic panel.)

Figure 3.15. Panel Defined in MDL

Panel Defined in MDL

Other windows may be available. For example, for the View2D module, a Viewer and a Settings window are available. For information on defining windows, see the MDL Reference, chapter 1.3.2.1. Window. For an example, see the Getting Started, chapter Adding the Macro Parameters and Panel.

3.7.1.2. Edit Instance Name

Figure 3.16. Module Context Menu — Edit Instance Name

Module Context Menu — Edit Instance Name

This option allows distinguishing several instances of the same module. Within a network, each module instance must have a unique name. If no specific instance name is given, the copies of the modules are numbered automatically (1, 2...). Alternatively, the instance can be renamed manually.

[Note]Note

Instances of modules have to be unique because modules are addressed by their instance names in scripting.

Select the option or use the respective shortcut (see Chapter 23, Shortcuts) to open a dialog for entering a new instance name.

The instance name is displayed above the module name. If the module instances are numbered, only the instance name is displayed, since it includes the module name.

Figure 3.17. Modules and Instance Names

Modules and Instance Names

3.7.1.3. Help Entries

Figure 3.18. Module Context Menu — Help

Module Context Menu — Help

Show Example Network

Opens the example network in a new network tab. Only active if an example network exists (otherwise the entry is greyed out).

Show Help

Displays the HTML help file for the module in the default browser. Only active if a help file exists.

Edit Help

Edits the mhelp file in MATE. Use this option if fields have changed (renamed, new fields, removed fields) or if the module is new.

3.7.1.4. Reload Definition

Reloads the module definition (.def file). This is necessary when layouting panels and windows or when working on the scripting.

[Tip]Tip

A single selected module can also be reloaded by pressing the according shortcut key for the OS. Refer to Section 23.1, “Shortcuts on Windows and Linux/KDE” and Section 23.2, “Shortcuts under Mac OS X”.

If modules are being reloaded, an animation (module turns white and slowing gains its color back) indicates that the modules' defintions are indeed being reloaded.

3.7.1.5. Debugging

Figure 3.19. Module Context Menu — Debugging

Module Context Menu — Debugging

In the Debugging submenu, helpful options are available.

Show Scripting Console

Opens the Scripting Console for scripting in the context of the current module, see Section 18.1, “Scripting”.

Run Tests

Starts the TestCenter for the module. Test cases associated with the module(s) are listed here. In case of WEMIsoSurface, only the two generic test cases “Formal” and “Meta” associated with all modules are available. When Finish is clicked, the test cases are run and test reports are available. (See also Section 4.6.4, “Run Module Tests”, the TestCenter Reference, and the Getting Started, chapter 16, Using the TestCenter.)

Figure 3.20. Run Tests — Test Selection

Run Tests — Test Selection

Figure 3.21. Run Module Tests — Reports

Run Module Tests — Reports

Show DLL Dependency (Windows only; not for macro modules)

This option uses the Dependency Walker for checking and displaying all dependencies for the module. For more information, please refer to the help of the Dependency Walker.

Figure 3.22. Show DLL Dependency

Show DLL Dependency

3.7.1.6. Related Files

Figure 3.23. Module Context Menu — Related Files

Module Context Menu — Related Files

Related Files: Lists all files belonging to the module. Possible file types are .def/.script (MDL definition files), .vcproj (VC++ project files on Windows), .mhelp/.html (uncompiled/compiled help file) and .py / .js (scripting files). Select a file to open it in the default editor (as set in Section 4.3.4, “Preferences — Supportive Programs”).

Show Enclosing Folder: Opens the main folder of the module, which contains the .def file.

3.7.1.7. Groups

For the Groups functions, see Section 3.9, “Using Groups”.

3.7.1.8. Add Selection to Snippets List

Adds the selected module(s) to the Snippet List, see Chapter 20, Snippets List.

3.7.2. Additional Inputs

Modules may have more inputs and outputs than visible at first, to keep the module display as uncluttered as possible. An example for a module with possibly hidden inputs is the View3D module. It offers the additional context menu entry View3D OptionsShow Inventor Inputs. If selected (default), three Inventor input fields are displayed. The option can also be selected in the Settings panel.

Figure 3.24. View3D With Visible Inventor Inputs (Default)

View3D With Visible Inventor Inputs (Default)

Figure 3.25. View3D With Hidden Inventor Inputs

View3D With Hidden Inventor Inputs

[Tip]Tip

The three Inventor inputs of View3D have certain positions in the scene rendering, i.e. the first input is before LUT and volume renderer, the second between LUT and volume renderer and the third after LUT and volume renderer. This can be seen when the Inventor inputs are displayed and the internal network is opened, see next paragraph.

Depending on the programming, the number of inputs may be unlimited. For example, this is the case for the Switch module.

3.7.3. Show Internal Network (Macro Modules)

In the context menu of macro modules, the option Show Internal Network is available. If selected, the network of the macro is opened on another network tab.

[Tip]Tip

Refer to chapter Section 23.3, “Module and Network Handling — Shortcuts and Tricks (All Platforms)” for a shortcut to open a macro's internal network.

Figure 3.26. RegionGrowingMacro — Internal Network

RegionGrowingMacro — Internal Network

The pseudo-connectors shaded in grey are placeholders and indicate the input (bottom) and output (top) parameters of the macro, which constitute the connectors of the macro module. They are automatically drawn at the edges of the bounding box of the network. Important points about them:

  • They cannot be moved or removed interactively but can only be changed in the script.

  • They cannot be selected in a rectangle but each of them can be clicked, in which case the input/output square, the connection(s), and the connected module(s) are highlighted.

[Note]Note

Modules in an internal network of a macro that are connected to the macro's input / output fields (visualized by being connected to the pseudo-connectors) cannot be removed interactively from the network.

On an attempt to remove such a module, a window with a warning pops up. If such a module needs to be removed, the according connection needs to be removed in the scripting and the macro reloaded first.

If the macro module only has inputs, only those are drawn. An example for inputs only are the View2D and View3D modules.

[Note]Note

The tab of the internal network remains connected to the module from which it was opened. When the module is deleted or its network closed, the internal network is also closed.