Possibility to retrieve objects by group. Reuse glowing point textures.
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / renderer / raster / shapes / composite / base / AbstractCompositeShape.java
index 54729ae..99f21c3 100644 (file)
@@ -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<SubShape> getGroup(final String groupIdentifier) {
+        return originalSubShapes.stream().filter(
+                subShape -> subShape.matchesGroup(groupIdentifier))
+                .collect(Collectors.toList());
+    }
+
     private void resliceIfNeeded() {
 
         final double proposedSliceFactor = relativityTracker