예제 #1
0
        public void SelectNode(int Index)
        {
            // TODO: Big problem here - The graphics class isn't aware of the selecting logic here.
            // So we'll one day need to support the graphics class aware of this and deselect this whenever another
            // object has been selected.
            if (SelectedIndex != -1)
            {
                BoundingBoxes[SelectedIndex].Unselect();
            }

            // Move the selection to the new Vertex
            BoundingBoxes[Index].Select();
            SelectedIndex = Index;

            // Render debug work
            OBJData.VertexStruct PathPoint = data.vertices[Index];
            RenderLine           FromA     = CreateConnectionLine(PathPoint, data.vertices[PathPoint.Unk3], System.Drawing.Color.Yellow);
            RenderLine           FromB     = CreateConnectionLine(PathPoint, data.vertices[PathPoint.Unk4], System.Drawing.Color.Brown);
            RenderLine           FromC     = CreateConnectionLine(PathPoint, data.vertices[PathPoint.Unk5], System.Drawing.Color.Red);

            PointConnectionsBatch.ClearObjects();
            PointConnectionsBatch.AddObject(RefManager.GetNewRefID(), FromA);
            PointConnectionsBatch.AddObject(RefManager.GetNewRefID(), FromB);
            PointConnectionsBatch.AddObject(RefManager.GetNewRefID(), FromC);

            foreach (var IncomingPoint in PathPoint.IncomingConnections)
            {
                RenderLine Connection = CreateConnectionLine(PathPoint, IncomingPoint, System.Drawing.Color.Green);
                PointConnectionsBatch.AddObject(RefManager.GetNewRefID(), Connection);
            }

            foreach (var OutgoingPoint in PathPoint.OutgoingConnections)
            {
                RenderLine Connection = CreateConnectionLine(PathPoint, OutgoingPoint, System.Drawing.Color.Blue);
                PointConnectionsBatch.AddObject(RefManager.GetNewRefID(), Connection);
            }

            PointConnectionsBatch.SetIsDirty();
        }