• 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/Objects/Scale.cs
1
using ACadSharp.Attributes;
2
using CSMath;
3

4
namespace ACadSharp.Objects
5
{
6
        /// <summary>
7
        /// Represents a <see cref="Scale"/> object
8
        /// </summary>
9
        /// <remarks>
10
        /// Object name <see cref="DxfFileToken.ObjectScale"/> <br/>
11
        /// Dxf class name <see cref="DxfSubclassMarker.Scale"/>
12
        /// </remarks>
13
        [DxfName(DxfFileToken.ObjectScale)]
14
        [DxfSubClass(DxfSubclassMarker.Scale)]
15
        public class Scale : NonGraphicalObject
16
        {
17
                public static Scale Default { get { return new Scale { Name = "1:1", PaperUnits = 1.0, DrawingUnits = 1.0, IsUnitScale = true }; } }
×
18

19
                /// <inheritdoc/>
20
                public override ObjectType ObjectType { get { return ObjectType.UNLISTED; } }
×
21

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

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

28
                /// <summary>
29
                /// Name
30
                /// </summary>
31
                [DxfCodeValue(300)]
32
                public override string Name
33
                {
34
                        get
35
                        {
×
36
                                return base.Name;
×
37
                        }
×
38
                        set
39
                        {
×
40
                                base.Name = value;
×
41
                        }
×
42
                }
43

44
                /// <summary>
45
                /// Group description.
46
                /// </summary>
47
                [DxfCodeValue(140)]
48
                public double PaperUnits { get; set; }
×
49

50
                /// <summary>
51
                /// Group description.
52
                /// </summary>
53
                [DxfCodeValue(141)]
54
                public double DrawingUnits { get; set; }
×
55

56
                /// <summary>
57
                /// Group description.
58
                /// </summary>
59
                [DxfCodeValue(290)]
60
                public bool IsUnitScale { get; set; }
×
61

62
                public double ScaleFactor => this.PaperUnits / this.DrawingUnits;
×
63

64
                public Scale() { }
×
65

66
                public Scale(string name) : base(name)
×
67
                {
×
68
                }
×
69

70
                public double ApplyTo(double value)
71
                {
×
72
                        return value * ScaleFactor;
×
73
                }
×
74

75
                public T ApplyTo<T>(T value)
76
                        where T : IVector, new()
77
                {
×
78
                        T result = new();
×
79

80
                        for (int i = 0; i < value.Dimension; i++)
×
81
                        {
×
82
                                result[i] = ApplyTo(value[i]);
×
83
                        }
×
84

85
                        return result;
×
86
                }
×
87
        }
88
}
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