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:176

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

Member Function Documentation

◆ write()

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

Definition at line 262 of file dotgroupcollaboration.cpp.

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