|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.vecmath.Tuple3f
javax.vecmath.Vector3f
jmri.util.PhysicalLocation
public class PhysicalLocation
PhysicalLocation Represents a physical location on the layout in 3D space. Dimension units are not specified, but should be kept consistent in all three dimensions for a given usage. Used by VSDecoder for spatially positioning sounds on the layout. Could also be used, for example, for velocity calculations between sensors, or for keying operations locations or panel icons to a physical map view of the layout.
| Field Summary | |
|---|---|
(package private) float[] |
f
|
static String |
NBPropertyKey
NBPropertyKey : Key name used when storing a PhysicalLocation as a NamedBean Property |
static PhysicalLocation |
Origin
Origin : constant representation of (0, 0, 0) |
| Fields inherited from class javax.vecmath.Tuple3f |
|---|
x, y, z |
| Constructor Summary | |
|---|---|
PhysicalLocation()
Default constructor |
|
PhysicalLocation(double x,
double y,
double z)
Constructor from X, Y, Z (double) |
|
PhysicalLocation(double x,
double y,
double z,
boolean is_tunnel)
Constructor from X, Y, Z (double) |
|
PhysicalLocation(float x,
float y,
float z)
Constructor from X, Y, Z (float) |
|
PhysicalLocation(float x,
float y,
float z,
boolean is_tunnel)
Constructor from X, Y, Z (float) + is_tunnel (boolean) |
|
PhysicalLocation(PhysicalLocation p)
Copy Constructor |
|
PhysicalLocation(javax.vecmath.Vector3d v)
|
|
PhysicalLocation(javax.vecmath.Vector3f v)
Constructor from Vector3f |
|
| Method Summary | |
|---|---|
Boolean |
equals(PhysicalLocation l)
equals() |
static PhysicalLocation |
getBeanPhysicalLocation(NamedBean b)
getBeanPhysicalLocation(NamedBean b) Extract the PhysicalLocation stored in NamedBean b, and return as a new PhysicalLocation object. |
static PhysicalLocationPanel |
getPanel(String title)
Get a panel component that can be used to view and/or edit a location. |
float |
getX()
Get X dimension |
float |
getY()
Get Y dimension |
float |
getZ()
Get Z dimension |
boolean |
isTunnel()
|
static PhysicalLocation |
parse(String pos)
Parse a string representation (x,y,z) Returns a new PhysicalLocation object. |
static void |
setBeanPhysicalLocation(PhysicalLocation p,
NamedBean b)
setBeanPhysicalLocation(PhysicalLocation p, NamedBean b) Store PhysicalLocation p as a property in NamedBean b. |
void |
setIsTunnel(boolean t)
|
void |
setX(float x)
Set X dimension |
void |
setY(float y)
Set Y dimension |
void |
setZ(float z)
Set Z dimension |
String |
toString()
toString() Output a string representation (x,y,z) |
javax.vecmath.Vector3d |
toVector3d()
|
void |
translate(PhysicalLocation ref)
translate() Translate this PhysicalLocation's coordinates to be relative to point "ref". |
static PhysicalLocation |
translate(PhysicalLocation loc,
PhysicalLocation ref)
translate() Return a PhysicalLocation that represents the position of point "loc" relative to reference point "ref". |
| Methods inherited from class javax.vecmath.Vector3f |
|---|
angle, cross, dot, length, lengthSquared, normalize, normalize |
| Methods inherited from class javax.vecmath.Tuple3f |
|---|
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clone, epsilonEquals, equals, equals, get, get, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, sub, sub |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
float[] f
public static final PhysicalLocation Origin
public static final String NBPropertyKey
| Constructor Detail |
|---|
public PhysicalLocation()
public PhysicalLocation(javax.vecmath.Vector3f v)
public PhysicalLocation(javax.vecmath.Vector3d v)
public PhysicalLocation(float x,
float y,
float z,
boolean is_tunnel)
public PhysicalLocation(float x,
float y,
float z)
public PhysicalLocation(double x,
double y,
double z)
public PhysicalLocation(double x,
double y,
double z,
boolean is_tunnel)
public PhysicalLocation(PhysicalLocation p)
| Method Detail |
|---|
public static PhysicalLocation translate(PhysicalLocation loc,
PhysicalLocation ref)
loc - : PhysicalLocation to translateref - : PhysicalLocation to use as new reference point (origin)
public static PhysicalLocation getBeanPhysicalLocation(NamedBean b)
b - : NamedBean
public static void setBeanPhysicalLocation(PhysicalLocation p,
NamedBean b)
p - PhysicalLocationb - NamedBeanpublic static PhysicalLocationPanel getPanel(String title)
public static PhysicalLocation parse(String pos)
pos - : String "(X, Y, Z)"
public String toString()
toString in class javax.vecmath.Tuple3fpublic javax.vecmath.Vector3d toVector3d()
public float getX()
public void setX(float x)
public float getY()
public void setY(float y)
public float getZ()
public void setZ(float z)
public boolean isTunnel()
public void setIsTunnel(boolean t)
public Boolean equals(PhysicalLocation l)
public void translate(PhysicalLocation ref)
ref - new reference (origin) point
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||