Example #1
0
 private void HighlightTextureByMaterial(MaterialObject material, Color c)
 {
     foreach (var item in TextureGrid.Items)
     {
         TextureObject to = item as TextureObject;
         if (to != null && to.RefList.Contains(material.InstID))
         {
             DataGridUtil.MarkAsHighlighted(TextureGrid, item, c);
         }
     }
 }
Example #2
0
 private void HighlightMeshByMaterial(MaterialObject material, Color c)
 {
     foreach (var item in MeshGrid.Items)
     {
         MeshObject mo = item as MeshObject;
         if (mo != null && material.RefList.Contains(mo.InstID))
         {
             DataGridUtil.MarkAsHighlighted(MeshGrid, item, c);
         }
     }
 }
Example #3
0
        private void MaterialGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var mat = DataGridUtil.GetSelectedObject <MaterialObject>(MaterialGrid);

            if (mat == null)
            {
                return;
            }
            ClearAllSelectionsAndHighlightedObjects();

            DataGridUtil.MarkAsHighlighted(MaterialGrid, mat, Colors.Chartreuse);
            HighlightMeshByMaterial(mat, Colors.Chartreuse);
            HighlightTextureByMaterial(mat, Colors.Chartreuse);
        }
Example #4
0
        private List <MaterialObject> HighlightMaterialByTexture(TextureObject texture, Color c)
        {
            List <MaterialObject> highlighted = new List <MaterialObject>();

            foreach (var item in MaterialGrid.Items)
            {
                MaterialObject mo = item as MaterialObject;
                if (mo != null && texture.RefList.Contains(mo.InstID))
                {
                    DataGridUtil.MarkAsHighlighted(MaterialGrid, item, c);
                    highlighted.Add(mo);
                }
            }
            return(highlighted);
        }
Example #5
0
        private List <MeshObject> HighlightMeshes(List <int> selection, Color c)
        {
            List <MeshObject> highlighted = new List <MeshObject>();

            foreach (var item in MeshGrid.Items)
            {
                MeshObject mo = item as MeshObject;
                if (mo != null && selection.Contains(mo.InstID))
                {
                    DataGridUtil.MarkAsHighlighted(MeshGrid, item, c);
                    highlighted.Add(mo);
                }
            }
            return(highlighted);
        }
Example #6
0
        private void TextureGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var texture = DataGridUtil.GetSelectedObject <TextureObject>(TextureGrid);

            if (texture == null)
            {
                return;
            }
            ClearAllSelectionsAndHighlightedObjects();

            DataGridUtil.MarkAsHighlighted(TextureGrid, texture, Colors.Chartreuse);
            var matLst = HighlightMaterialByTexture(texture, Colors.Chartreuse);

            foreach (var mat in matLst)
            {
                HighlightMeshByMaterial(mat, Colors.Chartreuse);
            }
        }
Example #7
0
        private void MeshGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var mesh = DataGridUtil.GetSelectedObject <MeshObject>(MeshGrid);

            if (mesh == null)
            {
                return;
            }
            ClearAllSelectionsAndHighlightedObjects();

            DataGridUtil.MarkAsHighlighted(MeshGrid, mesh, Colors.Chartreuse);
            var matLst = HighlightMaterialByMesh(mesh, Colors.Chartreuse);

            foreach (var mat in matLst)
            {
                HighlightTextureByMaterial(mat, Colors.Chartreuse);
            }
        }
Example #8
0
        bool NetHandle_StressTestResult(eNetCmd cmd, UsCmd c)
        {
            string name     = c.ReadString();
            int    avgMS    = c.ReadInt32();
            int    maxMS    = c.ReadInt32();
            int    drawcall = c.ReadInt32();
            int    parCount = c.ReadInt32();

            EffectGrid.Dispatcher.Invoke(new Action(() =>
            {
                foreach (var item in EffectGrid.Items)
                {
                    EffectObject mo = item as EffectObject;
                    if (mo != null && mo.Name == name)
                    {
                        if (_highlighted != null)
                        {
                            DataGridUtil.ClearHighlighted(EffectGrid, _highlighted);
                        }

                        mo.MSAvg          = avgMS;
                        mo.MSMax          = maxMS;
                        mo.DrawCallCount  = drawcall;
                        mo.TotalParticles = parCount;

                        DataGridUtil.MarkAsHighlighted(EffectGrid, item, Colors.Chartreuse);
                        _highlighted = mo;

                        break;
                    }
                }
            }));

            RunNextEffectStressTest();

            return(true);
        }