/// <summary>
 /// Returns all the Geometry Handles for a specified SurfaceStyle
 /// Obtain the SurfaceStyle by calling the GetSurfaceStyles function
 /// </summary>
 /// <param name="forStyle"></param>
 public IEnumerable <XbimGeometryHandle> GetGeometryHandles(XbimSurfaceStyle forStyle)
 {
     foreach (var item in this.Where(gh => gh.SurfaceStyle.Equals(forStyle)))
     {
         yield return(item);
     }
 }
Ejemplo n.º 2
0
 public override bool Equals(object obj)
 {
     if (obj is XbimSurfaceStyle)
     {
         XbimSurfaceStyle compareTo = (XbimSurfaceStyle)obj;
         if (IsIfcSurfaceStyle && styleId == compareTo.styleId) //if it is a surface style then this takes priority
         {
             return(true);
         }
         else if (IsIfcSurfaceStyle)
         {
             return(false);
         }
         else
         {
             return(ifcTypeId == compareTo.ifcTypeId); //otherwise the ifc type is precedent
         }
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
 private void SetupNewLayer(XbimSurfaceStyle topstyle, XbimModel model)
 {
     XBimMaterial m = new XBimMaterial();
     XbimTexture style;
     if (topstyle.IsIfcSurfaceStyle)
     {
         style = new XbimTexture().CreateTexture(topstyle.IfcSurfaceStyle(model));
     }
     else
     {
         style = new XbimTexture().CreateTexture(TypeMap[topstyle.IfcType.Name]);
     }
     m.CreateMaterial(style);
     m.Material.MaterialID = topstyle.IfcSurfaceStyleLabel;
     xMaterials[topstyle.IfcSurfaceStyleLabel.ToString()] = m;
     xLayers[topstyle.IfcSurfaceStyleLabel.ToString()] = new List<long>();
 }