Class Subunit

java.lang.Object
  extended bySubunit

public class Subunit
extends java.lang.Object

Subunit holds information about a specific Subunit including its SubunitType, current Conformations, ID, Solution, location/velocity mass, radius, bound Subunits, and graphic.


Field Summary
 javax.vecmath.Vector3d mypos
           
 javax.vecmath.Quat4d myrot
           
 
Constructor Summary
Subunit()
          Constructs a Subunit with default SubunitType, and other default parameters
Subunit(SubunitType st, java.util.Vector doms, Solution soln, int id, javax.vecmath.Vector3d p, javax.vecmath.Quat4d r, javax.vecmath.Vector3d v, javax.vecmath.Quat4d rv)
          Constructs a Subunit with the specified SubunitType, current Conformations, Solution, ID, position, rotation, velocity, angular velocity, mass, and radius.
 
Method Summary
 void addPartner(Subunit s)
          Add Subunit s to this Subunit's list of bound partner Subunits
 boolean changeConf(int dmid, Conformation newConf)
          Changes the Conformation of Domain number domain to newconf.
 void detachGraphic()
          Detaches this Subunit's graphic from its parent Assembly graphic
 boolean equals(Subunit s)
          Returns true if this Subunit is Subunit s
 javax.vecmath.Vector3d getBindingSitePos(BindingSite bs)
          Returns the position of bs in relation to the parent Assembly
 javax.vecmath.Quat4d getBindingSiteRot(BindingSite bs)
          Returns the rotation of bs in relation to the parent Assembly
 java.util.Vector getBindSiteOrs()
          Returns a Vector of the rotations of this Subunit's current BindingSites
 java.util.Vector getBindSitePoses()
          Returns a Vector of the positions of this Subunit's current BindingSites
 java.util.Vector getBindSites()
          Returns a Vector of the Subunit's current BindingSites and resets the BindingSites' Domain ID's
 java.util.Vector getBoundSubunits()
          Returns a Vector of Subunits bound to this Subunit
 javax.vecmath.Vector3d getBSPos(BindingSite bs)
          Returns the position of bs in relation to this Subunit
 javax.vecmath.Quat4d getBSRot(BindingSite bs)
          Returns the rotation of bs in relation to this Subunit
 javax.media.j3d.Transform3D getBStoSubTransform(BindingSite bs)
          Returns the transform of bs in relation to this Subunit
 javax.vecmath.Vector3d getBSUptoSub(BindingSite bs)
          Returns the up vector of bs in relation to this Subunit
 java.util.Vector getConfs()
          Returns a Vector of current Conformations (one for each Domain)
 java.util.Vector getConnectingBSs(Subunit s)
          Returns a Vector of all the BindingSites that bind this Subunit to s.
 java.util.Vector getDomains()
           
 int getid()
          Returns this Subunit's ID
 double getMass()
          Returns this Subunit's mass
 javax.vecmath.Vector3d getPos()
          Returns this Subunit's position in relation to its Assembly
 double getRadius()
          Returns this Subunit's radius
 javax.vecmath.Quat4d getRot()
          Returns this Subunit's rotation in relation to its Assembly
 javax.vecmath.Quat4d getRotV()
          Returns this Subunit's rotational velocity in relation to its Assembly
 Solution getSoln()
          Returns this Subunit's Solution
 SubunitType getST()
          Returns this Subunit's SubunitType
 SubunitGraphic getSubunitGraphic()
          Returns this Subunit's SubunitGraphic
 javax.media.j3d.Transform3D getTransform()
           
 javax.vecmath.Vector3d getV()
          Returns this Subunit's velocity in relation to its Assembly
 boolean isBoundSubunit(Subunit s)
          Returns true if this Subunit is bound to s, false otherwise
 boolean isUnbound()
          Returns true if this Subunit is not bound to any other Subunit, false otherwise
 boolean removePartner(Subunit s)
          Removes the specified Subunit from the vector of bound partner Subunits.
 void setid(int i)
          Sets this Subunit's ID to i
 void setTrans(javax.media.j3d.Transform3D t)
          Sets this Subunit's transformation in relation to its Assembly to t
 java.lang.String toString()
          Returns a String version of this Subunit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mypos

public javax.vecmath.Vector3d mypos

myrot

public javax.vecmath.Quat4d myrot
Constructor Detail

Subunit

public Subunit()
Constructs a Subunit with default SubunitType, and other default parameters


Subunit

public Subunit(SubunitType st,
               java.util.Vector doms,
               Solution soln,
               int id,
               javax.vecmath.Vector3d p,
               javax.vecmath.Quat4d r,
               javax.vecmath.Vector3d v,
               javax.vecmath.Quat4d rv)
Constructs a Subunit with the specified SubunitType, current Conformations, Solution, ID, position, rotation, velocity, angular velocity, mass, and radius. A graphic is construced according to the parameters given

Parameters:
st - SubunitType
doms - Vector of Domains in this Subunit
soln - Solution this Simulation takes place in
id - int, this Subunit's ID
p - Vector3d, this Subunit's position relative to its Assembly
r - Quat4d, this Subunit's rotation relative to its Assembly
v - Vector3d, this Subunit's velocity relative to its Assembly
rv - Quat4d, this Subunit's rotational velocity relative to its Assembly
Method Detail

