Exemplo n.º 1
0
        public void MapFromDTO(JObject sourceJSON, Autodesk.Revit.DB.Material dest)
        {
            LMAStudio.StreamVR.Common.Models.Material source = sourceJSON.ToObject <LMAStudio.StreamVR.Common.Models.Material>();

            dest.Color        = new Autodesk.Revit.DB.Color(source.Color.Red, source.Color.Green, source.Color.Blue);
            dest.Transparency = source.Transparency;
            dest.Shininess    = source.Shininess;
            dest.Smoothness   = source.Smoothness;
        }
Exemplo n.º 2
0
        public JObject ConvertToDTO(Autodesk.Revit.DB.Material source)
        {
            LMAStudio.StreamVR.Common.Models.Material dest = new LMAStudio.StreamVR.Common.Models.Material
            {
                Id    = source.Id.ToString(),
                Name  = source.Name,
                Color = new LMAStudio.StreamVR.Common.Models.Color
                {
                    Red   = source.Color.Red,
                    Blue  = source.Color.Blue,
                    Green = source.Color.Green
                },
                Transparency = source.Transparency,
                Shininess    = source.Shininess,
                Smoothness   = source.Smoothness
            };

            return(JObject.FromObject(dest));
        }