SetCollapsedCliqueMotifAttributes()
{
Debug.Assert(m_oCollapsedGroup != null);
Debug.Assert(m_oCollapsedGroupVertex != null);
Debug.Assert(m_oCollapsedGroupAttributes != null);
AssertValid();
// Get the vertices that were collapsed into the collapsed group
// vertex.
ICollection<IVertex> oCollapsedVertices = m_oCollapsedGroup.Vertices;
Debug.Assert(oCollapsedVertices != null);
Debug.Assert(oCollapsedVertices.Count > 0);
// Use a rounded X for the collapsed group vertex.
m_oCollapsedGroupVertex.SetValue(ReservedMetadataKeys.PerVertexShape,
VertexShape.SolidRoundedX);
// Use the color specified in the collapsed attributes.
SetVertexColorFromCollapsedGroupAttributes(
ReservedMetadataKeys.PerColor);
Int32 iCliqueVertices;
Double dCliqueScale;
if (
!m_oCollapsedGroupAttributes.TryGetValue(
CollapsedGroupAttributeKeys.CliqueVertices,
out iCliqueVertices)
||
!m_oCollapsedGroupAttributes.TryGetValue(
CollapsedGroupAttributeKeys.CliqueScale, out dCliqueScale)
)
{
return;
}
// Scale the size by a scale factor stored in the collapsed group
// attributes. The scale factor ranges from 0 to 1.0.
Single fRadius = MathUtil.TransformValueToRange(
(Single)dCliqueScale,
0, 1.0F,
(Single)MinimumCliqueRadius,
(Single)MaximumCliqueRadius
);
m_oCollapsedGroupVertex.SetValue(
ReservedMetadataKeys.PerVertexRadius, fRadius);
m_oCollapsedGroupVertex.SetValue(
ReservedMetadataKeys.PerVertexToolTip,
GetCollapsedCliqueMotifToolTip(iCliqueVertices)
);
}