Updated readability of the code.
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / renderer / raster / shapes / composite / base / AbstractCompositeShape.java
index 88ab271..747dd08 100644 (file)
@@ -1,20 +1,15 @@
 /*
- * Sixth 3D engine. Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * This project is released under Creative Commons Zero (CC0) license.
  */
-
 package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base;
 
 import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.geometry.Transform;
-import eu.svjatoslav.sixth.e3d.geometry.TransformPipe;
 import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
 import eu.svjatoslav.sixth.e3d.gui.UserRelativityTracker;
 import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController;
+import eu.svjatoslav.sixth.e3d.math.Transform;
+import eu.svjatoslav.sixth.e3d.math.TransformsStack;
 import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
 import eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator;
 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape;
@@ -69,7 +64,7 @@ public class AbstractCompositeShape extends AbstractShape {
      * This method should be overridden by anyone wanting to customize shape
      * before it is rendered.
      */
-    public void beforeTransformHook(final TransformPipe transformPipe,
+    public void beforeTransformHook(final TransformsStack transformPipe,
                                     final RenderingContext context) {
     }
 
@@ -153,7 +148,7 @@ public class AbstractCompositeShape extends AbstractShape {
     }
 
     public void setGroupForUngrouped(final String groupIdentifier) {
-        originalSubShapes.stream().filter(subShape -> subShape.isUngrouped()).forEach(subShape -> subShape.setGroup(groupIdentifier));
+        originalSubShapes.stream().filter(SubShape::isUngrouped).forEach(subShape -> subShape.setGroup(groupIdentifier));
     }
 
     @Override
@@ -186,7 +181,7 @@ public class AbstractCompositeShape extends AbstractShape {
         final List<AbstractShape> result = new ArrayList<>();
 
         final Slicer slicer = new Slicer(currentSliceFactor);
-        originalSubShapes.stream().filter(subShape -> subShape.isVisible()).forEach(subShape -> {
+        originalSubShapes.stream().filter(SubShape::isVisible).forEach(subShape -> {
             if (subShape.getShape() instanceof TexturedPolygon)
                 slicer.slice((TexturedPolygon) subShape.getShape());
             else
@@ -199,7 +194,7 @@ public class AbstractCompositeShape extends AbstractShape {
     }
 
     @Override
-    public void transform(final TransformPipe transformPipe,
+    public void transform(final TransformsStack transformPipe,
                           final RenderAggregator aggregator, final RenderingContext context) {
 
         // add current composite shape transform to the end of the transform