Skip to content

Commit

Permalink
- MultiLeaderStyle: Comments + TODOs
Browse files Browse the repository at this point in the history
-  MultiLeaderPropertyOverrideFlags: Misspelled enum identifier
-  MultiLeaderAnnotContext:
       OverallScale --> ScaleFactor (consistency!)
       property TextAttachmentPoint (group code: 171)
-  MultiLeaderAnnotContext.LeaderRoot: AttachmentDirection (internal set --> set)
-  MultiLeaderAnnotContext.LeaderLine: no setters for IList properties
  • Loading branch information
mme1950 committed Feb 29, 2024
1 parent caad93b commit e8e351d
Show file tree
Hide file tree
Showing 5 changed files with 376 additions and 51 deletions.
2 changes: 1 addition & 1 deletion ACadSharp/Entities/MultiLeaderPropertyOverrideFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public enum MultiLeaderPropertyOverrideFlags : int
/// <summary>
/// Override <see cref="MultiLeaderStyle.BlockContentConnection"/> property.
/// </summary>
BlockConnectionConnection = 0x800000,
BlockContentConnection = 0x800000,


/// <summary>
Expand Down
14 changes: 7 additions & 7 deletions ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2835,14 +2835,14 @@ private CadTemplate readMultiLeader()
template.LeaderLineTypeHandle = this.handleReference();
// 171 LeaderLine Weight
mLeader.LeaderLineWeight = (LineweightType)_objectReader.ReadBitShort();
// TODO Why do we need this
_objectReader.Advance(2);

// 290 Enable Landing
mLeader.EnableLanding = _objectReader.ReadBit();
// 291 Enable Dogleg
mLeader.EnableDogleg = _objectReader.ReadBit();

// TODO Why do we need this
_objectReader.Advance(2);

// 41 Dogleg Length / Landing distance
mLeader.LandingDistance = _objectReader.ReadBitDouble();
// 342 Arrowhead ID
Expand Down Expand Up @@ -2949,7 +2949,7 @@ private MultiLeaderAnnotContext readMultiLeaderAnnotContext(CadMLeaderTemplate t

// Common
// BD 40 Overall scale
annotContext.OverallScale = _objectReader.ReadBitDouble();
annotContext.ScaleFactor = _objectReader.ReadBitDouble();
// 3BD 10 Content base point
annotContext.ContentBasePoint = _objectReader.Read3BitDouble();
// BD 41 Text height
Expand Down Expand Up @@ -2993,7 +2993,7 @@ private MultiLeaderAnnotContext readMultiLeaderAnnotContext(CadMLeaderTemplate t
// CMC 90 Text color
annotContext.TextColor = _objectReader.ReadCmColor();
// BS 171 Alignment (1 = left, 2 = center, 3 = right)
annotContext.TextAlignment = (TextAlignmentType)_objectReader.ReadBitShort();
annotContext.TextAttachmentPoint = (TextAttachmentPointType)_objectReader.ReadBitShort();
// BS 172 Flow direction (1 = horizontal, 3 = vertical, 6 = by style)
annotContext.FlowDirection = (FlowDirectionType)_objectReader.ReadBitShort();
// CMC 91 Background fill color
Expand Down Expand Up @@ -3263,7 +3263,7 @@ private CadTemplate readMultiLeaderStyle()
mLeaderStyle.TextAngle = (TextAngleType)_objectReader.ReadBitShort();

} // END IF IsNewFormat OR DXF file
// BS 176 Text alignment type
// BS 176 Text alignment type
mLeaderStyle.TextAlignment = (TextAlignmentType)_objectReader.ReadBitShort();
// CMC 93 Text color
mLeaderStyle.TextColor = _mergedReaders.ReadCmColor();
Expand All @@ -3276,7 +3276,7 @@ private CadTemplate readMultiLeaderStyle()
// B 297 Always align text left
mLeaderStyle.TextAlignAlwaysLeft = _objectReader.ReadBit();
}// END IF IsNewFormat OR DXF file
// BD 46 Align space
// BD 46 Align space
mLeaderStyle.AlignSpace = _objectReader.ReadBitDouble();
// H 343 Block handle (hard pointer)
template.BlockContentHandle = this.handleReference();
Expand Down
5 changes: 4 additions & 1 deletion ACadSharp/Objects/MultiLeaderAnnotContext.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using ACadSharp.Attributes;
using ACadSharp.Entities;
using ACadSharp.Tables;

using CSMath;
Expand Down Expand Up @@ -33,7 +34,7 @@ public partial class MultiLeaderAnnotContext : CadObject
/// Overall scale
/// </summary>
[DxfCodeValue(40)]
public double OverallScale { get; set; }
public double ScaleFactor { get; set; }

/// <summary>
/// Content base point
Expand Down Expand Up @@ -166,6 +167,8 @@ public partial class MultiLeaderAnnotContext : CadObject

// BS 171 Alignment (1 = left, 2 = center, 3 = right)
// see above: TextAlignment
[DxfCodeValue(171)]
public TextAttachmentPointType TextAttachmentPoint { get; set; }

/// <summary>
/// Flow direction
Expand Down
6 changes: 3 additions & 3 deletions ACadSharp/Objects/MultiLeaderAnnotContextClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public LeaderRoot() { }
/// <summary>
/// Attachment direction
/// </summary>
public TextAttachmentDirectionType AttachmentDirection { get; internal set; }
public TextAttachmentDirectionType AttachmentDirection { get; set; }

public object Clone()
{
Expand Down Expand Up @@ -135,7 +135,7 @@ public LeaderLine() { }
/// <summary>
/// Points of leader line
/// </summary>
public IList<XYZ> Points { get; set; } = new List<XYZ>();
public IList<XYZ> Points { get; } = new List<XYZ>();

/// <summary>
/// Break info count
Expand All @@ -150,7 +150,7 @@ public LeaderLine() { }
/// <summary>
/// Start/end point pairs
/// </summary>
public IList<StartEndPointPair> StartEndPoints { get; set; }
public IList<StartEndPointPair> StartEndPoints { get; } = new List<StartEndPointPair>();

/// <summary>
/// Leader line index.
Expand Down
Loading

0 comments on commit e8e351d

Please sign in to comment.