// Path: src/main/java/openperipheral/addons/glasses/utils/ColorPoint2d.java
// @ScriptStruct
// @SerializableClass
// public class ColorPoint2d {
// 
// 	public static final ColorPoint2d NULL = new ColorPoint2d(0, 0, 0, 0.0f);
// 
// 	public ColorPoint2d() {}
// 
// 	public ColorPoint2d(float x, float y, int rgb, float opacity) {
// 		this.x = x;
// 		this.y = y;
// 		this.rgb = rgb;
// 		this.opacity = opacity;
// 	}
// 
// 	@Serialize
// 	@StructField(index = 0)
// 	public float x;
// 
// 	@Serialize
// 	@StructField(index = 1)
// 	public float y;
// 
// 	@Serialize
// 	@StructField(index = 2, optional = true)
// 	public int rgb = 0xFFFFFF;
// 
// 	@Serialize
// 	@StructField(index = 3, optional = true)
// 	public float opacity = 1;
// 
// 	@Override
// 	public String toString() {
// 		return String.format("(%f,%f %06X:%.2f", x, y, rgb, opacity);
// 	}
// 
// }
// 
// Path: src/main/java/openperipheral/addons/glasses/utils/ColorPointListBuilder.java
// public class ColorPointListBuilder implements IPointListBuilder<ColorPoint2d> {
// 
// 	private static class PointListImpl extends PointList<ColorPoint2d> {
// 
// 		public PointListImpl(List<ColorPoint2d> points) {
// 			super(points);
// 		}
// 
// 		@Override
// 		protected void drawPoint(RenderState renderState, ColorPoint2d p) {
// 			renderState.setColor(p.rgb, p.opacity);
// 			GL11.glVertex2f(p.x, p.y);
// 		}
// 
// 	}
// 
// 	private final List<ColorPoint2d> points = Lists.newArrayList();
// 
// 	private final BoundingBoxBuilder bbBuilder = BoundingBoxBuilder.create();
// 
// 	@Override
// 	public void add(ColorPoint2d point) {
// 		bbBuilder.addPoint(point.x, point.y);
// 		points.add(point);
// 	}
// 
// 	private static ColorPoint2d toBoundingBox(Box2d bb, ColorPoint2d point) {
// 		return new ColorPoint2d(point.x - bb.left, point.y - bb.top, point.rgb, point.opacity);
// 	}
// 
// 	@Override
// 	public IPointList<ColorPoint2d> buildPointList() {
// 		final Box2d bb = bbBuilder.build();
// 
// 		List<ColorPoint2d> relPoints = Lists.newArrayList();
// 		for (ColorPoint2d p : points)
// 			relPoints.add(toBoundingBox(bb, p));
// 
// 		return new PointListImpl(relPoints);
// 	}
// 
// 	@Override
// 	public Box2d buildBoundingBox() {
// 		return bbBuilder.build();
// 	}
// }
// 
// Path: src/main/java/openperipheral/addons/glasses/utils/IPointListBuilder.java
// public interface IPointListBuilder<P> {
// 	public void add(P point);
// 
// 	public IPointList<P> buildPointList();
// 
// 	public Box2d buildBoundingBox();
// }


import openperipheral.addons.glasses.utils.ColorPoint2d;
import openperipheral.addons.glasses.utils.ColorPointListBuilder;
import openperipheral.addons.glasses.utils.IPointListBuilder;
import openperipheral.api.adapter.AdapterSourceName;
import openperipheral.api.adapter.method.ScriptObject;
package openperipheral.addons.glasses.drawable;


@ScriptObject
@AdapterSourceName("glasses_gradient_line_strip")
public class GradientLineStrip extends LineStrip<ColorPoint2d> {

	public GradientLineStrip() {}

	public GradientLineStrip(ColorPoint2d... points) {
		super(points);
	}