changeConf

public boolean changeConf(int dmid,
                          Conformation newConf)
Changes the Conformation of Domain number domain to newconf. If the conformation change failed, returns false, returns true otherwise.

Parameters:
dmid - int, ID of the Domain in question
Returns:
boolean

getBSPos

public javax.vecmath.Vector3d getBSPos(BindingSite bs)
Returns the position of bs in relation to this Subunit

Parameters:
bs - BindingSite off of this Subunit
Returns:
Vector3d

getBSRot

public javax.vecmath.Quat4d getBSRot(BindingSite bs)
Returns the rotation of bs in relation to this Subunit

Parameters:
bs - BindingSite off of this Subunit
Returns:
Quat4d

detachGraphic

public void detachGraphic()
Detaches this Subunit's graphic from its parent Assembly graphic


getSubunitGraphic

public SubunitGraphic getSubunitGraphic()
Returns this Subunit's SubunitGraphic

Returns:
SubunitGraphic

getPos

public javax.vecmath.Vector3d getPos()
Returns this Subunit's position in relation to its Assembly

Returns:
Vector3d

getRot

public javax.vecmath.Quat4d getRot()
Returns this Subunit's rotation in relation to its Assembly

Returns:
Quat4d

getRotV

public javax.vecmath.Quat4d getRotV()
Returns this Subunit's rotational velocity in relation to its Assembly

Returns:
Quat4d

getV

public javax.vecmath.Vector3d getV()
Returns this Subunit's velocity in relation to its Assembly

Returns:
Vector3d

getRadius

public double getRadius()
Returns this Subunit's radius

Returns:
double

getMass

public double getMass()
Returns this Subunit's mass

Returns:
double

getSoln

public Solution getSoln()
Returns this Subunit's Solution

Returns:
Solution

getST

public SubunitType getST()
Returns this Subunit's SubunitType

Returns:
SubunitType

getBoundSubunits

public java.util.Vector getBoundSubunits()
Returns a Vector of Subunits bound to this Subunit

Returns:
Vector of Subunits

setTrans

public void setTrans(javax.media.j3d.Transform3D t)
Sets this Subunit's transformation in relation to its Assembly to t

Parameters:
t - Transform3D

isBoundSubunit

public boolean isBoundSubunit(Subunit s)
Returns true if this Subunit is bound to s, false otherwise

Parameters:
s - Subunit
Returns:
boolean

getConnectingBSs

public java.util.Vector getConnectingBSs(Subunit s)
Returns a Vector of all the BindingSites that bind this Subunit to s. The Vector is arranged as: [this Subunit's bs, s's bound bs, this Subunit's bs2, s's bound bs2, ...]

Parameters:
s - Subunit
Returns:
Vector

isUnbound

public boolean isUnbound()
Returns true if this Subunit is not bound to any other Subunit, false otherwise

Returns:
boolean

addPartner

public void addPartner(Subunit s)
Add Subunit s to this Subunit's list of bound partner Subunits

Parameters:
s - Subunit to add

removePartner

public boolean removePartner(Subunit s)
Removes the specified Subunit from the vector of bound partner Subunits. Returns true if the removal was sucessful, false otherwise

Parameters:
s - Subunit to be removed
Returns:
boolean

getid

public int getid()
Returns this Subunit's ID

Returns:
int

setid

public void setid(int i)
Sets this Subunit's ID to i

Parameters:
i - int

equals

public boolean equals(Subunit s)
Returns true if this Subunit is Subunit s

Parameters:
s - Subunit
Returns:
boolean

getConfs

public java.util.Vector getConfs()
Returns a Vector of current Conformations (one for each Domain)

Returns:
Vector

getDomains

public java.util.Vector getDomains()

getBindSites

public java.util.Vector getBindSites()
Returns a Vector of the Subunit's current BindingSites and resets the BindingSites' Domain ID's

Returns:
Vector

getBindSitePoses

public java.util.Vector getBindSitePoses()
Returns a Vector of the positions of this Subunit's current BindingSites

Returns:
Vector

getBindSiteOrs

public java.util.Vector getBindSiteOrs()
Returns a Vector of the rotations of this Subunit's current BindingSites

Returns:
Vector

getBStoSubTransform

public javax.media.j3d.Transform3D getBStoSubTransform(BindingSite bs)
Returns the transform of bs in relation to this Subunit

Parameters:
bs - BindingSite
Returns:
Transform3D

getBSUptoSub

public javax.vecmath.Vector3d getBSUptoSub(BindingSite bs)
Returns the up vector of bs in relation to this Subunit

Parameters:
bs - BindingSite
Returns:
Vector3d

getTransform

public javax.media.j3d.Transform3D getTransform()

getBindingSitePos

public javax.vecmath.Vector3d getBindingSitePos(BindingSite bs)
Returns the position of bs in relation to the parent Assembly

Parameters:
bs - BindingSite
Returns:
Vector3d

getBindingSiteRot

public javax.vecmath.Quat4d getBindingSiteRot(BindingSite bs)
Returns the rotation of bs in relation to the parent Assembly

Parameters:
bs - BindingSite
Returns:
Quat4d

toString

public java.lang.String toString()
Returns a String version of this Subunit

Returns:
String