Package se.conciliate.extensions.store
Interface MTLayerHeader
- All Known Subinterfaces:
MTCompleteLayer
,MTLayer
public interface MTLayerHeader
Header interface for layers. A model can have one or more layers
to make it possible to hide/show certain parts of the model at a time.
There is always a default layer called the background layer, containing
all vertices and edges that has not been assigned to another layer.
One of the layers is the "background" layer. This is always behind the other layers
and is not really a layer in the same sense as the other layers. All vertices
and edges that does not belong to another layer will automatically belong to
the background layer, i.e. calling setLayer(null) will move it to the background
layer. Most of the methods will do nothing when called on the background layer. The
ones making sense using are isBackgroundLayer().
Each layer have a layer type, and the available layer types are the
same for all models of a given type
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionexpand()
Returns aMTLayer
for this layer.long
getID()
Returns the ID of the layer.float
Returns a transient attribute for opacity in the layer.getUUID()
Returns the UUID of the layer.boolean
Returns true if the layer is the background layer.void
setOpacity
(float opacity, boolean playNice) Sets the transient attribute for opacity in the layer.
-
Method Details
-
isBackgroundLayer
boolean isBackgroundLayer()Returns true if the layer is the background layer.- Returns:
- true if the layer is the background layer.
- Since:
- 3.0
-
getID
long getID()Returns the ID of the layer.- Returns:
- The ID of the layer.
- Since:
- 3.0
-
getUUID
String getUUID()Returns the UUID of the layer.- Returns:
- The UUID of the layer.
- Since:
- 3.0
-
getOpacity
float getOpacity()Returns a transient attribute for opacity in the layer. The opacity is a value between 0.0f and 1.0f, inclusive on both sides. Another way to put this is [0.0, 1.0].- Returns:
- a transient attribute for opacity in the layer.
-
setOpacity
Sets the transient attribute for opacity in the layer. Note that this is a transient attribute and will not be persisted in any way.
The opacity must be a value between 0.0 and 1.0 inclusive. However, ifplayNice
is true, no exceptions will be throw if the opacity is outside the bounds. Instead, values greater than 1 will be interpreted as meaning 1 and values less than 0 will be interpreted as meaning 0. If playNice is false and the opacity is outside the bounds, an exception is raised.- Parameters:
opacity
- The new opacity value.playNice
- if false, throws an exception if opacity is outside its bounds, else opacity < 0 is interpreted as 0 and opacity > 1 is interpreted as 1.- Throws:
IllegalArgumentException
- if opacity is outside the bounds [0.0, 1.0] and playNice is false.
-
expand
Returns aMTLayer
for this layer. Beware that this might require querying the storage layer for more data.- Returns:
- A
MTLayer
representing this layer. - Throws:
MTAccessException
- If an MTAccessException occurs.- Since:
- 3.0
-