generativedesign
Class Node

java.lang.Object
  extended by processing.core.PVector
      extended by generativedesign.Node
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Attractor

public class Node
extends PVector

The node class supplies a basic object for physical simulations. It has a position (which can be constrained), a velocity vector with damping and it can attract or repulse other nodes.

See Also:
Serialized Form

Field Summary
 float damping
          Damping of the velocity: 0=no damping, 1=full damping (default = 0.5)
 float diameter
          Diameter of the node (useful if a click on the node has to be checked)
 String id
           
 float maxVelocity
          Maximum length of the velocity vector (default = 10)
 float maxX
          Maximum x position
 float maxY
          Maximum y position
 float maxZ
          Maximum z position
 float minX
          Minimum x position
 float minY
          Minimum y position
 float minZ
          Minimum z position
 float radius
           
 float ramp
           
 float strength
           
 PVector velocity
          Velocity vector (speed)
 
Fields inherited from class processing.core.PVector
x, y, z
 
Constructor Summary
Node()
           
Node(float theX, float theY)
           
Node(float theX, float theY, float theZ)
           
Node(PVector theVector)
           
 
Method Summary
 void attract(Node theNode)
           
 void attract(Node[] theNodes)
           
 float getDamping()
           
 float getDiameter()
           
 String getID()
           
 float getMaxVelocity()
           
 float getMaxX()
           
 float getMaxY()
           
 float getMaxZ()
           
 float getMinX()
           
 float getMinY()
           
 float getMinZ()
           
 float getRadius()
           
 float getRamp()
           
 float getStrength()
           
 PVector getVelocity()
           
 void rotateX(float theAngle)
           
 void rotateY(float theAngle)
           
 void rotateZ(float theAngle)
           
 void setBoundary(float theMinX, float theMinY, float theMaxX, float theMaxY)
           
 void setBoundary(float theMinX, float theMinY, float theMinZ, float theMaxX, float theMaxY, float theMaxZ)
           
 void setDamping(float theDamping)
           
 void setDiameter(float theDiameter)
           
 void setID(String theID)
           
 void setMaxVelocity(float theMaxVelocity)
           
 void setMaxX(float theMaxX)
           
 void setMaxY(float theMaxY)
           
 void setMaxZ(float theMaxZ)
           
 void setMinX(float theMinX)
           
 void setMinY(float theMinY)
           
 void setMinZ(float theMinZ)
           
 void setRadius(float theRadius)
           
 void setRamp(float theRamp)
           
 void setStrength(float theStrength)
           
 void setVelocity(PVector theVelocity)
           
 void update()
           
 void update(boolean theLockX, boolean theLockY, boolean theLockZ)
           
 
Methods inherited from class processing.core.PVector
add, add, add, add, add, angleBetween, array, copy, cross, cross, cross, dist, dist, div, div, div, dot, dot, dot, equals, fromAngle, fromAngle, get, get, hashCode, heading, heading2D, lerp, lerp, lerp, limit, mag, magSq, mult, mult, mult, normalize, normalize, random2D, random2D, random2D, random2D, random3D, random3D, random3D, random3D, rotate, set, set, set, set, setMag, setMag, sub, sub, sub, sub, sub, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public String id

diameter

public float diameter
Diameter of the node (useful if a click on the node has to be checked)


minX

public float minX
Minimum x position


maxX

public float maxX
Maximum x position


minY

public float minY
Minimum y position


maxY

public float maxY
Maximum y position


minZ

public float minZ
Minimum z position


maxZ

public float maxZ
Maximum z position


velocity

public PVector velocity
Velocity vector (speed)


maxVelocity

public float maxVelocity
Maximum length of the velocity vector (default = 10)


damping

public float damping
Damping of the velocity: 0=no damping, 1=full damping (default = 0.5)


radius

public float radius

strength

public float strength

ramp

public float ramp
Constructor Detail

Node

public Node()

Node

public Node(float theX,
            float theY)

Node

public Node(float theX,
            float theY,
            float theZ)

Node

public Node(PVector theVector)
Method Detail

rotateX

public void rotateX(float theAngle)

rotateY

public void rotateY(float theAngle)

rotateZ

public void rotateZ(float theAngle)

attract

public void attract(Node[] theNodes)

attract

public void attract(Node theNode)

update

public void update()

update

public void update(boolean theLockX,
                   boolean theLockY,
                   boolean theLockZ)

getID

public String getID()

setID

public void setID(String theID)

getDiameter

public float getDiameter()

setDiameter

public void setDiameter(float theDiameter)

setBoundary

public void setBoundary(float theMinX,
                        float theMinY,
                        float theMinZ,
                        float theMaxX,
                        float theMaxY,
                        float theMaxZ)

setBoundary

public void setBoundary(float theMinX,
                        float theMinY,
                        float theMaxX,
                        float theMaxY)

getMinX

public float getMinX()

setMinX

public void setMinX(float theMinX)

getMaxX

public float getMaxX()

setMaxX

public void setMaxX(float theMaxX)

getMinY

public float getMinY()

setMinY

public void setMinY(float theMinY)

getMaxY

public float getMaxY()

setMaxY

public void setMaxY(float theMaxY)

getMinZ

public float getMinZ()

setMinZ

public void setMinZ(float theMinZ)

getMaxZ

public float getMaxZ()

setMaxZ

public void setMaxZ(float theMaxZ)

getVelocity

public PVector getVelocity()

setVelocity

public void setVelocity(PVector theVelocity)

getMaxVelocity

public float getMaxVelocity()

setMaxVelocity

public void setMaxVelocity(float theMaxVelocity)

getDamping

public float getDamping()

setDamping

public void setDamping(float theDamping)

getRadius

public float getRadius()

setRadius

public void setRadius(float theRadius)

getStrength

public float getStrength()

setStrength

public void setStrength(float theStrength)

getRamp

public float getRamp()

setRamp

public void setRamp(float theRamp)


Processing Library generativedesign by Hartmut Bohnacker, Benedikt Gross. (c) 2015