Enum OutsideKernelPolicy
- All Implemented Interfaces:
Serializable,Comparable<OutsideKernelPolicy>,java.lang.constant.Constable
public enum OutsideKernelPolicy extends Enum<OutsideKernelPolicy>
How to handle voxels whose neighbors are outside the scene.
- Author:
- Owen Feehan
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description AS_OFFPretend any parts of the neighborhood that lie outside the scene are being off-valued.AS_ONPretend any parts of the neighborhood that lie outside the scene are being on-valued.IGNORE_OUTSIDEIgnore any parts of the neighborhood that lie outside the scene. -
Method Summary
Modifier and Type Method Description static OutsideKernelPolicyas(boolean on)booleanisIgnoreOutside()When true, any parts of the neighborhood that lie outside the scene are not considered in kernel neighborhoods.booleanisOutsideOn()In cases whereisIgnoreOutside()is false, then whether to treat voxels that lie outside the scene as on (if true) or off (if false).intmultiplex(int ignored, int asOn, int asOff)Multiplexes between three-values depending on which policy is currently selected.static OutsideKernelPolicyof(boolean ignoreOutside, boolean outsideHigh)Multiplexes between all three possible enums.static OutsideKernelPolicyvalueOf(String name)Returns the enum constant of this type with the specified name.static OutsideKernelPolicy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
IGNORE_OUTSIDE
Ignore any parts of the neighborhood that lie outside the scene. The second parameter here is arbtirary. -
AS_ON
Pretend any parts of the neighborhood that lie outside the scene are being on-valued. -
AS_OFF
Pretend any parts of the neighborhood that lie outside the scene are being off-valued.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
as
-
of
Multiplexes between all three possible enums.- Parameters:
ignoreOutside- if true, thenIGNORE_OUTSIDEis selected.outsideHigh- ifignoreOutside==false, and determines whetherAS_ON(if true) is selected orAS_OFF(if false).- Returns:
- either
AS_ONandAS_OFForIGNORE_OUTSIDE.
-
isIgnoreOutside
public boolean isIgnoreOutside()When true, any parts of the neighborhood that lie outside the scene are not considered in kernel neighborhoods.- Returns:
- true if parts of the neighborhood that lie outside the scene should be ignored.
-
isOutsideOn
public boolean isOutsideOn()In cases whereisIgnoreOutside()is false, then whether to treat voxels that lie outside the scene as on (if true) or off (if false).- Returns:
- true if voxels lying outside the scene should be treated as on in the above circumstances, otherwise they are treated as off.
-
multiplex
public int multiplex(int ignored, int asOn, int asOff)Multiplexes between three-values depending on which policy is currently selected.- Parameters:
ignored- the value to return if current policy isIGNORE_OUTSIDEasOn- the value to return if current policy isAS_ONasOff- the value to return if current policy isAS_OFF- Returns:
- one of the three values above.
-