Class LayerImpl
java.lang.Object
cz.fidentis.analyst.data.surfacemask.impl.LayerImpl
- All Implemented Interfaces:
Layer
Represents a single layer within a
SurfaceMaskLayers
, containing a surface mask
and a history of previous states for undo/redo functionality.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMask
(SurfaceMask2D mask) Adds a new surface mask to this layer and sets it as the current mask.Returns all surface masks in this layer.Returns the current surface mask in this layer.void
goBack()
Moves back to the previous mask state in the history if possible.void
Moves forward to the next mask state in the history if possible.boolean
Checks if the layer is currently visible.void
setCurrentMask
(int dir) Sets a new current surface mask for this layer.void
setCurrentMask
(SurfaceMask2D mask) Sets a new currentvoid
setVisibility
(boolean visible) Sets the visibility of this layer.void
Update the history, if the max depth is exceeded, the history is halved, and sets the current index to the last entry added.void
updateMask
(SurfaceMask2D oldMask, SurfaceMask2D newMask) Updates mask according to 3D
-
Constructor Details
-
LayerImpl
public LayerImpl()Constructs a new Layer with the specified surface mask.
-
-
Method Details
-
getCurrentMask
Description copied from interface:Layer
Returns the current surface mask in this layer.- Specified by:
getCurrentMask
in interfaceLayer
- Returns:
- The current
SurfaceMask2D
.
-
setCurrentMask
public void setCurrentMask(int dir) Description copied from interface:Layer
Sets a new current surface mask for this layer.- Specified by:
setCurrentMask
in interfaceLayer
- Parameters:
dir
- 1 - forward; -1 - back in masks.
-
setCurrentMask
Description copied from interface:Layer
Sets a new current- Specified by:
setCurrentMask
in interfaceLayer
- Parameters:
mask
- mask to be set as current
-
getAllMasks
Description copied from interface:Layer
Returns all surface masks in this layer.- Specified by:
getAllMasks
in interfaceLayer
- Returns:
- A list of all
SurfaceMask2D
objects in this layer.
-
addMask
Description copied from interface:Layer
Adds a new surface mask to this layer and sets it as the current mask.- Specified by:
addMask
in interfaceLayer
- Parameters:
mask
- TheSurfaceMask2D
to be added.
-
setVisibility
public void setVisibility(boolean visible) Description copied from interface:Layer
Sets the visibility of this layer.- Specified by:
setVisibility
in interfaceLayer
- Parameters:
visible
-true
to make the layer visible;false
to hide it.
-
updateHistory
public void updateHistory()Description copied from interface:Layer
Update the history, if the max depth is exceeded, the history is halved, and sets the current index to the last entry added.- Specified by:
updateHistory
in interfaceLayer
-
isVisible
public boolean isVisible()Description copied from interface:Layer
Checks if the layer is currently visible. -
goBack
public void goBack()Description copied from interface:Layer
Moves back to the previous mask state in the history if possible. -
goForward
public void goForward()Description copied from interface:Layer
Moves forward to the next mask state in the history if possible. -
updateMask
Description copied from interface:Layer
Updates mask according to 3D- Specified by:
updateMask
in interfaceLayer
- Parameters:
oldMask
- Original masknewMask
- New mask
-