public IXbimGeometryObject Create(IIfcGeometricRepresentationItem ifcRepresentation, ILogger logger)
 {
     using (new Tracer(LogHelper.CurrentFunctionName(), this._logger, ifcRepresentation))
     {
         return(_engine.Create(ifcRepresentation, null, logger));
     }
 }
 public IXbimGeometryObject Create(IIfcGeometricRepresentationItem ifcRepresentation, IIfcAxis2Placement3D objectLocation)
 {
     try
     {
         return(_engine.Create(ifcRepresentation, objectLocation));
     }
     catch (AccessViolationException e)
     {
         Logger.ErrorFormat("EE001: Failed to create geometry #{0} of type {1}, {2]", ifcRepresentation.EntityLabel, ifcRepresentation.GetType().Name, e.Message);
         return(null);
     }
 }
 public IXbimGeometryObject Create(IIfcGeometricRepresentationItem ifcRepresentation, IIfcAxis2Placement3D objectLocation, ILogger logger)
 {
     try
     {
         using (new Tracer(LogHelper.CurrentFunctionName(), this._logger, ifcRepresentation))
         {
             return(_engine.Create(ifcRepresentation, objectLocation, logger));
         }
     }
     catch (Exception e)
     {
         (logger ?? _logger).LogError("EE001: Failed to create geometry #{0} of type {1}, {2}", ifcRepresentation.EntityLabel, ifcRepresentation.GetType().Name, e.Message);
         return(null);
     }
 }
 private static void Report(IIfcGeometricRepresentationItem obj, TextHighliter sb)
 {
     if (obj is IIfcCurve crv)
     {
         Report(crv, sb);
     }
     else if (obj is IIfcSolidModel solid)
     {
         Report(solid, sb);
     }
     else if (obj is IIfcTessellatedItem tess)
     {
         Report(tess, sb);
     }
     else
     {
         sb.Append($"{obj.GetType().Name} not implemented in IIfcGeometricRepresentationItem.", Brushes.Red);
     }
 }
        private static IXbimSolidSet CreateSolids(this IIfcGeometricRepresentationItem repItem, IXbimGeometryEngine engine, ILogger logger)
        {
            var sSet      = engine.CreateSolidSet();
            var sweptArea = repItem as IIfcSweptAreaSolid;

            if (sweptArea != null && (sweptArea.SweptArea is IIfcCompositeProfileDef))
            {
                //this is necessary as composite profile definitions produce multiple solid
                return(engine.CreateSolidSet(sweptArea, logger));
            }
            else if (repItem is IIfcSweptAreaSolid)
            {
                sSet.Add(engine.CreateSolid(repItem as IIfcSweptAreaSolid, logger));
                return(sSet);
            }
            else if (repItem is IIfcSweptDiskSolid)
            {
                sSet.Add(engine.CreateSolid(repItem as IIfcSweptDiskSolid, logger));
                return(sSet);
            }
            else if (repItem is IIfcBooleanResult)
            {
                return(engine.CreateSolidSet(repItem as IIfcBooleanResult, logger));
            }
            else if (repItem is IIfcBooleanClippingResult)
            {
                return(engine.CreateSolidSet(repItem as IIfcBooleanClippingResult, logger));
            }
            else if (repItem is IIfcCsgSolid)
            {
                return(engine.CreateSolidSet(repItem as IIfcCsgSolid, logger));
            }
            else if (repItem is IIfcFacetedBrep)
            {
                return(engine.CreateSolidSet(repItem as IIfcFacetedBrep, logger));
            }
            else if (repItem is IIfcTriangulatedFaceSet)
            {
                return(engine.CreateSolidSet(repItem as IIfcTriangulatedFaceSet));
            }
            else if (repItem is IIfcShellBasedSurfaceModel)
            {
                return(engine.CreateSolidSet(repItem as IIfcShellBasedSurfaceModel));
            }
            else if (repItem is IIfcFaceBasedSurfaceModel)
            {
                return(engine.CreateSolidSet(repItem as IIfcFaceBasedSurfaceModel));
            }
            else if (repItem is IIfcBoundingBox)
            {
                sSet.Add(engine.CreateSolid(repItem as IIfcBoundingBox, logger)); return(sSet);
            }
            else if (repItem is IIfcSectionedSpine)
            {
                sSet.Add(engine.CreateSolid(repItem as IIfcSectionedSpine, logger)); return(sSet);
            }
            else if (repItem is IIfcCsgPrimitive3D)
            {
                sSet.Add(engine.CreateSolid(repItem as IIfcCsgPrimitive3D, logger)); return(sSet);
            }
            else if (repItem is IIfcAdvancedBrep)
            {
                sSet.Add(engine.CreateSolid(repItem as IIfcAdvancedBrep, logger)); return(sSet);
            }
            else
            {
                return(null);
            }
        }
 public IXbimGeometryObject Create(IIfcGeometricRepresentationItem ifcRepresentation)
 {
     return(Create(ifcRepresentation, null));
 }