Package com.io7m.jspatial.api.octtrees
Class OctTreeConfigurationD
- java.lang.Object
-
- com.io7m.jspatial.api.octtrees.OctTreeConfigurationD
-
- All Implemented Interfaces:
OctTreeConfigurationDType
public final class OctTreeConfigurationD extends java.lang.Object implements OctTreeConfigurationDType
The type of double precision octtree configurations.- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOctTreeConfigurationD.BuilderBuilds instances of typeOctTreeConfigurationD.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OctTreeConfigurationD.Builderbuilder()Creates a builder forOctTreeConfigurationD.static OctTreeConfigurationDcopyOf(OctTreeConfigurationDType instance)Creates an immutable copy of aOctTreeConfigurationDTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofOctTreeConfigurationDthat have equal attribute values.inthashCode()Computes a hash code from attributes:volume,minimumOctantWidth,minimumOctantHeight,minimumOctantDepth,trimOnRemove.doubleminimumOctantDepth()doubleminimumOctantHeight()doubleminimumOctantWidth()static OctTreeConfigurationDof(com.io7m.jregions.core.unparameterized.volumes.VolumeD volume, double minimumOctantWidth, double minimumOctantHeight, double minimumOctantDepth, boolean trimOnRemove)Construct a new immutableOctTreeConfigurationDinstance.java.lang.StringtoString()Prints the immutable valueOctTreeConfigurationDwith attribute values.booleantrimOnRemove()com.io7m.jregions.core.unparameterized.volumes.VolumeDvolume()OctTreeConfigurationDwithMinimumOctantDepth(double value)Copy the current immutable object by setting a value for theminimumOctantDepthattribute.OctTreeConfigurationDwithMinimumOctantHeight(double value)Copy the current immutable object by setting a value for theminimumOctantHeightattribute.OctTreeConfigurationDwithMinimumOctantWidth(double value)Copy the current immutable object by setting a value for theminimumOctantWidthattribute.OctTreeConfigurationDwithTrimOnRemove(boolean value)Copy the current immutable object by setting a value for thetrimOnRemoveattribute.OctTreeConfigurationDwithVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeD value)Copy the current immutable object by setting a value for thevolumeattribute.
-
-
-
Method Detail
-
volume
public com.io7m.jregions.core.unparameterized.volumes.VolumeD volume()
- Specified by:
volumein interfaceOctTreeConfigurationDType- Returns:
- The maximum bounding volume of the tree
-
minimumOctantWidth
public double minimumOctantWidth()
- Specified by:
minimumOctantWidthin interfaceOctTreeConfigurationDType- Returns:
- The minimum width of octants (must be
>= 0.0001)
-
minimumOctantHeight
public double minimumOctantHeight()
- Specified by:
minimumOctantHeightin interfaceOctTreeConfigurationDType- Returns:
- The minimum height of octants (must be
>= 0.0001)
-
minimumOctantDepth
public double minimumOctantDepth()
- Specified by:
minimumOctantDepthin interfaceOctTreeConfigurationDType- Returns:
- The minimum depth of octants (must be
>= 0.0001)
-
trimOnRemove
public boolean trimOnRemove()
- Specified by:
trimOnRemovein interfaceOctTreeConfigurationDType- Returns:
trueiff the implementation should attempt to trim empty leaf nodes when an item is removed
-
withVolume
public final OctTreeConfigurationD withVolume(com.io7m.jregions.core.unparameterized.volumes.VolumeD value)
Copy the current immutable object by setting a value for thevolumeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for volume- Returns:
- A modified copy of the
thisobject
-
withMinimumOctantWidth
public final OctTreeConfigurationD withMinimumOctantWidth(double value)
Copy the current immutable object by setting a value for theminimumOctantWidthattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minimumOctantWidth- Returns:
- A modified copy of the
thisobject
-
withMinimumOctantHeight
public final OctTreeConfigurationD withMinimumOctantHeight(double value)
Copy the current immutable object by setting a value for theminimumOctantHeightattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minimumOctantHeight- Returns:
- A modified copy of the
thisobject
-
withMinimumOctantDepth
public final OctTreeConfigurationD withMinimumOctantDepth(double value)
Copy the current immutable object by setting a value for theminimumOctantDepthattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for minimumOctantDepth- Returns:
- A modified copy of the
thisobject
-
withTrimOnRemove
public final OctTreeConfigurationD withTrimOnRemove(boolean value)
Copy the current immutable object by setting a value for thetrimOnRemoveattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for trimOnRemove- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofOctTreeConfigurationDthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:volume,minimumOctantWidth,minimumOctantHeight,minimumOctantDepth,trimOnRemove.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueOctTreeConfigurationDwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static OctTreeConfigurationD of(com.io7m.jregions.core.unparameterized.volumes.VolumeD volume, double minimumOctantWidth, double minimumOctantHeight, double minimumOctantDepth, boolean trimOnRemove)
Construct a new immutableOctTreeConfigurationDinstance.- Parameters:
volume- The value for thevolumeattributeminimumOctantWidth- The value for theminimumOctantWidthattributeminimumOctantHeight- The value for theminimumOctantHeightattributeminimumOctantDepth- The value for theminimumOctantDepthattributetrimOnRemove- The value for thetrimOnRemoveattribute- Returns:
- An immutable OctTreeConfigurationD instance
-
copyOf
public static OctTreeConfigurationD copyOf(OctTreeConfigurationDType instance)
Creates an immutable copy of aOctTreeConfigurationDTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable OctTreeConfigurationD instance
-
builder
public static OctTreeConfigurationD.Builder builder()
Creates a builder forOctTreeConfigurationD.- Returns:
- A new OctTreeConfigurationD builder
-
-