AddEdgeWidthAttributesToDConnectorMotif
(
ExcelTemplateGroupInfo oGroup,
Boolean bEdgeWidthColumnAutoFilled,
AutoFillNumericRangeColumnResults oEdgeWidthResults,
NumericRangeColumnAutoFillUserSettings oEdgeWidthDetails,
Dictionary<Int32, Object> oEdgeWidthSourceDictionary,
ReadWorkbookContext oReadWorkbookContext,
CollapsedGroupAttributes oCollapsedGroupAttributes,
Int32 iAnchorVertices
)
{
Debug.Assert(oGroup != null);
Debug.Assert(oEdgeWidthResults != null);
Debug.Assert(oReadWorkbookContext != null);
Debug.Assert(oCollapsedGroupAttributes != null);
Debug.Assert(iAnchorVertices >= 0);
// If the edge width column was autofilled, get the average width for
// the edges incident to the two-connector motif's first anchor, then
// its second anchor. Otherwise, don't do anything.
if (!bEdgeWidthColumnAutoFilled)
{
return;
}
for (Int32 iAnchorVertexIndex = 0;
iAnchorVertexIndex < iAnchorVertices;
iAnchorVertexIndex++)
{
Double dAverageEdgeWidth;
if ( TableColumnMapper.TryMapAverageNumber(
GetRowIDsToAverageForEdges(oGroup,
oCollapsedGroupAttributes, iAnchorVertexIndex),
oEdgeWidthSourceDictionary,
oEdgeWidthResults.SourceCalculationNumber1,
oEdgeWidthResults.SourceCalculationNumber2,
oEdgeWidthResults.DestinationNumber1,
oEdgeWidthResults.DestinationNumber2,
oEdgeWidthDetails.UseLogs,
out dAverageEdgeWidth
)
)
{
oCollapsedGroupAttributes.Add(
CollapsedGroupAttributeKeys.GetAnchorVertexEdgeWidthKey(
iAnchorVertexIndex),
dAverageEdgeWidth
);
}
}
}