protected override void OnLeftMouseClick(object sender, World3DClickEventArgs e)
        {
            base.OnLeftMouseClick(sender, e);
            var pt = e.PointInWorld;
            Transform3D.TryTransform(pt, out pt);

            if (Keyboard.IsKeyDown(Key.LeftAlt) && SelectedZonePoint != null)
            {
                SelectedZonePoint.X = (float)pt.X;
                SelectedZonePoint.Y = (float)pt.Y;
                SelectedZonePoint.Z = (float)(pt.Z + ZAdjustment);
                return;
            }
            else if (Keyboard.IsKeyDown(Key.LeftCtrl) && SelectedZonePoint != null)
            {
                SelectedZonePoint.TargetX = (float)pt.X;
                SelectedZonePoint.TargetY = (float)pt.Y;
                SelectedZonePoint.TargetZ = (float)(pt.Z + ZAdjustment);
                return;
            }

            if (ZonePointsService != null && ZonePointsService.ZonePoints != null)
            {
                var zp = ZonePointsService.ZonePoints.GetClosestPoint(pt, true);
                if (zp != null)
                {
                    SelectedZonePoint = zp;
                }
            }
        }
        protected override void OnLeftMouseClick(object sender, World3DClickEventArgs e)
        {
            base.OnLeftMouseClick(sender, e);
            if (e.ActiveRibbonControl as IRoamAreaEditorControl != null)
            {
                Point3D p = new Point3D(e.PointInWorld.X, e.PointInWorld.Y, 0);
                if (Transform3D != null)
                {
                    Transform3D.TryTransform(p, out p);
                }

                if (Keyboard.IsKeyDown(Key.LeftShift) && SelectedArea != null)
                {
                    this.SelectedArea.AddEntry(p);
                    return;
                }
                else if (Keyboard.IsKeyDown(Key.LeftAlt) && SelectedArea != null && RoamAreasDataService.SelectedVertex != null)
                {
                    RoamAreasDataService.SelectedVertex.X = p.X;
                    RoamAreasDataService.SelectedVertex.Y = p.Y;

                    //hack to update display
                    RoamAreasDataService.SelectedArea = SelectedArea;
                }
                else
                {
                    if (SelectedArea != null)
                    {
                        var select = SelectedArea.GetClosestVertex(p);
                        if (select != null)
                        {
                            RoamAreasDataService.SelectedVertex = select;
                        }
                    }
                }
            }
            else if (e.ActiveRibbonControl as ISpawnsControl != null && SpawnDataservice != null)
            {
                if (SpawnDataservice.SelectedSpawn != null)
                {
                    if (RoamAreasDataService.ZoneAreas != null)
                    {
                        var area = RoamAreasDataService.ZoneAreas.RoamAreas.FirstOrDefault(x => x.Id == SpawnDataservice.SelectedSpawn.RoamAreaId);
                        if (area != null)
                        {
                            RoamAreasDataService.SelectedArea = area;
                        }
                    }
                }
            }
        }
        protected override void OnLeftMouseClick(object sender, World3DClickEventArgs e)
        {
            base.OnLeftMouseClick(sender, e);
            if (this.GroundSpawnsService != null)
            {
                Point3D p = new Point3D(e.PointInWorld.X, e.PointInWorld.Y, e.PointInWorld.Z);
                if (Transform3D != null)
                {
                    Transform3D.TryTransform(p, out p);
                }

                if (Keyboard.IsKeyDown(Key.LeftAlt) && SelectedGroundSpawn != null)
                {
                    SelectedGroundSpawn.CenterPositionAt(new Point3D(p.X, p.Y, p.Z + ZAdjustment));
                    return;
                }

                if (e.CheckSelection != null)
                {
                    var selections = GroundSpawnsService.ZoneGroundSpawns.GroundSpawns.Where(x =>
                    {
                        var pt3d = new Point3D(x.MidPoint.X, x.MidPoint.Y, x.MaxZ);
                        pt3d = Transform3D.Transform(pt3d);
                        return e.CheckSelection(pt3d, 0);
                    });
                    if (selections.Count() > 0)
                    {
                        SelectedGroundSpawn = selections.ElementAt(0);

                        if (selections.Count() > 1)
                        {
                            SelectedGroundSpawns = selections;
                        }
                        else
                        {
                            SelectedGroundSpawns = null;
                        }
                        return;
                    }
                }

                var spawn = GroundSpawnsService.GetClosestGroundSpawn(p);
                if (spawn != null)
                {
                    SelectedGroundSpawn = spawn;
                    SelectedGroundSpawns = null;
                }
            }
        }
 public virtual void User3DClickAt(object sender, World3DClickEventArgs e)
 {
     switch (e.MouseButtonArgs.ChangedButton)
     {
         case System.Windows.Input.MouseButton.Left:
             OnLeftMouseClick(sender, e);
             break;
         case System.Windows.Input.MouseButton.Middle:
             OnMiddleMouseClick(sender, e);
             break;
         case System.Windows.Input.MouseButton.Right:
             OnRightMouseClick(sender, e);
             break;
         default:
             break;
     }
 }
 public void User3DClickAt(object sender, World3DClickEventArgs e)
 {
 }
 public abstract override void User3DClickAt( object sender, World3DClickEventArgs e );
        protected virtual void OnMiddleMouseClick(object sender, World3DClickEventArgs args)
        {

        }
        protected override void OnLeftMouseClick(object sender, World3DClickEventArgs e)
        {
            base.OnLeftMouseClick(sender, e);
            Point3D p = new Point3D(e.PointInWorld.X, e.PointInWorld.Y, e.PointInWorld.Z);
            if (Transform3D != null)
            {
                Transform3D.TryTransform(p, out p);
            }

            Door door = null;

            if (Keyboard.IsKeyDown(Key.LeftShift))
            {
                door = DoorService.DoorManager.DoorFactory();
                door.UnlockObject();
                door.X = (float)p.X;
                door.Y = (float)p.Y;
                door.Z = (float)p.Z;
                door.Created();

                DoorService.DoorManager.AddDoor(door);
                return;
            }

            if (Keyboard.IsKeyDown(Key.LeftCtrl) && SelectedDoor != null)
            {
                SelectedDoor.LookAt(p);
                return;
            }

            if (Keyboard.IsKeyDown(Key.LeftAlt) && SelectedDoor != null)
            {
                SelectedDoor.X = (float)p.X;
                SelectedDoor.Y = (float)p.Y;
                SelectedDoor.Z = (float)p.Z;
                return;
            }

            door = DoorService.GetClosestDoor(p);
            if (door != null)
            {
                SelectedDoor = door;
            }
        }
        public override void User3DClickAt(object sender, World3DClickEventArgs e)
        {
            if (e.ActiveRibbonControl as IDoorsControl == null) return;
            if (DoorService == null || DoorService.DoorManager == null) return;

            base.User3DClickAt(sender, e);
        }
        protected override void OnLeftMouseClick(object sender, World3DClickEventArgs e)
        {
            base.OnLeftMouseClick(sender, e);
            Point3D p = new Point3D(e.PointInWorld.X, e.PointInWorld.Y, 0);
            if (Transform3D != null)
            {
                Transform3D.TryTransform(p, out p);
            }

            if (Keyboard.IsKeyDown(Key.LeftShift) && SelectedArea != null)
            {
                this.SelectedArea.AddVertex(p);
                return;
            }
            else if (Keyboard.IsKeyDown(Key.LeftAlt) && SelectedArea != null && LineOfSightAreasService.SelectedVertex != null)
            {
                LineOfSightAreasService.SelectedArea.MoveVertex(LineOfSightAreasService.SelectedVertex, p);
                LineOfSightAreasService.SelectedVertex = p;

                //hack to update display
                LineOfSightAreasService.SelectedArea = SelectedArea;
            }

            if (SelectedArea != null)
            {
                SelectedVertex = new Point3D(p.X, p.Y, p.Z);
            }
        }
 public override void User3DClickAt(object sender, World3DClickEventArgs e)
 {
     if ( e.ActiveRibbonControl as ILineOfSightAreaEditorControl == null ) return;
     base.User3DClickAt(sender, e);
 }
        protected override void OnLeftMouseClick(object sender, World3DClickEventArgs e)
        {
            base.OnLeftMouseClick(sender, e);
            if (PathingService != null && PathingService.Pathing != null)
            {
                Point3D p = new Point3D(e.PointInWorld.X, e.PointInWorld.Y, e.PointInWorld.Z);
                if (Transform3D != null)
                {
                    Transform3D.TryTransform(p, out p);
                }

                if (Keyboard.IsKeyDown(Key.LeftShift))
                {
                    var newnode = new EQEmu.Path.Node(p.X, p.Y, p.Z + ZAdjustment);
                    if (PathingService != null && PathingService.Pathing != null)
                    {
                        PathingService.Pathing.AddNode(newnode);
                        if (SelectedNode != null && AutoConnect)
                        {
                            SelectedNode.ConnectToNodeTwoWay(newnode);
                            SelectedNode = newnode;
                        }
                    }
                    return;
                }

                if (Keyboard.IsKeyDown(Key.LeftAlt) && SelectedNode != null)
                {
                    SelectedNode.X = p.X;
                    SelectedNode.Y = p.Y;
                    SelectedNode.Z = p.Z + ZAdjustment;
                    return;
                }

                var node = PathingService.Pathing.GetNearbyNode(p);
                if (node != null)
                {
                    if (Keyboard.IsKeyDown(Key.LeftCtrl) && SelectedNode != null)
                    {
                        if (UseTwoWayConnect)
                        {
                            if (UseWarpConnect)
                            {
                                SelectedNode.ConnectToNodeAsWarp(node);
                                node.ConnectToNodeAsWarp(SelectedNode);
                            }
                            else
                            {
                                SelectedNode.ConnectToNodeTwoWay(node);
                            }
                        }
                        else
                        {
                            if (UseWarpConnect)
                            {
                                SelectedNode.ConnectToNodeAsWarp(node);
                            }
                            else
                            {
                                SelectedNode.ConnectToNode(node);
                            }
                        }
                        return;
                    }

                    SelectedNode = node;
                }
            }
        }
 public override void User3DClickAt(object sender, World3DClickEventArgs e)
 {
     if (e.ActiveRibbonControl as IPathingControl == null) return;
     base.User3DClickAt(sender, e);
 }
        protected override void OnLeftMouseClick(object sender, World3DClickEventArgs e)
        {
            base.OnLeftMouseClick(sender, e);
            EQEmu.Grids.Waypoint waypoint = null;

            if (this.GridsService != null && SelectedGrid != null)
            {
                Point3D p = new Point3D(e.PointInWorld.X, e.PointInWorld.Y, e.PointInWorld.Z);
                if (Transform3D != null)
                {
                    Transform3D.TryTransform(p, out p);
                }

                //add a new waypoint
                if (Keyboard.IsKeyDown(Key.LeftShift) && SelectedGrid != null)
                {
                    waypoint = SelectedGrid.GetNewWaypoint();

                    waypoint.X = p.X; waypoint.Y = p.Y; waypoint.Z = p.Z + ZAdjustment;
                    SelectedGrid.AddWaypoint(waypoint);

                    //TODO 3d displayer needs to handle this, hack to update display
                    SelectedGrid = SelectedGrid;
                    SelectedWaypoint = waypoint;

                    return;
                }
                //adjust waypoint heading
                if (Keyboard.IsKeyDown(Key.LeftCtrl) && SelectedWaypoint != null)
                {
                    SelectedWaypoint.LookAt(p);

                    //TODO 3d displayer needs to handle this, hack to update display
                    waypoint = SelectedWaypoint;
                    SelectedGrid = SelectedGrid;
                    SelectedWaypoint = waypoint;

                    return;
                }

                if (Keyboard.IsKeyDown(Key.LeftAlt) && SelectedWaypoint != null)
                {
                    SelectedWaypoint.X = p.X; SelectedWaypoint.Y = p.Y; SelectedWaypoint.Z = p.Z + ZAdjustment;

                    //TODO more update hacks
                    waypoint = SelectedWaypoint;
                    SelectedGrid = SelectedGrid;
                    SelectedWaypoint = waypoint;
                }

                List<Waypoint> selectedWaypoints = new List<Waypoint>();
                foreach (var wp in SelectedGrid.Waypoints.Where(
                    x =>
                    {
                        var checkPt = new Point3D(x.X, x.Y, x.Z);
                        Transform3D.TryTransform(checkPt, out checkPt);
                        double dist = 5.0;
                        return e.CheckSelection(checkPt, dist);
                    }))
                {
                    selectedWaypoints.Add(wp);
                }

                if (selectedWaypoints.Count > 0)
                {
                    SelectedWaypoint = selectedWaypoints.ElementAt(0);
                    SelectedWaypoints = selectedWaypoints;
                }
                else
                {
                    waypoint = SelectedGrid.GetNearestWaypoint(p);
                    if (waypoint != null)
                    {
                        SelectedWaypoint = waypoint;
                        SelectedWaypoints = null;
                    }
                }
            }
        }
 public override void User3DClickAt( object sender, World3DClickEventArgs e )
 {
     //throw new NotImplementedException();
 }