Thursday, December 3, 2009

Changes to module implementation

The Module Tool originally used the merge items option from the Core library in order to merge two connected items. Upon deletion, the command was undone. The problem was during copy/paste, because the original handle was hidden, so it would not get copied. Since this was creating a complicated situation, I opted to change the direction entirely:

Now, the ModuleTool does not merge any items. Instead, it just provides the visual connections and interface. It also provides a very important function:

connectedItems( list of graphics items, list of handles, list of handles )

The above function searches the list of graphics items and fills in the two other lists provided in the argument (so those are outputs). The two lists will contain the set of nodes that are replaced and the set of new nodes that replace the old ones. Other tools use this information when generating the model. So, the responsibility of modular deconstruction has been shifted to the other tools instead of a single tool.

For example, the getRates function in StoichiometryTool does the following:
QList from, to;
ModuleTool::connectedItems(handles, from,to);

for each rate

A summary of the tool categories and their dependencies ( right side = more dependent)

No comments: