artisynth.core.mfreemodels
Class MFreeNode3d

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.mechmodels.DynamicMechComponentBase
              extended by artisynth.core.mechmodels.Point
                  extended by artisynth.core.mechmodels.Particle
                      extended by artisynth.core.femmodels.FemNode
                          extended by artisynth.core.femmodels.FemNode3d
                              extended by artisynth.core.mfreemodels.MFreeNode3d
All Implemented Interfaces:
DynamicMechComponent, ForceEffector, MotionTargetComponent, MFreePoint3d, CopyableComponent, ModelComponent, RenderableComponent, Tracable, ScalableUnits, TransformableGeometry, java.lang.Cloneable, Boundable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, RenderablePoint, Scannable
Direct Known Subclasses:
MFreeHermiteNode3d

public class MFreeNode3d
extends FemNode3d
implements MFreePoint3d, Boundable


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static boolean DEFAULT_RENDER_BOUNDARY
           
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.mechmodels.Point
myRenderCoords
 
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
 
Fields inherited from interface artisynth.core.modelbase.CopyableComponent
COPY_REFERENCES
 
Constructor Summary
MFreeNode3d()
           
MFreeNode3d(double x, double y, double z)
           
MFreeNode3d(Point3d p)
           
 
Method Summary
 void addElementDependency(MFreeElement3d e)
           
 void addPartitionRestVolume(double pvol)
           
 void addPartitionVolume(double pvol)
           
 void addRestVolume(double pvol)
           
 void addVolume(double pvol)
           
 void computeCentroid(Vector3d centroid)
          Computed the centroid of this element.
 double computeCovariance(Matrix3d C)
          Computes the covariance of the element, assuming a uniform density of one.
 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).
 MFreeNode3d copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
          Create a copy of this component.
 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).
 double distance(Point pnt)
           
 double distance(Point3d pos)
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 PolygonalMesh getBoundaryMesh()
           
 java.util.ArrayList<MFreeNode3d> getDependentNodes()
           
 Vector3d getDisplacement()
           
 Vector3d getFalseDisplacement()
           
 void getFalseDisplacement(Vector3d disp)
           
 Point3d getFalsePosition()
           
 Vector3d getFalseVelocity()
           
 double getInfluenceRadius()
           
 java.util.LinkedList<MFreeElement3d> getMFreeElementDependencies()
           
 VectorNd getNodeCoordinates()
           
 double getPartitionRestVolume()
           
 double getPartitionVolume(double vol)
           
 Point3d getPoint(int idx)
          Returns the idx-th point associated with this element.
 Point3d getPosition()
           
 double getPressure()
           
 boolean getRenderBoundary()
           
 double getRestVolume()
           
 MFreeShapeFunction getShapeFunction()
           
 Vector3d getTargetDisplacement()
           
 int getTargetPos(double[] post, double s, double h, int idx)
           
 Point3d getTargetPosition()
           
 int getTargetVel(double[] velt, double s, double h, int idx)
           
 Vector3d getTargetVelocity()
           
 Point3d getTruePosition()
           
 Vector3d getTrueVelocity()
           
 Vector3d getVelocity()
           
 double getVolume()
           
 double getWeight(Point3d pos)
           
 MFreeWeightFunction getWeightFunction()
           
 boolean intersects(MFreeNode3d node)
           
 boolean isInDomain(Point3d pos, double tol)
           
 boolean isRadial()
           
 int numAdjacentElements()
           
 int numPoints()
          Returns the number of points associated with this element, if any, or zero otherwise.
 void prerender(RenderList list)
          Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.
 boolean reduceDependencies(double tol)
          Removes all dependencies with have very low weights ( |w| <= tol )
 void registerNodeNeighbor(MFreeNode3d nbrNode)
           
 void removeElementDependency(MFreeElement3d e)
           
 void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 void renderWidget(GLRenderer renderer, RenderProps props, int flags)
           
 void setBoundaryMesh(PolygonalMesh mesh)
           
 void setDependentNodes(java.util.List<MFreeNode3d> nodes, VectorNd coords)
           
 void setFalsePosition(Point3d pos)
           
 void setFalseVelocity(Vector3d vel)
           
 void setNodeCoordinates(VectorNd coords)
           
 void setPartitionRestVolume(double vol)
           
 void setPartitionVolume(double vol)
           
 void setRenderBoundary(boolean render)
           
 void setRestPosition(Point3d pos)
           
 void setRestVolume(double vol)
           
 void setShapeFunction(MFreeShapeFunction f)
           
 int setTargetPos(double[] post, int idx)
           
 int setTargetVel(double[] velt, int idx)
           
 void setVolume(double vol)
           
 void setWeightFunction(RadialWeightFunction f)
           
 void updateBoundaryMesh()
           
 void updateBounds(Point3d pmin, Point3d pmax)
          Update the minimum and maximum points for this object.
 void updatePosAndVelState()
           
 void updatePosState()
           
 void updateVelState()
           
 
