Package mgui.geometry.util
Class SpatialUnit
java.lang.Object
mgui.util.Unit
mgui.util.ScaledUnit
mgui.geometry.util.SpatialUnit
- All Implemented Interfaces:
java.lang.Comparable<Unit>
public class SpatialUnit extends ScaledUnit
Specifies a spatial unit, with respect to the default Java3D unit (meter). All subclasses must
implement the
convert method from the Unit interface.
SpatialUnit specifies no setter functions; the unit should be set from the constructor
and not changed.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields inherited from class mgui.util.ScaledUnit
conversion_factor, name, short_name -
Constructor Summary
Constructors Constructor Description SpatialUnit(java.lang.String long_name, java.lang.String short_name, double factor) -
Method Summary
Methods inherited from class mgui.util.ScaledUnit
getConversionToMeter, getName, getShortNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
SpatialUnit
public SpatialUnit(java.lang.String long_name, java.lang.String short_name, double factor)
-
-
Method Details
-
convert
Convertsvalue, specified withunit, to its equivalent in thisUnit.- Overrides:
convertin classScaledUnit- Parameters:
unit- the unit in whichvalueis currently specifiedvalue- the value to convert- Returns:
- the equivalent of
valuein this unit - Throws:
UnitConversionException
-