X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Frenderer%2Fraster%2Fshapes%2Fcomposite%2Fbase%2FAbstractCompositeShape.java;h=aa7c30e7fa941a30608e0079b4e76bb06ab5e916;hp=dd8b784a0982ea2f209e37e880d7dfdc22b30cf0;hb=e56f9b775bd49c31e8efab7204bee699036942b3;hpb=6213716671ccab6b7256de41838e1f5401ce173c diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java index dd8b784..aa7c30e 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java @@ -1,20 +1,20 @@ /* - * Sixth - System for data storage, computation, exploration and interaction. - * Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Sixth 3D engine. Copyright ©2012-2018, 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. + * */ 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.TransformPipe; 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; @@ -25,6 +25,7 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.slicer.Slicer; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * In order to get perspective correct textures, large textured polygons are @@ -119,6 +120,12 @@ public class AbstractCompositeShape extends AbstractShape { } } + public List getGroup(final String groupIdentifier) { + return originalSubShapes.stream().filter( + subShape -> subShape.matchesGroup(groupIdentifier)) + .collect(Collectors.toList()); + } + private void resliceIfNeeded() { final double proposedSliceFactor = relativityTracker @@ -146,7 +153,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