	@Override
	protected IPointListBuilder<ColorPoint2d> createBuilder() {
		return new ColorPointListBuilder();
	}

// Path: src/main/java/openperipheral/addons/glasses/utils/ColorPoint2d.java
// @ScriptStruct
// @SerializableClass
// public class ColorPoint2d {
// 
// 	public static final ColorPoint2d NULL = new ColorPoint2d(0, 0, 0, 0.0f);
// 
// 	public ColorPoint2d() {}
// 
// 	public ColorPoint2d(float x, float y, int rgb, float opacity) {
// 		this.x = x;
// 		this.y = y;
// 		this.rgb = rgb;
// 		this.opacity = opacity;
// 	}
// 
// 	@Serialize
// 	@StructField(index = 0)
// 	public float x;
// 
// 	@Serialize
// 	@StructField(index = 1)
// 	public float y;
// 
// 	@Serialize
// 	@StructField(index = 2, optional = true)
// 	public int rgb = 0xFFFFFF;
// 
// 	@Serialize
// 	@StructField(index = 3, optional = true)
// 	public float opacity = 1;
// 
// 	@Override
// 	public String toString() {
// 		return String.format("(%f,%f %06X:%.2f", x, y, rgb, opacity);
// 	}
// 
// }
// 
// Path: src/main/java/openperipheral/addons/glasses/utils/ColorPointListBuilder.java
// public class ColorPointListBuilder implements IPointListBuilder<ColorPoint2d> {
// 
// 	private static class PointListImpl extends PointList<ColorPoint2d> {
// 
// 		public PointListImpl(List<ColorPoint2d> points) {
// 			super(points);
// 		}
// 
// 		@Override
// 		protected void drawPoint(RenderState renderState, ColorPoint2d p) {
// 			renderState.setColor(p.rgb, p.opacity);
// 			GL11.glVertex2f(p.x, p.y);
// 		}
// 
// 	}
// 
// 	private final List<ColorPoint2d> points = Lists.newArrayList();
// 
// 	private final BoundingBoxBuilder bbBuilder = BoundingBoxBuilder.create();
// 
// 	@Override
// 	public void add(ColorPoint2d point) {
// 		bbBuilder.addPoint(point.x, point.y);
// 		points.add(point);
// 	}
// 
// 	private static ColorPoint2d toBoundingBox(Box2d bb, ColorPoint2d point) {
// 		return new ColorPoint2d(point.x - bb.left, point.y - bb.top, point.rgb, point.opacity);
// 	}
// 
// 	@Override
// 	public IPointList<ColorPoint2d> buildPointList() {
// 		final Box2d bb = bbBuilder.build();
// 
// 		List<ColorPoint2d> relPoints = Lists.newArrayList();
// 		for (ColorPoint2d p : points)
// 			relPoints.add(toBoundingBox(bb, p));
// 
// 		return new PointListImpl(relPoints);
// 	}
// 
// 	@Override
// 	public Box2d buildBoundingBox() {
// 		return bbBuilder.build();
// 	}
// }
// 
// Path: src/main/java/openperipheral/addons/glasses/utils/IPointListBuilder.java
// public interface IPointListBuilder<P> {
// 	public void add(P point);
// 
// 	public IPointList<P> buildPointList();
// 
// 	public Box2d buildBoundingBox();
// }


// Path: src/main/java/openperipheral/addons/glasses/drawable/GradientLineStrip.java
import openperipheral.addons.glasses.utils.ColorPoint2d;
import openperipheral.addons.glasses.utils.ColorPointListBuilder;
import openperipheral.addons.glasses.utils.IPointListBuilder;
import openperipheral.api.adapter.AdapterSourceName;
import openperipheral.api.adapter.method.ScriptObject;

package openperipheral.addons.glasses.drawable;


@ScriptObject
@AdapterSourceName("glasses_gradient_line_strip")
public class GradientLineStrip extends LineStrip<ColorPoint2d> {

	public GradientLineStrip() {}

	public GradientLineStrip(ColorPoint2d... points) {
		super(points);
	}

	@Override
	protected IPointListBuilder<ColorPoint2d> createBuilder() {
		return new ColorPointListBuilder();
	}

	@Override