Microscopic Traffic Simulator
|
Renderer for drawing bezier lanes during their building. More...
Classes | |
class | BezierLanePoints |
Assigns integer identifiers for additional points of a bezier lane. More... | |
Protected Member Functions | |||
override IList< double > | GetSquaredDistancesOfCanvasPointToWorldLanePoints (Point canvasPoint) | ||
Get squared distances of all lane world points from cursor point on canvas. More... | |||
![]() | |||
override void | Render (Point currentMouseLocation) | ||
Render preview change of move or zoom.
| |||
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... | |||
![]() | |||
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 | |
Point | firstWorldControlPoint |
The first control point of a previewing building lane. More... | |
bool | isFirstControlPointBeingDragged |
Determines whether the firstWorldControlPoint is currently being dragged. More... | |
Point | secondWorldControlPoint |
The second control point of a previewing building lane. More... | |
bool | secondControlPointIsMoving |
Determines whether the secondWorldControlPoint is currently being dragged. More... | |
![]() | |
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... | |
![]() | |
DrawingVisual | visual |
Drawing visual to render to. More... | |
Properties | |
Point | FirstWorldControlPoint [get] |
The first control point of a previewing building lane. More... | |
Point | SecondWorldControlPoint [get] |
The second control point of a previewing building lane. More... | |
![]() | |
double | PixelsPerMeter [get] |
Number of meters per one pixel determining zoom level. More... | |
Renderer for drawing bezier lanes during their building.
Definition at line 12 of file BezierLaneBuildingRenderer.cs.
|
protectedvirtual |
Get squared distances of all lane world points from cursor point on canvas.
cursorPointOnCanvasPoint | Cursor point on canvas. |
Reimplemented from Microscopic_Traffic_Simulator.Renderers.LaneBuildingRenderer.
Definition at line 230 of file BezierLaneBuildingRenderer.cs.
|
protected |
The first control point of a previewing building lane.
Definition at line 31 of file BezierLaneBuildingRenderer.cs.
|
protected |
Determines whether the firstWorldControlPoint is currently being dragged.
Definition at line 40 of file BezierLaneBuildingRenderer.cs.
|
protected |
Determines whether the secondWorldControlPoint is currently being dragged.
Definition at line 54 of file BezierLaneBuildingRenderer.cs.
|
protected |
The second control point of a previewing building lane.
Definition at line 45 of file BezierLaneBuildingRenderer.cs.
|
get |
The first control point of a previewing building lane.
Definition at line 35 of file BezierLaneBuildingRenderer.cs.
|
get |
The second control point of a previewing building lane.
Definition at line 49 of file BezierLaneBuildingRenderer.cs.