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