Doxygen
Loading...
Searching...
No Matches
DotGroupCollaboration::Edge Struct Reference
Collaboration diagram for DotGroupCollaboration::Edge:

Public Member Functions

 Edge (DotNode *start, DotNode *end, EdgeType type)
void write (TextStream &t) const

Public Attributes

DotNodepNStart
DotNodepNEnd
EdgeType eType
std::vector< Linklinks

Detailed Description

Definition at line 67 of file dotgroupcollaboration.h.

Constructor & Destructor Documentation

◆ Edge()

DotGroupCollaboration::Edge::Edge ( DotNode * start,
DotNode * end,
EdgeType type )
inline

Definition at line 69 of file dotgroupcollaboration.h.

70 : pNStart(start), pNEnd(end), eType(type) {}
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:181

References DotGraph::DotNode, end(), eType, pNEnd, and pNStart.

Member Function Documentation

◆ write()

void DotGroupCollaboration::Edge::write ( TextStream & t) const

Definition at line 264 of file dotgroupcollaboration.cpp.

265{
266 const char* linkTypeColor[] = {
267 "darkorchid3"
268 ,"orange"
269 ,"blueviolet"
270 ,"darkgreen"
271 ,"firebrick4"
272 ,"grey75"
273 ,"midnightblue"
274 };
275 DString arrowStyle = "dir=\"none\", style=\"dashed\"";
276 t << " Node" << pNStart->number();
277 t << "->";
278 t << "Node" << pNEnd->number();
279
280 t << " [shape=plaintext";
281 if (!links.empty()) // there are links
282 {
283 t << ", ";
284 // HTML-like edge labels crash on my Mac with Graphviz 2.0! and
285 // are not supported by older version of dot.
286 //
287 //t << label=<<TABLE BORDER=\"0\" CELLBORDER=\"0\">";
288 //for (const auto &link : links)
289 //{
290 // t << "<TR><TD";
291 // if ( !link.url.empty() )
292 // t << " HREF=\"" << link.url << "\"";
293 // t << ">" << DotNode::convertLabel(link->label) << "</TD></TR>";
294 //}
295 //t << "</TABLE>>";
296
297 t << "label=\"";
298 bool first=true;
299 int count=0;
300 const int maxLabels = 10;
301 for (const auto &link : links)
302 {
303 if (first) first=false; else t << "\\n";
304 t << DotNode::convertLabel(link.label);
305 count++;
306 }
307 if (count==maxLabels) t << "\\n...";
308 t << "\"";
309
310 }
311 switch( eType )
312 {
313 case thierarchy:
314 arrowStyle = "dir=\"back\", style=\"solid\"";
315 break;
316 default:
317 t << ", color=\"" << linkTypeColor[static_cast<int>(eType)] << "\"";
318 break;
319 }
320 t << ", " << arrowStyle;
321 t << "];\n";
322}
static DString convertLabel(const DString &, LabelStyle=LabelStyle::Plain)
Definition dotnode.cpp:198
int number() const
Definition dotnode.h:103

References DotNode::convertLabel(), eType, links, DotNode::number(), pNEnd, pNStart, and DotGroupCollaboration::thierarchy.

Member Data Documentation

◆ eType

EdgeType DotGroupCollaboration::Edge::eType

Definition at line 74 of file dotgroupcollaboration.h.

Referenced by Edge(), and write().

◆ links

std::vector<Link> DotGroupCollaboration::Edge::links

Definition at line 76 of file dotgroupcollaboration.h.

Referenced by write().

◆ pNEnd

DotNode* DotGroupCollaboration::Edge::pNEnd

Definition at line 73 of file dotgroupcollaboration.h.

Referenced by Edge(), and write().

◆ pNStart

DotNode* DotGroupCollaboration::Edge::pNStart

Definition at line 72 of file dotgroupcollaboration.h.

Referenced by Edge(), and write().


The documentation for this struct was generated from the following files: