public WpfMeshGeometry3D(IXbimMeshGeometry3D mesh) { WpfModel = new GeometryModel3D {Geometry = new MeshGeometry3D()}; Mesh.Positions = new WpfPoint3DCollection(mesh.Positions); Mesh.Normals = new WpfVector3DCollection(mesh.Normals); Mesh.TriangleIndices = new Int32Collection (mesh.TriangleIndices); _meshes = new XbimMeshFragmentCollection(mesh.Meshes); }
public WpfMeshGeometry3D(IXbimMeshGeometry3D mesh) { WpfModel = new GeometryModel3D(); WpfModel.Geometry = new MeshGeometry3D(); Mesh.Positions = new WpfPoint3DCollection(mesh.Positions); Mesh.Normals = new WpfVector3DCollection(mesh.Normals); Mesh.TriangleIndices = new Int32Collection (mesh.TriangleIndices); _meshes = new XbimMeshFragmentCollection(mesh.Meshes); }
/// <summary> /// Moves the content of this mesh to the other /// </summary> /// <param name="toMesh"></param> public void MoveTo(IXbimMeshGeometry3D toMesh) { if (_meshes.Any()) //if no meshes nothing to move { toMesh.BeginUpdate(); toMesh.Positions = Positions; Positions.Clear(); toMesh.Normals = Normals; Normals.Clear(); toMesh.TriangleIndices = TriangleIndices; TriangleIndices.Clear(); toMesh.Meshes = Meshes; _meshes.Clear(); toMesh.EndUpdate(); } }
public void MoveTo(IXbimMeshGeometry3D toMesh) { if (_meshes.Any()) //if no meshes nothing to move { toMesh.Positions = new List <XbimPoint3D>(Positions); toMesh.Normals = new List <XbimVector3D>(Normals); toMesh.TriangleIndices = new List <int>(TriangleIndices); toMesh.Meshes = new XbimMeshFragmentCollection(Meshes); _meshes.Clear(); WpfModel.Geometry = new MeshGeometry3D(); } }
public void MoveTo(IXbimMeshGeometry3D toMesh) { if (meshes.Any()) //if no meshes nothing to move { toMesh.BeginUpdate(); toMesh.Positions = this.Positions; toMesh.Normals = this.Normals; toMesh.TriangleIndices = this.TriangleIndices; toMesh.Meshes = this.Meshes; this.meshes.Clear(); WpfMesh.Geometry = new MeshGeometry3D(); toMesh.EndUpdate(); } }
//adds the content of the toAdd to this, it is added as a single mesh fragment, any meshes in toAdd are lost public void Add(IXbimMeshGeometry3D toAdd, int entityLabel, Type ifcType, short modelId) { var startPosition = Positions.Count; var fragment = new XbimMeshFragment(startPosition, TriangleIndexCount, modelId); Positions.AddRange(toAdd.Positions); Normals.AddRange(toAdd.Normals); foreach (var idx in toAdd.TriangleIndices) { TriangleIndices.Add(idx + startPosition); } fragment.EndPosition = PositionCount - 1; fragment.EndTriangleIndex = TriangleIndexCount - 1; fragment.EntityLabel = entityLabel; fragment.EntityTypeId = IfcMetaData.IfcTypeId(ifcType); _meshes.Add(fragment); }
/// <summary> /// Adds a geometry mesh to this, includes all mesh fragments /// </summary> /// <param name="geom"></param> public void Add(IXbimMeshGeometry3D geom) { if (geom.Positions.Any()) //if no positions nothing to add { BeginUpdate(); var startPos = Positions.Count; var startIndices = TriangleIndices.Count; Positions.AddRange(geom.Positions); Normals.AddRange(geom.Normals); foreach (var indices in geom.TriangleIndices) { TriangleIndices.Add(indices + startPos); } foreach (var fragment in geom.Meshes) { fragment.Offset(startPos, startIndices); Meshes.Add(fragment); } EndUpdate(); } }
/// <summary> /// Moves the content of this mesh to the other /// </summary> /// <param name="toMesh"></param> public void MoveTo(IXbimMeshGeometry3D toMesh) { if (meshes.Any()) //if no meshes nothing to move { toMesh.BeginUpdate(); toMesh.Positions = this.Positions; this.Positions.Clear(); toMesh.Normals = this.Normals; this.Normals.Clear(); toMesh.TriangleIndices = this.TriangleIndices; this.TriangleIndices.Clear(); toMesh.Meshes = this.Meshes; this.meshes.Clear(); toMesh.EndUpdate(); } }
/// <summary> /// Adds a geometry mesh to this, includes all mesh fragments /// </summary> /// <param name="geom"></param> public void Add(IXbimMeshGeometry3D geom) { if (geom.Positions.Any()) //if no positions nothing to add { this.BeginUpdate(); int startPos = Positions.Count; int startIndices = TriangleIndices.Count; Positions.AddRange(geom.Positions); Normals.AddRange(geom.Normals); foreach (var indices in geom.TriangleIndices) TriangleIndices.Add(indices + startPos); foreach (var fragment in geom.Meshes) { fragment.Offset(startPos, startIndices); Meshes.Add(fragment); } this.EndUpdate(); } }
//adds the content of the toAdd to this, it is added as a single mesh fragment, any meshes in toAdd are lost public void Add(IXbimMeshGeometry3D toAdd, int entityLabel, Type ifcType) { int startPosition = Positions.Count; XbimMeshFragment fragment = new XbimMeshFragment(startPosition, TriangleIndexCount); Positions.AddRange(toAdd.Positions); Normals.AddRange(toAdd.Normals); foreach (var idx in toAdd.TriangleIndices) TriangleIndices.Add(idx+startPosition); fragment.EndPosition = PositionCount - 1; fragment.EndTriangleIndex = TriangleIndexCount - 1; fragment.EntityLabel = entityLabel; fragment.EntityType = ifcType; meshes.Add(fragment); }
//adds the content of the toAdd to this, it is added as a single mesh fragment, any meshes in toAdd are lost public void Add(IXbimMeshGeometry3D toAdd, int entityLabel, Type ifcType, short modelId) { var startPosition = Positions.Count; var fragment = new XbimMeshFragment(startPosition, TriangleIndexCount, modelId); Positions.AddRange(toAdd.Positions); Normals.AddRange(toAdd.Normals); foreach (var idx in toAdd.TriangleIndices) TriangleIndices.Add(idx + startPosition); fragment.EndPosition = PositionCount - 1; fragment.EndTriangleIndex = TriangleIndexCount - 1; fragment.EntityLabel = entityLabel; fragment.EntityTypeId = IfcMetaData.IfcTypeId(ifcType); _meshes.Add(fragment); }
public void MoveTo(IXbimMeshGeometry3D toMesh) { if (_meshes.Any()) //if no meshes nothing to move { toMesh.Positions = new List<XbimPoint3D>(Positions); toMesh.Normals = new List<XbimVector3D>(Normals); toMesh.TriangleIndices = new List<int>(TriangleIndices); toMesh.Meshes = new XbimMeshFragmentCollection(Meshes); _meshes.Clear(); WpfModel.Geometry = new MeshGeometry3D(); } }
public void MoveTo(IXbimMeshGeometry3D toMesh) { if (meshes.Any()) //if no meshes nothing to move { toMesh.BeginUpdate(); toMesh.Positions = new List<XbimPoint3D>(this.Positions); toMesh.Normals = new List<XbimVector3D>(this.Normals); toMesh.TriangleIndices = new List<int>(this.TriangleIndices); toMesh.Meshes = new XbimMeshFragmentCollection(this.Meshes); this.meshes.Clear(); WpfMesh.Geometry = new MeshGeometry3D(); toMesh.EndUpdate(); } }
public XbimMeshFragment MeshTo(IXbimMeshGeometry3D mesh3D, Ifc2x3.Kernel.IfcProduct product, XbimMatrix3D transform, double deflection, short modelId) { return(default(XbimMeshFragment)); }