public XbimMeshFragment Add(IXbimGeometryModel geometryModel, IIfcProduct product, XbimMatrix3D transform, double?deflection, short modelId = 0) { throw new NotImplementedException(); }
/// <summary> /// Adds the geometry to the mesh for the given product, returns the mesh fragment details /// </summary> /// <param name="geometryModel">Geometry to add</param> /// <param name="product">The product the geometry represents (this may be a partial representation)</param> /// <param name="transform">Transform the geometry to a new location or rotation</param> /// <param name="deflection">Deflection for triangulating curves, if null default defelction for the model is used</param> public XbimMeshFragment Add(IXbimGeometryModel geometryModel, IfcProduct product, XbimMatrix3D transform, double?deflection = null, short modelId = 0) { return(Hidden.Add(geometryModel, product, transform, deflection, modelId)); }
XbimMeshFragment IXbimMeshGeometry3D.Add(IXbimGeometryModel geometryModel, IIfcProduct product, XbimMatrix3D transform, double?deflection, short modelId) { return(geometryModel.MeshTo(this, product, transform, deflection ?? product.Model.ModelFactors.DeflectionTolerance, modelId)); }
/// <summary> /// Adds the geometry to the mesh for the given product, returns the mesh fragment details /// </summary> /// <param name="geometryModel">Geometry to add</param> /// <param name="product">The product the geometry represents (this may be a partial representation)</param> /// <param name="transform">Transform the geometry to a new location or rotation</param> /// <param name="deflection">Deflection for triangulating curves, if null default defelction for the model is used</param> public XbimMeshFragment Add(IXbimGeometryModel geometryModel, IfcProduct product, XbimMatrix3D transform, double?deflection = null, short modelId = 0) { return(geometryModel.MeshTo(this, product, transform, deflection ?? product.ModelOf.ModelFactors.DeflectionTolerance)); }
/// <summary> /// Adds the geometry to the mesh for the given product, returns the mesh fragment details /// </summary> /// <param name="geometryModel">Geometry to add</param> /// <param name="product">The product the geometry represents (this may be a partial representation)</param> /// <param name="transform">Transform the geometry to a new location or rotation</param> /// <param name="deflection">Deflection for triangulating curves, if null default defelction for the model is used</param> public XbimMeshFragment Add(IXbimGeometryModel geometryModel, IfcProduct product, XbimMatrix3D transform, double? deflection = null, short modelId = 0) { return geometryModel.MeshTo(this, product, transform, deflection ?? product.ModelOf.ModelFactors.DeflectionTolerance); }
public MapData(IXbimGeometryModel geomModel, XbimMatrix3D m3d, IfcProduct product) { this.Geometry = geomModel; this.Matrix = m3d; this.Product = product; }
public void Clear() { this.Geometry = null; this.Product = null; }
private static void WriteGeometry(XbimModel model, ConcurrentDictionary<int, int[]> written, IXbimGeometryModel geomModel, ref XbimRect3D bounds, XbimMatrix3D m3d, IfcProduct product, double deflection) { XbimTriangulatedModelCollection tm = geomModel.Mesh(deflection); XbimRect3D bb = tm.Bounds; byte[] matrix = m3d.ToArray(true); short? typeId = IfcMetaData.IfcTypeId(product); XbimGeometryCursor geomTable = model.GetGeometryTable(); XbimLazyDBTransaction transaction = geomTable.BeginLazyTransaction(); int[] geomIds = new int[tm.Count + 1]; geomIds[0] = geomTable.AddGeometry(product.EntityLabel, XbimGeometryType.BoundingBox, typeId.Value, matrix, bb.ToDoublesArray(), 0, geomModel.SurfaceStyleLabel); bb = XbimRect3D.TransformBy(bb, m3d); if (bounds.IsEmpty) bounds = bb; else bounds.Union(bb); short subPart = 0; foreach (XbimTriangulatedModel b in tm) { geomIds[subPart + 1] = geomTable.AddGeometry(product.EntityLabel, XbimGeometryType.TriangulatedMesh, typeId.Value, matrix, b.Triangles, subPart, b.SurfaceStyleLabel); subPart++; } transaction.Commit(); written.AddOrUpdate(geomModel.RepresentationLabel, geomIds, (k, v) => v = geomIds); model.FreeTable(geomTable); }