Changed license to Creative Commons Zero (CC0).
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / renderer / raster / shapes / composite / wireframe / WireframeDrawing.java
1 /*
2  * Sixth 3D engine. Author: Svjatoslav Agejenko. 
3  * This project is released under Creative Commons Zero (CC0) license.
4  *
5 *
6  */
7
8 package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe;
9
10 import eu.svjatoslav.sixth.e3d.geometry.Point3D;
11 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.Line;
12 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
13 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape;
14
15 public class WireframeDrawing extends AbstractCompositeShape {
16
17     final private LineAppearance lineAppearance;
18     Point3D currentPoint;
19
20     public WireframeDrawing(final LineAppearance lineAppearance) {
21         super();
22         this.lineAppearance = lineAppearance;
23     }
24
25     public void addPoint(final Point3D point3d) {
26         if (currentPoint != null) {
27             final Line line = lineAppearance.getLine(currentPoint, point3d);
28             addShape(line);
29         }
30
31         currentPoint = new Point3D(point3d);
32     }
33
34 }