bpp-phyl3
3.0.0
|
Basal interface for tree drawing classes. More...
#include <Bpp/Phyl/Graphics/TreeDrawing.h>
Public Member Functions | |
TreeDrawing () | |
virtual | ~TreeDrawing () |
TreeDrawing * | clone () const =0 |
virtual std::string | getName () const =0 |
virtual bool | hasTree () const =0 |
virtual const Tree * | getTree () const =0 |
virtual void | setTree (const Tree *tree)=0 |
virtual void | setXUnit (double xu)=0 |
Set the 'horizontal' expansion unit. More... | |
virtual void | setYUnit (double yu)=0 |
Set the 'vertical' expansion unit. More... | |
virtual double | getXUnit () const =0 |
virtual double | getYUnit () const =0 |
virtual double | getWidth () const =0 |
virtual double | getHeight () const =0 |
virtual void | plot (GraphicDevice &gDevice) const =0 |
Plot the tree onto the specified device. More... | |
virtual Point2D< double > | getNodePosition (int nodeId) const =0 |
Get the position of a node. More... | |
virtual int | getNodeAt (const Point2D< double > &position) const =0 |
Get the node corresponding to a position on the device. More... | |
virtual void | addTreeDrawingListener (TreeDrawingListener *listener)=0 |
Add a drawing listener to this instance. More... | |
virtual void | removeTreeDrawingListener (TreeDrawingListener *listener)=0 |
Remove a drawing listener from this instance. More... | |
virtual void | collapseNode (int nodeId, bool yn)=0 |
Properties to draw. More... | |
virtual bool | isNodeCollapsed (int nodeId) const =0 |
virtual void | setDisplaySettings (const TreeDrawingSettings *tds)=0 |
Global drawing settings. More... | |
virtual const TreeDrawingSettings & | getDisplaySettings () const =0 |
Basal interface for tree drawing classes.
Basically, a TreeDrawing object draws a graph of the tree and computes the coordinates of each node on the graph. These coordinates may be retrieved by dedicated functions. The drawing is performed on a GraphicDevice object.
The TreeDrwing class is in charge of the tree representation, and offer tools to retrieve the coordinates of nodes. Using these functions to plot annotation may turn to be unefficient however, particularly for large trees, as they involve a search on the whole tree. For easier tuning of the drawing extensions, the interface defines the drawProperty, getSupportedDrawableProperties and isDrawable methods. These methods can be used to add features to the plot. Adding new features can then be performed by subclassing an existing algorithm and adding support for more properties.
The TreeDrawing interface do not implies that the implementation works on a copy of the tree. It takes a constant pointer toward the tree to plot. Depending on the implementation however, the inheriting class may chose to store a copy of the tree for convenience. Refer to the documentation of the specific implementation you are using for details.
Definition at line 221 of file TreeDrawing.h.
|
inline |
Definition at line 225 of file TreeDrawing.h.
|
inlinevirtual |
Definition at line 226 of file TreeDrawing.h.
|
pure virtual |
Add a drawing listener to this instance.
listener | a pointer toward an object implementing the TreeDrawingListener interface. This object will then be owned by the class and copied and deleted if/when needed, unless it is autonomous. |
Implemented in bpp::AbstractTreeDrawing.
Referenced by bpp::TreeDrawingDisplayControler::registerTreeDrawing().
|
pure virtual |
Implements bpp::Clonable.
Implemented in bpp::PhylogramPlot, and bpp::CladogramPlot.
|
pure virtual |
|
pure virtual |
Implemented in bpp::AbstractTreeDrawing.
|
pure virtual |
Implemented in bpp::PhylogramPlot, and bpp::CladogramPlot.
|
pure virtual |
Implemented in bpp::PhylogramPlot, and bpp::CladogramPlot.
|
pure virtual |
Get the node corresponding to a position on the device.
position | A position in the coordinates system of the last GraphicDevice used. |
NodeNotFoundException | If the node does not correspond to a node in the tree. |
Implemented in bpp::AbstractTreeDrawing.
|
pure virtual |
Get the position of a node.
nodeId | The identifier of the node. |
NodeNotFoundException | If the node does not correspond to a node in the tree. |
Implemented in bpp::AbstractTreeDrawing.
|
pure virtual |
Implemented in bpp::AbstractTreeDrawing.
Referenced by bpp::BranchLengthsTreeDrawingListener::afterDrawBranch(), bpp::BootstrapValuesTreeDrawingListener::afterDrawBranch(), bpp::LeafNamesTreeDrawingListener::afterDrawNode(), bpp::LabelInnerNodesTreeDrawingListener::afterDrawNode(), and bpp::LabelCollapsedNodesTreeDrawingListener::afterDrawNode().
|
pure virtual |
Implemented in bpp::PhylogramPlot, and bpp::CladogramPlot.
|
pure virtual |
Implemented in bpp::AbstractTreeDrawing.
Referenced by bpp::PhylogramDrawBranchEvent::getBranchCursor().
|
pure virtual |
Implemented in bpp::AbstractTreeDrawing.
|
pure virtual |
Implemented in bpp::AbstractTreeDrawing.
|
pure virtual |
Implemented in bpp::AbstractTreeDrawing.
Referenced by bpp::LabelInnerNodesTreeDrawingListener::afterDrawNode(), and bpp::LabelCollapsedNodesTreeDrawingListener::afterDrawNode().
|
pure virtual |
Plot the tree onto the specified device.
gDevice | An object implementing the GraphicDevice interface. |
Implemented in bpp::AbstractDendrogramPlot.
|
pure virtual |
Remove a drawing listener from this instance.
listener | a pointer toward an object implementing the TreeDrawingListener interface. If the listener is autonomous, it will be deleted. |
Implemented in bpp::AbstractTreeDrawing.
|
pure virtual |
Global drawing settings.
Implemented in bpp::AbstractTreeDrawing.
|
pure virtual |
tree | A pointer toward the tree to associate with this drawing. |
Implemented in bpp::PhylogramPlot, bpp::CladogramPlot, and bpp::AbstractTreeDrawing.
|
pure virtual |
Set the 'horizontal' expansion unit.
The effect of this expansion factor depends on the implementation of the interface.
xu | The horizontal unit length. |
Implemented in bpp::AbstractTreeDrawing.
|
pure virtual |
Set the 'vertical' expansion unit.
The effect of this expansion factor depends on the implementation of the interface.
yu | The vertical unit length. |
Implemented in bpp::AbstractTreeDrawing.