Wednesday, September 30, 2009

New Layout

New options for docking the widget: either Dock Widgets or Tool Box Widgets. Users can use Settings menu to change the default view.

Changes to the Parts/Connections Catalog: Tabbed View (shown above) or the normal Tree View. Settings menu has the option to flip between the two.

Sunday, September 27, 2009

C API : Callback functions

The C API now provides a way for C programs to respond to changes in the model. The following code will set "f" as a callback function:

void f();

void tc_main()
tc_callback( f );

The callback function will be triggered whenever the dataChanged() signal is emitted, which indicates that one of the following has occurred: items inserted or deleted, some table value has changed, an item has been renamed.

Wednesday, September 23, 2009

Plug-in-able Plot Window

The PlotTool class, which is the default plotting window in TinkerCell, has been modified to accept a variety of PlotWidgets. The current set of PlotWidgets include:

Plot2DWidget -- for drawing normal 2D graphs using Qwt
Plot3DWidget -- for drawing 3D surface plots using Qwt3D
PlotTextWidget -- for displaying information as text

All of the above classes inherit from PlotWidget

PlotWidget requires that each subclass define a data() method, which returns the current data shown in the graph. The PlotTool also requests the current PlotWidget to export the data in one of many formats (given as a string argument). The PlotWidget class will take care of exporting data as text, but it will handle any of the other export types.

Adding new plot types requires defining a new class that inherits from PlotWidget and overriding the data() and the exportData() methods. The PlotTool may need to be modified in order to add functions specific for plotting using the new widget. Each PlotWidget also comes with its own toolbar (variable names toolBar). This is automatically loaded by the PlotTool whenever a new PlotWidget is selected.