Exemplo n.º 1
0
        public Span Clone()
        {
            var newSpan = new Span();

            if (Begin != null)
            {
                newSpan.Begin = Begin.Clone();
            }
            newSpan.BeginFlags   = BeginFlags;
            newSpan.Color        = Color;
            newSpan.Continuation = Continuation;
            if (End != null)
            {
                newSpan.End = End.Clone();
            }
            newSpan.EndFlags = EndFlags;
            newSpan.Escape   = Escape;
            if (Exit != null)
            {
                newSpan.Exit = Exit.Clone();
            }
            newSpan.ExitFlags     = ExitFlags;
            newSpan.NextColor     = NextColor;
            newSpan.Rule          = Rule;
            newSpan.StopAtEol     = StopAtEol;
            newSpan.TagColor      = TagColor;
            newSpan.BeginTagColor = beginTagColor;
            newSpan.EndTagColor   = endTagColor;
            return(newSpan);
        }
Exemplo n.º 2
0
        private IEnumerable <Line> SplitZAxis(int size)
        {
            var output    = new List <Line>();
            var nextPoint = Start.Clone();

            while ((End.Z - nextPoint.Z) > size)
            {
                var endPoint = new Point {
                    Y = End.Y, X = End.X, Z = nextPoint.Z + size
                };
                output.Add(new Line
                {
                    Block     = Block,
                    Start     = nextPoint.Clone(),
                    End       = endPoint,
                    Data      = Data,
                    BlockName = BlockName
                });
                nextPoint   = endPoint.Clone();
                nextPoint.Y = Start.Y;
                nextPoint.X = Start.X;
                nextPoint.Z++;
            }
            output.Add(new Line
            {
                Start     = nextPoint,
                End       = End.Clone(),
                Block     = Block,
                Data      = Data,
                BlockName = BlockName
            });
            return(output);
        }
Exemplo n.º 3
0
        private IEnumerable <Line> SplitXAxis(int size)
        {
            var output    = new List <Line>();
            var nextPoint = Start.Clone();

            while ((End.X - nextPoint.X) > size)
            {
                var endPoint = new Point()
                {
                    Y = End.Y, Z = End.Z, X = nextPoint.X + size
                };
                output.Add(new Line()
                {
                    Block = Block, Start = nextPoint.Clone(), End = endPoint
                });
                nextPoint   = endPoint.Clone();
                nextPoint.Y = Start.Y;
                nextPoint.Z = Start.Z;
                nextPoint.X++;
            }
            output.Add(new Line()
            {
                Start = nextPoint, End = End.Clone(), Block = Block
            });
            return(output);
        }
Exemplo n.º 4
0
        public override NoteRest Clone()
        {
            var clone = (Note)MemberwiseClone();

            clone.Start = Start.Clone();
            clone.End   = End?.Clone();
            return(clone);
        }
Exemplo n.º 5
0
 public Line Shift(Position position)
 {
     return(new Line
     {
         Block = Block,
         BlockName = BlockName,
         Data = Data,
         Start = Start.Clone().Shift(position),
         End = End.Clone().Shift(position)
     });
 }
Exemplo n.º 6
0
        public IEnumerable <CoordinateF> GetBoxPoints()
        {
            yield return(new CoordinateF(Start.X, End.Y, End.Z));

            yield return(End.Clone());

            yield return(new CoordinateF(Start.X, Start.Y, End.Z));

            yield return(new CoordinateF(End.X, Start.Y, End.Z));

            yield return(new CoordinateF(Start.X, End.Y, Start.Z));

            yield return(new CoordinateF(End.X, End.Y, Start.Z));

            yield return(Start.Clone());

            yield return(new CoordinateF(End.X, Start.Y, Start.Z));
        }
Exemplo n.º 7
0
        public CoordinateF[][] GetBoxFaces()
        {
            var topLeftBack   = new CoordinateF(Start.X, End.Y, End.Z);
            var topRightBack  = End.Clone();
            var topLeftFront  = new CoordinateF(Start.X, Start.Y, End.Z);
            var topRightFront = new CoordinateF(End.X, Start.Y, End.Z);

            var bottomLeftBack   = new CoordinateF(Start.X, End.Y, Start.Z);
            var bottomRightBack  = new CoordinateF(End.X, End.Y, Start.Z);
            var bottomLeftFront  = Start.Clone();
            var bottomRightFront = new CoordinateF(End.X, Start.Y, Start.Z);

            return(new[]
            {
                new[] { topLeftFront, topRightFront, bottomRightFront, bottomLeftFront },
                new[] { topRightBack, topLeftBack, bottomLeftBack, bottomRightBack },
                new[] { topLeftBack, topLeftFront, bottomLeftFront, bottomLeftBack },
                new[] { topRightFront, topRightBack, bottomRightBack, bottomRightFront },
                new[] { topLeftBack, topRightBack, topRightFront, topLeftFront },
                new[] { bottomLeftFront, bottomRightFront, bottomRightBack, bottomLeftBack }
            });
        }
Exemplo n.º 8
0
        public IEnumerable <LineF> GetBoxLines()
        {
            var topLeftBack   = new CoordinateF(Start.X, End.Y, End.Z);
            var topRightBack  = End.Clone();
            var topLeftFront  = new CoordinateF(Start.X, Start.Y, End.Z);
            var topRightFront = new CoordinateF(End.X, Start.Y, End.Z);

            var bottomLeftBack   = new CoordinateF(Start.X, End.Y, Start.Z);
            var bottomRightBack  = new CoordinateF(End.X, End.Y, Start.Z);
            var bottomLeftFront  = Start.Clone();
            var bottomRightFront = new CoordinateF(End.X, Start.Y, Start.Z);

            yield return(new LineF(topLeftBack, topRightBack));

            yield return(new LineF(topLeftFront, topRightFront));

            yield return(new LineF(topLeftBack, topLeftFront));

            yield return(new LineF(topRightBack, topRightFront));

            yield return(new LineF(topLeftBack, bottomLeftBack));

            yield return(new LineF(topLeftFront, bottomLeftFront));

            yield return(new LineF(topRightBack, bottomRightBack));

            yield return(new LineF(topRightFront, bottomRightFront));

            yield return(new LineF(bottomLeftBack, bottomRightBack));

            yield return(new LineF(bottomLeftFront, bottomRightFront));

            yield return(new LineF(bottomLeftBack, bottomLeftFront));

            yield return(new LineF(bottomRightBack, bottomRightFront));
        }
Exemplo n.º 9
0
 public BoxF Clone()
 {
     return(new BoxF(Start.Clone(), End.Clone()));
 }
Exemplo n.º 10
0
 public override Shape DeepClone()
 {
     return(new Line(Start.Clone(), End.Clone(), Color, Width));
 }
Exemplo n.º 11
0
 public override Shape DeepClone()
 {
     return(new Arc(Start.Clone(), End.Clone(), Radius, Color, Width));
 }
Exemplo n.º 12
0
 public Wall Clone()
 {
     return(new Wall(Start.Clone(), End.Clone(), IsHorizontal));
 }
Exemplo n.º 13
0
 public override NoteRest Clone()
 {
     return(new Rest(Start.Clone(), End?.Clone()));
 }
Exemplo n.º 14
0
 public override Shape DeepClone()
 {
     return(new Measurement(Start.Clone(), End.Clone(), Color, Location, ConversionRate, Unit));
 }