/// <summary>
 /// Compares two objects for geomtric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcRepresentationItem a, IfcRepresentationItem b)
 {
     if (a is IfcSolidModel)
     {
         return(((IfcSolidModel)a).GeometricEquals(b));
     }
     else if (a is IfcBooleanResult)
     {
         return(((IfcBooleanResult)a).GeometricEquals(b));
     }
     else if (a is IfcConnectedFaceSet)
     {
         return(((IfcConnectedFaceSet)a).GeometricEquals(b));
     }
     else if (a is IfcFaceBasedSurfaceModel)
     {
         return(((IfcFaceBasedSurfaceModel)a).GeometricEquals(b));
     }
     else if (a is IfcShellBasedSurfaceModel)
     {
         return(((IfcShellBasedSurfaceModel)a).GeometricEquals(b));
     }
     else if (a is IfcPlane)
     {
         return(((IfcPlane)a).GeometricEquals(b));
     }
     else
     {
         // return false;
         throw new XbimGeometryException("Unsupported solid geometry type " + a.GetType().Name);
     }
 }
 /// <summary>
 /// Returns a Hash Code for the geometric properties of this object
 /// </summary>
 /// <param name="repItem"></param>
 /// <returns></returns>
 public static int GetGeometryHashCode(this IfcRepresentationItem repItem)
 {
     if (repItem is IfcSolidModel)
     {
         return(((IfcSolidModel)repItem).GetGeometryHashCode());
     }
     else if (repItem is IfcBooleanResult)
     {
         return(((IfcBooleanResult)repItem).GetGeometryHashCode());
     }
     else if (repItem is IfcConnectedFaceSet)
     {
         return(((IfcConnectedFaceSet)repItem).GetGeometryHashCode());
     }
     else if (repItem is IfcFaceBasedSurfaceModel)
     {
         return(((IfcFaceBasedSurfaceModel)repItem).GetGeometryHashCode());
     }
     else if (repItem is IfcShellBasedSurfaceModel)
     {
         return(((IfcShellBasedSurfaceModel)repItem).GetGeometryHashCode());
     }
     else if (repItem is IfcPlane)
     {
         return(((IfcPlane)repItem).GetGeometryHashCode());
     }
     else if (repItem is IfcBoundingBox)
     {
         return(((IfcBoundingBox)repItem).GetGeometryHashCode());
     }
     else
     {
         throw new XbimGeometryException("Unsupported solid geometry type " + repItem.GetType().Name);
     }
 }
Пример #3
0
        public IXbimShapeGeometryData Mesh(IfcRepresentationItem shape)
        {
            var fbm = shape as IfcFaceBasedSurfaceModel;

            if (fbm != null)
            {
                return(Mesh(fbm));
            }
            var sbm = shape as IfcShellBasedSurfaceModel;

            if (sbm != null)
            {
                return(Mesh(sbm));
            }
            var cfs = shape as IfcConnectedFaceSet;

            if (cfs != null)
            {
                return(Mesh(cfs));
            }
            var fbr = shape as IfcFacetedBrep;

            if (fbr != null)
            {
                return(Mesh(fbr));
            }
            throw new ArgumentException("Unsupported representation type for tessellation, " + shape.GetType().Name);
        }