This class describe what are the methods to implement for a hierarchical tree node. More...
#include <InterfaceNode.h>
Public Member Functions | |
virtual void | addChild (InterfaceNode *)=0 |
add a child Component (sub item in the hierarchy), and modify the child's parent to be equal to this instance More... | |
virtual void | attachChild (InterfaceNode *)=0 |
add a child Component (but leave its parent unchanged) More... | |
virtual void | deleteChildren ()=0 |
delete all sub Component, but do not delete the pointer (only the top-level component has the right to do that) More... | |
virtual bool | doubleClicked ()=0 |
this method is called each time the InterfaceNode is double clicked by the user. More... | |
virtual const ComponentList & | getChildren ()=0 |
get the list of the InterfaceNode children (sub items in the hierarchy) More... | |
virtual QPixmap | getIcon ()=0 |
Get the pixmap that will be displayed for this node. More... | |
virtual QString | getName () const =0 |
get the name to be displayed More... | |
virtual bool | getNodeModified () const =0 |
Get the current modification flag. More... | |
virtual InterfaceNode * | getParent ()=0 |
get the parent Component More... | |
virtual QMenu * | getPopupMenu (QWidget *parent=nullptr)=0 |
get the popup menu to display (or NULL if inexistant) More... | |
virtual bool | inItalic () const =0 |
should the name be displayed in italic? More... | |
virtual void | removeChild (InterfaceNode *)=0 |
remove a sub Component (only the top-level component has the right to do that) More... | |
virtual void | setName (const QString &)=0 |
set the name to be displayed More... | |
virtual void | setNodeModified (bool)=0 |
Set up the node modification flag. More... | |
virtual void | setParent (InterfaceNode *)=0 |
set the parent Component More... | |
virtual | ~InterfaceNode ()=default |
empty virtual destructor, to avoid memory leak More... | |
This class describe what are the methods to implement for a hierarchical tree node.
An InterfaceNode can only have one parent, even if it is a child of more than one InterfaceNodes.
Consequence: an InterfaceNode can be present many times in the hierarchy, but can only depends from one parent. To add an InterfaceNode as a child and change its parent to this use addChild(). To add an InterfaceNode as a child without modifying its parent, use attachChild().
This class defines an "interface" (in the OOP/java meaning of the term). See the introduction of GoF: "Program to an interface, not an implementation." To see what Erich Gamma has to say about it: http://www.artima.com/lejava/articles/designprinciplesP.html To see what Bjarne Stroustrup has to say about it: http://www.artima.com/intv/modern.html
|
virtualdefault |
empty virtual destructor, to avoid memory leak
|
pure virtual |
add a child Component (sub item in the hierarchy), and modify the child's parent to be equal to this instance
This is to be used with care. The preferred method to add a child component is to use the Component's constructor with the parent parameter: Component(Component *, const QString &, Representation rep) .
Implemented in camitk::Component.
|
pure virtual |
add a child Component (but leave its parent unchanged)
There can be some refresh problem, see the note in addChild()
Implemented in camitk::Component.
|
pure virtual |
delete all sub Component, but do not delete the pointer (only the top-level component has the right to do that)
Implemented in camitk::Component.
|
pure virtual |
this method is called each time the InterfaceNode is double clicked by the user.
Implemented in camitk::Component.
|
pure virtual |
get the list of the InterfaceNode children (sub items in the hierarchy)
Implemented in camitk::Component.
|
pure virtual |
Get the pixmap that will be displayed for this node.
If you want your component to have a nice pixmap displayed in the explorer, for example, you just need to
And that all folks! A nice icon will be now used to display your component!
Implemented in camitk::Component, camitk::MeshComponent, PMLComponent, and VtkMeshComponent.
|
pure virtual |
get the name to be displayed
Implemented in camitk::Component.
|
pure virtual |
Get the current modification flag.
Implemented in camitk::Component.
|
pure virtual |
get the parent Component
Implemented in camitk::Component.
|
pure virtual |
get the popup menu to display (or NULL if inexistant)
Implemented in camitk::Component.
|
pure virtual |
should the name be displayed in italic?
Implemented in camitk::Component.
|
pure virtual |
remove a sub Component (only the top-level component has the right to do that)
Implemented in camitk::Component.
|
pure virtual |
set the name to be displayed
Implemented in camitk::Component.
|
pure virtual |
Set up the node modification flag.
This means that the name(s) or children hierarchy were modified This can be useful information when a viewer, such as the Explorer viewer, needs to know what to refresh
Implemented in camitk::Component.
|
pure virtual |
set the parent Component
Implemented in camitk::Component.
Referenced by camitk::Component::addProperty().