Formatting update
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / renderer / raster / shapes / composite / base / SubShape.java
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.base;
6
7 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape;
8
9 public class SubShape {
10
11     private final AbstractShape shape;
12     private boolean visible = true;
13     private String groupIdentifier;
14
15     public SubShape(AbstractShape shape) {
16         this.shape = shape;
17     }
18
19     public boolean isUngrouped() {
20         return groupIdentifier == null;
21     }
22
23     public boolean matchesGroup(final String groupIdentifier) {
24         if (this.groupIdentifier == null)
25             return groupIdentifier == null;
26
27         return this.groupIdentifier.equals(groupIdentifier);
28     }
29
30     public void setGroup(final String groupIdentifier) {
31         this.groupIdentifier = groupIdentifier;
32     }
33
34     public AbstractShape getShape() {
35         return shape;
36     }
37
38     public boolean isVisible() {
39         return visible;
40     }
41
42     public void setVisible(boolean visible) {
43         this.visible = visible;
44     }
45 }