Exemplo n.º 1
0
 private List<MaterialObject> HighlightMaterialByMesh(MeshObject mesh, Color c)
 {
     List<MaterialObject> highlighted = new List<MaterialObject>();
     foreach (var item in MaterialGrid.Items)
     {
         MaterialObject mo = item as MaterialObject;
         if (mo != null && mo.RefList.Contains(mesh.InstID))
         {
             DataGridUtil.MarkAsHighlighted(MaterialGrid, item, c);
             highlighted.Add(mo);
         }
     }
     return highlighted;
 }
Exemplo n.º 2
0
        public void NetRequest_FlyToMesh(MeshObject mesh)
        {
            if (mesh == null)
            {
                ModernDialog.ShowMessage("请先选中一个 Mesh", "定位", MessageBoxButton.OK);
                return;
            }

            UsCmd cmd = new UsCmd();
            cmd.WriteNetCmd(eNetCmd.CL_FlyToObject);
            cmd.WriteInt32(mesh.InstID);
            NetManager.Instance.Send(cmd);
        }
Exemplo n.º 3
0
        public bool NetHandle_FrameDataV2_Meshes(eNetCmd cmd, UsCmd c)
        {
            MeshGrid.Dispatcher.Invoke(new Action(() =>
            {
                int count = c.ReadInt32();
                UsLogging.Printf("eNetCmd.NetHandle_FrameDataV2_Meshes [b]({0} got)[/b].", count);
                for (int i = 0; i < count; i++)
                {
                    var m = new MeshObject();
                    m.Visible = true;
                    m.InstID = c.ReadInt32();
                    m.VertCnt = c.ReadInt32();
                    m.TriCnt = c.ReadInt32();
                    m.MatCnt = c.ReadInt32();
                    m.Size = c.ReadFloat();
                    ((ObservableCollection<MeshObject>)(MeshGrid.DataContext)).Add(m);
                }
            }));

            return true;
        }