本文整理汇总了C++中GraphEdge::getText方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphEdge::getText方法的具体用法?C++ GraphEdge::getText怎么用?C++ GraphEdge::getText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphEdge
的用法示例。
在下文中一共展示了GraphEdge::getText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
/**
* Writes a description of the graph to the given stream, using the Dot
* language.
* The method allows for both directed graphs and non-directed graphs, the
* latter are required for drawing purposes (since Dot will not produce the
* arrow heads and the splines terminate before reaching the nodes).
* @param str The stream to write to
* @param sType Either "graph" or "digraph"
* @param sEdge The edge connector ("--" or "->")
* @param bWriteCall true to write call information, false otherwise
*/
void GraphWidget::write(QTextStream& str, const QString& sType,
const QString& sEdge, bool bWriteCall)
{
QFont font;
QDictIterator<GraphNode> itr(m_dictNodes);
GraphEdge* pEdge;
Encoder enc;
font = Config().getFont(KScopeConfig::Graph);
// Header
str << sType << " G {\n";
// Graph attributes
str << "\tgraph [rankdir=" << Config().getGraphOrientation() << ", "
<< "kscope_zoom=" << m_dZoom
<< "];\n";
// Default node attributes
str << "\tnode [shape=box, height=\"0.01\", style=filled, "
<< "fillcolor=\"" << Config().getColor(KScopeConfig::GraphNode).name()
<< "\", "
<< "fontcolor=\"" << Config().getColor(KScopeConfig::GraphText).name()
<< "\", "
<< "fontname=\"" << font.family() << "\", "
<< "fontsize=" << QString::number(font.pointSize())
<< "];\n";
// Iterate over all nodes
for (; itr.current(); ++itr) {
// Write a node
str << "\t" << itr.current()->getFunc() << ";\n";
// Iterate over all edges leaving this node
QDictIterator<GraphEdge> itrEdge(itr.current()->getOutEdges());
for (; itrEdge.current(); ++itrEdge) {
pEdge = itrEdge.current();
str << "\t" << pEdge->getHead()->getFunc() << sEdge
<< pEdge->getTail()->getFunc();
// Write call information
if (bWriteCall) {
str << " ["
<< "kscope_file=\"" << pEdge->getFile() << "\","
<< "kscope_line=" << pEdge->getLine() << ","
<< "kscope_text=\"" << enc.encode(pEdge->getText()) << "\""
<< "]";
}
str << ";\n";
}
}
// Close the graph
str << "}\n";
}