Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

AllHierarchies Class Reference

Inheritance diagram for AllHierarchies:

Inheritance graph
[legend]
Collaboration diagram for AllHierarchies:

Collaboration graph
[legend]
List of all members.

Detailed Description

AllHierarchies - manage all hierarchies.

Todo:
Variable and function naming is a complete mess here. Til now I just fixed the declarations to match the implementations. Furtheron all underscore/capitalized namings should be unified. No interface variable should only be named id. When it is a hierarchy's id call it for example hierId.

the TclArray called hier is cononfusing me with the TclArray hierarchy. I know they contain different stuff but again: the naming is extraordinary bad.

the TclArray hier is overloaded: its information should be split into several arrays named by the third argument of the hier array.

the methods C_to_Tcllist() and ldelete() are not related to AllHierarchies.

private varialbes should be named starting with and underscore

Author:
Dietmar Fünning, Kilian A. Foth (see also AUTHORS and THANKS for more)
Id
allhierarchies.tcl,v 1.34 2004/10/11 13:50:05 micha Exp

Definition at line 29 of file allhierarchies.tcl.

Public Member Functions

 AllHierarchies (TclList args)
 getAllHierarchyIds ()
 init_data ()

Private Member Functions

 _init_data ()
 balanceNode (TclString id, TclString type_id)
 C_to_Tcllist (List list)
 center (TclString id, TclNumber level)
 compute_fathers_and_sons (Hierarchy hierarchy, TclString type_id)
 compute_graph (TclString id)
 compute_hierarchy (Hierarchy hierarchy)
 compute_positions (TclString id)
 display_graph (TclString id, TclNumber level, TclList nodes_current_lvl, TclNumber x_start, TclNumber y_start, TclNumber counter)
 drawHierarchy (TclString id)
 drawSort (TclString id, TclString type_id)
 importNode (TclString id, TclString type_id)
 initial_x_pos (TclString id, TclNumber level)
 initialize_depth (TclString id, TclString type_id)
 is_hierarchy_a_tree (Hierarchy hierarchy, TclString type_id)
 labelEnter (TclCommand w, TclNumber pointerx, TclNumber pointery)
 labelLeave (TclCommand w)
 ldelete (TclList list, TclString type_id)
 leaves_right (TclString id, TclString String)
 max_type_depth (TclString id, TclString type_id, TclNumber depth)
 new_order (TclString id, TclString String)
 number_of_fathers_and_sons (Hierarchy hierarchy, TclString type_id)
 position_leaves (TclString id, TclNumber level)
 position_leaves2 (TclString id, TclString type_id)
 position_of_type (Hierarchy hierarchy, TclString type_id)
 set_level_array (TclString id, TclString type_id)
 stringlength (TclString id, TclString type_id)
 xpixels_per_character (TclString id)

Private Attributes

TclString canvas = ""
TclNumber current_x = 1
TclNumber current_y = 1
TclArray hier
TclArray hierarchies
TclArray levels
TclNumber max_y = 1
TclNumber maxdepth = 0
TclNumber maxlength = 0
TclNumber recurse_necessary = 0
TclNumber unit = 10
TclArray widths


Constructor & Destructor Documentation

AllHierarchies::AllHierarchies TclList  args  ) 
 

constructor

Definition at line 89 of file allhierarchies.tcl.


Member Function Documentation

AllHierarchies::_init_data  )  [private]
 

get data from the cdg tool.

Definition at line 133 of file allhierarchies.tcl.

AllHierarchies::balanceNode TclString  id,
TclString  type_id
[private]
 

rearrange children of a node so that wide nodes alternate with narrow nodes.

Definition at line 434 of file allhierarchies.tcl.

AllHierarchies::C_to_Tcllist List  list  )  [private]
 

Converts a C-list of types into a Tcl-list of type-ids and filters out 'bot'. Only this function and position_of_type work with C-data structures. Definition at line 291 of file allhierarchies.tcl.

AllHierarchies::center TclString  id,
TclNumber  level
[private]
 

find sort's final x-coordinate.

Definition at line 576 of file allhierarchies.tcl.

AllHierarchies::compute_fathers_and_sons Hierarchy  hierarchy,
TclString  type_id
[private]
 

find a types sons and fathers in the hierarchy. (uses the C-function listOfSons) Definition at line 330 of file allhierarchies.tcl.

AllHierarchies::compute_graph TclString  id  )  [private]
 

This function is used only for nontree-graphs.

Definition at line 849 of file allhierarchies.tcl.

AllHierarchies::compute_hierarchy Hierarchy  hierarchy  )  [private]
 

gather all relevant data for displaying a hierarchy.

Definition at line 186 of file allhierarchies.tcl.

AllHierarchies::compute_positions TclString  id  )  [private]
 

calls initial_x_pos and center.

