KitchenDraw SDK 2
Show / Hide Table of Contents

Class Scene.Shape

Represents an object's shape, which is in essence a list of points with some additional data provided for each point.

Inheritance
object
List<Scene.Shape.Point>
Scene.Shape
Implements
IList<Scene.Shape.Point>
ICollection<Scene.Shape.Point>
IList
ICollection
IReadOnlyList<Scene.Shape.Point>
IReadOnlyCollection<Scene.Shape.Point>
IEnumerable<Scene.Shape.Point>
IEnumerable
Inherited Members
List<Scene.Shape.Point>.Add(Scene.Shape.Point)
List<Scene.Shape.Point>.AddRange(IEnumerable<Scene.Shape.Point>)
List<Scene.Shape.Point>.AsReadOnly()
List<Scene.Shape.Point>.BinarySearch(int, int, Scene.Shape.Point, IComparer<Scene.Shape.Point>)
List<Scene.Shape.Point>.BinarySearch(Scene.Shape.Point)
List<Scene.Shape.Point>.BinarySearch(Scene.Shape.Point, IComparer<Scene.Shape.Point>)
List<Scene.Shape.Point>.Clear()
List<Scene.Shape.Point>.Contains(Scene.Shape.Point)
List<Scene.Shape.Point>.ConvertAll<TOutput>(Converter<Scene.Shape.Point, TOutput>)
List<Scene.Shape.Point>.CopyTo(Scene.Shape.Point[])
List<Scene.Shape.Point>.CopyTo(int, Scene.Shape.Point[], int, int)
List<Scene.Shape.Point>.CopyTo(Scene.Shape.Point[], int)
List<Scene.Shape.Point>.Exists(Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.Find(Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.FindAll(Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.FindIndex(Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.FindIndex(int, Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.FindIndex(int, int, Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.FindLast(Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.FindLastIndex(Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.FindLastIndex(int, Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.FindLastIndex(int, int, Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.ForEach(Action<Scene.Shape.Point>)
List<Scene.Shape.Point>.GetEnumerator()
List<Scene.Shape.Point>.GetRange(int, int)
List<Scene.Shape.Point>.IndexOf(Scene.Shape.Point)
List<Scene.Shape.Point>.IndexOf(Scene.Shape.Point, int)
List<Scene.Shape.Point>.IndexOf(Scene.Shape.Point, int, int)
List<Scene.Shape.Point>.Insert(int, Scene.Shape.Point)
List<Scene.Shape.Point>.InsertRange(int, IEnumerable<Scene.Shape.Point>)
List<Scene.Shape.Point>.LastIndexOf(Scene.Shape.Point)
List<Scene.Shape.Point>.LastIndexOf(Scene.Shape.Point, int)
List<Scene.Shape.Point>.LastIndexOf(Scene.Shape.Point, int, int)
List<Scene.Shape.Point>.Remove(Scene.Shape.Point)
List<Scene.Shape.Point>.RemoveAll(Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.RemoveAt(int)
List<Scene.Shape.Point>.RemoveRange(int, int)
List<Scene.Shape.Point>.Reverse()
List<Scene.Shape.Point>.Reverse(int, int)
List<Scene.Shape.Point>.Sort()
List<Scene.Shape.Point>.Sort(IComparer<Scene.Shape.Point>)
List<Scene.Shape.Point>.Sort(int, int, IComparer<Scene.Shape.Point>)
List<Scene.Shape.Point>.Sort(Comparison<Scene.Shape.Point>)
List<Scene.Shape.Point>.ToArray()
List<Scene.Shape.Point>.TrimExcess()
List<Scene.Shape.Point>.TrueForAll(Predicate<Scene.Shape.Point>)
List<Scene.Shape.Point>.Capacity
List<Scene.Shape.Point>.Count
List<Scene.Shape.Point>.this[int]
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: KD.SDK2
Assembly: KD.SDK2.dll
Syntax
public class Scene.Shape : List<Scene.Shape.Point>, IList<Scene.Shape.Point>, ICollection<Scene.Shape.Point>, IList, ICollection, IReadOnlyList<Scene.Shape.Point>, IReadOnlyCollection<Scene.Shape.Point>, IEnumerable<Scene.Shape.Point>, IEnumerable
Remarks

This class operates on shape string, which can be obtained, for example, from Shape property. Use ToString() method to convert a shape back to its string representation.

This class inherits List<Shape.Point>, so you can access individual points as you would do it with generic list.

Examples

The following example shows how to move a shape.

// This function takes string describing a shape and returns the same
// shape but moved by (dx;dy).
public void MoveActiveShapesByDxDy(Scene scene, double dx, double dy)
{
    for(int i = 0; i < scene.Shapes.Count; i++)
    {
        Scene.Shape shape = new Scene.Shape(scene.Unit, scene.Shapes[i]);

        foreach (Scene.Shape.Point point in shape)
        {
            point.X += dx;
            point.Y += dy;
        }

        scene.Shapes[i] = shape.ToString();
    }
}

Constructors

Name Description
Shape(UnitType, string)

Instantiates Shape object from the given shape string.

Methods

Name Description
ToString()

Returns string representation of the shape.

In this article
Back to top Generated by DocFX