示例#1
0
        /// <summary>
        /// Adds a canonical example to the preprocessor. If the specified gate
        /// already contains a canonical example, it will be replaced
        /// </summary>
        /// <param name="gateName">The gate to add the example to</param>
        /// <param name="sketch">The example itself. Should contain
        /// a single image. If any parts are to be emphasized, they should be
        /// drawn in red.</param>
        public void addCanonicalExample(string gateName, Sketch.Sketch sketch)
        {
            Shape s = new Shape();

            s.AddSubstrokes(new List <Substroke>(sketch.Substrokes));
            _td.addCanonicalGate(gateName, s);
        }
 public void restore()
 {
     _sketch.clearShapes();
     foreach (var pair in _shapeGeometry)
     {
         Shape            shape      = pair.Key;
         List <Substroke> substrokes = pair.Value;
         shape.AddSubstrokes(substrokes);
         _sketch.AddShape(shape);
     }
 }