Smrf.NodeXL.Visualization.Wpf.CollapsedGroupDrawingManager.DrawFanMotifFan C# (CSharp) Method

DrawFanMotifFan() protected method

protected DrawFanMotifFan ( Color oHeadColor, System.Windows.Media.DrawingContext oDrawingContext, System.Boolean bDrawAsSelected, Double dGraphScale, VertexDrawingHistory oVertexDrawingHistory ) : void
oHeadColor Color
oDrawingContext System.Windows.Media.DrawingContext
bDrawAsSelected System.Boolean
dGraphScale Double
oVertexDrawingHistory VertexDrawingHistory
return void
    DrawFanMotifFan
    (
        Color oHeadColor,
        DrawingContext oDrawingContext,
        Boolean bDrawAsSelected,
        Double dGraphScale,
        VertexDrawingHistory oVertexDrawingHistory
    )
    {
        Debug.Assert(oDrawingContext != null);
        Debug.Assert(dGraphScale >= GraphDrawer.MinimumGraphScale);
        Debug.Assert(dGraphScale <= GraphDrawer.MaximumGraphScale);
        Debug.Assert(oVertexDrawingHistory != null);
        AssertValid();

        // The fill color to use for the fan was set in PreDrawVertex().

        Object oFanColorAsObject;

        if ( !m_oCollapsedGroupVertex.TryGetValue(
            ReservedMetadataKeys.FanMotifFanColor,
            typeof(System.Drawing.Color), out oFanColorAsObject) )
        {
            return;
        }

        // If the collapsed group vertex is selected, the entire vertex,
        // including the fan drawn here, should be drawn using oHeadColor,
        // which the caller has set to the selected color.

        Color oFanColor = bDrawAsSelected ? oHeadColor :
            WpfGraphicsUtil.ColorToWpfColor(
                (System.Drawing.Color)oFanColorAsObject);

        Double dAngleRadians = GetFanMotifAngleRadians();
        Rect oVertexBounds = oVertexDrawingHistory.GetBounds().Bounds;

        Brush oFillBrush = new SolidColorBrush(oFanColor);
        WpfGraphicsUtil.FreezeIfFreezable(oFillBrush);

        Color oPenColor = GetCollapsedMotifOutlineColor(255);
        Brush oPenBrush = new SolidColorBrush(oPenColor);
        WpfGraphicsUtil.FreezeIfFreezable(oPenBrush);

        Pen oPen = new Pen(oPenBrush, 2.0 * dGraphScale);
        WpfGraphicsUtil.FreezeIfFreezable(oPen);

        oDrawingContext.DrawGeometry( oFillBrush, oPen, 
            GetCircleSegment(oVertexBounds, dAngleRadians, dGraphScale) );
    }