Saturday, August 15, 2009

Command line refactor (part II) and other updates

The command line is still on refactor. In fact the target of refactor was that to be possible to make ALL current functionality to be called by command line. This in itself did showed a lot of limitations of the old command line. Some of them are: command line have fixed number of arguments. The commands themselves do not even are described for the command line parser if they are commands that modify the scene or are commands that do not. For this, there are old commands that do nothing like showProperties and refreshView. They are called right away by parser every command is executed because a shape will modify the Naro's document, so they need to be

Even doing a refreshView twice is not a big deal, but the refactor tries not to stop here, it tries to give a possibility for user to pick shapes for real, to have variable number of arguments and better hints. For now doing this, the application will need to enter in the "Command Line mode" which means that when you will start writing commands, is similar like you draw a shape.

Also, it was impossible to map x, y, z to a point picker component in a consistent way. So after refacit the commands like: line 0 0 0 100 100 100, they are declared as:
line point1:Point3D point2:Point3D from parser standpoint. This when it will be finish will make a more coherent and possible to offer code completion on user.

For persons who follow the commits, most of code of command line was integrated in the Infrastructure.Interface assembly which was the "referenced by all" assembly. But in practice the command line code was used (almost) only by the Command Line dialog. The command line code was got out of.

Also, the parser will offer live controls for giving to user hints as he writes the command. For valid arguments, you will have green colored buttons, for the command you write will be colored in yellow till is complete, for future arguments (which may be undefined, erroneous) are underlined with red.

I will want also to not let Execute button to be enable when your command have invalid arguments as is both useless for user and executing it, and user may lose his written command.

A special note, a good idea that was concluded after today's NaroCAD Feedback Sessions by our user Van and most probably will be implemented in the next iteration: users will be able to filter shapes' visualization by tagging. They will work as an extended concept on NaroCAD's Layers. This will compensate the unclear separation between 2D and 3D mode in NaroCAD. The tagging will be done automatically for new shapes and it will be explained when it will be done how everything works. The good thing about tagging is that you will be able to assign tags like: Sketch 1 (so all shapes that you draw in a separate sketch), Liquid, etc. Tagging will be done initially only for visualization, but most probably the search in the objects tree dialog may be changed to take in account node tagging so you can filter from tree also all shapes that will correspond to a tag. So stay tuned!

No comments: