artisynth.core.femmodels
Class AuxMaterialBundle

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.CompositeComponentBase
          extended by artisynth.core.femmodels.AuxMaterialBundle
All Implemented Interfaces:
ComponentChangeListener, CompositeComponent, IndexedComponentList, ModelComponent, RenderableComponent, TransformableGeometry, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Scannable

public class AuxMaterialBundle
extends CompositeComponentBase
implements RenderableComponent, TransformableGeometry


Nested Class Summary
static class AuxMaterialBundle.FractionRenderType
           
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.CompositeComponent
CompositeComponent.NavpanelDisplay
 
Field Summary
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Fields inherited from interface artisynth.core.util.TransformableGeometry
ARTICULATED, SIMULATING
 
Constructor Summary
AuxMaterialBundle()
           
AuxMaterialBundle(java.lang.String name)
           
 
Method Summary
 void addElement(AuxMaterialElementDesc desc)
           
 void checkElementDesc(FemModel femMod, AuxMaterialElementDesc desc)
           
 void clearElements()
           
 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).
static FemMaterial createDefaultMaterial()
           
 RenderProps createRenderProps()
          Factory method to create render properties appropriate to this object.
 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.
static FemModel3d getAncestorFem(ModelComponent comp)
           
 AuxMaterialElementDescList getElements()
           
 double getElementWidgetSize()
           
 PropertyMode getElementWidgetSizeMode()
           
 double getFractionRenderRadius()
           
 PropertyMode getFractionRenderRadiusMode()
           
 AuxMaterialBundle.FractionRenderType getFractionRenderType()
           
 PropertyMode getFractionRenderTypeMode()
           
 FemMaterial getMaterial()
           
 int getRenderHints()
          Returns a bit code giving rendering hints about this renderable.
 RenderProps getRenderProps()
          Returns the render properities for this object.
 void getSelection(java.util.LinkedList<java.lang.Object> list, int qid)
          Append to list the component (or components) associated with the qid-th selection query issued by this component's render method.
 boolean isSelectable()
          Returns true if this object is in fact selectable.
 int numSelectionQueriesNeeded()
          If this selectable manages its own selection (by issuing selection queries within its render method), then this method should return the maximum number of selection queries that will be required.
 void prerender(RenderList list)
          Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.
 boolean removeElement(AuxMaterialElementDesc desc)
           
 void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 void scaleDistance(double s)
           
 void scaleMass(double s)
           
 void setDefaultValues()
          Sets the attributes of this component to their default values.
 void setElementWidgetSize(double size)
           
 void setElementWidgetSizeMode(PropertyMode mode)
           
 void setFractionRenderRadius(double size)
           
 void setFractionRenderRadiusMode(PropertyMode mode)
           
 void setFractionRenderType(AuxMaterialBundle.FractionRenderType type)
           
 void setFractionRenderTypeMode(PropertyMode mode)
           
 void setMaterial(FemMaterial mat)
           
 void setRenderProps(RenderProps props)
          Assigns a new set of render properties to this object.
 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.
 
Methods inherited from class artisynth.core.modelbase.CompositeComponentBase
componentChanged, copy, findComponent, get, get, getByNumber, getChildren, getNavpanelDisplay, getNumberLimit, hasChildren, hasState, hierarchyContainsReferences, indexOf, iterator, numComponents, postscan, scan, setDisplayMode, updateNameMap
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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, write
 

Field Detail

myProps

public static PropertyList myProps
Constructor Detail

AuxMaterialBundle

public AuxMaterialBundle()

AuxMaterialBundle

public AuxMaterialBundle(java.lang.String name)
Method Detail

setDefaultValues

public void setDefaultValues()
Description copied from class: ModelComponentBase
Sets the attributes of this component to their default values.


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

setElementWidgetSize

public void setElementWidgetSize(double size)

getElementWidgetSize

public double getElementWidgetSize()

setElementWidgetSizeMode

public void setElementWidgetSizeMode(PropertyMode mode)

getElementWidgetSizeMode

public PropertyMode getElementWidgetSizeMode()

setFractionRenderRadius

public void setFractionRenderRadius(double size)

getFractionRenderRadius

public double getFractionRenderRadius()

setFractionRenderRadiusMode

public void setFractionRenderRadiusMode(PropertyMode mode)

getFractionRenderRadiusMode

public PropertyMode getFractionRenderRadiusMode()

setFractionRenderType

public void setFractionRenderType(AuxMaterialBundle.FractionRenderType type)

getFractionRenderType

public AuxMaterialBundle.FractionRenderType getFractionRenderType()

setFractionRenderTypeMode

public void setFractionRenderTypeMode(PropertyMode mode)

getFractionRenderTypeMode

public PropertyMode getFractionRenderTypeMode()

createDefaultMaterial

public static FemMaterial createDefaultMaterial()

getMaterial

public FemMaterial getMaterial()

setMaterial

public void setMaterial(FemMaterial mat)

checkElementDesc

public void checkElementDesc(FemModel femMod,
                             AuxMaterialElementDesc desc)

getElements

public AuxMaterialElementDescList getElements()

addElement

public void addElement(AuxMaterialElementDesc desc)

removeElement

public boolean removeElement(AuxMaterialElementDesc desc)

clearElements

public void clearElements()

getAncestorFem

public static FemModel3d getAncestorFem(ModelComponent comp)

createRenderProps

public RenderProps createRenderProps()
Description copied from interface: HasRenderProps
Factory method to create render properties appropriate to this object.

Specified by:
createRenderProps in interface HasRenderProps
Returns:
new render properties for this object

getRenderProps

public RenderProps getRenderProps()
Description copied from interface: HasRenderProps
Returns the render properities for this object. If no render properties are assigned, this routines returns null.

Specified by:
getRenderProps in interface HasRenderProps
Returns:
current render properties for this object

setRenderProps

public void setRenderProps(RenderProps props)
Description copied from interface: HasRenderProps
Assigns a new set of render properties to this object. An argument of null will remove render properties from this object.

Specified by:
setRenderProps in interface HasRenderProps
Parameters:
props - new render properties for this object

prerender

public void prerender(RenderList list)
Description copied from interface: GLRenderable
Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.

Specified by:
prerender in interface GLRenderable

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
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.

isSelectable

public boolean isSelectable()
Returns true if this object is in fact selectable.

Specified by:
isSelectable in interface GLSelectable
Returns:
true if this object is selectable

numSelectionQueriesNeeded

public int numSelectionQueriesNeeded()
Description copied from interface: GLSelectable
If this selectable manages its own selection (by issuing selection queries within its render method), then this method should return the maximum number of selection queries that will be required. Otherwise, this method should return -1.

Specified by:
numSelectionQueriesNeeded in interface GLSelectable
Returns:
maximum number of selection queries needed by this component, or -1 if this component does not manage its own selection.

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
Parameters:
pmin - minimum point
pmax - maximum point

getRenderHints

public int getRenderHints()
Description copied from interface: GLRenderable
Returns a bit code giving rendering hints about this renderable. Current bit codes include TRANSLUCENT.

Specified by:
getRenderHints in interface GLRenderable
Returns:
bit code of rendering hints.

getSelection

public void getSelection(java.util.LinkedList<java.lang.Object> list,
                         int qid)
Description copied from interface: GLSelectable
Append to list the component (or components) associated with the qid-th selection query issued by this component's render method. This will only be called if this component manages its own selection (i.e., the number nums returned by GLSelectable.numSelectionQueriesNeeded() is positive), and qid will in turn be a number between 0 and nums-1.

Specified by:
getSelection in interface GLSelectable
Parameters:
list - selected objects are appended to the end of this list
qid - index of the selection query

scaleDistance

public void scaleDistance(double s)

scaleMass

public void scaleMass(double s)

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

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.