本文整理汇总了C++中NodePtr::GetLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ NodePtr::GetLabel方法的具体用法?C++ NodePtr::GetLabel怎么用?C++ NodePtr::GetLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodePtr
的用法示例。
在下文中一共展示了NodePtr::GetLabel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: traversenoquote
//Added by BCO
//------------------------------------------------------------------------------
void Tree::traversenoquote (NodePtr p)
{
if (p)
{
if (p->IsLeaf())
{
for (int i=0; i<(NEXUSString (p->GetLabel())).length(); i++) {
if ((NEXUSString (p->GetLabel()))[i]!= '\'') {
*treeStream <<(NEXUSString (p->GetLabel()))[i];
}
}
//*treeStream<<NEXUSString (p->GetLabel());
if (EdgeLengths)
{
*treeStream << ':' << p->GetEdgeLength ();
}
}
else
{
*treeStream << "(";
}
traversenoquote (p->GetChild());
if (p->GetSibling())
{
*treeStream << ",";
}
else
{
if (p != Root)
{
*treeStream << ")";
// 29/3/96
if ((p->GetAnc()->GetLabel() != "") && InternalLabels)
{
*treeStream << NEXUSString (p->GetAnc()->GetLabel ()) ; //here's the change from traverse
}
if (EdgeLengths && (p->GetAnc () != Root))
{
*treeStream << ':' << p->GetAnc()->GetEdgeLength ();
}
}
}
traversenoquote (p->GetSibling());
}
}
示例2: makeNodeList
//------------------------------------------------------------------------------
void Tree::makeNodeList (NodePtr p)
{
if (p)
{
makeNodeList (p->GetChild ());
makeNodeList (p->GetSibling ());
if (p->IsLeaf())
{
int leafnumberposition=p->GetLeafNumber()-1;//modified by BCO
string plabel=p->GetLabel(); //modified by BCO
LeafList[plabel] = leafnumberposition; //modified by BCO
assert((Leaves+Internals)>leafnumberposition);
Nodes[leafnumberposition] = p; //modified by BCO
p->SetIndex (leafnumberposition); //modified by BCO
}
else
{
Nodes[count] = p;
p->SetIndex (count);
count++;
}
if (p != Root)
{
}
}
}
示例3: drawLine
void Tree::drawLine (NodePtr p, bool isChild)
{
*treeStream << Line.c_str();
if (p->IsLeaf())
{
* treeStream<< " " << p->GetLabel () <<endl;
}
else
{
// Draw internal label, if present
string s = p->GetLabel();
if (s != "" && isChild)
*treeStream << p->GetLabel();
*treeStream << endl;
}
}
示例4: traverse
//------------------------------------------------------------------------------
void Tree::traverse (NodePtr p)
{
if (p)
{
if (p->IsLeaf())
{
*treeStream << NEXUSString (p->GetLabel());
if (EdgeLengths)
{
*treeStream << ':' << p->GetEdgeLength ();
}
}
else
{
*treeStream << "(";
}
traverse (p->GetChild());
if (p->GetSibling())
{
*treeStream << ",";
}
else
{
if (p != Root)
{
*treeStream << ")";
// 29/3/96
if ((p->GetAnc()->GetLabel() != "") && InternalLabels)
{
*treeStream << '\'' << NEXUSString (p->GetAnc()->GetLabel ()) << '\'';
}
if (EdgeLengths && (p->GetAnc () != Root))
{
*treeStream << ':' << p->GetAnc()->GetEdgeLength ();
}
}
}
traverse (p->GetSibling());
}
}