COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
NTree Class Reference

Tree model. More...

#include <NTree.hpp>

Inherits QAbstractItemModel, and CNode.

Public Slots

void clear_tree ()
 Clears the tree. Deletes all component that are not client component. More...
 
void update_tree ()
 Sends a request to update de tree. More...
 

Signals

void current_index_changed (const QModelIndex &newIndex, const QModelIndex &oldIndex)
 Signal emitted when the current index has changed. More...
 
void advanced_mode_changed (bool advanced)
 Signal emitted when advanced mode changed. More...
 
void begin_update_tree ()
 
void end_update_tree ()
 

Public Member Functions

 NTree (Handle< cf3::ui::core::NRoot > rootNode)
 Constructor. More...
 
void set_tree_root (Handle< NRoot > node)
 Replaces the current component tree. More...
 
Handle< NRoottree_root () const
 Gives the current root. More...
 
void set_current_index (const QModelIndex &newIndex)
 Sets the current index. More...
 
QModelIndex current_index () const
 Gives the current index. More...
 
cf3::common::URI current_path () const
 Gives the path of the current index. More...
 
void list_node_options (const QModelIndex &index, QList< boost::shared_ptr< cf3::common::Option > > &options, bool *ok=nullptr) const
 Gets node options. More...
 
void list_node_properties (const QModelIndex &index, QMap< QString, QString > &params, bool *ok=nullptr) const
 Gets node properties. More...
 
void list_node_actions (const QModelIndex &index, QList< ActionInfo > &actions, bool *ok=nullptr) const
 Gets node actions. More...
 
QString node_path (const QModelIndex &index) const
 Retrieves a node path. More...
 
void set_advanced_mode (bool advanceMode)
 Set advanced mode. More...
 
bool is_advanced_mode () const
 Indicates whether advanced mode is activated or not. More...
 
bool are_from_same_node (const QModelIndex &left, const QModelIndex &right) const
 Checks whether two indexes point to the same node. More...
 
Handle< CNodenode_by_path (const cf3::common::URI &path) const
 Retrieves a node from its path. More...
 
Handle< CNodenode_by_path (const cf3::common::URI &path)
 Retrieves a node from its path. More...
 
QModelIndex index_from_path (const cf3::common::URI &path) const
 Retrieves a node index from its path. More...
 
cf3::common::URI pathFromIndex (const QModelIndex &index) const
 Gives the path of the provided index. More...
 
void modify_options (const QModelIndex &index, const QMap< QString, QString > &options)
 Modifies options of a node. More...
 
void set_debug_mode_enabled (bool debugMode)
 Set the debug mode. More...
 
bool is_debug_mode_enabled () const
 Indicates whether the debug mode is activated or not. More...
 
void update_root_children ()
 Updates the children row counts, starting from the root. More...
 
void options_changed (const cf3::common::URI &path)
 
bool node_matches (const QModelIndex &index, const QRegExp &regex) const
 Checks whether a node name or one of its children matches a provided regular expression. More...
 
bool check_index_visible (const QModelIndex &index) const
 Checks whether a nodeis visible or not. More...
 
common::URI complete_relativepath (const common::URI &uri) const
 Resolves the provided URI from the current index path. More...
 
void content_listed (Handle< Component > node)
 
VIRTUAL FUNCTIONS
virtual QVariant data (const QModelIndex &index, int role) const
 Implementation of QAbstractItemModel::data(). More...
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 Implementation of QAbstractItemModel::index(). More...
 
virtual QModelIndex parent (const QModelIndex &child) const
 Implementation of QAbstractItemModel::parent()-> More...
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
 Implementation of QAbstractItemModel::rowCount(). More...
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
 Implementation of QAbstractItemModel::columnCount(). More...
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 Gives header titles. More...
 
virtual QString tool_tip () const
 Gives the tool tip text. More...
 
Signals
void list_tree_reply (cf3::common::SignalArgs &node)
 Signal called when the tree needs to be updated. More...
 
- Public Member Functions inherited from CNode
 CNode (const std::string &name, const QString &component_type, Type type)
 
