Microscopic Traffic Simulator
Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer Class Reference

Renderer for drawing lanes during their building. More...

Inheritance diagram for Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer:
Microscopic_Traffic_Simulator.Renderers.VisualCanvasRenderer Microscopic_Traffic_Simulator.Renderers.BezierLaneBuildingRenderer

Classes

class  LanePoints
 Assigns integer identifiers for each point of a lane. More...
 

Protected Member Functions

override void Render (Point currentMouseLocation)
 Render preview change of move or zoom.

Parameters
currentMouseLocationCurrent mouse location.
More...
 
void DrawPreviewStraightLane (Point endPointOnCanvas)
 Draws preview of straight lane. More...
 
Vector GetVectorOfMoveOfPointIfItIsBeingDragged (Point cursorPointOnCanvas, bool isBeingDragged)
 Gets vector of move of point if the point is being dragged and update the previous reference point for dragging. More...
 
void SetPointToDraggingModeIfCursorIsNearAndDragging (ref bool pointIsInDraggingMode, Point cursorPointOnCanvas, double squaredDistanceOfWorldPointFromCanvasPoint, IList< double > squaredDistancesOfRemainingWorldPointsFromCanvasPoint)
 Set point to dragging mode if cursor is near to any point of lane. More...
 
virtual IList< double > GetSquaredDistancesOfCanvasPointToWorldLanePoints (Point cursorPointOnCanvasPoint)
 Get squared distances of all lane world points from cursor point on canvas. More...
 
- Protected Member Functions inherited from Microscopic_Traffic_Simulator.Renderers.VisualCanvasRenderer
 VisualCanvasRenderer (DrawingVisual visual)
 Initialization of visual canvas renderer. More...
 
Point TransformRealWorldPoint (Point point)
 Transforms real-world point to point on canvas. More...
 
Point TransformCanvasPoint (Point point)
 Transform point on canvas to real-world point. More...
 

Protected Attributes

const double PenThickness = 1.0
 Thickness of the pen drawing the preview of a lane. More...
 
const double DraggingCircleRadius = 4.0
 Radius of a circle surrounding the points of a lane. The circle determines the area where cursor must be when user wants to press left mouse button and drag a point the circle surround. More...
 
const double DraggingCircleRadiusSquared = DraggingCircleRadius * DraggingCircleRadius
 Value of squared radius of dragging circle which can be used to skip sqrt operation in computation of the Euclidean distance. More...
 
Pen pen = new Pen(Brushes.Green, PenThickness)
 Pen used to draw road preview. More...
 
Point startWorldPoint = null
 Start point of a previewing building lane. More...
 
Point endWorldPoint = null
 End point of a previewing building lane. More...
 
Point previousReferencePointForDragging
 Previous reference point for dragging More...
 
Point lastCursorPointOnCanvas
 Last cursor point after rendering prewview of building lane. More...
 
- Protected Attributes inherited from Microscopic_Traffic_Simulator.Renderers.VisualCanvasRenderer
DrawingVisual visual
 Drawing visual to render to. More...
 

Additional Inherited Members

- Properties inherited from Microscopic_Traffic_Simulator.Renderers.VisualCanvasRenderer
double PixelsPerMeter [get]
 Number of meters per one pixel determining zoom level. More...
 

Detailed Description

Renderer for drawing lanes during their building.

Definition at line 12 of file LaneBuildingRenderer.cs.

Member Function Documentation

void Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.DrawPreviewStraightLane ( Point  endPointOnCanvas)
protected

Draws preview of straight lane.

Parameters
endPointOnCanvasEnd point on canvas.

Definition at line 132 of file LaneBuildingRenderer.cs.

virtual IList<double> Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.GetSquaredDistancesOfCanvasPointToWorldLanePoints ( Point  cursorPointOnCanvasPoint)
protectedvirtual

Get squared distances of all lane world points from cursor point on canvas.

Parameters
cursorPointOnCanvasPointCursor point on canvas.
Returns
List of squared distances of all lane world points from cursor point on canvas.

Reimplemented in Microscopic_Traffic_Simulator.Renderers.BezierLaneBuildingRenderer.

Definition at line 285 of file LaneBuildingRenderer.cs.

Vector Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.GetVectorOfMoveOfPointIfItIsBeingDragged ( Point  cursorPointOnCanvas,
bool  isBeingDragged 
)
protected

Gets vector of move of point if the point is being dragged and update the previous reference point for dragging.

Parameters
cursorPointOnCanvasCursor point as a new point of movement (dragging).
isBeingDraggedDetermines whether certain point is being dragged.
Returns
Vector of move of point.

Definition at line 228 of file LaneBuildingRenderer.cs.

override void Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.Render ( Point  currentMouseLocation)
protectedvirtual

Render preview change of move or zoom.

Parameters
currentMouseLocationCurrent mouse location.

Implements Microscopic_Traffic_Simulator.Renderers.VisualCanvasRenderer.

Definition at line 123 of file LaneBuildingRenderer.cs.

void Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.SetPointToDraggingModeIfCursorIsNearAndDragging ( ref bool  pointIsInDraggingMode,
Point  cursorPointOnCanvas,
double  squaredDistanceOfWorldPointFromCanvasPoint,
IList< double >  squaredDistancesOfRemainingWorldPointsFromCanvasPoint 
)
protected

Set point to dragging mode if cursor is near to any point of lane.

Parameters
pointIsInDraggingModeFlag to set if the point is switched to dragging mode.
cursorPointOnCanvasCursor point on canvas.
squaredDistanceOfWorldPointFromCanvasPointSquared distance of cursor point to some lane world point.
squaredDistancesOfRemainingWorldPointsFromCanvasPointList of squared distances of cursor point to all lane world points.

Definition at line 264 of file LaneBuildingRenderer.cs.

Member Data Documentation

const double Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.DraggingCircleRadius = 4.0
protected

Radius of a circle surrounding the points of a lane. The circle determines the area where cursor must be when user wants to press left mouse button and drag a point the circle surround.

Definition at line 38 of file LaneBuildingRenderer.cs.

const double Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.DraggingCircleRadiusSquared = DraggingCircleRadius * DraggingCircleRadius
protected

Value of squared radius of dragging circle which can be used to skip sqrt operation in computation of the Euclidean distance.

Definition at line 44 of file LaneBuildingRenderer.cs.

Point Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.endWorldPoint = null
protected

End point of a previewing building lane.

Definition at line 68 of file LaneBuildingRenderer.cs.

Point Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.lastCursorPointOnCanvas
protected

Last cursor point after rendering prewview of building lane.

Definition at line 87 of file LaneBuildingRenderer.cs.

Pen Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.pen = new Pen(Brushes.Green, PenThickness)
protected

Pen used to draw road preview.

Definition at line 49 of file LaneBuildingRenderer.cs.

const double Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.PenThickness = 1.0
protected

Thickness of the pen drawing the preview of a lane.

Definition at line 32 of file LaneBuildingRenderer.cs.

Point Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.previousReferencePointForDragging
protected

Previous reference point for dragging

Definition at line 82 of file LaneBuildingRenderer.cs.

Point Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.startWorldPoint = null
protected

Start point of a previewing building lane.

Definition at line 54 of file LaneBuildingRenderer.cs.


The documentation for this class was generated from the following file: