コード例 #1
0
        internal void OnDeserialized(StreamingContext context)
        {
            Edges.ForEach(e => e.Brep = this);
            Loops.ForEach(l => l.Brep = this);
            Trims.ForEach(t => t.Brep = this);
            Faces.ForEach(f => f.Brep = this);

            //TODO: all the data props to the real props
        }
コード例 #2
0
ファイル: ModelLod.cs プロジェクト: TRaphaelK/nova-3di-lab
 public void Serialize(BinaryWriter writer)
 {
     Header.Serialize(writer);
     Vertices.ForEach(vertex => vertex.Serialize(writer));
     Normals.ForEach(normal => normal.Serialize(writer));
     Faces.ForEach(face => face.Serialize(writer));
     SubObjects.ForEach(subObject => subObject.Serialize(writer));
     PartAnimations?.ForEach(partAnimation => partAnimation.Serialize(writer));
     CollisionPlaneVectors.ForEach(plane => plane.Serialize(writer));
     CollisionVolumes.ForEach(volume => volume.Serialize(writer));
     Materials.ForEach(material => material.Serialize(writer));
 }
コード例 #3
0
        public override void Transform(Transformations.IUnitTransformation transform, TransformFlags flags)
        {
            Faces.ForEach(f => f.Transform(transform, flags));

            // Handle flip transforms / negative scales
            var origin = GetOrigin();

            if (Faces.All(x => x.Plane.OnPlane(origin) >= 0))
            {
                // All planes are facing inwards - flip them all
                Faces.ForEach(x => x.Flip());
            }

            base.Transform(transform, flags);
        }
コード例 #4
0
ファイル: ModelLod.cs プロジェクト: TRaphaelK/nova-3di-lab
        private int CalculateLength()
        {
            using (MemoryStream buffer = new MemoryStream())
                using (BinaryWriter writer = new BinaryWriter(buffer))
                {
                    Vertices.ForEach(vertex => vertex.Serialize(writer));
                    Normals.ForEach(normal => normal.Serialize(writer));
                    Faces.ForEach(face => face.Serialize(writer));
                    SubObjects.ForEach(subObject => subObject.Serialize(writer));
                    CollisionPlaneVectors.ForEach(collisionPlane => collisionPlane.Serialize(writer));
                    CollisionVolumes.ForEach(collisionVolume => collisionVolume.Serialize(writer));
                    Materials.ForEach(material => material.Serialize(writer));

                    return((int)buffer.Length);
                }
        }
コード例 #5
0
ファイル: Solid.cs プロジェクト: juanjp600/cbre
        public override void Transform(Transformations.IUnitTransformation transform, TransformFlags flags)
        {
            Coordinate newStart = transform.Transform(BoundingBox.Start);
            Coordinate newEnd   = transform.Transform(BoundingBox.End);

            if ((newStart - newEnd).VectorMagnitude() > 1000000m)
            {
                return;
            }

            Faces.ForEach(f => f.Transform(transform, flags));

            // Handle flip transforms / negative scales
            var origin = GetOrigin();

            if (Faces.All(x => x.Plane.OnPlane(origin) >= 0))
            {
                // All planes are facing inwards - flip them all
                Faces.ForEach(x => x.Flip());
            }

            base.Transform(transform, flags);
        }
コード例 #6
0
 protected Solid(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     Faces = ((Face[])info.GetValue("Faces", typeof(Face[]))).ToList();
     Faces.ForEach(x => x.Parent = this);
 }
コード例 #7
0
 public void SetHighlights()
 {
     Faces.ForEach(f => f.SetHighlights((UInt32)Flags));
 }