std::string derived_type_name () const
 Component::derived_type_name implementation. More...
 
QString component_type () const
 
Handle< CNodechild (Uint index)
 
bool is_local_component () const
 
Type type () const
 
bool is_root ()
 
void set_properties (const common::SignalArgs &node)
 
void set_signals (const common::SignalArgs &node)
 
void modify_options (const QMap< QString, QString > &options)
 Modifies options. More...
 
void list_options (QList< boost::shared_ptr< common::Option > > &list)
 
void list_properties (QMap< QString, QString > &props)
 
void list_signals (QList< ActionInfo > &actions)
 
template<class TYPE >
Handle< const TYPE > castTo () const
 
template<class TYPE >
Handle< TYPE > castTo ()
 
void connect_notifier (QObject *reciever, const char *signal, const char *slot)
 
void add_node (boost::shared_ptr< CNode > node)
 Adds a sub-node. More...
 
void remove_node (const QString &node_name)
 Removes a sub-node. More...
 
CNodeNotifiernotifier () const
 
void list_child_paths (QStringList &list, bool recursive, bool client_node=true) const
 Lists all children paths in a string list. More...
 
void request_signal_signature (const QString &name)
 
void local_signature (const QString &name, common::SignalArgs &node)
 Retrieves the signature of a local signal. More...
 
void finish_setup ()
 
virtual void about_to_be_removed ()
 
void reply_update_tree (common::SignalArgs &node)
 
void reply_configure (common::SignalArgs &node)
 
void reply_list_content (common::SignalArgs &node)
 
void reply_signal_signature (common::SignalArgs &node)
 Method called when the server replies to a signal. More...
 
- Public Member Functions inherited from Component
 Component (const std::string &name)
 
virtual ~Component ()
 Virtual destructor. More...
 
const std::string & name () const
 Access the name of the component. More...
 
void rename (const std::string &name)
 Rename the component. More...
 
URI uri () const
 Construct the full path. More...
 
void complete_path (URI &path) const
 
Handle< Componentaccess_component (const URI &path) const
 
Handle< Componentaccess_component_checked (const URI &path)
 
Handle< Component const > access_component_checked (const URI &path) const
 
Handle< Componenthandle ()
 Get a handle to the component. More...
 
Handle< Component const > handle () const
 
template<typename ComponentT >
Handle< ComponentT > handle ()
 
template<typename ComponentT >
Handle< ComponentT const > handle () const
 
Handle< Componentparent () const
 
Handle< Component const > root () const
 
Handle< Componentroot ()
 
Handle< Componentget_child (const std::string &name)
 
Handle< Component const > get_child (const std::string &name) const
 
Handle< Componentget_child_checked (const std::string &name)
 
Handle< Component const > get_child_checked (const std::string &name) const
 
Handle< Componentcreate_component (const std::string &name, const std::string &builder)
 Build a (sub)component of this component using the extended type_name of the component. More...
 
template<typename T >
Handle< T > create_component (const std::string &name)
 Create a (sub)component of this component automatically cast to the specified type. More...
 
template<typename T >
Handle< T > create_static_component (const std::string &name)
 Create a static "always there" subcomponent. More...
 
Componentadd_component (const boost::shared_ptr< Component > &subcomp)
 Add the passed component as a subcomponent. More...
 
void add_link (Component &linked_component)
 
boost::shared_ptr< Componentremove_component (const std::string &name)
 Remove a (sub)component of this component. More...
 
boost::shared_ptr< Componentremove_component (Component &subcomp)
 Remove a (sub)component of this component. More...
 
void clear ()
 Remove all sub-components of this component, except for the static ones. More...
 
void move_to (Component &to_parent)
 
std::string tree (bool basic_mode=false, Uint depth=0, Uint recursion_level=0) const
 
std::string info (const std::string &what=std::string("cospt")) const
 
size_t count_children () const
 
PropertyListproperties ()
 
const PropertyListproperties () const
 
OptionListoptions ()
 
const OptionListoptions () const
 