Definition at line 535 of file allhierarchies.tcl.

AllHierarchies::display_graph TclString  id,
TclNumber  level,
TclList  nodes_current_lvl,
TclNumber  x_start,
TclNumber  y_start,
TclNumber  counter
[private]
 

display nontree-graphs. This function is used only for nontree-graphs Definition at line 944 of file allhierarchies.tcl.

AllHierarchies::drawHierarchy TclString  id  )  [private]
 

draw hierarchy on its associated canvas

Definition at line 351 of file allhierarchies.tcl.

AllHierarchies::drawSort TclString  id,
TclString  type_id
[private]
 

draw one sort on the canvas. This method is only called when the hierarchy is a tree.

Note:
No check prevents us from calling this method on a non-tree hierarchy.
Definition at line 497 of file allhierarchies.tcl.

AllHierarchies::getAllHierarchyIds  ) 
 

Return list of all hierarchies' names.

Definition at line 1166 of file allhierarchies.tcl.

AllHierarchies::importNode TclString  id,
TclString  type_id
[private]
 

fills global arrays with data from cdg.

Definition at line 397 of file allhierarchies.tcl.

AllHierarchies::init_data  ) 
 

call _init_data if necessary.

Definition at line 120 of file allhierarchies.tcl.

AllHierarchies::initial_x_pos TclString  id,
TclNumber  level
[private]
 

sort's initial position.

Definition at line 556 of file allhierarchies.tcl.

AllHierarchies::initialize_depth TclString  id,
TclString  type_id
[private]
 

initialize the depth information. This method recurses over all types in a hierarchy and sets their depth information to zero. Definition at line 220 of file allhierarchies.tcl.

AllHierarchies::is_hierarchy_a_tree Hierarchy  hierarchy,
TclString  type_id
[private]
 

compute tree property. This method computes whether a hierarchy is a tree. This function is traversing recursivly the complete hierarchy in the following way:

  • if the number of fathers is greater than one then the hierarchy is not a tree.
    Parameters:
    hierarchy a pointer to a HierarchyStruct
    type_id an entry in the hierarchy
Definition at line 258 of file allhierarchies.tcl.

AllHierarchies::labelEnter TclCommand  w,
TclNumber  pointerx,
TclNumber  pointery
[private]
 

command bound to Enter-event.

Definition at line 1146 of file allhierarchies.tcl.

AllHierarchies::labelLeave TclCommand  w  )  [private]
 

command bound to Leave-event.

Definition at line 1156 of file allhierarchies.tcl.

AllHierarchies::ldelete TclList  list,
TclString  type_id
[private]
 

deletes a string from a list.

Todo:
this method is in no way specific to AllHierarchies
Definition at line 685 of file allhierarchies.tcl.

AllHierarchies::leaves_right TclString  id,
TclString  type_id
[private]
 

move leaves to the rightmost possible position. Leaves are positioned right beside their non-leaf-siblings Definition at line 645 of file allhierarchies.tcl.

AllHierarchies::max_type_depth TclString  id,
TclString  type_id,
TclNumber  depth
[private]
 

compute maximal distance between type and 'top'. This function finds a type's depth in trees, and the length of the longest path from top to the type for non-trees: Definition at line 235 of file allhierarchies.tcl.

AllHierarchies::new_order TclString  id,
TclString  String
[private]
 

store the new order in 'levels(level)'

Definition at line 664 of file allhierarchies.tcl.

AllHierarchies::number_of_fathers_and_sons Hierarchy  hierarchy,
TclString  type_id
[private]
 

stores the number of successors and predecessors each type has

Definition at line 275 of file allhierarchies.tcl.

AllHierarchies::position_leaves TclString  id,
TclNumber  level
[private]
 

some nodes are still not correctly positioned.

Definition at line 698 of file allhierarchies.tcl.

AllHierarchies::position_leaves2 TclString  id,
TclString  type_id
[private]
 

position leaves between their siblings

Todo:
bad method name
Definition at line 727 of file allhierarchies.tcl.

AllHierarchies::position_of_type Hierarchy  hierarchy,
TclString  type_id
[private]
 

This is the interface to functions.i

Todo:
the documentation does not match the intension of this function
Definition at line 308 of file allhierarchies.tcl.

AllHierarchies::set_level_array TclString  id,
TclString  type_id
[private]
 

populate the array levels.

Definition at line 413 of file allhierarchies.tcl.

AllHierarchies::stringlength TclString  id,
TclString  type_id
[private]
 

stores types stringlength.

Definition at line 201 of file allhierarchies.tcl.

AllHierarchies::xpixels_per_character TclString  id  )  [private]
 

How many pixels are to be used for a character ?

Definition at line 1131 of file allhierarchies.tcl.


The documentation for this class was generated from the following file:
XCDG 0.95 (20 Oct 2004)