• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DomCR / ACadSharp / 12905761471

22 Jan 2025 10:03AM UTC coverage: 2.0% (-74.0%) from 75.963%
12905761471

push

github

DomCR
version 1.0.6

104 of 7676 branches covered (1.35%)

Branch coverage included in aggregate %.

590 of 27024 relevant lines covered (2.18%)

5.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ACadSharp/Entities/PolyfaceMesh.cs
1
using ACadSharp.Attributes;
2
using CSMath;
3
using System;
4
using System.Collections.Generic;
5

6
namespace ACadSharp.Entities
7
{
8
        /// <summary>
9
        /// Represents a <see cref="PolyfaceMesh"/> entity.
10
        /// </summary>
11
        /// <remarks>
12
        /// Object name <see cref="DxfFileToken.EntityPolyline"/> <br/>
13
        /// Dxf class name <see cref="DxfSubclassMarker.PolyfaceMesh"/>
14
        /// </remarks>
15
        [DxfName(DxfFileToken.EntityPolyline)]
16
        [DxfSubClass(DxfSubclassMarker.PolyfaceMesh)]
17
        public class PolyfaceMesh : Polyline
18
        {
19
                /// <inheritdoc/>
20
                public override ObjectType ObjectType { get { return ObjectType.POLYLINE_PFACE; } }
×
21

22
                /// <inheritdoc/>
23
                public override string ObjectName => DxfFileToken.EntityPolyline;
×
24

25
                /// <inheritdoc/>
26
                public override string SubclassMarker => DxfSubclassMarker.PolyfaceMesh;
×
27

28
                public CadObjectCollection<VertexFaceRecord> Faces { get; private set; }
×
29

30
                public PolyfaceMesh()
×
31
                {
×
32
                        this.Vertices.OnAdd += this.verticesOnAdd;
×
33
                        this.Faces = new CadObjectCollection<VertexFaceRecord>(this);
×
34
                }
×
35

36
                public override IEnumerable<Entity> Explode()
37
                {
×
38
                        throw new System.NotImplementedException();
×
39
                }
40

41
                /// <inheritdoc/>
42
                public override CadObject Clone()
43
                {
×
44
                        PolyfaceMesh clone = (PolyfaceMesh)base.Clone();
×
45

46
                        clone.Faces = new SeqendCollection<VertexFaceRecord>(clone);
×
47
                        foreach (VertexFaceRecord v in this.Faces)
×
48
                        {
×
49
                                clone.Vertices.Add((VertexFaceRecord)v.Clone());
×
50
                        }
×
51

52
                        return clone;
×
53
                }
×
54

55
                private void verticesOnAdd(object sender, CollectionChangedEventArgs e)
56
                {
×
57
                        if (e.Item is not VertexFaceMesh)
×
58
                        {
×
59
                                this.Vertices.Remove((Vertex)e.Item);
×
60
                                throw new ArgumentException($"Wrong vertex type {e.Item.SubclassMarker} for {this.SubclassMarker}");
×
61
                        }
62
                }
×
63

64
                internal override void AssignDocument(CadDocument doc)
65
                {
×
66
                        base.AssignDocument(doc);
×
67
                        doc.RegisterCollection(this.Faces);
×
68
                }
×
69

70
                internal override void UnassignDocument()
71
                {
×
72
                        this.Document.UnregisterCollection(this.Faces);
×
73
                        base.UnassignDocument();
×
74
                }
×
75
        }
76
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc