de.grogra.imp3d.objects
Class Supershape

java.lang.Object
  extended by de.grogra.graph.impl.Edge
      extended by de.grogra.graph.impl.Node
          extended by de.grogra.imp3d.objects.Null
              extended by de.grogra.imp3d.objects.ShadedNull
                  extended by de.grogra.imp3d.objects.Supershape
All Implemented Interfaces:
Transformation, Pickable, Renderable, Manageable, PersistenceCapable, Shareable, UserFields, XObject, Map, java.io.Serializable

public class Supershape
extends ShadedNull
implements Pickable, Renderable

This class represents a supershape. An implementation of Johan Gielis's Superformula which was published in the American Journal of Botany 90(3): 333–338. 2003. INVITED SPECIAL PAPER A GENERIC GEOMETRIC TRANSFORMATION THAT UNIFIES A WIDE RANGE OF NATURAL AND ABSTRACT SHAPES

Author:
MH
See Also:
Serialized Form

Nested Class Summary
static class Supershape.Pattern
           
 
Nested classes/interfaces inherited from class de.grogra.graph.impl.Node
Node.AccessorBridge, Node.FieldAttributeAccessor, Node.NType
 
Nested classes/interfaces inherited from interface de.grogra.util.Map
Map.Chain
 
Field Summary
static Node.NType $TYPE
           
protected  float a
           
protected static float A_MAX
           
protected static float A_MIN
           
static Node.NType.Field a$FIELD
           
protected  float b
           
protected static float B_MAX
           
protected static float B_MIN
           
static Node.NType.Field b$FIELD
           
protected static float M_MAX
           
protected static float M_MIN
           
protected  float m1
           
static Node.NType.Field m1$FIELD
           
protected  float m2
           
static Node.NType.Field m2$FIELD
           
protected static float N1_MAX
           
protected static float N1_MIN
           
protected  float n11
           
static Node.NType.Field n11$FIELD
           
protected  float n12
           
static Node.NType.Field n12$FIELD
           
protected  float n13
           
static Node.NType.Field n13$FIELD
           
protected static float N2_MAX
           
protected static float N2_MIN
           
protected  float n21
           
static Node.NType.Field n21$FIELD
           
protected  float n22
           
static Node.NType.Field n22$FIELD
           
protected  float n23
           
static Node.NType.Field n23$FIELD
           
protected static float N3_MAX
           
protected static float N3_MIN
           
 
Fields inherited from class de.grogra.imp3d.objects.ShadedNull
INFINITE_MASK, interior, interior$FIELD, shader, shader$FIELD, treatedAsInfinite$FIELD, USED_BITS
 
Fields inherited from class de.grogra.imp3d.objects.Null
transform, transform$FIELD, TRANSFORMING_MASK, transforming$FIELD
 
Fields inherited from class de.grogra.graph.impl.Node
ADDITIONAL_FIELDS, bits, DELETED, EXTENT_BIT, EXTENT_MASK, extentIndex$FIELD, extentTail$FIELD, HAS_OBSERVERS, IS_INTERPRETIVE, isInterpretive$FIELD, LAST_EXTENT_INDEX, layer$FIELD, MARK, mark$FIELD, MIME_TYPE, MIN_UNUSED_SPECIAL_OF_SOURCE, MIN_UNUSED_SPECIAL_OF_TARGET, name$FIELD
 
Fields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAP
 
Constructor Summary
Supershape()
           
Supershape(float a, float b, float m, float n1, float n2, float n3)
           
Supershape(float a, float b, float m1, float n11, float n12, float n13, float m2, float n21, float n22, float n23)
           
 
Method Summary
 void draw(java.lang.Object object, boolean asNode, RenderState rs)
           
 float getA()
           
 float getB()
           
 float getM1()
           
 float getM2()
           
 float getN11()
           
 float getN12()
           
 float getN13()
           
 float getN21()
           
 float getN22()
           
 float getN23()
           
protected  Node.NType getNTypeImpl()
          This method returns the Node.NType which describes the managed fields of the class of this node.
protected  Node newInstance()
          This method returns a new instance of the class of this node.
 void pick(java.lang.Object object, boolean asNode, Point3d origin, Vector3d direction, Matrix4d transformation, PickList list)
          Computes intersections of a given ray with this shape.
 void setA(float value)
           
 void setB(float value)
           
 void setM1(float value)
           
 void setM2(float value)
           
 void setN11(float value)
           
 void setN12(float value)
           
 void setN13(float value)
           
 void setN21(float value)
           
 void setN22(float value)
           
 void setN23(float value)
           
 
Methods inherited from class de.grogra.imp3d.objects.ShadedNull
getInterior, getShader, getSymbolColor, isTreatedAsInfinite, setBackShader, setColor, setColor, setFrontShader, setInterior, setMaterial, setShader, setShaders, setTreatedAsInfinite
 
Methods inherited from class de.grogra.imp3d.objects.Null
getLocalTransformation, getTransform, getTranslation, isTransforming, postTransform, preTransform, setRotation, setScale, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransforming, setTranslation
 
Methods inherited from class de.grogra.graph.impl.Node
addEdgeBitsTo, addReference, appendBranchNode, appendBranchNode, appendReferencesTo, clone, clone, cloneGraph, dump, dumpTree, dup, dupUnmanagedFields, edgeChanged, fieldModified, findAdjacent, get, getAccessor, getAccessor, getAttributes, getAxisParent, getBoolean, getBranch, getBranchLength, getBranchNode, getBranchTail, getByte, getChar, getCommonAncestor, getCurrentGraphState, getDirectChildCount, getDouble, getEdgeAttributeAccessor, getEdgeAttributes, getEdgeBitsTo, getEdgeTo, getExtentIndex, getFirst, getFirstEdge, getFloat, getGraph, getId, getIndex, getInstantiator, getInt, getLayer, getLong, getManageableType, getName, getNeighbor, getNext, getNType, getObject, getOrCreateEdgeTo, getOrNull, getPersistenceManager, getPredecessor, getProvider, getShort, getSource, getStamp, getSuccessor, getSymbol, getTarget, getTransaction, getUserField, getUserFieldCount, getXClass, getXData, hasName, initProvider, initXClass, insertBranchNode, insertBranchNode, instantiateGraph, isAncestorOf, isDirection, isManagingInstance, isMarked, isRoot, isSource, isTarget, manageableReadResolve, manageableWriteReplace, paramString, removeAll, removeEdgeBitsTo, removeFromChain, removeFromChain, removeReference, setBranch, setBranch, setExtentIndex, setGraphForDeserialization, setLayer, setMark, setName, setSuccessor, setSuccessor, specialEdgeAdded, specialEdgeRefModified, specialEdgeRemoved, toString, writeReplace
 
Methods inherited from class de.grogra.graph.impl.Edge
addEdgeBits, getBitMark, getEdgeBits, getObjectMark, getSpecialEdgeDescriptor, parseEdgeKeys, remove, removeEdgeBits, setBitMark, setEdgeBits, setObjectMark, testEdgeBits
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.grogra.persistence.PersistenceCapable
getBitMark, getObjectMark, setBitMark, setObjectMark
 

Field Detail

$TYPE

public static final Node.NType $TYPE

a

protected float a

A_MAX

protected static final float A_MAX
See Also:
Constant Field Values

A_MIN

protected static final float A_MIN
See Also:
Constant Field Values

a$FIELD

public static final Node.NType.Field a$FIELD

b

protected float b

B_MAX

protected static final float B_MAX
See Also:
Constant Field Values

B_MIN

protected static final float B_MIN
See Also:
Constant Field Values

b$FIELD

public static final Node.NType.Field b$FIELD

M_MAX

protected static final float M_MAX
See Also:
Constant Field Values

M_MIN

protected static final float M_MIN
See Also:
Constant Field Values

m1

protected float m1

m1$FIELD

public static final Node.NType.Field m1$FIELD

m2

protected float m2

m2$FIELD

public static final Node.NType.Field m2$FIELD

N1_MAX

protected static final float N1_MAX
See Also:
Constant Field Values

N1_MIN

protected static final float N1_MIN
See Also:
Constant Field Values

n11

protected float n11

n11$FIELD

public static final Node.NType.Field n11$FIELD

n12

protected float n12

n12$FIELD

public static final Node.NType.Field n12$FIELD

n13

protected float n13

n13$FIELD

public static final Node.NType.Field n13$FIELD

N2_MAX

protected static final float N2_MAX
See Also:
Constant Field Values

N2_MIN

protected static final float N2_MIN
See Also:
Constant Field Values

n21

protected float n21

n21$FIELD

public static final Node.NType.Field n21$FIELD

n22

protected float n22

n22$FIELD

public static final Node.NType.Field n22$FIELD

n23

protected float n23

n23$FIELD

public static final Node.NType.Field n23$FIELD

N3_MAX

protected static final float N3_MAX
See Also:
Constant Field Values

N3_MIN

protected static final float N3_MIN
See Also:
Constant Field Values
Constructor Detail

Supershape

public Supershape()

Supershape

public Supershape(float a,
                  float b,
                  float m,
                  float n1,
                  float n2,
                  float n3)

Supershape

public Supershape(float a,
                  float b,
                  float m1,
                  float n11,
                  float n12,
                  float n13,
                  float m2,
                  float n21,
                  float n22,
                  float n23)
Method Detail

draw

public void draw(java.lang.Object object,
                 boolean asNode,
                 RenderState rs)
Specified by:
draw in interface Renderable

getA

public float getA()

getB

public float getB()

getM1

public float getM1()

getM2

public float getM2()

getN11

public float getN11()

getN12

public float getN12()

getN13

public float getN13()

getN21

public float getN21()

getN22

public float getN22()

getN23

public float getN23()

getNTypeImpl

protected Node.NType getNTypeImpl()
Description copied from class: Node
This method returns the Node.NType which describes the managed fields of the class of this node. This method has to be implemented in every concrete subclass.

Overrides:
getNTypeImpl in class ShadedNull
Returns:
type describing the managed fields of the class of this node

newInstance

protected Node newInstance()
Description copied from class: Node
This method returns a new instance of the class of this node. This method has to be implemented in every concrete subclass.

Overrides:
newInstance in class ShadedNull
Returns:
new instance of class of this node

pick

public void pick(java.lang.Object object,
                 boolean asNode,
                 Point3d origin,
                 Vector3d direction,
                 Matrix4d transformation,
                 PickList list)
Description copied from interface: Pickable
Computes intersections of a given ray with this shape.

Specified by:
pick in interface Pickable
Parameters:
object - the object of which this shape is an attribute
asNode - true iff object is a node
origin - the origin of the ray, in local coordinates
direction - the direction of the ray, in local coordinates
transformation - the transformation from local coordinates to world coordinates
list - the list to which intersections have to be added

setA

public void setA(float value)

setB

public void setB(float value)

setM1

public void setM1(float value)

setM2

public void setM2(float value)

setN11

public void setN11(float value)

setN12

public void setN12(float value)

setN13

public void setN13(float value)

setN21

public void setN21(float value)

setN22

public void setN22(float value)

setN23

public void setN23(float value)