COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
Handles a CNode component in the tree. More...
#include <TreeNode.hpp>
Inherits QObject.
Public Slots | |
void | update_child_list () |
Updates the child internal list. The method must be called whenever children are added or removed from the corresponding node. More... | |
Public Member Functions | |
TreeNode (Handle< CNode > node, TreeNode *parent, int row_number) | |
Constructor. More... | |
~TreeNode () | |
bool | has_parent () const |
Checks whether the node has a parent or not. More... | |
TreeNode * | child (int row_number) |
Returns the ith child of this node. More... | |
Handle< CNode > | node () |
Gives the node handled by this object. More... | |
Handle< CNode > | node () const |
Gives the node handled by this object. More... | |
TreeNode * | parent_node () const |
Gives the parent. More... | |
int | row_number () const |
Gives the row number. More... | |
int | child_count () const |
Gives the child count. More... | |
QString | node_name () const |
Gives the node name. More... | |
TreeNode * | child_by_name (const QString &name) |
Retrieves a child from its name. More... | |
Private Member Functions | |
void | remove_child (TreeNode *child) |
Private Attributes | |
Handle< CNode > | m_node |
Handled node. More... | |
TreeNode * | m_parent |
The parent. May be nullptr . More... | |
int | m_row_number |
The row number. More... | |
QList< TreeNode * > | m_child_nodes |
List of children. More... | |
Handles a CNode component in the tree.
Definition at line 30 of file TreeNode.hpp.
Constructor.
node | The node to handle. The pointer can not be nullptr . |
parent | Pointer to the parent TreeNode. May be nullptr . |
rowNumber | Row number of the node under the parent. Must be greater or equal to 0. |
Definition at line 19 of file TreeNode.cpp.
~TreeNode | ( | ) |
Definition at line 34 of file TreeNode.cpp.
TreeNode * child | ( | int | row_number | ) |
Returns the ith child of this node.
If the TreeNode object corresponding to the asked child does not exist yet, it is created.
rowNumber |
nullptr
pointer if the row number is not valid (less than 0, or bigger than the number of child this this node has). Definition at line 52 of file TreeNode.cpp.
TreeNode * child_by_name | ( | const QString & | name | ) |
Retrieves a child from its name.
nullptr
pointer if no child as such name. Definition at line 121 of file TreeNode.cpp.
int child_count | ( | ) | const |
bool has_parent | ( | ) | const |
Checks whether the node has a parent or not.
A node has a parent if was constructed with a non-null pointer as parent
.
true
if the node has parent. Otherwise, returns false
. Definition at line 45 of file TreeNode.cpp.
Gives the node handled by this object.
Definition at line 81 of file TreeNode.cpp.
Gives the node handled by this object.
Definition at line 89 of file TreeNode.cpp.
|
inline |
Gives the node name.
Calling the method is equivalent to
Definition at line 91 of file TreeNode.hpp.
TreeNode * parent_node | ( | ) | const |
Gives the parent.
nullptr
pointer if the node has no porent. Definition at line 97 of file TreeNode.cpp.
|
private |
Definition at line 156 of file TreeNode.cpp.
int row_number | ( | ) | const |
|
slot |
Updates the child internal list. The method must be called whenever children are added or removed from the corresponding node.
getChild
will have to be recreated again. Thus, calling this method too often may lead to performance problems. Definition at line 143 of file TreeNode.cpp.
List of children.
This list is initialized at the right size in the constructor with nullptr
pointers (one pointer for each child). Each pointer is replaced when the corresponding child is built by getChild
method.
Definition at line 133 of file TreeNode.hpp.
Handled node.
Definition at line 120 of file TreeNode.hpp.
|
private |
The parent. May be nullptr
.
Definition at line 123 of file TreeNode.hpp.
|
private |
The row number.
Definition at line 126 of file TreeNode.hpp.
Send comments to: COOLFluiD Web Admin |