[Smtk-developers] Operators, debugging, and logs
David Thompson
david.thompson at kitware.com
Thu Oct 6 17:26:04 EDT 2016
Hi SMTK devs,
I am writing to let you know about some recent changes to model operators that may be of interest:
1. The base operator now includes a protected ivar named m_debugLevel . It is 0 by default. You may set it in the debugger and/or at the top of your operator's operateInternal() method, then use it during an operation to output additional information. If people are interested, it should also be possible to expose the debug level as an advanced item in the base operator attribute so that debugging can be turned on/off from the ModelBuilder UI on a per-operator basis.
2. The model manager owns an instance of smtk::io::Logger, available via log(). ModelBuilder now displays all messages added to the log from the moment the operation starts until the result of the operation. This is great for providing feedback to users via smtkErrorMacro, smtkWarningMacro, smtkDebugMacro, and smtkInfoMacro.
3. The base Operator class now has a virtual generateSummary() method that generates a log message from the operator's outcome. You may override it to provide information specific to your operation. With the change above, ModelBuilder now provides feedback to the user for each operation performed.
David
More information about the Smtk-developers
mailing list