Example #1
0
 public static Material Material(IMaterialProperties property)
 {
     return(new Material
     {
         Name = property.Name,
         Properties = new List <IMaterialProperties>()
         {
             property
         },
     });
 }
Example #2
0
        public static Material AddMaterialProperties(this Material material, IMaterialProperties newProperties)
        {
            if (material.Properties.Where(x => x.GetType() == newProperties.GetType()).FirstOrDefault() != null)
            {
                BH.Engine.Reflection.Compute.RecordError("Properties of that type already exist on this material - please remove them before adding new properties of that type");
            }
            else
            {
                material.Properties.Add(newProperties);
            }

            return(material);
        }
Example #3
0
        public static MaterialComposition MaterialComposition(IMaterialProperties materialProperty)
        {
            Material material = new Material
            {
                Name       = materialProperty.Name,
                Properties = new List <IMaterialProperties>()
                {
                    materialProperty
                },
            };

            return((MaterialComposition)material);
        }
Example #4
0
        public static Material Material(IMaterialProperties property)
        {
            if (property == null)
            {
                BH.Engine.Reflection.Compute.RecordError("Cannot create a Physical.Material from a null set of material properties.");
                return(null);
            }

            return(new Material
            {
                Name = property.Name,
                Properties = new List <IMaterialProperties>()
                {
                    property
                },
            });
        }
Example #5
0
        public static MaterialComposition MaterialComposition(IMaterialProperties materialProperty)
        {
            if (materialProperty == null)
            {
                BH.Engine.Reflection.Compute.RecordError("Cannot create a material composition from a null set of material properties.");
                return(null);
            }

            Material material = new Material
            {
                Name       = materialProperty.Name,
                Properties = new List <IMaterialProperties>()
                {
                    materialProperty
                },
            };

            return((MaterialComposition)material);
        }
Example #6
0
 public static Material SetMaterialProperties(this Material material, IMaterialProperties newProperties)
 {
     material.MaterialProperties = newProperties;
     return(material);
 }
Example #7
0
 public static Material Material(string name, MaterialType materialType = MaterialType.Undefined, double thickness = 0.0, IMaterialProperties materialProperties = null)
 {
     return(new Material
     {
         Name = name,
         MaterialType = materialType,
         Thickness = thickness,
         MaterialProperties = materialProperties,
     });
 }