void reset_options ()
 Reset all options to their default value. More...
 
void configure_option_recursively (const std::string &optname, const boost::any &val)
 
Componentmark_basic ()
 marks this component as basic. More...
 
template<typename ComponentT >
void put_components (std::vector< boost::shared_ptr< ComponentT > > &vec, const bool recurse)
 
template<typename ComponentT >
void put_components (std::vector< boost::shared_ptr< ComponentT const > > &vec, const bool recurse) const
 
template<>
void put_components (std::vector< boost::shared_ptr< Component > > &vec, const bool recurse)
 
template<>
void put_components (std::vector< boost::shared_ptr< Component const > > &vec, const bool recurse) const
 
Component::iterator begin ()
 The begin iterator for a range containing Components. More...
 
Component::iterator end ()
 The end iterator for a range containing Components. More...
 
Component::const_iterator begin () const
 The begin iterator for a range containing Components (const version) More...
 
Component::const_iterator end () const
 The end iterator for a range containing Components (const version) More...
 
Component::iterator recursive_begin ()
 The begin iterator for a recursive range containing Components. More...
 
Component::iterator recursive_end ()
 The end iterator for a recursive range containing Components. More...
 
Component::const_iterator recursive_begin () const
 The begin iterator for a recursive range containing Components (const version) More...
 
Component::const_iterator recursive_end () const
 The end iterator for a recursive range containing Components (const version) More...
 
template<typename T >
Handle< T > create_component (const std::string &name, const std::string &builder)
 Create a component using the reduced builder name. More...
 
void signal_configure (SignalArgs &args)
 configures all the options on this class More...
 
void signal_create_component (SignalArgs &args)
 creates a component from this component More...
 
void signal_delete_component (SignalArgs &args)
 delete this component More...
 
void signal_move_component (SignalArgs &args)
 moves a component from this component to another More...
 
void signal_list_tree (SignalArgs &args) const
 lists the sub components and puts them on the xml_tree More...
 
void signal_list_tree_recursive (SignalArgs &args) const
 prints tree recursively More...
 
void signal_list_properties (SignalArgs &args) const
 lists the properties of this component More...
 
void signal_list_options (SignalArgs &args) const
 lists the properties of this component More...
 
void signal_list_options_recursive (SignalArgs &args) const
 prints all options recursive More...
 
void signal_list_signals (SignalArgs &args) const
 lists the signals of this component More...
 
void signal_list_signals_recursive (SignalArgs &args) const
 prints all signals recursive More...
 
void signal_print_info (SignalArgs &args) const
 gets info on this component More...
 
void signal_print_tree (SignalArgs &args) const
 signal to print the tree More...
 
void signature_print_tree (SignalArgs &args) const
 signature to signal_print_tree More...
 
void signal_rename_component (SignalArgs &args)
 renames this component More...
 
void signal_save_tree (SignalArgs &args)
 dumps the tree to a file More...
 
void signal_list_content (SignalArgs &args)
 gives information about this component such as options, signals, ... More...
 
void signal_signature (SignalArgs &args)
 Gives a signal signature, if any. More...
 
void signature_create_component (SignalArgs &args)
 
void signature_rename_component (SignalArgs &args)
 
void signature_move_component (SignalArgs &args)
 
void signal_store_timings (SignalArgs &args)
 Signal to store the timings (if enabled) into properties, i.e. for readout from python or the GUI. More...
 
void signal_clear (SignalArgs &args)
 Signal to remove all sub-components. More...
 
void signal_reset_options (SignalArgs &args)
 Signal to set all options to their default value. More...
 
void signal_add_tag (SignalArgs &args)
 Signal to add a tag. More...
 
void signature_add_tag (SignalArgs &args)
 
- Public Member Functions inherited from SignalHandler
 ~SignalHandler ()
 
const storage_tsignal_list () const
 
SignalPtr signal (const SignalID &sname)
 
SignalCPtr signal (const SignalID &sname) const
 
SignalRet call_signal (const SignalID &sname, SignalArgs &sinput)
 Calls the signal by providing its name and input. More...
 
SignalRet call_signal (const SignalID &sname, std::vector< std::string > &sinput)
 Calls the signal by providing its name and input. More...
 
bool signal_exists (const SignalID &sname) const
 Checks if a signal exists or not. More...
 
Signalregist_signal (const SignalID &sname)
 Regist signal. More...
 
void unregist_signal (const SignalID &sname)
 Unregist signal. More...
 
- Public Member Functions inherited from ConnectionManager
 ~ConnectionManager ()
 destructor closes all connections More...
 
Connectionconnection (const std::string &name)
 
Connectionmanage_connection (const std::string &name)
 manages a connection (creates if necessary) More...
 
- Public Member Functions inherited from TaggedObject
 TaggedObject ()
 Constructor. More...
 
bool has_tag (const std::string &tag) const
 
void add_tag (const std::string &tag)
 
std::vector< std::string > get_tags () const
 
void remove_tag (const std::string &tag)
 

Static Public Member Functions

static Handle< NTreeglobal ()
 
- Static Public Member Functions inherited from CNode
static std::string type_name ()
 
static boost::shared_ptr< CNodecreate_from_xml (common::XML::XmlNode node)
 Creates an object tree from a given node. More...
 
- Static Public Member Functions inherited from Component
static std::string type_name ()
 Get the class name. More...
 

Protected Member Functions

virtual void disable_local_signals (QMap< QString, bool > &localSignals) const
 
- Protected Member Functions inherited from CNode
virtual void setup_finished ()
 
- Protected Member Functions inherited from Component
Componentadd_static_component (const boost::shared_ptr< Component > &subcomp)
 Add a static (sub)component of this component. More...
 
void raise_tree_updated_event ()
 raise event that the path has changed More...
 

Private Member Functions

TreeNodeindex_to_tree_node (const QModelIndex &index) const
 Converts an index to a tree node. More...
 
Handle< CNodeindex_to_node (const QModelIndex &index) const
 Converts an index to a node. More...
 
void build_node_path_recursive (const QModelIndex &index, QString &path) const
 Retrieves a node path from its index. More...
 
bool node_matches_recursive (Handle< Component > node, const QRegExp regex) const
 Recursively checks whether a node name or one of its children matches a provided regular expression. The check stops once a recursive call returns true. More...
 

Private Attributes

QStringList m_columns
 Column titles. More...
 
TreeNodem_root_node
 The root node. More...
 
QModelIndex m_current_index
 Current index. More...
 
bool m_advanced_mode
 Indicates whether we are in advanced mode or not. More...
 
bool m_debug_mode_enabled
 Indicates whether we are in debug mode or not. More...
 
QMutex * m_mutex
 Mutex to control concurrent access. More...
 

Additional Inherited Members

- Public Types inherited from CNode
enum  Type { STANDARD_NODE = 0, LOCAL_NODE = 1, DEBUG_NODE = 2 }
 Defines the sub-node types. More...
 
- Public Types inherited from Component
typedef ComponentIterator< Componentiterator
 type of the iterator to Component More...
 
typedef ComponentIterator< Component const > const_iterator
 type of the iterator to constant Component More...
 
- Public Types inherited from SignalHandler
typedef std::vector< SignalPtrstorage_t
 storage type for signals More...
 
- Public Attributes inherited from SignalHandler
storage_t m_signals
 storage of the signals More...
 
- Protected Attributes inherited from CNode
CNodeNotifierm_notifier
 This internal notifier. More...
 
QStringList m_local_signals
 Lists the names of the local signals. More...
 
QMutex * m_mutex
 
bool m_content_listed
 
bool m_listing_content
 
bool m_is_root
 
QList< ActionInfom_action_sigs
 List of signals that can be remotely executed. More...
 

Detailed Description

Tree model.

Author
Quentin Gasper.

Definition at line 39 of file NTree.hpp.

Constructor & Destructor Documentation

NTree ( Handle< cf3::ui::core::NRoot rootNode)

Constructor.

