29.2. Naming Conventions

The following spelling schemes are used:

29.2.1. Code

  • (!) 02.01.01: Class names: UpperCamelCase

  • (!) 02.01.02: Typedefs: UpperCamelCase or lowerCamelCase

  • (!) 02.01.03: Defines: ALL_UPPER_CASE

  • (!) 02.01.04: Enum values: UpperCamelCase or ALL_UPPER_CASE

  • (!) 02.01.05: Methods, functions, variables: lowerCamelCase

  • (!) 02.01.06: Private and protected member variables are preceded by an underscore ("_")

  • (+) 02.01.08: Use an underscore prefix ("_") for methods, macros and variables that are "semantically private", i.e. are meant for internal usage by the class and not as part of the class interface.

  • (+) 02.01.09: Use common speaking names for methods:

    • get/set for methods that get/set member variables/states.

    • Instead of get, the alternative of using just the variable name as method name is allowed (as in Qt).

    • is/has/are/should to access boolean states depending on the context.

    • Only use common abbreviations, keep the code readable to others, don't be creative here.

29.2.2. Files

  • (!) 02.02.01: Do not use umlauts, whitespace or other uncommon characters in file or directory names.

  • (!) 02.02.02: Use identical upper/lower case spelling in header and source files.

  • (!) 02.02.03: Use "/" instead of "\" as path separator in include statements.

  • (!) 02.02.04: Use "ml" prefix for everything that links to the ML.

  • (+) 02.02.05: Upper and lower case prefixes: Use the lower case prefix "ml" for all C/C++ files (for example mlMyModule.h) and the upper case prefix "ML" for the rest (for example .bat, .dll, .def, etc.) and for directory names.

29.2.3. MeVisLab/ML Identifiers

  • (!) 02.03.01: Field variables: lowerCamelCase with "Fld" at the end (register field names without "Fld").

  • (!) 02.03.02: Enum item tokens: ALL_UPPER_CASE in Inventor fields, UpperCamelCase in other fields

  • (!) 02.03.03: Module input/output fields: Prefix "in"/"out" (not "input" or "output").

  • (+) 02.03.04: Recommended names for input/output fields:

    • inImage, inObject, inMask, inLabel, inMarker, ...

    • outImage, outObject, ...

    • outNode for Inventor outputs, possibly outViewNode, outEditNode, ...

  • (+) 02.03.05: Apply and Update: o Use Apply for the action of applying modifications made through a module's UI (parameter fields) o Use Update for the action of updating a result from a modified input object (for example input image).

  • (+) 02.03.06: Auto-Apply/Update: If appropriate, provide boolean fields autoApply and enum fields updateMode with items "Off", "AutoClear" and "AutoUpdate".

29.2.4. MDL Layout

  • (!) 02.04.01: Field titles: Use "Headline Spelling", i.e. upper case at beginning and new words (except for words as "in", "and", etc.), words separated by spaces. Add a trailing colon (":").

  • (!) 02.04.02: CheckBox labels: Use correct orthographic spelling, i.e. upper case only at the beginning, words separated by spaces. No trailing colon.

  • (!) 02.04.03: Box, tabs and other grouping labels: Same as field titles ("Headline Spelling"), but no trailing colon.

  • (+) 02.04.04: Use "CheckBox" instead of "Field" controls for boolean fields.

  • (+) 02.04.05: Avoid inconsistencies between UI labels and field names. Let MeVisLab generate the UI label from the field name, or at least choose a label that is close to the field name.