Example #1
0
 internal XbimGeometryData GetGeometryData(XbimGeometryHandle handle)
 {
     Api.JetSetCurrentIndex(sesid, table, geometryTablePrimaryIndex);
     Api.MakeKey(sesid, table, handle.GeometryLabel, MakeKeyGrbit.NewKey);
     if (Api.TrySeek(sesid, table, SeekGrbit.SeekEQ))
     {
         Api.RetrieveColumns(sesid, table, _colValues);
         _colValGeometryLabel.Value = Api.RetrieveColumnAsInt32(sesid, table, _colIdGeometryLabel);
         return(new XbimGeometryData(_colValGeometryLabel.Value.Value, _colValProductLabel.Value.Value, (XbimGeometryType)_colValGeomType.Value, _colValProductIfcTypeId.Value.Value, _colValShapeData.Value, _colValTransformMatrix.Value, _colValGeometryHash.Value.Value, _colValStyleLabel.Value.HasValue ? _colValStyleLabel.Value.Value : 0, _colValSubPart.Value.HasValue ? _colValSubPart.Value.Value : 0));
     }
     else
     {
         return(null);
     }
 }
        /// <summary>
        /// Returns the Ifc entity for a given Geometry Label
        /// </summary>
        /// <param name="geometryLabel"></param>
        /// <returns></returns>
        public IPersistIfcEntity GetFromGeometryLabel(int geometryLabel)
        {
            XbimGeometryHandle filledGeomData = cache.GetGeometryHandle(geometryLabel);

            return(cache.GetInstance(filledGeomData.ProductLabel, true, true));
        }
        internal XbimGeometryData GetGeometryData(XbimGeometryHandle handle)
        {
            
            Api.JetSetCurrentIndex(sesid, table, geometryTablePrimaryIndex);
            Api.MakeKey(sesid, table, handle.GeometryLabel, MakeKeyGrbit.NewKey);
            if (Api.TrySeek(sesid, table, SeekGrbit.SeekEQ))
            {
                Api.RetrieveColumns(sesid, table, _colValues);
                _colValGeometryLabel.Value = Api.RetrieveColumnAsInt32(sesid, table, _colIdGeometryLabel);
                return new XbimGeometryData(_colValGeometryLabel.Value.Value, _colValProductLabel.Value.Value, (XbimGeometryType)_colValGeomType.Value, _colValProductIfcTypeId.Value.Value, _colValShapeData.Value, _colValTransformMatrix.Value, _colValGeometryHash.Value.Value, _colValStyleLabel.Value.HasValue ? _colValStyleLabel.Value.Value : 0, _colValSubPart.Value.HasValue ? _colValSubPart.Value.Value : 0);

            }
            else
                return null;
        }
Example #4
0
 private void SetupMaterial(ColourMap TypeMap, XbimGeometryHandle xgh, XbimModel model, Int32 ModelID)
 {
     if (xMaterials.ContainsKey(xgh.SurfaceStyle.IfcSurfaceStyleLabel.ToString()) && xLayers[xgh.SurfaceStyle.IfcSurfaceStyleLabel.ToString()].Count > MAX_LAYER_SIZE)
     {
         String LayerName = xgh.SurfaceStyle.IfcSurfaceStyleLabel.ToString();
         while (xLayers.ContainsKey(LayerName))
         {
             LayerName += "_";
         }
         xLayers[LayerName] = xLayers[xgh.SurfaceStyle.IfcSurfaceStyleLabel.ToString()];
         xMaterials[LayerName] = xMaterials[xgh.SurfaceStyle.IfcSurfaceStyleLabel.ToString()];
         SetupNewLayer(xgh.SurfaceStyle, model);
     }
     else
     {
         if (xgh.SurfaceStyleLabel != 0 && !xMaterials.ContainsKey(xgh.SurfaceStyle.IfcSurfaceStyleLabel.ToString()))
         {
             SetupNewLayer(xgh.SurfaceStyle, model);
         }
     }
 }