If the root node is a nullptr pointer

Parameters
rootNodeThe root node. May be nullptr.

Definition at line 36 of file NTree.cpp.

Member Function Documentation

void advanced_mode_changed ( bool  advanced)
signal

Signal emitted when advanced mode changed.

Parameters
advancedNew advanced mode status
See also
setAdvancedMode
bool are_from_same_node ( const QModelIndex &  left,
const QModelIndex &  right 
) const

Checks whether two indexes point to the same node.

If indexes point to a null node, they are considered as not pointing to the same node.

Parameters
leftLeft node
rightRight node
Returns
Returns true if both indexes point to the same node. Otherwise returns false.

Definition at line 219 of file NTree.cpp.

void begin_update_tree ( )
signal
void build_node_path_recursive ( const QModelIndex &  index,
QString &  path 
) const
private

Retrieves a node path from its index.

This is a recursive method.

Parameters
indexNode index.
pathIntermediate retrieved path

Definition at line 754 of file NTree.cpp.

bool check_index_visible ( const QModelIndex &  index) const

Checks whether a nodeis visible or not.

A node is visible if:

  • it is basic
  • it is advanced and advanced mode is activated
  • it is a client component and debug mode is activated.
    Parameters
    indexIndex of the node to check
    Returns
    Returns true if the node is visible. Otherwise, returns false (i.e. the index is not valid).

Definition at line 424 of file NTree.cpp.

void clear_tree ( )
slot

Clears the tree. Deletes all component that are not client component.

Definition at line 676 of file NTree.cpp.

int columnCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

Implementation of QAbstractItemModel::columnCount().

Returns
Always returns 1.

Definition at line 568 of file NTree.cpp.

URI complete_relativepath ( const common::URI uri) const

Resolves the provided URI from the current index path.

The current index must be a valid index.

Parameters
uriThe URI to resolve. Must of scheme URI::Scheme::CPATH.
Returns
Returns the complete path.

Definition at line 711 of file NTree.cpp.

void content_listed ( Handle< Component node)

Definition at line 728 of file NTree.cpp.

QModelIndex current_index ( ) const

Gives the current index.

The current index may not be valid if #changeCurrentIndex was never called.

Returns
Returns the current index.
See also
setCurrentIndex.

Definition at line 98 of file NTree.cpp.

void current_index_changed ( const QModelIndex &  newIndex,
const QModelIndex &  oldIndex 
)
signal

Signal emitted when the current index has changed.

Parameters
newIndexThe new current index
oldIndexThe old current index
See also
setCurrentIndex
URI current_path ( ) const

Gives the path of the current index.

Returns
Returns the path of the index returned by #getCurrentIndex() or an empty path if not valid current index is set.

Definition at line 107 of file NTree.cpp.

QVariant data ( const QModelIndex &  index,
int  role 
) const
virtual

Implementation of QAbstractItemModel::data().

Only the role Qt::DisplayRole and Qt::DecorationRole are accepted. Other roles will result to the return of an empty QVariant object (built with the default construtor).

Parameters
indexConcerned item index.
roleRole of the returned value (only Qt::DisplayRole or Qt::DecorationRole).
Returns
Returns an empty QVariant object if the role is neither Qt::DisplayRole nor Qt::DecorationRole or if the index.isValid() returns false. Otherwise, returns the nodename of the the item at the specified index.

Definition at line 468 of file NTree.cpp.

virtual void disable_local_signals ( QMap< QString, bool > &  localSignals) const
inlineprotectedvirtual

Disables the local signals that need to.

Parameters
localSignalsMap of local signals. All values are set to true by default.

Implements CNode.

Definition at line 342 of file NTree.hpp.

void end_update_tree ( )
signal
Handle< NTree > global ( )
static

Definition at line 796 of file NTree.cpp.

QVariant headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
virtual

Gives header titles.

Overrides QAbstractItemModel::headerData().

Parameters
sectionSection number.
orientationHeader orientation.
roleData role. Only Qt::DisplayRole is accepted.
Returns
Returns the data or an empty QVariant on error.

