artisynth.core.femmodels
Class AuxMaterialElementDesc

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.femmodels.AuxMaterialElementDesc
All Implemented Interfaces:
AuxiliaryMaterial, ModelComponent, RenderableComponent, ScalableUnits, TransformableGeometry, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Clonable, Scannable

public class AuxMaterialElementDesc
extends RenderableComponentBase
implements AuxiliaryMaterial, ScalableUnits, TransformableGeometry

A class wrapping the description of each FEM element. It implements the AuxiliaryMaterial required to mix material types together within a single element.


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface artisynth.core.util.TransformableGeometry
ARTICULATED, SIMULATING
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
AuxMaterialElementDesc()
           
AuxMaterialElementDesc(FemElement3d elem)
           
AuxMaterialElementDesc(FemElement3d elem, FemMaterial mat)
           
AuxMaterialElementDesc(FemElement3d elem, FemMaterial mat, double frac)
           
 
Method Summary
 void computeStress(SymmetricMatrix3d sigma, SolidDeformation def, IntegrationPoint3d pt, IntegrationData3d dt, FemMaterial baseMat)
           
 void computeTangent(Matrix6d D, SymmetricMatrix3d stress, SolidDeformation def, IntegrationPoint3d pt, IntegrationData3d dt, FemMaterial baseMat)
           
 void connectToHierarchy()
          Called by the system after this component is added to the component hierarchy (i.e., when it is added as a child of another CompositeComponent).
 void disconnectFromHierarchy()
          Called by the system after this component is removed from the component hierarchy (i.e., when it is removed as a child of its parent).
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 FemElement3d getElement()
           
 double getFraction()
           
 double[] getFractions()
           
 FemMaterial getMaterial()
           
 boolean hasSymmetricTangent()
           
 boolean isInvertible()
           
 void printElementReference(java.io.PrintWriter pw, CompositeComponent ancestor)
           
 void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 void renderFraction(GLRenderer renderer, RenderProps props, double rad, AuxMaterialBundle.FractionRenderType renderType)
           
 void scaleDistance(double s)
          Scales all distance coordinates.
 void scaleMass(double s)
          Scales all mass units.
 boolean scanItem(ReaderTokenizer rtok, java.util.Deque<ScanToken> tokens)
           
 void setElement(FemElement3d elem)
           
 void setFraction(double frac)
           
 void setFractions(double[] fracs)
           
 void setMaterial(FemMaterial mat)
           
 void transformGeometry(AffineTransform3dBase X)
          Applies an affine transformation to the geometry of this object.
 void transformGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
          Applies an affine transformation to the geometry of this object.
 void updateBounds(Point3d pmin, Point3d pmax)
          Update the minimum and maximum points for this object.
 void write(java.io.PrintWriter pw, NumberFormat fmt, java.lang.Object ref)
          Writes a text description of this element to a PrintWriter.
 
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase
copy, createRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, prerender, setRenderProps, updateRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface maspack.util.Clonable
clone
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

AuxMaterialElementDesc

public AuxMaterialElementDesc()

AuxMaterialElementDesc

public AuxMaterialElementDesc(FemElement3d elem)

AuxMaterialElementDesc

public AuxMaterialElementDesc(FemElement3d elem,
                              FemMaterial mat)

AuxMaterialElementDesc

public AuxMaterialElementDesc(FemElement3d elem,
                              FemMaterial mat,
                              double frac)
Method Detail

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Overrides:
getAllPropertyInfo in class ModelComponentBase
Returns:
static information for all exported properties

setFraction

public void setFraction(double frac)

setFractions

public void setFractions(double[] fracs)

getFraction

public double getFraction()

getFractions

public double[] getFractions()

getMaterial

public FemMaterial getMaterial()

setMaterial

public void setMaterial(FemMaterial mat)

isInvertible

public boolean isInvertible()
Specified by:
isInvertible in interface AuxiliaryMaterial

updateBounds

public void updateBounds(Point3d pmin,
                         Point3d pmax)
Description copied from interface: GLRenderable
Update the minimum and maximum points for this object. In an x-y-z coordinate system with x directed to the right and y directed upwards, the minimum and maximum points can be thought of as defining the left-lower-far and right-upper-near corners of a bounding cube. This method should only reduce the elements of the minimum point and increase the elements of the maximum point, since it may be used as part of an iteration to determine the bounding cube for several different objects.

Specified by:
updateBounds in interface GLRenderable
Overrides:
updateBounds in class RenderableComponentBase
Parameters:
pmin - minimum point
pmax - maximum point

computeStress

public void computeStress(SymmetricMatrix3d sigma,
                          SolidDeformation def,
                          IntegrationPoint3d pt,
                          IntegrationData3d dt,
                          FemMaterial baseMat)
Specified by:
computeStress in interface AuxiliaryMaterial

computeTangent

public void computeTangent(Matrix6d D,
                           SymmetricMatrix3d stress,
                           SolidDeformation def,
                           IntegrationPoint3d pt,
                           IntegrationData3d dt,
                           FemMaterial baseMat)
Specified by:
computeTangent in interface AuxiliaryMaterial

hasSymmetricTangent

public boolean hasSymmetricTangent()
Specified by:
hasSymmetricTangent in interface AuxiliaryMaterial

getElement

public FemElement3d getElement()

setElement

public void setElement(FemElement3d elem)

transformGeometry

public void transformGeometry(AffineTransform3dBase X)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. This method should be equivalent to
 transformGeometry (X, this, 0);
 

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - affine transformation

transformGeometry

public void transformGeometry(AffineTransform3dBase X,
                              TransformableGeometry topObject,
                              int flags)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. If recursively invoked within a component hierarchy, then topComponent should be the component for which the method was initially invoked. The variable flags provides information about the context in which the transformation is being applied. At present, the available flags are TransformableGeometry.SIMULATING and TransformableGeometry.ARTICULATED.

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - affine transformation
topObject - component on which the method was initially invoked
flags - provides information about the context in which the transformation is being applied.

scaleDistance

public void scaleDistance(double s)
Description copied from interface: ScalableUnits
Scales all distance coordinates.

Specified by:
scaleDistance in interface ScalableUnits
Parameters:
s - scaling factor

scaleMass

public void scaleMass(double s)
Description copied from interface: ScalableUnits
Scales all mass units.

Specified by:
scaleMass in interface ScalableUnits
Parameters:
s - scaling factor

connectToHierarchy

public void connectToHierarchy()
Description copied from class: ModelComponentBase
Called by the system after this component is added to the component hierarchy (i.e., when it is added as a child of another CompositeComponent). This method is responsible for doing any required hierarchy-dependent initialization.

When this method is called, ModelComponent.getParent() will return the new parent component; the system will have set this beforehand.

Specified by:
connectToHierarchy in interface ModelComponent
Overrides:
connectToHierarchy in class ModelComponentBase

disconnectFromHierarchy

public void disconnectFromHierarchy()
Description copied from class: ModelComponentBase
Called by the system after this component is removed from the component hierarchy (i.e., when it is removed as a child of its parent). This method is responsible for any required hierarchy-dependent deinitialization.

When this method is called, ModelComponent.getParent() will still return this original parent component; the system will set this to null after.

Specified by:
disconnectFromHierarchy in interface ModelComponent
Overrides:
disconnectFromHierarchy in class ModelComponentBase

printElementReference

public void printElementReference(java.io.PrintWriter pw,
                                  CompositeComponent ancestor)
                           throws java.io.IOException
Throws:
java.io.IOException

scanItem

public boolean scanItem(ReaderTokenizer rtok,
                        java.util.Deque<ScanToken> tokens)
                 throws java.io.IOException
Throws:
java.io.IOException

write

public void write(java.io.PrintWriter pw,
                  NumberFormat fmt,
                  java.lang.Object ref)
           throws java.io.IOException
Description copied from class: ModelComponentBase
Writes a text description of this element to a PrintWriter. The text description should be compatable with scan and complete enough to allow full reconstruction of the element.

Specified by:
write in interface Scannable
Overrides:
write in class ModelComponentBase
Parameters:
pw - stream for writing the element
fmt - numeric formating information
ref - optional reference object which can be used for producing references to other objects
Throws:
java.io.IOException - if an I/O error occured

render

public void render(GLRenderer renderer,
                   int flags)
Description copied from interface: GLRenderable
Render this object using Open GL via the JOGL.

Specified by:
render in interface GLRenderable
Specified by:
render in class RenderableComponentBase
Parameters:
renderer - renderer object which is used to perform the rendering. Provides pointers to GL and GLU, along with helper functions.
flags - supplies flags that may be used to control different aspects of the rendering. Flags are defined in GLRenderer and currently include GLRenderer.SELECTED, GLRenderer.VERTEX_COLORING, GLRenderer.HSV_COLOR_INTERPOLATION, GLRenderer.SORT_FACES, and GLRenderer.CLEAR_MESH_DISPLAY_LISTS.

renderFraction

public void renderFraction(GLRenderer renderer,
                           RenderProps props,
                           double rad,
                           AuxMaterialBundle.FractionRenderType renderType)