79784882bfa6ae7db53fbf9299b29a8bd5e87c16
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / renderer / raster / shapes / composite / base / SubShape.java
1 /*
2  * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of version 3 of the GNU Lesser General Public License
6  * or later as published by the Free Software Foundation.
7  *
8  */
9
10 package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base;
11
12 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape;
13
14 public class SubShape {
15
16     private final AbstractShape shape;
17     private boolean visible = true;
18     private String groupIdentifier;
19
20     public SubShape(AbstractShape shape) {
21         this.shape = shape;
22     }
23
24     public boolean isUngrouped() {
25         return groupIdentifier == null;
26     }
27
28     public boolean matchesGroup(final String groupIdentifier) {
29         if (this.groupIdentifier == null)
30             return groupIdentifier == null;
31
32         return this.groupIdentifier.equals(groupIdentifier);
33     }
34
35     public void setGroup(final String groupIdentifier) {
36         this.groupIdentifier = groupIdentifier;
37     }
38
39     public AbstractShape getShape() {
40         return shape;
41     }
42
43     public boolean isVisible() {
44         return visible;
45     }
46
47     public void setVisible(boolean visible) {
48         this.visible = visible;
49     }
50 }