Definition at line 577 of file NTree.cpp.

QModelIndex index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
virtual

Implementation of QAbstractItemModel::index().

Gives the index of the item at the given row and column under the given parent. If the parent index is not valid, the root item is taken as parent.

Parameters
rowItem row from the parent.
columnItem column.
parentItem parent.
Returns
Returns the requested index, or a nullptr index if hasIndex(row, column, parent) returns false.

Definition at line 500 of file NTree.cpp.

QModelIndex index_from_path ( const cf3::common::URI path) const

Retrieves a node index from its path.

Parameters
pathThe node index path
Returns
Returns the found node index, or a invalid index if it does not exist.

Definition at line 302 of file NTree.cpp.

Handle< CNode > index_to_node ( const QModelIndex &  index) const
private

Converts an index to a node.

Parameters
indexNode index to convert
Returns
Returns the node, or a null shared pointer if the index could not be converted (i.e. index is invalid)

Definition at line 815 of file NTree.cpp.

TreeNode * index_to_tree_node ( const QModelIndex &  index) const
private

Converts an index to a tree node.

Parameters
indexNode index to convert
Returns
Returns the tree node, or nullptr if the index could not be converted (i.e. index is invalid)

Definition at line 806 of file NTree.cpp.

bool is_advanced_mode ( ) const

Indicates whether advanced mode is activated or not.

Returns
Returns true if advanced mode is activated, otherwise, returns false.

Definition at line 210 of file NTree.cpp.

bool is_debug_mode_enabled ( ) const

Indicates whether the debug mode is activated or not.

Returns
Returns true if the debug mode is activated; otherwise, returns false.

Definition at line 370 of file NTree.cpp.

void list_node_actions ( const QModelIndex &  index,
QList< ActionInfo > &  actions,
bool *  ok = nullptr 
) const

Gets node actions.

Parameters
indexNode index
actionsList where action will be stored.
okIf not nullptr, used to store whether the action gathering succeeded or not (i.e. it fails if the index is not valid).

Definition at line 157 of file NTree.cpp.

void list_node_options ( const QModelIndex &  index,
QList< boost::shared_ptr< cf3::common::Option > > &  options,
bool *  ok = nullptr 
) const

Gets node options.

Parameters
indexNode index
optionsList where options will be stored
okIf not nullptr, used to strore whether the option gathering succeded or not.

Definition at line 116 of file NTree.cpp.

void list_node_properties ( const QModelIndex &  index,
QMap< QString, QString > &  params,
bool *  ok = nullptr 
) const

Gets node properties.

Parameters
indexNode index
propsMap where properties will be stored. The key is the property name, the value is the property value.
okIf not nullptr, used to store whether the property gathering succeeded or not.

Definition at line 137 of file NTree.cpp.

void list_tree_reply ( cf3::common::SignalArgs node)

Signal called when the tree needs to be updated.

Parameters
nodeNew tree

Definition at line 591 of file NTree.cpp.

void modify_options ( const QModelIndex &  index,
const QMap< QString, QString > &  options 
)

Modifies options of a node.

This method calls CNode::modifyOptions() of the corresponding node

Parameters
indexNode index
optionsOptions to modify. The key is the option name and the value is the option value to set.

Definition at line 451 of file NTree.cpp.

Handle< CNode > node_by_path ( const cf3::common::URI path) const

Retrieves a node from its path.

Parameters
pathThe node path
Returns
Returns the found node, or a null shared pointer if the node does not exist.

Definition at line 228 of file NTree.cpp.

Handle< CNode > node_by_path ( const cf3::common::URI path)

Retrieves a node from its path.

Parameters
pathThe node path
Returns
Returns the found node, or a null shared pointer if the node does not exist.

Definition at line 265 of file NTree.cpp.

bool node_matches ( const QModelIndex &  index,
const QRegExp &  regex 
) const

Checks whether a node name or one of its children matches a provided regular expression.

Parameters
indexIndex of the node to check.
regexRegular expression to match.
Returns
Returns true if the node or at least one of its children matches the regular expression.

