Skip to content
Snippets Groups Projects
Commit d54bff62 authored by Paul Nitzke's avatar Paul Nitzke
Browse files

Complete documentation for DotWriter

parent 58240432
No related branches found
No related tags found
1 merge request!27Complete documentation and streamline coding style a bit
......@@ -3,24 +3,30 @@ using DataStructures;
namespace SparseTransform.Convert
{
/// <summary>
/// Provides an IWriter implementation that outputs an uncolored DOT graph.
/// </summary>
class DotWriter : IWriter
{
public string Write(IGraph inputGraph)
/// <summary>
/// Transforms the <c>graph</c> to a DOT string.
/// </summary>
/// <param name="graph">IGraph implementation to transform</param>
/// <returns>DOT string</returns>
public string Write(IGraph graph)
{
StringBuilder output = new StringBuilder();
if (inputGraph is AdjacencyGraph)
if (graph is AdjacencyGraph)
{
return processAdjacencyGraph((AdjacencyGraph)inputGraph, output).ToString();
return processAdjacencyGraph((AdjacencyGraph)graph, output).ToString();
}
else
{
return processBipartiteGraph((BipartiteGraph)inputGraph, output).ToString();
return processBipartiteGraph((BipartiteGraph)graph, output).ToString();
}
}
/// <summary>
/// generates and adds a description-line in dot-format for every node and edge in the <c>inputGraph</c>
/// while interprating the graph as a adjacency graph
......@@ -37,7 +43,6 @@ namespace SparseTransform.Convert
return output;
}
/// <summary>
/// generates and adds a description-line in dot-format for every node and edge in the <c>inputGraph</c>
/// while interprating the graph as a bipartite graph
......@@ -57,7 +62,6 @@ namespace SparseTransform.Convert
return output;
}
/// <summary>
/// creates an edge entry in dot-format for each node in list <c>nodes</c>
/// </summary>
......@@ -86,7 +90,6 @@ namespace SparseTransform.Convert
}
}
/// <summary>
/// creates a node entry in dot-format for each node in list <c>nodes</c>
/// </summary>
......@@ -101,7 +104,6 @@ namespace SparseTransform.Convert
}
}
/// <summary>
/// auxiliary method for creating the dot-node label of graph node
/// </summary>
......@@ -112,8 +114,5 @@ namespace SparseTransform.Convert
{
return "\t" + prefix + node.Index + " [shape=circle, style=filled]";
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment