public PointAnalysisTool(PlanarProjection projection, bool snap, ArbiterRoadNetwork arn, WorldTransform wt)
 {
     this.projection = projection;
     this.snapToWaypoints = snap;
     this.roadNetwork = arn;
     this.wt = wt;
 }
        public void Render(System.Drawing.Graphics g, RndfEditor.Display.Utilities.WorldTransform t)
        {
            // draw the sparse polygon of the selected
            if (this.Toolbox.Partition != null)
            {
                DrawingUtility.DrawControlPolygon(
                    this.Toolbox.Partition.SparsePolygon,
                    Color.DarkSeaGreen, System.Drawing.Drawing2D.DashStyle.Solid, g, t);

                foreach (Coordinates c in this.Toolbox.Partition.SparsePolygon)
                {
                    DrawingUtility.DrawControlPoint(c, Color.DarkSeaGreen, null, ContentAlignment.MiddleCenter, ControlPointStyle.SmallX, g, t);
                }

                foreach (Coordinates c in this.Toolbox.tmpPolyCoords)
                {
                    DrawingUtility.DrawControlPoint(c, Color.DarkViolet, null, ContentAlignment.MiddleCenter, ControlPointStyle.SmallCircle, g, t);
                }

                if (this.Toolbox.tmpPolyCoords.Count > 1)
                {
                    for (int i = 0; i < this.Toolbox.tmpPolyCoords.Count - 1; i++)
                    {
                        DrawingUtility.DrawControlLine(this.Toolbox.tmpPolyCoords[i], this.Toolbox.tmpPolyCoords[i + 1], g, t, null, Color.DarkViolet);
                    }
                }
            }
        }
 public void InMove(UrbanChallenge.Common.Coordinates orig, UrbanChallenge.Common.Coordinates offset, WorldTransform t)
 {
     this.position = orig + offset;
 }
        public System.Drawing.RectangleF GetBoundingBox(WorldTransform wt)
        {
            // Determine size of bounding box
            float scaled_offset = 1 / wt.Scale;

            // invert the scale
            float scaled_size = DrawingUtility.cp_large_size;

            // assume that the world transform is currently applied correctly to the graphics
            RectangleF rect = new RectangleF((float)this.position.X - scaled_size / 2, (float)this.position.Y - scaled_size / 2, scaled_size, scaled_size);

            // return
            return rect;
        }
 public void BeginMove(UrbanChallenge.Common.Coordinates orig, WorldTransform t)
 {
 }
 /// <summary>
 /// Perform a test to see if this is selected
 /// </summary>
 /// <param name="loc"></param>
 /// <param name="tol"></param>
 /// <param name="filter"></param>
 /// <returns></returns>
 public HitTestResult HitTest(Coordinates loc, float tol, WorldTransform wt, DisplayObjectFilter filter)
 {
     // return a no-hit
     return new HitTestResult(this, false, float.MaxValue);
 }
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            Color c;

            if (this.selected == SelectionType.NotSelected)
            {
                c = DrawingUtility.ColorArbiterUserWaypoint;
            }
            else
            {
                c = DrawingUtility.ColorArbiterUserWaypointSelected;
            }

            if (DrawingUtility.DisplayArbiterWaypointId)
            {
                DrawingUtility.DrawControlPoint(this.position, c, this.WaypointId.ToString(), ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
            }
            else
            {
                DrawingUtility.DrawControlPoint(this.position, c, null, ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
            }
        }
 public void CancelMove(Coordinates orig, WorldTransform t)
 {
     this.position = orig;
 }
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            Color c = DrawingUtility.ColorArbiterPerimeterWaypoint;

            if (selected == SelectionType.SingleSelected)
                c = DrawingUtility.ColorArbiterPerimeterWaypointSelected;
            else if (this.IsExit)
                c = Color.Red;
            else if (this.IsEntry)
                c = Color.Blue;

            if (DrawingUtility.DisplayArbiterPerimeterWaypointId)
            {
                DrawingUtility.DrawControlPoint(this.position, c, this.WaypointId.ToString(),
                    ContentAlignment.BottomCenter, ControlPointStyle.SmallBox, g, t);
            }
            else
            {
                DrawingUtility.DrawControlPoint(this.position, c, null,
                    ContentAlignment.BottomCenter, ControlPointStyle.SmallBox, g, t);
            }
        }
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            if (this.Mode == ZoneToolboxMode.StayOut)
            {
                if (this.WrappingHelpers.Count > 0)
                {
                    for (int i = 0; i < this.WrappingHelpers.Count; i++)
                    {
                        DrawingUtility.DrawControlPoint(this.WrappingHelpers[i], Color.SteelBlue, null, ContentAlignment.MiddleCenter, ControlPointStyle.SmallCircle, g, t);

                        if (i + 1 < this.WrappingHelpers.Count)
                        {
                            DrawingUtility.DrawColoredControlLine(Color.SteelBlue, System.Drawing.Drawing2D.DashStyle.Solid,
                                this.WrappingHelpers[i], this.WrappingHelpers[i + 1], g, t);
                        }
                    }

                    if (this.WrappingHelpers.Count > 0)
                    {
                        DrawingUtility.DrawColoredControlLine(Color.SteelBlue, System.Drawing.Drawing2D.DashStyle.Solid,
                            this.WrappingHelpers[this.WrappingHelpers.Count - 1], this.CurrentMouse, g, t);
                    }
                }
            }
            else if (this.Mode == ZoneToolboxMode.NavNodes)
            {
                if (this.rightClickNode != null)
                {
                    DrawingUtility.DrawControlPoint(this.rightClickNode.Position, Color.Red, null, ContentAlignment.MiddleCenter, ControlPointStyle.SmallCircle, g, t);
                }
                else if (this.rightClickEdge != null)
                {
                    DrawingUtility.DrawColoredArrowControlLine(Color.Red, System.Drawing.Drawing2D.DashStyle.Solid,
                            this.rightClickEdge.Start.Position, this.rightClickEdge.End.Position, g, t);
                }

                if (this.PreviousNode != null)
                {
                    DrawingUtility.DrawColoredArrowControlLine(Color.DarkBlue, System.Drawing.Drawing2D.DashStyle.Solid,
                            this.PreviousNode.Position, this.CurrentMouse, g, t);
                }
            }
        }
 public RulerTool(bool snap, ArbiterRoadNetwork arn, WorldTransform wt)
 {
     this.snapToWaypoints = snap;
     this.roadNetwork = arn;
     this.wt = wt;
 }
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            if (this.Initial != null && this.Current != null)
            {
                DrawingUtility.DrawControlPoint(this.Initial.Value, DrawingUtility.ColorToolRuler, null, System.Drawing.ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
                DrawingUtility.DrawControlPoint(this.Current.Value, DrawingUtility.ColorToolRuler, null, System.Drawing.ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);

                DrawingUtility.DrawColoredControlLine(DrawingUtility.ColorToolRuler, System.Drawing.Drawing2D.DashStyle.Solid,
                    this.Initial.Value, this.Current.Value, g, t);

                Coordinates dir = this.Current.Value - this.Initial.Value;
                Coordinates final = this.Initial.Value + dir.Normalize(dir.Length / 2.0);

                string label = dir.Length.ToString("F6") + " m";

                    DrawingUtility.DrawControlPoint(final, DrawingUtility.ColorToolRuler, label, System.Drawing.ContentAlignment.BottomCenter, ControlPointStyle.None, g, t);
            }
        }
 public void Render(System.Drawing.Graphics g, WorldTransform t)
 {
 }
 public System.Drawing.RectangleF GetBoundingBox(WorldTransform wt)
 {
     return new System.Drawing.RectangleF();
 }
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            if (!this.snapToWaypoints || this.roadNetwork == null)
            {
                if (this.Current != null)
                {
                    LLACoord lla = GpsTools.XyToLlaDegrees(Current, projection);

                    string locString = Current.X.ToString("F6") + ", " + Current.Y.ToString("F6") + "\n" +
                        lla.lat.ToString("F6") + ", " + lla.lon.ToString("F6") + "\n" + GpsTools.LlaDegreesToArcMinSecs(lla);

                    DrawingUtility.DrawControlPoint(this.Current, DrawingUtility.ColorToolPointAnalysis, locString,
                        ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
                }

                if (Save != null && Save.Count > 0)
                {
                    foreach (Coordinates tmp in Save)
                    {
                        LLACoord lla = GpsTools.XyToLlaDegrees(tmp, projection);

                        string locString = tmp.X.ToString("F6") + ", " + tmp.Y.ToString("F6") + "\n" +
                            lla.lat.ToString("F6") + ", " + lla.lon.ToString("F6") + "\n" + GpsTools.LlaDegreesToArcMinSecs(lla);

                        DrawingUtility.DrawControlPoint(tmp, DrawingUtility.ColorToolPointAnalysis, locString,
                            ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
                    }
                }
            }
            else
            {
                if (this.Current != null)
                {
                    Coordinates c = this.Current;
                    double minDist = Double.MaxValue;
                    Coordinates? closest = null;

                    foreach (IArbiterWaypoint iaw in this.roadNetwork.ArbiterWaypoints.Values)
                    {
                        double d = iaw.Position.DistanceTo(c);
                        if (d < minDist && ((IDisplayObject)iaw).HitTest(c, (float)0.2, wt, DrawingUtility.DefaultFilter).Hit)
                        {
                            minDist = d;
                            closest = iaw.Position;
                        }
                    }

                    if (closest != null)
                        c = closest.Value;

                    LLACoord lla = GpsTools.XyToLlaDegrees(c, projection);

                    string locString = c.X.ToString("F6") + ", " + c.Y.ToString("F6") + "\n" +
                        lla.lat.ToString("F6") + ", " + lla.lon.ToString("F6") + "\n" + GpsTools.LlaDegreesToArcMinSecs(lla);

                    DrawingUtility.DrawControlPoint(c, DrawingUtility.ColorToolPointAnalysis, locString,
                        ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
                }
            }
        }
 public System.Drawing.RectangleF GetBoundingBox(WorldTransform wt)
 {
     throw new Exception("The method or operation is not implemented.");
 }
 public void InMove(UrbanChallenge.Common.Coordinates orig, UrbanChallenge.Common.Coordinates offset, WorldTransform t)
 {
     throw new Exception("The method or operation is not implemented.");
 }
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            //if (t.WorldLowerLeft.X < this.Position.X && t.WorldLowerLeft.Y < this.position.Y && t.WorldUpperRight.X > this.position.X && t.WorldUpperRight.Y > this.position.Y)
            if (t.ShouldDraw(this.GetBoundingBox(t)))
            {
                Color c;

                if (this.isCheckpoint && this.IsStop)
                {
                    c = DrawingUtility.ColorArbiterWaypointStopCheckpoint;
                }
                else if (this.isCheckpoint)
                {
                    c = DrawingUtility.ColorArbiterWaypointCheckpoint;
                }
                else if (this.IsStop)
                {
                    c = DrawingUtility.ColorArbiterWaypointStop;
                }
                else
                {
                    c = DrawingUtility.ColorArbiterWaypoint;
                }

                if (this.isCheckpoint && DrawingUtility.DisplayArbiterWaypointCheckpointId)
                {
                    DrawingUtility.DrawControlPoint(this.position, DrawingUtility.ColorDisplayArbiterCheckpoint, this.checkpointId.ToString(),
                        ContentAlignment.TopCenter, ControlPointStyle.SmallCircle, g, t);
                }

                if (DrawingUtility.DisplayArbiterWaypointId)
                {
                    DrawingUtility.DrawControlPoint(this.position, c, this.WaypointId.ToString(),
                        ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
                }
                else
                {
                    DrawingUtility.DrawControlPoint(this.position, c, null,
                        ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
                }
            }
        }
 public void BeginMove(Coordinates orig, WorldTransform t)
 {
 }
Exemplo n.º 20
0
 public System.Drawing.RectangleF GetBoundingBox(RndfEditor.Display.Utilities.WorldTransform wt)
 {
     return(new RectangleF());
 }
 public void InMove(Coordinates orig, Coordinates offset, WorldTransform t)
 {
     this.position = orig + offset;
 }
Exemplo n.º 22
0
 public RndfEditor.Display.Utilities.HitTestResult HitTest(UrbanChallenge.Common.Coordinates loc, float tol, RndfEditor.Display.Utilities.WorldTransform wt, RndfEditor.Display.Utilities.DisplayObjectFilter filter)
 {
     return(new HitTestResult(this, false, float.MaxValue));
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public RoadDisplay()
        {
            // create the display
            InitializeComponent();

            // make sure we're not in design mode
            if (!this.DesignMode)
            {
                // initialize the tranform before calling InitializeComponent so the OnResize method works properly
                transform = new WorldTransform();

                // set our style
                base.SetStyle(ControlStyles.UserPaint, true);
                base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                base.SetStyle(ControlStyles.Opaque, true);
                base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
                base.SetStyle(ControlStyles.ResizeRedraw, true);
                base.SetStyle(ControlStyles.Selectable, true);

                // new ai vehicle
                this.aiVehicle = new AiVehicle();

                // set new display objects
                this.Reset();
            }
        }
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            // wrapping helpers
            foreach (Coordinates c in this.WrappingHelpers)
            {
                DrawingUtility.DrawControlPoint(c, DrawingUtility.ColorArbiterIntersectionWrappingHelpers,
                    null, System.Drawing.ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
            }

            if (WrapFinal != null && WrapInitial != null)
            {
                // square
                Polygon square = this.CreateSquarePolygon(this.WrapInitial.Value, this.WrapFinal.Value);
                DrawingUtility.DrawControlPolygon(square, DrawingUtility.ColorArbiterIntersection, System.Drawing.Drawing2D.DashStyle.Solid, g, t);

                // inter poly
                Polygon interPoly = this.CreateIntersectionPolygon(square);

                // make sure inter poly not null before continuing
                if (interPoly != null)
                {
                    DrawingUtility.DrawControlPolygon(interPoly, DrawingUtility.ColorArbiterIntersectionBoundaryPolygon, System.Drawing.Drawing2D.DashStyle.DashDotDot, g, t);
                }
                /*
                Coordinates c0 = WrapInitial.Value;
                Coordinates c1 = WrapInitial.Value + (new Coordinates(WrapFinal.Value.X - WrapInitial.Value.X, 0));
                Coordinates c2 = WrapInitial.Value + (new Coordinates(0, WrapFinal.Value.Y - WrapInitial.Value.Y));
                Coordinates c3 = WrapFinal.Value;
                List<Coordinates> cs = new List<Coordinates>();
                cs.Add(c0);
                cs.Add(c1);
                cs.Add(c3);
                cs.Add(c2);
                Polygon p = new Polygon(cs, CoordinateMode.AbsoluteProjected);

                DrawingUtility.DrawColoredControlLine(DrawingUtility.ColorArbiterIntersection, System.Drawing.Drawing2D.DashStyle.Solid, c0, c1, g, t);
                DrawingUtility.DrawColoredControlLine(DrawingUtility.ColorArbiterIntersection, System.Drawing.Drawing2D.DashStyle.Solid, c1, c3, g, t);
                DrawingUtility.DrawColoredControlLine(DrawingUtility.ColorArbiterIntersection, System.Drawing.Drawing2D.DashStyle.Solid, c0, c2, g, t);
                DrawingUtility.DrawColoredControlLine(DrawingUtility.ColorArbiterIntersection, System.Drawing.Drawing2D.DashStyle.Solid, c2, c3, g, t);

                List<Coordinates> interPolygonCoords = new List<Coordinates>();

                foreach (Coordinates c in this.WrappingHelpers)
                {
                    if (p.IsInside(c))
                    {
                        interPolygonCoords.Add(c);
                    }
                }

                Console.WriteLine("Coords");
                foreach (Coordinates c in interPolygonCoords)
                {
                    Console.WriteLine(c.ToString());
                }
                Console.WriteLine("");

                List<BoundaryLine> boundaries = ArbiterTools.IntersectionToolkit.JarvisMarch(interPolygonCoords);
                List<Coordinates> newBounds = new List<Coordinates>();

                if (boundaries != null)
                {
                    foreach (BoundaryLine bl in boundaries)
                    {
                        newBounds.Add(bl.p1);
                        DrawingUtility.DrawColoredControlLine(DrawingUtility.ColorArbiterIntersection, System.Drawing.Drawing2D.DashStyle.DashDotDot, bl.p1, bl.p2, g, t);
                    }
                }

                if (newBounds.Count >= 3)
                {
                    p = new Polygon(newBounds, CoordinateMode.AbsoluteProjected);

                    foreach (IArbiterWaypoint iaw in arn.ArbiterWaypoints.Values)
                    {
                        if (p.IsInside(iaw.Position))
                        {
                            DrawingUtility.DrawControlPoint(iaw.Position, DrawingUtility.ColorArbiterIntersection, null, System.Drawing.ContentAlignment.MiddleCenter, ControlPointStyle.SmallX, g, t);
                        }
                    }
                }*/
            }
        }
        /// <summary>
        /// Renders the grid
        /// </summary>
        /// <param name="g"></param>
        /// <param name="t"></param>
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            // check if we are showinghte grid
            Coordinates wll = t.WorldLowerLeft;
            Coordinates wur = t.WorldUpperRight;

            // sapcing
            double tmpSpacing = (double)spacing;

            // num x lines
            double xNum = Math.Ceiling(Math.Abs(wll.X - wur.X) / tmpSpacing);

            // num y lines
            double yNum = Math.Ceiling(Math.Abs(wll.Y - wur.Y) / tmpSpacing);

            // check length
            if (xNum < 400 && yNum < 400)
            {
                // pen width
                float pw = 1.25f / t.Scale;

                // pen
                using (Pen p = new Pen(color, pw))
                {
                    // draw x lines
                    for (double i = Math.Floor(wll.X / tmpSpacing) * tmpSpacing; i <= Math.Ceiling(wur.X / tmpSpacing) * tmpSpacing; i += tmpSpacing)
                    {
                        g.DrawLine(p, DrawingUtility.ToPointF(new Coordinates(i, wur.Y)), DrawingUtility.ToPointF(new Coordinates(i, wll.Y)));
                    }

                    // draw y lines
                    for (double j = Math.Floor(wll.Y / tmpSpacing) * tmpSpacing; j <= Math.Ceiling(wur.Y / tmpSpacing) * tmpSpacing; j += tmpSpacing)
                    {
                        g.DrawLine(p, DrawingUtility.ToPointF(new Coordinates(wll.X, j)), DrawingUtility.ToPointF(new Coordinates(wur.X, j)));
                    }
                }
            }

            /*PointF ll = new PointF((float)wll.X, (float)wll.Y);
            PointF ur = new PointF((float)wur.X, (float)wur.Y);

            float startX = (float)Math.Floor(wll.X / spacing) * spacing;
            float endX = (float)Math.Ceiling(wur.X / spacing) * spacing;
            float startY = (float)Math.Floor(wll.Y / spacing) * spacing;
            float endY = (float)Math.Ceiling(wur.Y / spacing) * spacing;

            using (Pen p = new Pen(color, 1 / t.Scale))
            {
                if (endX - startX / spacing < 400 && endY - startY / spacing < 400)
                {
                    for (float x = startX; x <= endX; x += spacing)
                    {
                        g.DrawLine(p, x, ll.Y, x, ur.Y);
                    }

                    for (float y = startY; y <= endY; y += spacing)
                    {
                        g.DrawLine(p, ll.X, y, ur.X, y);
                    }
                }
            }*/
        }
        public HitTestResult HitTest(UrbanChallenge.Common.Coordinates loc, float tol, WorldTransform wt, DisplayObjectFilter filter)
        {
            if (filter(this))
            {
                Coordinates closest = this.GetClosest(loc);

                if ((float)loc.DistanceTo(closest) < 5 + tol)
                {
                    return new HitTestResult(this, true, (float)loc.DistanceTo(closest));
                }
            }

            return new HitTestResult(this, false, float.MaxValue);
        }
 public void CancelMove(UrbanChallenge.Common.Coordinates orig, WorldTransform t)
 {
     this.position = orig;
 }
        /// <summary>
        /// Renders the lane splint
        /// </summary>
        /// <param name="g"></param>
        /// <param name="t"></param>
        /// <remarks>TODO: set lane spline</remarks>
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            Color c = DrawingUtility.ColorArbiterLaneSpline;

            if (DrawingUtility.DisplayArbiterLanes)
            {
                Coordinates cp = t.GetWorldPoint(new PointF(t.ScreenSize.Width/2, t.ScreenSize.Height/2));
                Coordinates lp = this.LanePath().GetClosestPoint(cp).Location;
                string s = this.LaneId.ToString();
                DrawingUtility.DrawControlLabel(lp, Color.DarkBlue, s, ContentAlignment.MiddleCenter, ControlPointStyle.None, g, t);
            }

            bool displayPolygon = false;
            switch (this.LaneId.Number)
            {
                case 1:
                    displayPolygon = DrawingUtility.DisplayArbiterLanePolygon1;
                    break;
                case 2:
                    displayPolygon = DrawingUtility.DisplayArbiterLanePolygon2;
                    break;
                case 3:
                    displayPolygon = DrawingUtility.DisplayArbiterLanePolygon3;
                    break;
                case 4:
                    displayPolygon = DrawingUtility.DisplayArbiterLanePolygon4;
                    break;
            }

            if (displayPolygon && this.LanePolygon != null)
            {
                // show intersection polygon
                HatchBrush hBrush1 = new HatchBrush(HatchStyle.ForwardDiagonal, DrawingUtility.ColorArbiterLanePolygon, Color.White);

                // populate polygon
                List<PointF> polyPoints = new List<PointF>();
                foreach (Coordinates lpp in this.LanePolygon.points)
                {
                    polyPoints.Add(DrawingUtility.ToPointF(lpp));
                }

                // draw poly and fill
                g.FillPolygon(hBrush1, polyPoints.ToArray());

                DrawingUtility.DrawControlPolygon(this.LanePolygon, DrawingUtility.ColorArbiterLanePolygon, System.Drawing.Drawing2D.DashStyle.Solid, g, t);
            }

            if(DrawingUtility.DisplayArbiterLanePath)
            {
                DrawingUtility.DrawControlLine(this.laneLinePath, g, t, new Pen(Color.MediumVioletRed), Color.MediumVioletRed);
            }
        }
        public HitTestResult HitTest(UrbanChallenge.Common.Coordinates loc, float tol, WorldTransform wt, DisplayObjectFilter filter)
        {
            // check filter
            if (filter.Target == null || filter.Target is ArbiterParkingSpotWaypoint)
            {
                // get bounding box dependent on tolerance
                RectangleF bounding = this.GetBoundingBox(wt);
                bounding.Inflate(tol, tol);

                // check if contains point
                if (bounding.Contains(DrawingUtility.ToPointF(loc)))
                {
                    return new HitTestResult(this, true, (float)loc.DistanceTo(this.Position));
                }
            }

            return new HitTestResult(this, false, float.MaxValue);
        }
Exemplo n.º 30
0
 public override void CancelMove(UrbanChallenge.Common.Coordinates orig, RndfEditor.Display.Utilities.WorldTransform t)
 {
     throw new Exception("The method or operation is not implemented.");
 }
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            Color c;

            if (selected == SelectionType.SingleSelected)
                c = DrawingUtility.ColorArbiterParkingSpotWaypointSelected;
            else if (this.isCheckpoint)
                c = DrawingUtility.ColorArbiterParkingSpotWaypointCheckpoint;
            else
                c = DrawingUtility.ColorArbiterParkingSpotWaypoint;

            if (DrawingUtility.DisplayArbiterWaypointCheckpointId && this.isCheckpoint)
            {
                DrawingUtility.DrawControlPoint(this.position, DrawingUtility.ColorDisplayArbiterCheckpoint, this.checkpointId.ToString(),
                    ContentAlignment.TopCenter, ControlPointStyle.SmallCircle, g, t);
            }

            if (DrawingUtility.DisplayArbiterParkingSpotWaypointId)
            {
                DrawingUtility.DrawControlPoint(this.position, c, this.WaypointId.ToString(),
                    ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
            }
            else
            {
                DrawingUtility.DrawControlPoint(this.position, c, null,
                    ContentAlignment.BottomCenter, ControlPointStyle.SmallCircle, g, t);
            }
        }
Exemplo n.º 32
0
 public override void BeginMove(UrbanChallenge.Common.Coordinates orig, RndfEditor.Display.Utilities.WorldTransform t)
 {
 }
 public HitTestResult HitTest(UrbanChallenge.Common.Coordinates loc, float tol, WorldTransform wt, DisplayObjectFilter filter)
 {
     return new HitTestResult(this, false, float.MaxValue);
 }
Exemplo n.º 34
0
 public override void CancelMove(UrbanChallenge.Common.Coordinates orig, RndfEditor.Display.Utilities.WorldTransform t)
 {
     this.VehicleState.Position = orig;
 }
 public void Render(System.Drawing.Graphics g, WorldTransform t)
 {
     DrawingUtility.DrawColoredControlLine(DrawingUtility.ColorArbiterUserPartition, System.Drawing.Drawing2D.DashStyle.Dash,
         this.InitialGeneric.Position, this.FinalGeneric.Position, g, t);
 }
        public void Render(System.Drawing.Graphics g, WorldTransform t)
        {
            if (this.trackedCluster.targetClass == SceneEstimatorTargetClass.TARGET_CLASS_CARLIKE)
            {
                bool clusterStopped = this.trackedCluster.isStopped;
                bool occluded = ((this.trackedCluster.statusFlag == SceneEstimatorTargetStatusFlag.TARGET_STATE_OCCLUDED_FULL && clusterStopped) ||
                    (this.trackedCluster.statusFlag == SceneEstimatorTargetStatusFlag.TARGET_STATE_OCCLUDED_PART && clusterStopped));

                Color c = this.trackedCluster.statusFlag == SceneEstimatorTargetStatusFlag.TARGET_STATE_ACTIVE ?
                    DrawingUtility.ColorSimTrafficCar :
                    DrawingUtility.ColorSimDeletedCar;

                if(occluded)
                    c = Color.Chocolate;
                else if ((this.trackedCluster.statusFlag == SceneEstimatorTargetStatusFlag.TARGET_STATE_OCCLUDED_FULL && !clusterStopped) ||
                    (this.trackedCluster.statusFlag == SceneEstimatorTargetStatusFlag.TARGET_STATE_OCCLUDED_PART && !clusterStopped))
                {
                    occluded = true;
                    c = Color.DarkOrange;
                }

                if (this.trackedCluster.statusFlag == SceneEstimatorTargetStatusFlag.TARGET_STATE_ACTIVE
                    && this.trackedCluster.isStopped && this.trackedCluster.speedValid)
                    c = Color.Red;
                else if (this.trackedCluster.statusFlag == SceneEstimatorTargetStatusFlag.TARGET_STATE_ACTIVE
                    && this.trackedCluster.isStopped && !this.trackedCluster.speedValid)
                    c = Color.SkyBlue;

                bool draw = this.trackedCluster.statusFlag == SceneEstimatorTargetStatusFlag.TARGET_STATE_ACTIVE || occluded ?
                    DrawingUtility.DrawSimCars :
                    DrawingUtility.DrawSimCars && DrawingUtility.DrawSimCarDeleted;

                if (draw)
                {
                    Coordinates heading = (new Coordinates(1,0)).Rotate(this.trackedCluster.absoluteHeading).Normalize(3.0);
                    Coordinates headingCoord = this.trackedCluster.closestPoint + heading;

                    if(trackedCluster.headingValid)
                        DrawingUtility.DrawColoredControlLine(Color.Blue, DashStyle.Solid, this.trackedCluster.closestPoint, headingCoord, g, t);

                    if (DrawingUtility.DrawSimCarId)
                    {
                        DrawingUtility.DrawControlPoint(
                            this.trackedCluster.closestPoint,
                            c,
                            this.trackedCluster.id.ToString(),
                            ContentAlignment.TopLeft,
                            ControlPointStyle.LargeBox,
                            g, t);

                        DrawingUtility.DrawControlPoint(
                            this.trackedCluster.closestPoint,
                            c,
                            this.trackedCluster.speed.ToString("f1"),
                            ContentAlignment.BottomLeft,
                            ControlPointStyle.LargeBox,
                            g, t);

                        DrawingUtility.DrawControlPoint(
                            this.trackedCluster.closestPoint,
                            c,
                            this.PartitionIdString(),
                            ContentAlignment.BottomRight,
                            ControlPointStyle.LargeBox,
                            g, t);
                    }
                    else
                    {
                        DrawingUtility.DrawControlPoint(
                            this.trackedCluster.closestPoint,
                            c,
                            null,
                            ContentAlignment.MiddleCenter,
                            ControlPointStyle.LargeBox,
                            g, t);
                    }
                }
            }
        }