Definition at line 404 of file NTree.cpp.

bool node_matches_recursive ( Handle< Component node,
const QRegExp  regex 
) const
private

Recursively checks whether a node name or one of its children matches a provided regular expression. The check stops once a recursive call returns true.

Parameters
nodeThe node to check.
regexRegular expression to match.
Returns
Returns true if the node or at least one of its children matches the regular expression.

Definition at line 780 of file NTree.cpp.

QString node_path ( const QModelIndex &  index) const

Retrieves a node path.

Parameters
indexNode index
Returns
Returns the node path

Definition at line 177 of file NTree.cpp.

void options_changed ( const cf3::common::URI path)

Definition at line 392 of file NTree.cpp.

QModelIndex parent ( const QModelIndex &  child) const
virtual

Implementation of QAbstractItemModel::parent()->

Parameters
childItem index of which we would like to know the parent.
Returns
Returns the parent index of the given child or a nullptr index if the child is not a valid index.

Definition at line 524 of file NTree.cpp.

URI pathFromIndex ( const QModelIndex &  index) const

Gives the path of the provided index.

Parameters
indexIndex of which we want to know the path.
Returns
Returns the index path, or an empty path if the index is not valid.

Definition at line 337 of file NTree.cpp.

int rowCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

Implementation of QAbstractItemModel::rowCount().

If the parent index is not valid, the root item is taken as parent.

Returns
Returns the row count (number of children) of a given parent.

Definition at line 545 of file NTree.cpp.

void set_advanced_mode ( bool  advanceMode)

Set advanced mode.

Parameters
advancedModeIf true, advanced mode is activated.
Todo:
find a better way to refresh the tree

Definition at line 192 of file NTree.cpp.

void set_current_index ( const QModelIndex &  newIndex)

Sets the current index.

If newIndex is valid and different from the current index, the current index is changed and current_index_changed signal is emitted. If newIndex is either not valid or the same as the current index, nothing is done.

Parameters
newIndexThe new index.
See also
getCurrentIndex
current_index_changed

Definition at line 82 of file NTree.cpp.

void set_debug_mode_enabled ( bool  debugMode)

Set the debug mode.

In debug mode, client components are showed.

Parameters
debugModeIf true, the debug mode is activated. Otherwise, it is deactivated.

Definition at line 354 of file NTree.cpp.

void set_tree_root ( Handle< NRoot node)

Replaces the current component tree.

The old tree is destroyed (regarding to boost::shared_ptr delete rules).

Parameters
nodeThe new root. May be nullptr.

Definition at line 57 of file NTree.cpp.

QString tool_tip ( ) const
virtual

Gives the tool tip text.

Returns
Returns The class name

Implements CNode.

Definition at line 771 of file NTree.cpp.

Handle< NRoot > tree_root ( ) const

Gives the current root.

Returns
Returns the current root

Definition at line 75 of file NTree.cpp.

void update_root_children ( )

Updates the children row counts, starting from the root.

Note
This method emits a layoutChanged() signal, causing the view(s) to be completely updated. Calling this method too often might decrease the program performances.

Definition at line 379 of file NTree.cpp.

void update_tree ( )
slot

Sends a request to update de tree.

Definition at line 742 of file NTree.cpp.

Member Data Documentation

bool m_advanced_mode
private

Indicates whether we are in advanced mode or not.

Definition at line 356 of file NTree.hpp.

QStringList m_columns
private

Column titles.

Definition at line 347 of file NTree.hpp.

QModelIndex m_current_index
private

Current index.

Definition at line 353 of file NTree.hpp.

bool m_debug_mode_enabled
private

Indicates whether we are in debug mode or not.

Definition at line 359 of file NTree.hpp.

QMutex* m_mutex
private

Mutex to control concurrent access.

Definition at line 362 of file NTree.hpp.

TreeNode* m_root_node
private

The root node.

Definition at line 350 of file NTree.hpp.


The documentation for this class was generated from the following files:
Send comments to:
COOLFluiD Web Admin