TryCalculatePerEdgeAndPerVertexMetrics
(
IGraph oGraphClone,
IGraph oGraph,
ReadabilityMetricUserSettings oReadabilityMetricUserSettings,
BackgroundWorker oBackgroundWorker,
Dictionary<IEdge, Int32> oEdgeInformation,
Dictionary<IVertex, VertexInformation> oVertexInformations,
LinkedList<GraphMetricColumn> oGraphMetricColumns
)
{
Debug.Assert(oGraphClone != null);
Debug.Assert(oGraph != null);
Debug.Assert(oReadabilityMetricUserSettings != null);
Debug.Assert(oBackgroundWorker != null);
Debug.Assert(oEdgeInformation != null);
Debug.Assert(oVertexInformations != null);
Debug.Assert(oGraphMetricColumns != null);
AssertValid();
ICollection<GraphMetricValueWithID> oGraphMetricValuesWithID;
if ( oReadabilityMetricUserSettings.ShouldCalculateReadabilityMetrics(
ReadabilityMetrics.PerEdgeEdgeCrossings) )
{
if ( !TryCalculatePerEdgeEdgeCrossings(oGraphClone, oGraph,
oBackgroundWorker, oEdgeInformation,
out oGraphMetricValuesWithID) )
{
return (false);
}
oGraphMetricColumns.AddLast(
new GraphMetricColumnWithID( WorksheetNames.Edges,
TableNames.Edges, EdgeTableColumnNames.EdgeCrossings,
ExcelTableUtil.AutoColumnWidth, NumericFormat,
CellStyleNames.GraphMetricGood,
oGraphMetricValuesWithID.ToArray() ) );
}
if ( oReadabilityMetricUserSettings.ShouldCalculateReadabilityMetrics(
ReadabilityMetrics.PerVertexEdgeCrossings) )
{
if ( !TryCalculatePerVertexEdgeCrossings(oGraphClone,
oBackgroundWorker, oEdgeInformation, oVertexInformations,
out oGraphMetricValuesWithID) )
{
return (false);
}
oGraphMetricColumns.AddLast(
new GraphMetricColumnWithID( WorksheetNames.Vertices,
TableNames.Vertices, VertexTableColumnNames.EdgeCrossings,
ExcelTableUtil.AutoColumnWidth, NumericFormat,
CellStyleNames.GraphMetricGood,
oGraphMetricValuesWithID.ToArray() ) );
}
if ( oReadabilityMetricUserSettings.ShouldCalculateReadabilityMetrics(
ReadabilityMetrics.PerVertexVertexOverlap) )
{
if ( !TryCalculatePerVertexVertexOverlap(oGraphClone,
oBackgroundWorker, oVertexInformations,
out oGraphMetricValuesWithID) )
{
return (false);
}
oGraphMetricColumns.AddLast(
new GraphMetricColumnWithID( WorksheetNames.Vertices,
TableNames.Vertices, VertexTableColumnNames.VertexOverlap,
ExcelTableUtil.AutoColumnWidth, NumericFormat,
CellStyleNames.GraphMetricGood,
oGraphMetricValuesWithID.ToArray() ) );
}
return (true);
}