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