C# Class SharpNeat.View.Graph.IOGraphPainter

Paints IOGraphs to a GDI+ Graphics object.
Datei anzeigen Open project: colgreen/sharpneat Class Usage Examples

Protected Properties

Property Type Description
__brushBlack System.Drawing.Brush
__brushNodeFill System.Drawing.Brush
__fontNodeTag System.Drawing.Font
__penBlack System.Drawing.Pen
_connectionNegative Color
_connectionPositive Color

Public Methods

Method Description
PaintNetwork ( IOGraph graph, Graphics g, Rectangle viewportArea, float zoomFactor ) : void

Paints the provided IOGraph onto the provided GDI+ Graphics drawing surface.

Protected Methods

Method Description
IsPointWithinViewport ( Point p, PaintState state ) : bool

Indicates if a point is within the graphics area represented by the viewport. That is, does an element at this position need to be painted.

ModelToViewport ( Point p, PaintState state ) : Point

Converts from a model coordinate to a viewport coordinate.

PaintNetwork ( IOGraph graph, PaintState state ) : void

Paints the provided IOGraph onto the current GDI+ Graphics drawing surface.

PaintNode ( GraphNode node, PaintState state ) : void

Paints a single graph node.

Private Methods

Method Description
PaintBackConnection ( Pen pen, Point srcPos, Point tgtPos, ConnectionPointInfo srcInfo, ConnectionPointInfo tgtInfo, PaintState state ) : void
PaintConnection ( GraphConnection con, PaintState state ) : void
PaintConnections ( IList nodeList, PaintState state ) : void
PaintNodes ( IList nodeList, PaintState state ) : void

Method Details

IsPointWithinViewport() protected method

Indicates if a point is within the graphics area represented by the viewport. That is, does an element at this position need to be painted.
protected IsPointWithinViewport ( Point p, PaintState state ) : bool
p Point
state PaintState
return bool

ModelToViewport() protected method

Converts from a model coordinate to a viewport coordinate.
protected ModelToViewport ( Point p, PaintState state ) : Point
p Point
state PaintState
return Point

PaintNetwork() public method

Paints the provided IOGraph onto the provided GDI+ Graphics drawing surface.
public PaintNetwork ( IOGraph graph, Graphics g, Rectangle viewportArea, float zoomFactor ) : void
graph IOGraph
g System.Drawing.Graphics
viewportArea System.Drawing.Rectangle
zoomFactor float
return void

PaintNetwork() protected method

Paints the provided IOGraph onto the current GDI+ Graphics drawing surface.
protected PaintNetwork ( IOGraph graph, PaintState state ) : void
graph IOGraph
state PaintState
return void

PaintNode() protected method

Paints a single graph node.
protected PaintNode ( GraphNode node, PaintState state ) : void
node GraphNode
state PaintState
return void

Property Details

__brushBlack protected_oe static_oe property

Black brush
protected static Brush,System.Drawing __brushBlack
return System.Drawing.Brush

__brushNodeFill protected_oe static_oe property

Brush for node fill color.
protected static Brush,System.Drawing __brushNodeFill
return System.Drawing.Brush

__fontNodeTag protected_oe static_oe property

Font for drawing text on the viewport.
protected static Font,System.Drawing __fontNodeTag
return System.Drawing.Font

__penBlack protected_oe static_oe property

Black pen for node borders.
protected static Pen,System.Drawing __penBlack
return System.Drawing.Pen

_connectionNegative protected_oe static_oe property

Pen for drawing connections with negative connection weight.
protected static Color _connectionNegative
return Color

_connectionPositive protected_oe static_oe property

Pen for drawing connections with positive connection weight.
protected static Color _connectionPositive
return Color