artisynth.core.modelbase
Class ControllerMonitorBase

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.ModelAgentBase
          extended by artisynth.core.modelbase.ControllerMonitorBase
All Implemented Interfaces:
HasState, ModelAgent, ModelComponent, RenderableComponent, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Scannable
Direct Known Subclasses:
ControllerBase, MonitorBase

public abstract class ControllerMonitorBase
extends ModelAgentBase
implements RenderableComponent


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, myProps, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
ControllerMonitorBase()
           
 
Method Summary
 ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
           
 RenderProps createRenderProps()
          Factory method to create render properties appropriate to this object.
 ComponentState createState(ComponentState prevState)
          Factory routine to create a state object for this component, which can then be used as an argument for HasState.setState(artisynth.core.modelbase.ComponentState) and HasState.getState(artisynth.core.modelbase.ComponentState).
 void getInitialState(ComponentState state)
           
 void getInitialState(ComponentState newstate, ComponentState oldstate)
          Gets an initial state for this component and returns the value in state.
 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.
 void getState(ComponentState state)
          Get the current state of this component.
 boolean hasState()
          Returns true if this component has state.
 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.
abstract  void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 void setInitialState(ComponentState state)
           
 void setRenderProps(RenderProps props)
          Assigns a new set of render properties to this object.
 void setState(ComponentState state)
          Set the state of this component.
 void updateBounds(Point3d pmin, Point3d pmax)
          Update the minimum and maximum points for this object.
 
Methods inherited from class artisynth.core.modelbase.ModelAgentBase
dispose, finalize, getModel, initialize, setModel, setModelFromComponent, write
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getAllPropertyInfo, 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getAllPropertyInfo, getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 

Constructor Detail

ControllerMonitorBase

public ControllerMonitorBase()
Method Detail

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

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

render

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

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

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

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.

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.

copy

public ModelComponent copy(int flags,
                           java.util.Map<ModelComponent,ModelComponent> copyMap)
Overrides:
copy in class ModelComponentBase

hasState

public boolean hasState()
Returns true if this component has state. Structure change events involving components that have state will cause the current state history of of the system to be cleared.

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

createState

public ComponentState createState(ComponentState prevState)
Factory routine to create a state object for this component, which can then be used as an argument for HasState.setState(artisynth.core.modelbase.ComponentState) and HasState.getState(artisynth.core.modelbase.ComponentState). The state object does not have to be set to the component's current state. If the component does not have any state information, this method should return an instance of EmptyState.

Specified by:
createState in interface HasState
Parameters:
prevState - If non-null, supplies a previous state that was created by this component and which can be used to provide pre-sizing hints.
Returns:
new object for storing this component's state

getState

public void getState(ComponentState state)
Get the current state of this component.

Specified by:
getState in interface HasState
Parameters:
state - receives the state information

setState

public void setState(ComponentState state)
Set the state of this component.

Specified by:
setState in interface HasState
Parameters:
state - state to be copied

getInitialState

public void getInitialState(ComponentState state)

getInitialState

public void getInitialState(ComponentState newstate,
                            ComponentState oldstate)
Description copied from interface: HasState
Gets an initial state for this component and returns the value in state. If prevstate is non-null, then it is assumed to contain a previous initial state value returned by this method, and state should be set to be as consistent with this previous state as possible. For example, suppose that this component currently contains subcomponents A, B, and C, while the prevstate contains the state from a previous time when it had components B, C, and D. Then state should contain substate values for B and C that are taken from prevstate. To facilitate this, the information returned in state should contain additional information such as the identities of all the (current) sub-components.

Specified by:
getInitialState in interface HasState
Parameters:
newstate - receives the state information
oldstate - previous state information; may be null.

setInitialState

public void setInitialState(ComponentState state)