5 #include "../Tree/TreeTemplateTools.h"
23 if (
getINode()->hasDistanceToFather())
36 getTree_()->setVoidBranchLengths(0.);
46 unsigned int tipCounter = 0;
61 bool drawBranch =
true;
65 if (length < -10000000)
72 x2 = x + hDirection * length *
getXUnit();
81 unique_ptr<Cursor> cursor;
82 unique_ptr<DrawINodeEvent> nodeEvent;
83 unique_ptr<DrawIBranchEvent> branchEvent;
89 cursor.reset(
new Cursor(x2, y, 0, hpos));
90 nodeEvent.reset(
new DrawINodeEvent(
this, &gDevice, &node, *cursor));
93 else if (node.
getInfos().isCollapsed())
97 cursor.reset(
new Cursor(x2, y, 0, hpos));
98 nodeEvent.reset(
new DrawINodeEvent(
this, &gDevice, &node, *cursor));
104 double miny = 1000000;
115 y = (maxy + miny) / 2.;
116 cursor.reset(
new Cursor(x2, y, 0, hpos));
117 nodeEvent.reset(
new DrawINodeEvent(
this, &gDevice, &node, *cursor));
119 gDevice.
drawLine(x2, miny, x2, maxy);
125 nodeEvent.reset(
new DrawINodeEvent(
this, &gDevice, &node, *cursor));
short getVerticalOrientation() const
static short ORIENTATION_TOP_TO_BOTTOM
short getHorizontalOrientation() const
static short ORIENTATION_LEFT_TO_RIGHT
void fireBeforeBranchEvent_(const DrawIBranchEvent &event) const
TreeTemplate< INode > * getTree_()
void fireAfterTreeEvent_(const DrawTreeEvent &event) const
void fireBeforeNodeEvent_(const DrawINodeEvent &event) const
void setTree(const Tree *tree)
void fireAfterNodeEvent_(const DrawINodeEvent &event) const
void fireBeforeTreeEvent_(const DrawTreeEvent &event) const
void fireAfterBranchEvent_(const DrawIBranchEvent &event) const
Data structure describing a plotting direction.
Cursor getTranslation(double x, double y) const
virtual const TreeDrawing * getTreeDrawing() const
virtual const Cursor & getCursor() const
Event class that uses INode object (more efficient than relying on nodes id, but less generic).
const INode * getINode() const
Event class that uses INode object (more efficient than relying on nodes id, but less generic).
Event class used by TreeDrawing classes.
static short TEXT_HORIZONTAL_LEFT
static short TEXT_HORIZONTAL_RIGHT
virtual void drawLine(double x1, double y1, double x2, double y2)=0
const NodeTemplate< NodeInfos > * getSon(size_t i) const
virtual const NodeInfos & getInfos() const
virtual bool hasDistanceToFather() const
Tell is this node has a distance to the father.
virtual bool isLeaf() const
virtual double getDistanceToFather() const
Get the distance to the father node is there is one, otherwise throw a NodeException.
virtual size_t getNumberOfSons() const
Cursor getBranchCursor(double position) const
PhylogramDrawBranchEvent(const TreeDrawing *source, GraphicDevice *gd, const INode *node, const Cursor &cursor, short orientation)
void recursivePlot_(GraphicDevice &gDevice, INode &node, double x, double &y, double hDirection, double vDirection, unsigned int &tipCounter) const
void drawDendrogram_(GraphicDevice &gDevice) const
void setTree(const Tree *tree=0)
Basal interface for tree drawing classes.
virtual double getXUnit() const =0
Interface for phylogenetic tree objects.
Defines the basic types of data flow nodes.