public AddPointAfterAction(Surface surface, Vertex vertex, double x, double y)
 {
     Surface = surface;
     Vertex = vertex;
     X = x;
     Y = y;
 }
Exemplo n.º 2
0
 private Surface(
     Vertex position,
     IReadOnlyCollection<Vertex> points,
     bool isSelected,
     string name)
 {
     Points = ImmutableList.CreateRange(points);
     Position = position;
     IsSelected = isSelected;
     Name = name;
 }
Exemplo n.º 3
0
 public MovePointsAction(Surface surface, Vertex vertex, Vector delta)
 {
     Surface = surface;
     Points = new [] { vertex };
     Delta = delta;
 }
Exemplo n.º 4
0
 public Surface RemovePoint(Vertex vertex)
 {
     return Create(Position, Points.Remove(vertex), IsSelected, Name);
 }
Exemplo n.º 5
0
 public Surface AddPoint(Vertex vertex, Vertex previous)
 {
     return Create(Position, Points.Insert(Points.IndexOf(previous) + 1, vertex), IsSelected, Name);
 }
Exemplo n.º 6
0
 public Surface MovePoint(Vertex vertex, Vector delta)
 {
     return Create(Position, Points.Replace(vertex, vertex.Move(delta)), IsSelected, Name);
 }
Exemplo n.º 7
0
 public Scene RemovePoint(Surface surface, Vertex vertex)
 {
     return Create(Surfaces.Replace(surface, surface.RemovePoint(vertex)));
 }
Exemplo n.º 8
0
 public Scene AddPoint(Surface surface, Vertex vertex, Vertex previous)
 {
     return Create(Surfaces.Replace(surface, surface.AddPoint(vertex, previous)));
 }
Exemplo n.º 9
0
 public Scene MovePoint(Surface surface, Vertex vertex, Vector delta)
 {
     return Create(Surfaces.Replace(surface, surface.MovePoint(vertex, delta)));
 }
Exemplo n.º 10
0
 public Line(Vertex a, Vertex b)
 {
     A = a;
     B = b;
 }
Exemplo n.º 11
0
        public static Surface Create(
            Vertex position,
            IReadOnlyCollection<Vertex> points,
            bool isSelected,
            string name)
        {
            if (points.Count < 3)
            {
                throw new InvalidOperationException(nameof(points.Count) + " should be more than 3");
            }

            return new Surface(position, points, isSelected, name);
        }
Exemplo n.º 12
0
 public RemovePointAction(Surface surface, Vertex vertex)
 {
     Surface = surface;
     Vertex = vertex;
 }
Exemplo n.º 13
0
 public AddSurfaceAction(Vertex position, IReadOnlyCollection<Vertex> points, string name)
 {
     Position = position;
     Points = points;
     Name = name;
 }