private void AddLighting(IIfcSurfaceStyleLighting lighting) { DiffuseReflectionColour = new XbimColour(lighting.DiffuseReflectionColour); DiffuseTransmissionColour = new XbimColour(lighting.DiffuseTransmissionColour); TransmissionColour = new XbimColour(lighting.TransmissionColour); ReflectanceColour = new XbimColour(lighting.ReflectanceColour); }
private void AddColour(XbimColour colour) { if (string.IsNullOrEmpty(colour.Name)) { colour.Name = "C" + (ColourMap.Count + 1); } ColourMap.Add(colour); }
public override bool Equals(object obj) { XbimColour col = obj as XbimColour; float tolerance = (float)1e-5; if (col == null) { return(false); } return(Math.Abs(col.Red - Red) < tolerance && Math.Abs(col.Green - Green) < tolerance && Math.Abs(col.Blue - Blue) < tolerance && Math.Abs(col.Alpha - Alpha) < tolerance && Math.Abs(col.DiffuseFactor - DiffuseFactor) < tolerance && Math.Abs(col.TransmissionFactor - TransmissionFactor) < tolerance && Math.Abs(col.DiffuseTransmissionFactor - DiffuseTransmissionFactor) < tolerance && Math.Abs(col.ReflectionFactor - ReflectionFactor) < tolerance && Math.Abs(col.SpecularFactor - SpecularFactor) < tolerance); }
public static XbimTexture Create(XbimColour colour) { var texture = new XbimTexture(); return(texture.CreateTexture(colour)); }
private XbimTexture CreateTexture(XbimColour colour) { ColourMap.Clear(); AddColour(colour); return(this); }
static XbimColour() { DefaultColour = new XbimColour("Default", 1, 1, 1); }