示例#1
0
        public void PickActor(Point cursor)
        {
            int  mesh    = -1;
            uint actorId = RenderMethods.GetPickedActor(cursor.X, cursor.Y, ref mesh);

            m_ProjectView.SelectActorNode(actorId);
        }
示例#2
0
        private void panelRender_DragDrop(object sender, DragEventArgs e)
        {
            TreeNode effectNode = (TreeNode)e.Data.GetData(typeof(TreeNode).ToString(), false);

            if (effectNode != null)
            {
                XmlNode element = (XmlNode)effectNode.Tag;
                if (element != null)
                {
                    Point targetPoint = panelRender.PointToClient(new Point(e.X, e.Y));
                    uint  actorId     = RenderMethods.GetPickedActor(targetPoint.X, targetPoint.Y);
                    m_ChangeDelegate?.Invoke(element, actorId);
                }
            }
        }
示例#3
0
 private void panelRender_DragOver(object sender, DragEventArgs e)
 {
     string[] formats = e.Data.GetFormats();
     if (formats.Contains(typeof(TreeNode).ToString()))
     {
         Point targetPoint = panelRender.PointToClient(new Point(e.X, e.Y));
         uint  actorId     = RenderMethods.GetPickedActor(targetPoint.X, targetPoint.Y);
         if (actorId != 0)
         {
             e.Effect = DragDropEffects.Copy;
         }
         else
         {
             e.Effect = DragDropEffects.None;
         }
     }
 }
示例#4
0
        private void panelRender_DragDrop(object sender, DragEventArgs e)
        {
            TreeNode materialNode = (TreeNode)e.Data.GetData(typeof(TreeNode).ToString(), false);

            if (materialNode != null)
            {
                Point targetPoint = panelRender.PointToClient(new Point(e.X, e.Y));
                int   mesh        = -1;
                uint  actorId     = RenderMethods.GetPickedActor(targetPoint.X, targetPoint.Y, ref mesh);
                m_ChangeDelegate?.Invoke(materialNode.Name, actorId, mesh);
                return;
            }

            ListViewItem item = (ListViewItem)e.Data.GetData(typeof(ListViewItem).ToString(), false);

            if (item != null)
            {
                Point targetPoint = panelRender.PointToClient(new Point(e.X, e.Y));
                int   mesh        = -1;
                uint  actorId     = RenderMethods.GetPickedActor(targetPoint.X, targetPoint.Y, ref mesh);
                m_ChangeDelegate?.Invoke(item.Name, actorId, mesh);
            }
        }