C# Class CityGeneratorWPF.Service.DrawService

Handles Drawing to a canvas
Afficher le fichier Open project: TobieD/City-Generator Class Usage Examples

Méthodes publiques

Свойство Type Description
OnClick ClickOnCanvas

Méthodes publiques

Méthode Description
ClearCanvas ( ) : void

Clear the entire canvas

DrawCell ( Cell cell, Color c, bool bFill = true, bool bBorder = false ) : void
DrawCircle ( Circle cr, Color c ) : void
DrawCircle ( Point p, double radius, Color c ) : void
DrawDistrict ( District district, Color c, bool bDrawRoads, bool bDrawCells ) : void
DrawLine ( Point p1, Point p2, Color c, int thick = 1 ) : void

Draw a line from point 1 to point 2

DrawLine ( Voronoi line, Color c, int thick = 1 ) : void
DrawPoint ( Point p, double radius, Color c ) : void

Add a point to the canvas

DrawPolygon ( IList points, Color c ) : void
DrawPolygon ( Triangle t, Color c ) : void
DrawRectangle ( Point p, int width, int height, Color c ) : void

Draw Rectangle from a point and width and height

DrawRectangle ( Rectangle rect, Color c ) : void
DrawRoad ( Road road, Color linecolor, Color startColor, Color endColor, bool drawStartEnd = true, int width = 1 ) : void
DrawService ( Canvas drawCanvas ) : System.Collections.Generic

Create a new DrawService and hook up the events

DrawText ( string text, Color c, Point position ) : void
DrawTriangle ( Point p1, Point p2, Point p3, Color c ) : void
DrawTriangle ( Triangle t, Color c ) : void

Private Methods

Méthode Description
OnCanvasMouseDown ( object sender, System e ) : void

On mouse Down event

Method Details

ClearCanvas() public méthode

Clear the entire canvas
public ClearCanvas ( ) : void
Résultat void

DrawCell() public méthode

public DrawCell ( Cell cell, Color c, bool bFill = true, bool bBorder = false ) : void
cell Voronoi.Cell
c System.Windows.Media.Color
bFill bool
bBorder bool
Résultat void

DrawCircle() public méthode

public DrawCircle ( Circle cr, Color c ) : void
cr Voronoi.Circle
c System.Windows.Media.Color
Résultat void

DrawCircle() public méthode

public DrawCircle ( Point p, double radius, Color c ) : void
p Voronoi.Point
radius double
c System.Windows.Media.Color
Résultat void

DrawDistrict() public méthode

public DrawDistrict ( District district, Color c, bool bDrawRoads, bool bDrawCells ) : void
district CityGenerator.District
c System.Windows.Media.Color
bDrawRoads bool
bDrawCells bool
Résultat void

DrawLine() public méthode

Draw a line from point 1 to point 2
public DrawLine ( Point p1, Point p2, Color c, int thick = 1 ) : void
p1 Voronoi.Point
p2 Voronoi.Point
c System.Windows.Media.Color
thick int
Résultat void

DrawLine() public méthode

public DrawLine ( Voronoi line, Color c, int thick = 1 ) : void
line Voronoi
c System.Windows.Media.Color
thick int
Résultat void

DrawPoint() public méthode

Add a point to the canvas
public DrawPoint ( Point p, double radius, Color c ) : void
p Voronoi.Point
radius double
c System.Windows.Media.Color
Résultat void

DrawPolygon() public méthode

public DrawPolygon ( IList points, Color c ) : void
points IList
c System.Windows.Media.Color
Résultat void

DrawPolygon() public méthode

public DrawPolygon ( Triangle t, Color c ) : void
t Voronoi.Triangle
c System.Windows.Media.Color
Résultat void

DrawRectangle() public méthode

Draw Rectangle from a point and width and height
public DrawRectangle ( Point p, int width, int height, Color c ) : void
p Voronoi.Point
width int
height int
c Color
Résultat void

DrawRectangle() public méthode

public DrawRectangle ( Rectangle rect, Color c ) : void
rect Voronoi.Rectangle
c Color
Résultat void

DrawRoad() public méthode

public DrawRoad ( Road road, Color linecolor, Color startColor, Color endColor, bool drawStartEnd = true, int width = 1 ) : void
road Road
linecolor Color
startColor Color
endColor Color
drawStartEnd bool
width int
Résultat void

DrawService() public méthode

Create a new DrawService and hook up the events
public DrawService ( Canvas drawCanvas ) : System.Collections.Generic
drawCanvas Canvas
Résultat System.Collections.Generic

DrawText() public méthode

public DrawText ( string text, Color c, Point position ) : void
text string
c Color
position Voronoi.Point
Résultat void

DrawTriangle() public méthode

public DrawTriangle ( Point p1, Point p2, Point p3, Color c ) : void
p1 Voronoi.Point
p2 Voronoi.Point
p3 Voronoi.Point
c Color
Résultat void

DrawTriangle() public méthode

public DrawTriangle ( Triangle t, Color c ) : void
t Triangle
c Color
Résultat void

Property Details

OnClick public_oe property

public ClickOnCanvas OnClick
Résultat ClickOnCanvas