Methods inherited from class artisynth.core.femmodels.FemNode3d
addElementDependency, addIndirectNeighbor, clearIndirectNeighbors, deregisterNodeNeighbor, getElementDependencies, getIncompressIndex, getIndex, getIndirectNeighbor, getIndirectNeighborBySolveIndex, getIndirectNeighbors, getInternalForce, getNodeNeighbor, getNodeNeighborBySolveIndex, getNodeNeighbors, getRestPosition, getStrain, getStress, getVonMisesStrain, getVonMisesStress, removeElementDependency, resetRestPosition, scaleDistance, scanItem, setIncompressIndex, setIndex, setStrain, setStress, setTargetDisplacement, transformGeometry, zeroStrain, zeroStress
 
Methods inherited from class artisynth.core.femmodels.FemNode
addMass
 
Methods inherited from class artisynth.core.mechmodels.Particle
applyGravity, applyPosImpulse, getConstraint, getCopyReferences, getInverseMass, getMass, getMass, getMass, getVelDerivative, isDuplicatable, scaleMass, setConstraint, setDynamic, setMass, transformGeometry
 
Methods inherited from class artisynth.core.mechmodels.Point
addExternalForce, addForce, addPosImpulse, addPosition, addPosJacobian, addScaledExternalForce, addScaledForce, addScaledPosition, addScaledVelocity, addSolveBlock, addSolveBlocks, addTargetJacobian, addToSolveBlockDiagonal, addVelJacobian, addVelocity, applyForces, createMassBlock, createSolveBlock, getExternalForce, getForce, getForce, getJacobianType, getMassForces, getPointDamping, getPointDampingMode, getPosDerivative, getPosition, getPosState, getPosStateSize, getRenderCoords, getRenderProps, getSelection, getState, getState, getTargetActivity, getTracables, getTracingProbe, getVelocity, getVelState, getVelStateSize, isMassConstant, isSelectable, resetTargets, setExternalForce, setForce, setForce, setForcesToExternal, setPointDamping, setPointDampingMode, setPosition, setPosition, setPosState, setRenderProps, setScaledExternalForce, setState, setState, setState, setTargetActivity, setTargetPosition, setTargetVelocity, setVelocity, setVelocity, setVelState, subForce, velocityLimitExceeded, zeroExternalForces, zeroForces
 
Methods inherited from class artisynth.core.mechmodels.DynamicMechComponentBase
addMasterAttachment, getAttachment, getMasterAttachments, getSolveIndex, hasState, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setSolveIndex
 
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase
getRenderHints, numSelectionQueriesNeeded, 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, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, 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.mfreemodels.MFreePoint3d
getRestPosition
 
Methods inherited from interface maspack.render.RenderablePoint
isSelected
 
Methods inherited from interface maspack.render.GLSelectable
numSelectionQueriesNeeded
 
Methods inherited from interface maspack.render.GLRenderable
getRenderHints
 
Methods inherited from interface artisynth.core.mechmodels.DynamicMechComponent
addMasterAttachment, checkFlag, clearFlag, getAttachment, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setFlag, setSolveIndex
 
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.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 

Field Detail

DEFAULT_RENDER_BOUNDARY

public static boolean DEFAULT_RENDER_BOUNDARY

myProps

public static PropertyList myProps
Constructor Detail

MFreeNode3d

public MFreeNode3d()

MFreeNode3d

public MFreeNode3d(Point3d p)

