コード例 #1
0
 /// <summary>
 /// Moves the cursor to the next shape instanceData that meets the criteria of the previous TrySeek call
 /// </summary>
 /// <param name="si"></param>
 /// <returns></returns>
 public bool TryMoveNextShapeInstance(ref IXbimShapeInstanceData si)
 {
     if (Api.TryMoveNext(Sesid, Table))
     {
         GetShapeInstanceData(si);
         return(true);
     }
     return(false);
 }
コード例 #2
0
 internal bool TrySeekShapeInstance(ref IXbimShapeInstanceData shapeInstance)
 {
     Api.JetSetCurrentIndex(Sesid, Table, instanceTablePrimaryIndex);
     if (Api.TryMoveFirst(Sesid, Table))
     {
         GetShapeInstanceData(shapeInstance);
         return(true);
     }
     return(false);
 }
コード例 #3
0
 /// <summary>
 /// Moves the cursor to the next shape instance that meets the criteria of the previous TrySeek call
 /// </summary>
 /// <param name="si"></param>
 /// <returns></returns>
 public bool TryMoveNextShapeInstance(ref IXbimShapeInstanceData si)
 {
     if (Api.TryMoveNext(this.sesid, this.table))
     {
         GetShapeInstanceData(si);
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #4
0
 private void GetShapeInstanceData(IXbimShapeInstanceData si)
 {
     Api.RetrieveColumns(Sesid, Table, _colValues);
     si.RepresentationContext = _colValRepresentationContext.Value.Value;
     si.InstanceLabel         = Api.RetrieveColumnAsInt32(Sesid, Table, _colIdInstanceLabel).Value;
     si.IfcTypeId             = _colValIfcTypeId.Value.Value;
     si.IfcProductLabel       = _colValIfcProductLabel.Value.Value;
     si.StyleLabel            = _colValStyleLabel.Value.Value;
     si.ShapeGeometryLabel    = _colValShapeLabel.Value.Value;
     si.RepresentationType    = _colValRepType.Value.Value;
     si.Transformation        = _colValTransformation.Value;
     si.BoundingBox           = _colValBoundingBox.Value;
 }
コード例 #5
0
 public bool TrySeekProductType(short productType, ref IXbimShapeInstanceData shapeInstance)
 {
     Api.JetSetCurrentIndex(Sesid, Table, productTypeIndex);
     Api.MakeKey(Sesid, Table, productType, MakeKeyGrbit.NewKey);
     if (Api.TrySeek(Sesid, Table, SeekGrbit.SeekGE))
     {
         Api.MakeKey(Sesid, Table, productType, MakeKeyGrbit.NewKey | MakeKeyGrbit.FullColumnEndLimit);
         if (Api.TrySetIndexRange(Sesid, Table, SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive))
         {
             GetShapeInstanceData(shapeInstance);
             return(true);
         }
     }
     return(false);
 }
コード例 #6
0
 /// <summary>
 /// xbimShapeInstanceData will contain the first shape instanceData of the specified product label
 /// </summary>
 /// <param name="context"></param>
 /// <param name="si"></param>
 /// <returns></returns>
 public bool TrySeekShapeInstanceOfGeometry(int shapeGeometryLabel, ref IXbimShapeInstanceData si)
 {
     Api.JetSetCurrentIndex(Sesid, Table, geometryShapeIndex);
     Api.MakeKey(Sesid, Table, shapeGeometryLabel, MakeKeyGrbit.NewKey);
     if (Api.TrySeek(Sesid, Table, SeekGrbit.SeekGE))
     {
         Api.MakeKey(Sesid, Table, shapeGeometryLabel, MakeKeyGrbit.NewKey | MakeKeyGrbit.FullColumnEndLimit);
         if (Api.TrySetIndexRange(Sesid, Table, SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive))
         {
             GetShapeInstanceData(si);
             return(true);
         }
     }
     return(false);
 }
コード例 #7
0
 /// <summary>
 /// xbimShapeInstanceData will contain the first shape instanceData in the specified context
 /// </summary>
 /// <param name="context"></param>
 /// <param name="si"></param>
 /// <param name="retrieveAll">if false only retrieve the key index data for speed, if true all data is returned</param>
 /// <returns></returns>
 public bool TrySeekShapeInstance(int context, ref IXbimShapeInstanceData si)
 {
     Api.JetSetCurrentIndex(Sesid, Table, instanceTablePrimaryIndex);
     Api.MakeKey(Sesid, Table, context, MakeKeyGrbit.NewKey);
     if (Api.TrySeek(Sesid, Table, SeekGrbit.SeekGE))
     {
         Api.MakeKey(Sesid, Table, context, MakeKeyGrbit.NewKey | MakeKeyGrbit.FullColumnEndLimit);
         if (Api.TrySetIndexRange(Sesid, Table, SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive))
         {
             GetShapeInstanceData(si);
             return(true);
         }
     }
     return(false);
 }
コード例 #8
0
 /// <summary>
 /// xbimShapeInstanceData will contain the first shape instance of the specified product label
 /// </summary>
 /// <param name="product"></param>
 /// <param name="si"></param>
 /// <returns></returns>
 public bool TrySeekShapeInstanceOfProduct(int product, ref IXbimShapeInstanceData si)
 {
     Api.JetSetCurrentIndex(sesid, table, productIndex);
     Api.MakeKey(sesid, table, product, MakeKeyGrbit.NewKey);
     if (Api.TrySeek(sesid, table, SeekGrbit.SeekGE))
     {
         Api.MakeKey(sesid, table, product, MakeKeyGrbit.NewKey | MakeKeyGrbit.FullColumnEndLimit);
         if (Api.TrySetIndexRange(sesid, table, SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive))
         {
             GetShapeInstanceData(si);
             return(true);
         }
     }
     return(false);
 }
コード例 #9
0
 public bool TrySeekSurfaceStyle(int context, int surfaceStyle, ref IXbimShapeInstanceData shapeInstance)
 {
     Api.JetSetCurrentIndex(sesid, table, instanceTablePrimaryIndex);
     Api.MakeKey(sesid, table, context, MakeKeyGrbit.NewKey);
     Api.MakeKey(sesid, table, surfaceStyle, MakeKeyGrbit.None);
     if (Api.TrySeek(sesid, table, SeekGrbit.SeekGE))
     {
         Api.MakeKey(sesid, table, context, MakeKeyGrbit.NewKey);
         Api.MakeKey(sesid, table, surfaceStyle, MakeKeyGrbit.FullColumnEndLimit);
         if (Api.TrySetIndexRange(sesid, table, SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive))
         {
             GetShapeInstanceData(shapeInstance);
             return(true);
         }
     }
     return(false);
 }
コード例 #10
0
 public int AddInstance(IXbimShapeInstanceData instance)
 {
     using (var update = new Update(sesid, table, JET_prep.Insert))
     {
         _colValRepresentationContext.Value = instance.RepresentationContext;
         _colValIfcProductLabel.Value       = instance.IfcProductLabel;
         _colValIfcTypeId.Value             = instance.IfcTypeId;
         _colValShapeLabel.Value            = instance.ShapeGeometryLabel;
         _colValStyleLabel.Value            = instance.StyleLabel;
         _colValRepType.Value        = instance.RepresentationType;
         _colValTransformation.Value = instance.Transformation;
         _colValBoundingBox.Value    = instance.BoundingBox;
         Api.SetColumns(sesid, table, _colValues);
         instance.InstanceLabel = Api.RetrieveColumnAsInt32(sesid, table, _colIdInstanceLabel, RetrieveColumnGrbit.RetrieveCopy).Value;
         update.Save();
         UpdateCount(1);
     }
     return(instance.InstanceLabel);
 }
コード例 #11
0
 private void GetShapeInstanceData(IXbimShapeInstanceData si)
 {
     Api.RetrieveColumns(sesid, table, _colValues);
     si.RepresentationContext = _colValRepresentationContext.Value.Value;
     si.InstanceLabel = Api.RetrieveColumnAsInt32(sesid, table, _colIdInstanceLabel).Value;
     si.IfcTypeId = _colValIfcTypeId.Value.Value;
     si.IfcProductLabel = _colValIfcProductLabel.Value.Value;
     si.StyleLabel = _colValStyleLabel.Value.Value;
     si.ShapeGeometryLabel = _colValShapeLabel.Value.Value;
     si.RepresentationType = _colValRepType.Value.Value;
     si.Transformation = _colValTransformation.Value;
     si.BoundingBox = _colValBoundingBox.Value;
 }
コード例 #12
0
 public bool TrySeekSurfaceStyle(int context, int surfaceStyle, ref IXbimShapeInstanceData shapeInstance)
 {
     Api.JetSetCurrentIndex(sesid, table, instanceTablePrimaryIndex);
     Api.MakeKey(sesid, table, context, MakeKeyGrbit.NewKey);
     Api.MakeKey(sesid, table, surfaceStyle, MakeKeyGrbit.None);
     if (Api.TrySeek(sesid, table, SeekGrbit.SeekGE))
     {
         Api.MakeKey(sesid, table, context, MakeKeyGrbit.NewKey );
         Api.MakeKey(sesid, table, surfaceStyle, MakeKeyGrbit.FullColumnEndLimit);
         if (Api.TrySetIndexRange(sesid, table, SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive))
         {
             GetShapeInstanceData(shapeInstance);
             return true;
         }
     }
     return false;
 }
コード例 #13
0
 /// <summary>
 /// xbimShapeInstanceData will contain the first shape instance of the specified product label
 /// </summary>
 /// <param name="product"></param>
 /// <param name="si"></param>
 /// <returns></returns>
 public bool TrySeekShapeInstanceOfProduct(int product, ref IXbimShapeInstanceData si)
 {
     Api.JetSetCurrentIndex(sesid, table, productIndex);
     Api.MakeKey(sesid, table, product, MakeKeyGrbit.NewKey);
     if (Api.TrySeek(sesid, table, SeekGrbit.SeekGE))
     {
         Api.MakeKey(sesid, table, product, MakeKeyGrbit.NewKey | MakeKeyGrbit.FullColumnEndLimit);
         if (Api.TrySetIndexRange(sesid, table, SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive))
         {
             GetShapeInstanceData(si);
             return true;
         }
     }
     return false;
 }
コード例 #14
0
 /// <summary>
 /// Moves the cursor to the next shape instance that meets the criteria of the previous TrySeek call
 /// </summary>
 /// <param name="si"></param>
 /// <returns></returns>
 public bool TryMoveNextShapeInstance(ref IXbimShapeInstanceData si)
 {
     if (Api.TryMoveNext(this.sesid, this.table))
     {
         GetShapeInstanceData(si);
         return true;
     }
     else
         return false;
 }
コード例 #15
0
        public int AddInstance(IXbimShapeInstanceData instance)
        {
            using (var update = new Update(sesid, table, JET_prep.Insert))
            {
                _colValRepresentationContext.Value = instance.RepresentationContext;
                _colValIfcProductLabel.Value = instance.IfcProductLabel;
                _colValIfcTypeId.Value = instance.IfcTypeId;
                _colValShapeLabel.Value = instance.ShapeGeometryLabel;
                _colValStyleLabel.Value = instance.StyleLabel;
                _colValRepType.Value = instance.RepresentationType;
                _colValTransformation.Value = instance.Transformation;
                _colValBoundingBox.Value = instance.BoundingBox;
                Api.SetColumns(sesid, table, _colValues);
                instance.InstanceLabel = Api.RetrieveColumnAsInt32(sesid, table, _colIdInstanceLabel, RetrieveColumnGrbit.RetrieveCopy).Value;
                update.Save();
                UpdateCount(1);

            }
            return instance.InstanceLabel;
        }