[Scilab-Dev] SEP #15 : Scilab Tree component

François Vogel fvogelnew1 at free.fr
Mon Feb 16 22:33:41 CET 2009


Vincent COUVERT said on 15/02/2009 16:28:
> Actually, we build a tree data structure in Scilab (all functions for 
> building and modifiying the tree just aim at editing this data 
> structure) and then displaying it.
> 
> However, you're right, we have to consider the special case of GED.

Well, GED is one of the hosting environment explicitly targeted by 
SEP#15 in its introduction.
Another target is "Any user's uses for tree visualisation".
I understand therefore that trees will be displayable only in their 
single window detached from the rest of any other GUI? Isn't this too 
bad? Why not taking the opportunity of having just a tree widget like, 
say a scrollbar widget, that can be placed in a larger GUI? My point 
is: GED should not be a special case but the standard use case.

Some other questions from my side:

- Abstract says "This tree will be integrated in the docking system 
and will be used for visualisation only". What do you mean exactly by 
"for visualization only"? What other use do you have in mind that you 
want to prevent by saying this? The user editing nodes labels for 
instance? What else?

- Performance: you plan to use tlists while Serge pointed the finger 
to handles. Did you consider performance issues for large trees? Which 
is the best in front of the performance criterion? Handles or tlists? 
Is this question perhaps pointless (not sure handles are not some kind 
of tlists anyway)?

- Callbacks:
   ~ I understand that the callback string is a call to a function 
written in Scilab language, right?
   ~ Is it possible to have any Scilab code here, for instance 
disp("hello"), or anything else, say a very long loop?
   ~ Can I have Tcl calls such as "TCL_EvalStr(...)" in callback 
strings and/or in Scilab functions called by the callback?
   ~ How is the callback executed and when precisely in the Scilab 
event loop?
   ~ I think it could be an improvement to have another type of 
callback which would be a direct call to a Tcl procedure written and 
living in the main or in a slave Tcl interpreter. What do you think?

- trees, nodes and leaves: I think I understand that a tree is 
composed of nodes. Each node can be either a tree (in which case it is 
said to be a sub-tree), or a leaf. Is this statement right? Actually 
you do not seem to define what is a leaf (OK there are clues on page 
12). Is it simply that a leaf is a node without children or is it more 
subtle?

- sub-trees: SEP page 2 says "subTrees should be created before the 
tree creation". This looks like a strong limitation. How will you 
handle this in an environment such as GED, which will see sub-trees 
added whenever a new curve will be added in a figure? I think most of 
the time you do not know in advance what the tree looks like after the 
user will interact with it. Note that this interaction may be indirect.

- Insertion: How can the user insert a node at the very end of a tree, 
i.e. after the last node? I don't see how it is possible. (see the top 
of page 3 in SEP#15 and the list of errors for insertion). Actually I 
don't see how insertion works at all. In the list of error messages it 
is said that "if position already exists it returns an error message".

- I think that treeNodeParent(tree, node) may have more than one match 
if the same node can be found at different places of the tree. How is 
this handled? Does it return all matches? The first (in some sense 
TBD) match? Another one?

- Similar comment for treeNodeChildren(tree, node). The output might 
need to be a list containing lists of children nodes for each 
occurrence of node in tree, unless only one children is returned even 
if there is more than one match. On page 7 you explain that a warning 
is returned in that situation, but what does the command return? The 
first match?

- User interaction (SEP page 8) : the user can select a node or leaf. 
What for? What can the user do once this is selected? Is it possible 
to select more than one node? Can this behavior (single/multiple 
selection) be decided by the programmer? Also, how can the programmer 
be aware that the user selected one or more nodes in a tree?

Finally I have seen that the implementation work for the tree object 
was already committed but I couldn't figure out of to access the new 
commands. Scilab says it does not know about the new commands. Anythin 
I need to do to gear the new feature in? I would be happy to try the 
examples from the SEP.

Francois



More information about the dev mailing list