|
| UT_InfoTree (UT_InfoTree *tree_top=NULL, UT_InfoTree *parent=NULL, const UT_StringHolder &name=TREE_TOP_DEFAULT_NAME) |
|
| ~UT_InfoTree () |
|
void | clearProperties () |
|
void | clearChildren () |
| Clears all child branches. Doesn't affect our properties. More...
|
|
UT_InfoTree * | addChildBranch (const UT_StringHolder &name) |
|
UT_InfoTree * | addChildMap (const UT_StringHolder &name) |
| Adds a child branch with "Property" and "Value" headings. More...
|
|
ut_PropertyRow * | addProperties () |
| Create a new empty row. More...
|
|
template<class ValType1 > |
ut_PropertyRow * | addProperties (const ValType1 &v1) |
|
template<class ValType1 , class ValType2 > |
ut_PropertyRow * | addProperties (const ValType1 &v1, const ValType2 &v2) |
|
template<class ValType1 , class ValType2 , class ValType3 > |
ut_PropertyRow * | addProperties (const ValType1 &v1, const ValType2 &v2, const ValType3 &v3) |
|
template<class ValType1 , class ValType2 , class ValType3 , class ValType4 > |
ut_PropertyRow * | addProperties (const ValType1 &v1, const ValType2 &v2, const ValType3 &v3, const ValType4 &v4) |
|
void | addColumnHeading (const UT_StringHolder &label, fpreal width=-1.0) |
|
void | addColumnHeading (int label, fpreal width=-1.0) |
|
UT_InfoTree * | getParentBranch () const |
| Get a pointer to my parent. More...
|
|
UT_InfoTree * | getTreeTop () const |
| Get a pointer to the very top node in the tree. More...
|
|
const UT_StringHolder & | getName () const |
| Return this branch's name. More...
|
|
void | setName (const UT_StringHolder &new_name) |
| In case we decide to change the name of this branch. More...
|
|
const UT_StringHolder & | getInfoType () const |
| Return this branch's "type" idwentifier. More...
|
|
void | setInfoType (const UT_StringHolder &new_type) |
| In case we decide to change the "type" of this branch. More...
|
|
UT_InfoTree * | getDescendentPtr (UT_StringArray &path) |
|
const UT_Array< UT_InfoTree * > & | getChildBranches () const |
|
const UT_Array< ut_PropertyRow * > & | getProperties () const |
|
const ut_PropertyRow & | getColumnHeadings () const |
|
const UT_FloatArray & | getColumnWidths () const |
|
This is a tree in which each node can have as many children as it likes, and at each node we can store data in the form of strings (which are stored in arrays/rows, in case we want to display each row in a spreadsheet table).
Definition at line 75 of file UT_InfoTree.h.
Create a child or subtree under this tree with the name 'branch_name' The caller should NOT call delete on the pointer returned when they are done with it, since this class' destructor will take care of any children created in addChildBranch(..).
IMPORTANT NOTE: It is assumed that all branches on the same level will have unique names, BUT this is NOT enforced to prevent a performance hit since these trees can get rebuilt pretty often to accurately reflect the data they are containing. BOTTOM LINE: Make sure 'branch_name' is unique among 'myChildBranches' (otherwise there'll be trouble when we decide to traverse a tree given a path of branches - system won't crash, but will always choose the first available branch on a level with the name it is looking for).
Add column headings for this node to be used when the info is displayed in a table. THE NUMBER OF HEADINGS ADDED HERE WILL DETERMINE THE NUMBER OF COLUMNS DISPLAYED. Note: This class does NOT ensure that the # of column headings matches the width of each property array in 'myProperties'. Instead, we only display as many properties per row as we have number of columns.
The width parameter must either be specified on all columns or on none. If set on all columns, it represents the fraction of the total width that gets allocated to that column (the values get normalized). If any column has a width specified of <= 0.0, the whole thing reverts to the default behavior of allocating all columns with equal width.
template<class ValType1 >
HOW TO USE: You may add up to 4 properties to a single row at once using these methods. If you still need to add more properties to this SAME row/array after that, simply use the returned ut_PropertyRow* to call 'append()' on and add more properties. To add properties that are ints, use the same technique, since there is an 'append()' method in ut_PropertyRow that takes an int parameter (or check the overridden version of addProperties below). BOTTOM LINE - if you want maximum flexibility, call this with no parameters and then append each property manually to the returned ut_PropertyRow*.
Definition at line 215 of file UT_InfoTree.h.
Get a ptr to a specific descendant branch of this tree, given a UT_StringArray of branch names. e.g. if you want to traverse down the tree through a child branch named "Antigen" and get a pointer to that branch's child called "Rocks", then your UT_StringArray should simply have 2 elements, "Antigen" and "Rocks", respectively in that order. Method returns NULL if no such valid path found.
NOTE: Again, this assumes all branches at the same level have unique names, as stated above for 'addChildBranch()'.