MFreeNode3d

public MFreeNode3d(double x,
                   double y,
                   double z)
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 FemNode3d
Returns:
static information for all exported properties

setRestPosition

public void setRestPosition(Point3d pos)
Overrides:
setRestPosition in class FemNode3d

setTargetPos

public int setTargetPos(double[] post,
                        int idx)
Specified by:
setTargetPos in interface MotionTargetComponent
Overrides:
setTargetPos in class Point

getTargetPos

public int getTargetPos(double[] post,
                        double s,
                        double h,
                        int idx)
Specified by:
getTargetPos in interface MotionTargetComponent
Overrides:
getTargetPos in class Point

getTargetPosition

public Point3d getTargetPosition()
Overrides:
getTargetPosition in class Point

getTargetDisplacement

public Vector3d getTargetDisplacement()
Overrides:
getTargetDisplacement in class FemNode3d

setTargetVel

public int setTargetVel(double[] velt,
                        int idx)
Specified by:
setTargetVel in interface MotionTargetComponent
Overrides:
setTargetVel in class Point

getTargetVel

public int getTargetVel(double[] velt,
                        double s,
                        double h,
                        int idx)
Specified by:
getTargetVel in interface MotionTargetComponent
Overrides:
getTargetVel in class Point

getTargetVelocity

public Vector3d getTargetVelocity()
Overrides:
getTargetVelocity in class Point

registerNodeNeighbor

public void registerNodeNeighbor(MFreeNode3d nbrNode)

addElementDependency

public void addElementDependency(MFreeElement3d e)

removeElementDependency

public void removeElementDependency(MFreeElement3d e)

getMFreeElementDependencies

public java.util.LinkedList<MFreeElement3d> getMFreeElementDependencies()

numAdjacentElements

public int numAdjacentElements()
Overrides:
numAdjacentElements in class FemNode3d

setWeightFunction

public void setWeightFunction(RadialWeightFunction f)

getWeightFunction

public MFreeWeightFunction getWeightFunction()

setShapeFunction

public void setShapeFunction(MFreeShapeFunction f)

getShapeFunction

public MFreeShapeFunction getShapeFunction()

isInDomain

public boolean isInDomain(Point3d pos,
                          double tol)

intersects

public boolean intersects(MFreeNode3d node)

getWeight

public double getWeight(Point3d pos)

copy

public MFreeNode3d copy(int flags,
                        java.util.Map<ModelComponent,ModelComponent> copyMap)
Description copied from interface: CopyableComponent
Create a copy of this component. If COPY_REFERENCES is set in flags, then any component referenced by this component should itself be set to a copy. This should be done first checking copyMap for an existing copy of the referenced component. If there is no existing copy, then a copy should be created by calling copy recursively and adding the new copy to copyMap.

Specified by:
copy in interface CopyableComponent
Overrides:
copy in class FemNode3d

getFalseDisplacement

public void getFalseDisplacement(Vector3d disp)

getFalseDisplacement

public Vector3d getFalseDisplacement()

getDisplacement

public Vector3d getDisplacement()
Overrides:
getDisplacement in class FemNode3d

getFalsePosition

public Point3d getFalsePosition()

setFalsePosition

public void setFalsePosition(Point3d pos)

getFalseVelocity

public Vector3d getFalseVelocity()

setFalseVelocity

public void setFalseVelocity(Vector3d vel)

getDependentNodes

public java.util.ArrayList<MFreeNode3d> getDependentNodes()
Specified by:
getDependentNodes in interface MFreePoint3d

setDependentNodes

public void setDependentNodes(java.util.List<MFreeNode3d> nodes,
                              VectorNd coords)
Specified by:
setDependentNodes in interface MFreePoint3d

reduceDependencies

public boolean reduceDependencies(double tol)
Description copied from interface: MFreePoint3d
Removes all dependencies with have very low weights ( |w| <= tol )

Specified by:
reduceDependencies in interface MFreePoint3d
Returns:
true if modified

getNodeCoordinates

public VectorNd getNodeCoordinates()
Specified by:
getNodeCoordinates in interface MFreePoint3d

setNodeCoordinates

