Microscopic Traffic Simulator

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Protected Member Functions | Protected Attributes | List of all members
Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer Class Reference

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

Inheritance diagram for Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer:

## 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
  currentMouseLocation | Current 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

  endPointOnCanvas | End point on canvas.

Definition at line 132 of file LaneBuildingRenderer.cs.

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

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

Parameters

  cursorPointOnCanvasPoint | Cursor 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

  cursorPointOnCanvas | Cursor point as a new point of movement (dragging).
  isBeingDragged | Determines 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 | ) |
| protected virtual

Render preview change of move or zoom.

Parameters

  currentMouseLocation | Current 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

  pointIsInDraggingMode | Flag to set if the point is switched to dragging mode.
  cursorPointOnCanvas | Cursor point on canvas.
  squaredDistanceOfWorldPointFromCanvasPoint | Squared distance of cursor point to some lane world point.
  squaredDistancesOfRemainingWorldPointsFromCanvasPoint | List 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:

- Microscopic Traffic Simulator/Renderers/LaneBuildingRenderer.cs