artisynth.core.renderables
Class TextLabeller3d

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.renderables.TextComponentBase
              extended by artisynth.core.renderables.TextLabeller3d
All Implemented Interfaces:
ModelComponent, RenderableComponent, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Disposable, Scannable

public class TextLabeller3d
extends TextComponentBase


Nested Class Summary
 
Nested classes/interfaces inherited from class artisynth.core.renderables.TextComponentBase
TextComponentBase.FontStyle, TextComponentBase.HorizontalAlignment, TextComponentBase.VerticalAlignment
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static boolean defaultByReference
           
static int defaultFontSize
           
static Point2d defaultTextOffset
           
static double defaultTextSize
           
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.renderables.TextComponentBase
defaultFontName, defaultHAlignment, defaultVAlignment
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
TextLabeller3d()
           
TextLabeller3d(java.lang.String name)
           
 
Method Summary
 int addItem(java.lang.String text, Point3d pos, AffineTransform3dBase trans, boolean byRef)
          Adds a label to draw
 int addItem(java.lang.String text, Point3d pos, boolean byRef)
          Adds a label to draw
 void clearItems()
          Clears all text items
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 int getRenderHints()
          Returns a bit code giving rendering hints about this renderable.
 Point2d getTextOffset()
          Sets space to add to the left/bottom
 double getTextSize()
          Returns the text scaling
 boolean isSelectable()
          Returns true if this object is in fact selectable.
 void labelPoints(java.util.List<? extends Point> pnts)
           
 void labelPoints(PointList<? extends Point> pnts)
           
 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.
 boolean removeItem(int id)
          Removes a label based on its ID number
 void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 void setTextOffset(double xOffset, double yOffset)
           
 void setTextOffset(Point2d offset)
          Sets space to add to the left/bottom
 
Methods inherited from class artisynth.core.renderables.TextComponentBase
createDefaultRenderProps, createRenderProps, dispose, getFontFamily, getFontSize, getFontStyle, getHorizontalAlignment, getVerticalAlignment, setFont, setFontFamily, setFontSize, setFontStyle, setHorizontalAlignment, setTextColor, setTextRenderer, setTextSize, setVerticalAlignment
 
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase
copy, getRenderProps, getSelection, prerender, setRenderProps, updateBounds, updateRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, 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, 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
connectToHierarchy, disconnectFromHierarchy, 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

defaultFontSize

public static int defaultFontSize

defaultTextSize

public static double defaultTextSize

defaultTextOffset

public static Point2d defaultTextOffset

defaultByReference

public static boolean defaultByReference

myProps

public static PropertyList myProps
Constructor Detail

TextLabeller3d

public TextLabeller3d()

TextLabeller3d

public TextLabeller3d(java.lang.String name)
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 TextComponentBase
Returns:
static information for all exported properties

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.

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
Overrides:
getRenderHints in class RenderableComponentBase
Returns:
bit code of rendering hints.

getTextSize

public double getTextSize()
Returns the text scaling

Overrides:
getTextSize in class TextComponentBase

setTextOffset

public void setTextOffset(Point2d offset)
Sets space to add to the left/bottom


setTextOffset

public void setTextOffset(double xOffset,
                          double yOffset)

getTextOffset

public Point2d getTextOffset()
Sets space to add to the left/bottom


addItem

public int addItem(java.lang.String text,
                   Point3d pos,
                   boolean byRef)
Adds a label to draw

Parameters:
text - text to display
pos - position of text in 3D world
byRef - if true, sets the point by reference
Returns:
in ID number which can be used to remove the label

addItem

public int addItem(java.lang.String text,
                   Point3d pos,
                   AffineTransform3dBase trans,
                   boolean byRef)
Adds a label to draw

Parameters:
text - text to display
pos - position of text in 3D world
trans - transform to apply to position when rendering
byRef - if true, sets the point/transform by reference
Returns:
in ID number which can be used to remove the label

removeItem

public boolean removeItem(int id)
Removes a label based on its ID number


clearItems

public void clearItems()
Clears all text items


labelPoints

public void labelPoints(java.util.List<? extends Point> pnts)

labelPoints

public void labelPoints(PointList<? extends Point> pnts)

isSelectable

public boolean isSelectable()
Description copied from class: RenderableComponentBase
Returns true if this object is in fact selectable.

Specified by:
isSelectable in interface GLSelectable
Overrides:
isSelectable in class TextComponentBase
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
Overrides:
numSelectionQueriesNeeded in class TextComponentBase
Returns:
maximum number of selection queries needed by this component, or -1 if this component does not manage its own selection.