public void setNodeCoordinates(VectorNd coords)
Specified by:
setNodeCoordinates in interface MFreePoint3d

updatePosAndVelState

public void updatePosAndVelState()
Specified by:
updatePosAndVelState in interface MFreePoint3d

updatePosState

public void updatePosState()
Specified by:
updatePosState in interface MFreePoint3d

updateVelState

public void updateVelState()
Specified by:
updateVelState in interface MFreePoint3d

getTruePosition

public Point3d getTruePosition()

getTrueVelocity

public Vector3d getTrueVelocity()

isRadial

public boolean isRadial()

getInfluenceRadius

public double getInfluenceRadius()

getPosition

public Point3d getPosition()
Specified by:
getPosition in interface MFreePoint3d
Overrides:
getPosition in class Point

getVelocity

public Vector3d getVelocity()
Overrides:
getVelocity in class Point

distance

public double distance(Point pnt)
Overrides:
distance in class Point

distance

public double distance(Point3d pos)
Overrides:
distance in class Point

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
Overrides:
prerender in class Point

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
Overrides:
createRenderProps in class Point
Returns:
new render properties for this object

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
Overrides:
render in class Point
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.

renderWidget

public void renderWidget(GLRenderer renderer,
                         RenderProps props,
                         int flags)

setBoundaryMesh

public void setBoundaryMesh(PolygonalMesh mesh)

getBoundaryMesh

public PolygonalMesh getBoundaryMesh()

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 FemNode3d

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 FemNode3d

computeCentroid

public void computeCentroid(Vector3d centroid)
Description copied from interface: Boundable
Computed the centroid of this element.

Specified by:
computeCentroid in interface Boundable
Parameters:
centroid - returns the computed centroid value.

computeCovariance

public double computeCovariance(Matrix3d C)
Description copied from interface: Boundable
Computes the covariance of the element, assuming a uniform density of one. The covariance is defined as
 int_V \rho x x^T dV,
 
where \rho is the density, x is any spatial point within the element, and the integral is evaluated over the element's spatial extent. The method returns the element's spatial size, which for elements of dimension 3, 2, 1, or 0 will be a volume, area, length, or discrete value.

Implementation of this method is optional, with non-implementation indicated by having the method return -1. Non-implementation may prevent the element from being enclosed within certain types of oriented bounding box (OBB) constructions.

Specified by:
computeCovariance in interface Boundable
Parameters:
C - returns the covariance
Returns:
spatial size of the element, or -1 if this method is not implemented.

updateBoundaryMesh

public void updateBoundaryMesh()

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 Boundable
Specified by:
updateBounds in interface GLRenderable
Overrides:
updateBounds in class Point
Parameters:
pmin - minimum point
pmax - maximum point

getRenderBoundary

public boolean getRenderBoundary()

setRenderBoundary

public void setRenderBoundary(boolean render)

setRestVolume

public void setRestVolume(double vol)

setPartitionRestVolume

public void setPartitionRestVolume(double vol)

setVolume

public void setVolume(double vol)

setPartitionVolume

public void setPartitionVolume(double vol)

getRestVolume

public double getRestVolume()

getPartitionVolume

public double getPartitionVolume(double vol)

getPartitionRestVolume

public double getPartitionRestVolume()

getVolume

public double getVolume()

addRestVolume

public void addRestVolume(double pvol)

addVolume

public void addVolume(double pvol)

addPartitionVolume

public void addPartitionVolume(double pvol)

addPartitionRestVolume

public void addPartitionRestVolume(double pvol)

getPressure

public double getPressure()

numPoints

public int numPoints()
Description copied from interface: Boundable
Returns the number of points associated with this element, if any, or zero otherwise. If the element has points, then it's spatial extent is assumed to be enclosed within their convex hull. At present, elements that do not have points cannot be enclosed within oriented bounding box (OBB) trees.

Specified by:
numPoints in interface Boundable
Returns:
number of points associated with this element

getPoint

public Point3d getPoint(int idx)
Description copied from interface: Boundable
Returns the idx-th point associated with this element.

Specified by:
getPoint in interface Boundable
Parameters:
idx - index of the point (must be on the range 0 to Boundable.numPoints()).
Returns:
idx-th point associated with this element. Must not be modified.