Exemple #1
0
        /// <inheritdoc/>
        public override void Assign(Base source)
        {
            base.Assign(source);

            PolyLineObject src = source as PolyLineObject;

            pointsCollection = src.pointsCollection.Clone();
            center           = src.center;
            //recalculateBounds();
        }
Exemple #2
0
        /// <inheritdoc/>
        public override void Assign(Base source)
        {
            base.Assign(source);

            PolyLineObject src = source as PolyLineObject;

            if (src.points == null)
            {
                return;
            }
            if (src.pointTypes == null)
            {
                return;
            }
            points     = new List <PointF>(src.points);
            pointTypes = new List <byte>(src.pointTypes);
            center     = src.center;
            //recalculateBounds();
        }
Exemple #3
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            Border.SimpleBorder = true;
            base.Serialize(writer);
            PolyLineObject c = writer.DiffObject as PolyLineObject;

            StringBuilder sb = new StringBuilder(pointsCollection.Count * 10);

            foreach (PolyPoint point in pointsCollection)
            {
                point.Serialize(sb);
                sb.Append("|");
            }

            if (sb.Length > 0)
            {
                sb.Length--;
            }

            writer.WriteStr("PolyPoints_v2", sb.ToString());

            writer.WriteFloat("CenterX", center.X);
            writer.WriteFloat("CenterY", center.Y);
        }
Exemple #4
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            Border.SimpleBorder = true;
            base.Serialize(writer);
            PolyLineObject c = writer.DiffObject as PolyLineObject;

            StringBuilder sb = new StringBuilder(points.Count * 10);

            for (int i = 0; i < points.Count; i++)
            {
                sb.AppendFormat("{0}\\{1}\\{2}", points[i].X.ToString(CultureInfo.InvariantCulture),
                                points[i].Y.ToString(CultureInfo.InvariantCulture),
                                pointTypes[i]);
                if (i < points.Count - 1)
                {
                    sb.Append("|");
                }
            }

            writer.WriteStr("PolyPoints", sb.ToString());

            writer.WriteFloat("CenterX", center.X);
            writer.WriteFloat("CenterY", center.Y);
        }