//[Update:[Thu Jul 23 IST 2020]]
/*History:
**Mon Oct 28 2019
   Started.
**Wed Oct 30 2019
 First working version.
**Thu Jul 23 2020
  Added blank drawPoint
*/

import java.io.*;

public  class SVG
    implements Pad {
    private PrintWriter pw;
    private Vec2 curr;
    private boolean first;
    
    public SVG(PrintWriter pw) {
        this.pw = pw;
    }

    public void startGroup() {
        pw.println("<g style=\"fill:none;stroke:#000000\">");
    }
    public void endGroup() {
        pw.println("</g>");
    }
    public  void startPic() {
        pw.println("<svg>");
    }
    
    public  void endPic() {
        pw.println("</svg>");
        pw.flush();
        pw.close();
    }
    
    public  void startPath() {
        pw.print("<path style=\"fill:none\"  d=\"m ");
        first = true;

    }
    public  void startPath1() {
        pw.print("<path style=\"fill:none;stroke:#cccccc\"  d=\"m ");
        first = true;
    }
    public  void endPath() {
        pw.println("\"/>");
    }
    public  void endPath1() {
        pw.println("\"/>");
    }

    public void addPoint(Vec2 p) {
        if(first) {
            first = false;
            pw.print(" "+mx(p.x)+","+my(p.y));
        }
        else {
            pw.print(" "+mx(p.x-curr.x)+","+my(p.y-curr.y));
        }
        curr = p;
    }
    
    
    private  final int mult = 2000;

    private  double mx(double x) {
        return mult*x;
    }

    private  double my(double y) {
        return -mult*y;
    }

    public void drawPoint(Vec2 p) {}
}
