Guido Ranzuglia - 2009-09-01

Hi,
it's time to great changes in MeshLab code. The first one is related with a totally new way of define filters' parameters. The old FilterParameter and FilterParameterSet classes has been removed replaced by a bunch of totally new classes . The underline structure is not so easy to explain in a few word (probably in the next few days i will add a page in the wiki doc with the details...) but i tried to mantain an end-user interface as easy as possibile.
Instead of FilterParameter and FilterParameter you will find RichParameter (and all the derived classes i.e. RichInt, RichBool etc.) and RichParameterSet.

Suppose you have to add an "int widget" to a MeshLab filters' GUI.
In the previous version of MeshLab sdk you had to write something like:

void initParameterSet(QAction *filter,MeshDocument &md, FilterParameterSet &parlist)
{
..
parlist.addInt("Parameter Name",defaultvalue,"Parameter Description","Parameter Tooltip");
..
parlist.setInt("Parameter Name",1);
..
}

now you will write:

void initParameterSet(QAction filter,MeshDocument &md, RichParameterSet &parlist)
{
..
parlist.addParam(new RichInt("Parameter Name",defaultvalue,"Parameter Description","Parameter Tooltip"));
..
RichParameter
intparam = parlist.at[0];
intparam->set(new IntValue(1));
..
}

WARNING: you shouldn't delete nothing!!! the framework will delete all the added parameters and values for you!

Good News for almost all the developers. For the plugins "officially" ("officially" means that your plugin is present not commented in file meshlabpluginsv12.pro) included in meshlab v.1.2, I updated all the code for you. The others should make the few changes needed.

PS in the previous code there were some parameter's widgets unused by plugins' developers (for instance Matrix44fWidget...). This widgets in the new version but NOT fully implemented. If you try to use one of them an assert will be thrown. If you need one of them send me a mail and I will try to add the missing code as soon as possible...but are you REALLY sure that you need it?!?!?! :>:>:>:>:>:>:>

PS2 obviously, as all the new things, bugs could be (and will be) present. Please, until I will not add the new Parameters system's page on wiki doc, I would like that you don't try to patch the bugs by your own. Instead send me a mail at guido.ranzuglia@isti.cnr.it or post a new thread on this forum with as much details as you can about the bugs nature. "Don't patch a bug" doesn't mean that you cannot run the debugger but only that you shouldn't update the SVN by yourself. Paolo is exonorated by the previous rule. As Orwell said "all the animals are equal, but some animals are more equal than others" :) .

For further details on Parameters system and for questions please, feel free to send me a mail at guido.ranzuglia@isti.cnr.it

Guido