1 //! \file ToGraphvizWriter.cpp
3 #include "ToGraphvizWriter.h"
9 void ToGraphvizWriter::writeHeader(std::ostream
& os
)
15 void ToGraphvizWriter::writeFooter(std::ostream
& os
)
21 /*! \bug When writing an #Article only, attributes are only set on the article
22 * itself. Attributes won't be written on linked articles.
23 * However, when writing an #ArticleCollection, all articles are included, so
24 * all attibutes will be written.
26 void ToGraphvizWriter::writeArticle(const Article
* a
, std::ostream
& os
)
28 // marked articles are printed as box
30 os
<< "\"" << a
->getTitle() << "\" [shape=box];" << std::endl
;
33 if(!a
->isAnalyzed()) {
34 os
<< "\"" << a
->getTitle() << "\" [fillcolor=gray,style=filled];" << std::endl
;
37 // unanalyzed articles are printed greyed out
38 for(auto al
= a
->linkBegin(); al
!= a
->linkEnd(); al
++) {
39 os
<< "\"" << a
->getTitle() << "\" -> \"" << (*al
)->getTitle() << "\";" << std::endl
;
43 void ToGraphvizWriter::output(const Article
* a
, std::ostream
& os
)
52 void ToGraphvizWriter::output(const ArticleCollection
& ac
, std::ostream
& os
)
57 writeArticle(a
.second
, os
);