Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <c>Leader</c> class.
 /// </summary>
 public Leader(Block block, IEnumerable <Vector2> vertexes, DimensionStyle style)
     : base(EntityType.Leader, DxfObjectCode.Leader)
 {
     if (vertexes == null)
     {
         throw new ArgumentNullException(nameof(vertexes));
     }
     this.vertexes = new List <Vector2>(vertexes);
     if (this.vertexes.Count < 2)
     {
         throw new ArgumentOutOfRangeException(nameof(vertexes), this.vertexes.Count, "The leader vertexes list requires at least two points.");
     }
     if (style == null)
     {
         throw new ArgumentNullException(nameof(style));
     }
     this.style          = style;
     this.hasHookline    = false;
     this.showArrowhead  = true;
     this.pathType       = LeaderPathType.StraightLineSegements;
     this.lineColor      = AciColor.ByLayer;
     this.elevation      = 0.0;
     this.offset         = Vector2.Zero;
     this.styleOverrides = new DimensionStyleOverrideDictionary();
     this.styleOverrides.BeforeAddItem    += this.StyleOverrides_BeforeAddItem;
     this.styleOverrides.AddItem          += this.StyleOverrides_AddItem;
     this.styleOverrides.BeforeRemoveItem += this.StyleOverrides_BeforeRemoveItem;
     this.styleOverrides.RemoveItem       += this.StyleOverrides_RemoveItem;
     this.annotation = this.BuildAnnotation(block);
     this.annotation.AddReactor(this);
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <c>Leader</c> class.
 /// </summary>
 public Leader(string text, IEnumerable <Vector2> vertexes, DimensionStyle style)
     : base(EntityType.Leader, DxfObjectCode.Leader)
 {
     if (vertexes == null)
     {
         throw new ArgumentNullException(nameof(vertexes));
     }
     this.vertexes = new List <Vector2>(vertexes);
     if (this.vertexes.Count < 2)
     {
         throw new ArgumentOutOfRangeException(nameof(vertexes), this.vertexes.Count, "The leader vertexes list requires at least two points.");
     }
     if (style == null)
     {
         throw new ArgumentNullException(nameof(style));
     }
     this.style     = style;
     hasHookline    = true;
     showArrowhead  = true;
     pathType       = LeaderPathType.StraightLineSegements;
     lineColor      = AciColor.ByLayer;
     elevation      = 0.0;
     offset         = Vector2.Zero;
     styleOverrides = new DimensionStyleOverrideDictionary();
     styleOverrides.BeforeAddItem    += StyleOverrides_BeforeAddItem;
     styleOverrides.AddItem          += StyleOverrides_AddItem;
     styleOverrides.BeforeRemoveItem += StyleOverrides_BeforeRemoveItem;
     styleOverrides.RemoveItem       += StyleOverrides_RemoveItem;
     annotation = BuildAnnotation(text);
     annotation.AddReactor(this);
     this.vertexes.Insert(this.vertexes.Count - 1, CalculateHookLine());
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <c>Leader</c> class.
 /// </summary>
 public Leader(IList <Vector2> vertexes, DimensionStyle style)
     : base(EntityType.Leader, DxfObjectCode.Leader)
 {
     if (vertexes == null)
     {
         throw new ArgumentNullException(nameof(vertexes));
     }
     if (vertexes.Count < 2)
     {
         throw new ArgumentOutOfRangeException(nameof(vertexes), "The leader vertexes list requires at least two points.");
     }
     this.vertexes      = new List <Vector2>(vertexes);
     this.style         = style;
     this.hasHookline   = false;
     this.showArrowhead = true;
     this.pathType      = LeaderPathType.StraightLineSegements;
     this.annotation    = null;
     this.textPosition  = LeaderTextVerticalPosition.Above;
     this.lineColor     = AciColor.ByLayer;
     this.elevation     = 0.0;
     this.offset        = Vector2.Zero;
 }
Beispiel #4
0
        public override void CopyFrom(DxfHandledObject from, CloneContext cloneContext)
        {
            base.CopyFrom(from, cloneContext);
            DxfLeader dxfLeader = (DxfLeader)from;

            if (dxfLeader.dxfDimensionStyleOverrides_0 != null)
            {
                this.dxfDimensionStyleOverrides_0 = dxfLeader.dxfDimensionStyleOverrides_0.Clone(cloneContext);
            }
            this.bool_2               = dxfLeader.bool_2;
            this.leaderPathType_0     = dxfLeader.leaderPathType_0;
            this.leaderCreationType_0 = dxfLeader.leaderCreationType_0;
            this.hookLineDirection_0  = dxfLeader.hookLineDirection_0;
            this.bool_3               = dxfLeader.bool_3;
            this.double_2             = dxfLeader.double_2;
            this.double_3             = dxfLeader.double_3;
            this.list_0.AddRange((IEnumerable <WW.Math.Point3D>)dxfLeader.list_0);
            this.color_0 = dxfLeader.color_0;
            if (dxfLeader.AssociatedAnnotation == null)
            {
                this.AssociatedAnnotation = (DxfEntity)null;
            }
            else if (cloneContext.SourceModel == cloneContext.TargetModel)
            {
                this.AssociatedAnnotation = dxfLeader.AssociatedAnnotation;
            }
            else
            {
                this.AssociatedAnnotation = (DxfEntity)dxfLeader.AssociatedAnnotation.Clone(cloneContext);
                cloneContext.method_0((DxfHandledObject)this.AssociatedAnnotation);
            }
            this.vector3D_0 = dxfLeader.vector3D_0;
            this.vector3D_1 = dxfLeader.vector3D_1;
            this.vector3D_2 = dxfLeader.vector3D_2;
            this.vector3D_3 = dxfLeader.vector3D_3;
        }
 /// <summary>
 /// Initializes a new instance of the <c>Leader</c> class.
 /// </summary>
 public Leader(IList<Vector2> vertexes, DimensionStyle style)
     : base(EntityType.Leader, DxfObjectCode.Leader)
 {
     if (vertexes == null)
         throw new ArgumentNullException(nameof(vertexes));
     if (vertexes.Count < 2)
         throw new ArgumentOutOfRangeException(nameof(vertexes), "The leader vertexes list requires at least two points.");
     this.vertexes = new List<Vector2>(vertexes);
     this.style = style;
     this.hasHookline = false;
     this.showArrowhead = true;
     this.pathType = LeaderPathType.StraightLineSegements;
     this.annotation = null;
     this.textPosition = LeaderTextVerticalPosition.Above;
     this.lineColor = AciColor.ByLayer;
     this.elevation = 0.0;
     this.offset = Vector2.Zero;
 }