bpp-phyl
2.2.0
|
Phylogram representation of trees. More...
#include <Bpp/Phyl/Graphics/PhylogramPlot.h>
Public Member Functions | |
PhylogramPlot () | |
virtual | ~PhylogramPlot () |
PhylogramPlot * | clone () const |
std::string | getName () const |
void | setTree (const Tree *tree=0) |
double | getWidth () const |
double | getHeight () const |
void | treeHasChanged () |
Method to implement to deal with redrawing when the underlying tree has been modified. More... | |
void | setHorizontalOrientation (short orientation) |
void | setVerticalOrientation (short orientation) |
short | getHorizontalOrientation () const |
short | getVerticalOrientation () const |
void | plot (GraphicDevice &gDevice) const throw (Exception) |
Plot the tree onto the specified device. More... | |
bool | hasTree () const |
const TreeTemplate< INode > * | getTree () const |
Point2D< double > | getNodePosition (int nodeId) const throw (NodeNotFoundException) |
Get the position of a node. More... | |
int | getNodeAt (const Point2D< double > &position) const throw (NodeNotFoundException) |
Get the node corresponding to a position on the device. More... | |
bool | belongsTo (const Point2D< double > &p1, const Point2D< double > &p2) const |
Utilitary function, telling if a point belongs to a specified area. More... | |
virtual void | drawAtNode (GraphicDevice &gDevice, const INode &node, const std::string &text, double xOffset=0, double yOffset=0, short hpos=GraphicDevice::TEXT_HORIZONTAL_LEFT, short vpos=GraphicDevice::TEXT_VERTICAL_CENTER, double angle=0) const |
Draw some text at a particular node position. More... | |
virtual void | drawAtBranch (GraphicDevice &gDevice, const INode &node, const std::string &text, double xOffset=0, double yOffset=0, short hpos=GraphicDevice::TEXT_HORIZONTAL_LEFT, short vpos=GraphicDevice::TEXT_VERTICAL_CENTER, double angle=0) const |
Draw some text at a particular branch position. More... | |
void | setDisplaySettings (const TreeDrawingSettings *tds) throw (NullPointerException) |
Global drawing settings. More... | |
const TreeDrawingSettings & | getDisplaySettings () const |
double | getXUnit () const |
double | getYUnit () const |
void | setXUnit (double xu) |
Set the 'horizontal' expansion unit. More... | |
void | setYUnit (double yu) |
Set the 'vertical' expansion unit. More... | |
void | collapseNode (int nodeId, bool yn) throw (NodeNotFoundException, Exception) |
Properties to draw. More... | |
bool | isNodeCollapsed (int nodeId) const throw (NodeNotFoundException, Exception) |
void | addTreeDrawingListener (TreeDrawingListener *listener) throw (Exception) |
Add a drawing listener to this instance. More... | |
void | removeTreeDrawingListener (TreeDrawingListener *listener) throw (Exception) |
Remove a drawing listener from this instance. More... | |
Static Public Attributes | |
static short | ORIENTATION_LEFT_TO_RIGHT = 1 |
static short | ORIENTATION_RIGHT_TO_LEFT = 2 |
static short | ORIENTATION_TOP_TO_BOTTOM = 3 |
static short | ORIENTATION_BOTTOM_TO_TOP = 4 |
static const TreeDrawingSettings | DEFAULT_SETTINGS |
Protected Member Functions | |
TreeTemplate< INode > * | getTree_ () |
const TreeTemplate< INode > * | getTree_ () const |
void | fireBeforeTreeEvent_ (const DrawTreeEvent &event) const |
void | fireAfterTreeEvent_ (const DrawTreeEvent &event) const |
void | fireBeforeNodeEvent_ (const DrawINodeEvent &event) const |
void | fireAfterNodeEvent_ (const DrawINodeEvent &event) const |
void | fireBeforeBranchEvent_ (const DrawIBranchEvent &event) const |
void | fireAfterBranchEvent_ (const DrawIBranchEvent &event) const |
Private Member Functions | |
void | drawDendrogram_ (GraphicDevice &gDevice) const throw (Exception) |
void | recursivePlot_ (GraphicDevice &gDevice, INode &node, double x, double &y, double hDirection, double vDirection, unsigned int *tipCounter) const |
Private Attributes | |
double | totalDepth_ |
double | numberOfLeaves_ |
Phylogram representation of trees.
This representation is for trees with branch lengths.
Definition at line 69 of file PhylogramPlot.h.
|
inline |
Definition at line 77 of file PhylogramPlot.h.
Referenced by clone().
|
inlinevirtual |
Definition at line 81 of file PhylogramPlot.h.
|
inlinevirtualinherited |
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. |
Implements bpp::TreeDrawing.
Definition at line 305 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::listeners_.
|
inherited |
Utilitary function, telling if a point belongs to a specified area.
This method is used internally to get a node coordinates.
p1 | Point to look for. |
p2 | Second point defining the center of the area. |
Definition at line 86 of file AbstractTreeDrawing.cpp.
|
inlinevirtual |
Implements bpp::TreeDrawing.
Definition at line 83 of file PhylogramPlot.h.
References PhylogramPlot().
|
inlinevirtualinherited |
Properties to draw.
Collapsing nodes
Implements bpp::TreeDrawing.
Definition at line 293 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::tree_.
|
virtualinherited |
Draw some text at a particular branch position.
gDevice | The GraphicDevice object on which to draw. |
node | The node of interest. |
text | The text to draw. |
xOffset | Horizontal offset. |
yOffset | Vertical offset. |
hpos | The way the text should be aligned horizontally (see GraphicDevice). |
vpos | The way the text should be aligned vertically (see GraphicDevice). |
angle | The rotation value of the text. |
Definition at line 97 of file AbstractTreeDrawing.cpp.
References bpp::NodeTemplate< NodeInfos >::getFather(), bpp::NodeTemplate< NodeInfos >::getInfos(), and bpp::Node::hasFather().
|
virtualinherited |
Draw some text at a particular node position.
gDevice | The GraphicDevice object on which to draw. |
node | The node of interest. |
text | The text to draw. |
xOffset | Horizontal offset. |
yOffset | Vertical offset. |
hpos | The way the text should be aligned horizontally (see GraphicDevice). |
vpos | The way the text should be aligned vertically (see GraphicDevice). |
angle | The rotation value of the text. |
Definition at line 92 of file AbstractTreeDrawing.cpp.
References bpp::NodeTemplate< NodeInfos >::getInfos().
|
privatevirtual |
Implements bpp::AbstractDendrogramPlot.
Definition at line 75 of file PhylogramPlot.cpp.
|
inlineprotectedinherited |
Definition at line 366 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::listeners_.
Referenced by recursivePlot_(), and bpp::CladogramPlot::recursivePlot_().
|
inlineprotectedinherited |
Definition at line 352 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::listeners_.
Referenced by recursivePlot_(), and bpp::CladogramPlot::recursivePlot_().
|
inlineprotectedinherited |
Definition at line 338 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::listeners_.
|
inlineprotectedinherited |
Definition at line 359 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::listeners_.
Referenced by recursivePlot_(), and bpp::CladogramPlot::recursivePlot_().
|
inlineprotectedinherited |
Definition at line 345 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::listeners_.
Referenced by recursivePlot_(), and bpp::CladogramPlot::recursivePlot_().
|
inlineprotectedinherited |
Definition at line 331 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::listeners_.
|
inlinevirtualinherited |
Implements bpp::TreeDrawing.
Definition at line 283 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::settings_.
|
inlinevirtual |
Implements bpp::TreeDrawing.
Definition at line 91 of file PhylogramPlot.h.
References numberOfLeaves_.
Referenced by recursivePlot_().
|
inlineinherited |
Definition at line 72 of file AbstractDendrogramPlot.h.
References bpp::AbstractDendrogramPlot::horOrientation_.
Referenced by recursivePlot_(), and bpp::CladogramPlot::recursivePlot_().
|
inlinevirtual |
Implements bpp::TreeDrawing.
Definition at line 86 of file PhylogramPlot.h.
|
virtualinherited |
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. |
Implements bpp::TreeDrawing.
Definition at line 70 of file AbstractTreeDrawing.cpp.
References bpp::Node::getId(), and bpp::NodeTemplate< NodeInfos >::getInfos().
|
virtualinherited |
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. |
Implements bpp::TreeDrawing.
Definition at line 55 of file AbstractTreeDrawing.cpp.
References bpp::Node::getId(), and bpp::NodeTemplate< NodeInfos >::getInfos().
|
inlinevirtualinherited |
Implements bpp::TreeDrawing.
Definition at line 219 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::tree_.
|
inlineprotectedinherited |
Definition at line 328 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::tree_.
Referenced by setTree(), bpp::CladogramPlot::setTree(), treeHasChanged(), and bpp::CladogramPlot::treeHasChanged().
|
inlineprotectedinherited |
Definition at line 329 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::tree_.
|
inlineinherited |
Definition at line 73 of file AbstractDendrogramPlot.h.
References bpp::AbstractDendrogramPlot::verOrientation_.
Referenced by recursivePlot_(), and bpp::CladogramPlot::recursivePlot_().
|
inlinevirtual |
Implements bpp::TreeDrawing.
Definition at line 90 of file PhylogramPlot.h.
References totalDepth_.
|
inlinevirtualinherited |
Implements bpp::TreeDrawing.
Definition at line 285 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::xUnit_.
Referenced by recursivePlot_(), and bpp::CladogramPlot::recursivePlot_().
|
inlinevirtualinherited |
Implements bpp::TreeDrawing.
Definition at line 287 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::yUnit_.
Referenced by recursivePlot_(), and bpp::CladogramPlot::recursivePlot_().
|
inlinevirtualinherited |
Implements bpp::TreeDrawing.
Definition at line 212 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::tree_.
Referenced by bpp::CladogramPlot::setTree(), treeHasChanged(), and bpp::CladogramPlot::treeHasChanged().
|
inlinevirtualinherited |
Implements bpp::TreeDrawing.
Definition at line 299 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::tree_.
|
virtualinherited |
Plot the tree onto the specified device.
gDevice | An object implementing the GraphicDevice interface. |
Implements bpp::TreeDrawing.
Definition at line 50 of file AbstractDendrogramPlot.cpp.
|
private |
Definition at line 93 of file PhylogramPlot.cpp.
References bpp::AbstractTreeDrawing::fireAfterBranchEvent_(), bpp::AbstractTreeDrawing::fireAfterNodeEvent_(), bpp::AbstractTreeDrawing::fireBeforeBranchEvent_(), bpp::AbstractTreeDrawing::fireBeforeNodeEvent_(), bpp::Node::getDistanceToFather(), getHeight(), bpp::AbstractDendrogramPlot::getHorizontalOrientation(), bpp::NodeTemplate< NodeInfos >::getInfos(), bpp::Node::getNumberOfSons(), bpp::NodeTemplate< NodeInfos >::getSon(), bpp::AbstractDendrogramPlot::getVerticalOrientation(), bpp::AbstractTreeDrawing::getXUnit(), bpp::AbstractTreeDrawing::getYUnit(), bpp::Node::hasDistanceToFather(), bpp::Node::isLeaf(), bpp::AbstractDendrogramPlot::ORIENTATION_LEFT_TO_RIGHT, and bpp::AbstractDendrogramPlot::ORIENTATION_TOP_TO_BOTTOM.
|
inlinevirtualinherited |
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. |
Implements bpp::TreeDrawing.
Definition at line 312 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::listeners_.
|
inlinevirtualinherited |
Global drawing settings.
Implements bpp::TreeDrawing.
Definition at line 278 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::settings_.
|
inlineinherited |
Definition at line 69 of file AbstractDendrogramPlot.h.
References bpp::AbstractDendrogramPlot::horOrientation_.
|
virtual |
tree | A pointer toward the tree to associate with this drawing. |
Reimplemented from bpp::AbstractTreeDrawing.
Definition at line 66 of file PhylogramPlot.cpp.
References bpp::AbstractTreeDrawing::getTree_(), and bpp::AbstractTreeDrawing::setTree().
|
inlineinherited |
Definition at line 70 of file AbstractDendrogramPlot.h.
References bpp::AbstractDendrogramPlot::verOrientation_.
|
inlinevirtualinherited |
Set the 'horizontal' expansion unit.
The effect of this expansion factor depends on the implementation of the interface.
xu | The horizontal unit length. |
Implements bpp::TreeDrawing.
Definition at line 289 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::xUnit_.
|
inlinevirtualinherited |
Set the 'vertical' expansion unit.
The effect of this expansion factor depends on the implementation of the interface.
yu | The vertical unit length. |
Implements bpp::TreeDrawing.
Definition at line 291 of file AbstractTreeDrawing.h.
References bpp::AbstractTreeDrawing::yUnit_.
|
inlinevirtual |
Method to implement to deal with redrawing when the underlying tree has been modified.
Implements bpp::AbstractTreeDrawing.
Definition at line 93 of file PhylogramPlot.h.
References bpp::TreeTemplateTools::getHeight(), bpp::AbstractTreeDrawing::getTree_(), bpp::AbstractTreeDrawing::hasTree(), numberOfLeaves_, and totalDepth_.
|
staticinherited |
Definition at line 373 of file AbstractTreeDrawing.h.
|
private |
Definition at line 74 of file PhylogramPlot.h.
Referenced by getHeight(), and treeHasChanged().
|
staticinherited |
Definition at line 84 of file AbstractDendrogramPlot.h.
|
staticinherited |
Definition at line 81 of file AbstractDendrogramPlot.h.
Referenced by bpp::CladogramDrawBranchEvent::CladogramDrawBranchEvent(), bpp::PhylogramDrawBranchEvent::PhylogramDrawBranchEvent(), recursivePlot_(), and bpp::CladogramPlot::recursivePlot_().
|
staticinherited |
Definition at line 82 of file AbstractDendrogramPlot.h.
|
staticinherited |
Definition at line 83 of file AbstractDendrogramPlot.h.
Referenced by recursivePlot_(), and bpp::CladogramPlot::recursivePlot_().
|
private |
Definition at line 73 of file PhylogramPlot.h.
Referenced by getWidth(), and treeHasChanged().