artisynth.core.renderables
Class HudPrintStream

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.HudPrintStream
All Implemented Interfaces:
ModelComponent, RenderableComponent, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Disposable, Scannable

public class HudPrintStream
extends TextComponentBase

Simple component to print info on the main viewer


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 int defaultBufferSize
           
static java.lang.String defaultFontName
           
static double defaultLineSpacing
           
static int defaultNumDisplayLines
           
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.renderables.TextComponentBase
defaultFontSize, defaultHAlignment, defaultTextSize, 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
HudPrintStream()
          Basic component, defaulting to 5 lines of 12pt monospaced font in bottom left corner
 
Method Summary
 void clear()
          Clears the buffer
 void cls()
          Appends blank lines to clear the screen
 void fullscreen()
          Makes the HUD full-screen according to the viewer's current height
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 int getBufferSize()
          Returns maximum size of line buffer
 double getLineSpacing()
          Gets the line spacing
 int getNumDisplayLines()
          Maximum number of lines to display
 Point2d getPosition()
          Gets current 2D normalized coordinates, [0 1]x[0 1]
 int getRenderHints()
          Returns a bit code giving rendering hints about this renderable.
 int getScrollOffset()
          Gets the current scroll offset
 boolean isFullscreen()
           
 void locateBottomCentre()
          Moves the HUD to the bottom-centre
 void locateBottomLeft()
          Moves the HUD to the bottom-left corner
 void locateBottomRight()
          Moves the HUD to the bottom-right
 void locateTopCentre()
          Moves the HUD to the top-centre
 void locateTopLeft()
          Moves the HUD to the top-left corner
 void locateTopRight()
          Moves the HUD to the top-right
 void print(java.lang.String str)
          Standard print functionality
 void printf(java.lang.String fmt, java.lang.Object... args)
          Standard printf functionality
 void println(java.lang.String str)
          Standard println functionality
 void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 void scrollDown()
          Scroll down by one line
 void scrollUp()
          Scroll up by one line
 void setBufferSize(int buffSize)
          Sets maximum number of lines to store
 void setFullscreen(boolean enable)
           
 void setLineSpacing(double sp)
          Sets the line spacing, 1 for single-space
 void setNumDisplayLines(int max)
          Sets maximum number of lines to display
 void setPosition(Point2d pos)
          Sets the 2D normalized coordinates, [0 1]x[0 1]
 void setScrollOffset(int offset)
          Set number of lines to scroll up 0 <= offset <= # buffered lines - lines on screen
 void setVerticalAlignment(TextComponentBase.VerticalAlignment vAlignment)
          Sets the vertical alignment, one of TOP, CENTRE, BOTTOM
 void toggleFullscreen()
           
 
Methods inherited from class artisynth.core.renderables.TextComponentBase
createDefaultRenderProps, createRenderProps, dispose, getFontFamily, getFontSize, getFontStyle, getHorizontalAlignment, getTextSize, getVerticalAlignment, isSelectable, numSelectionQueriesNeeded, setFont, setFontFamily, setFontSize, setFontStyle, setHorizontalAlignment, setTextColor, setTextRenderer, setTextSize
 
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

defaultFontName

public static java.lang.String defaultFontName

defaultNumDisplayLines

public static int defaultNumDisplayLines

defaultLineSpacing

public static double defaultLineSpacing

defaultBufferSize

public static int defaultBufferSize

myProps

public static PropertyList myProps
Constructor Detail

HudPrintStream

public HudPrintStream()
Basic component, defaulting to 5 lines of 12pt monospaced font in bottom left corner

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.

cls

public void cls()
Appends blank lines to clear the screen


clear

public void clear()
Clears the buffer


printf

public void printf(java.lang.String fmt,
                   java.lang.Object... args)
Standard printf functionality


print

public void print(java.lang.String str)
Standard print functionality


println

public void println(java.lang.String str)
Standard println functionality


getNumDisplayLines

public int getNumDisplayLines()
Maximum number of lines to display


setNumDisplayLines

public void setNumDisplayLines(int max)
Sets maximum number of lines to display


setBufferSize

public void setBufferSize(int buffSize)
Sets maximum number of lines to store


getBufferSize

public int getBufferSize()
Returns maximum size of line buffer


setLineSpacing

public void setLineSpacing(double sp)
Sets the line spacing, 1 for single-space


getLineSpacing

public double getLineSpacing()
Gets the line spacing


getPosition

public Point2d getPosition()
Gets current 2D normalized coordinates, [0 1]x[0 1]


setPosition

public void setPosition(Point2d pos)
Sets the 2D normalized coordinates, [0 1]x[0 1]


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.

locateTopLeft

public void locateTopLeft()
Moves the HUD to the top-left corner


locateTopCentre

public void locateTopCentre()
Moves the HUD to the top-centre


locateTopRight

public void locateTopRight()
Moves the HUD to the top-right


locateBottomLeft

public void locateBottomLeft()
Moves the HUD to the bottom-left corner


locateBottomCentre

public void locateBottomCentre()
Moves the HUD to the bottom-centre


locateBottomRight

public void locateBottomRight()
Moves the HUD to the bottom-right


fullscreen

public void fullscreen()
Makes the HUD full-screen according to the viewer's current height


toggleFullscreen

public void toggleFullscreen()

isFullscreen

public boolean isFullscreen()

setFullscreen

public void setFullscreen(boolean enable)

setVerticalAlignment

public void setVerticalAlignment(TextComponentBase.VerticalAlignment vAlignment)
Description copied from class: TextComponentBase
Sets the vertical alignment, one of TOP, CENTRE, BOTTOM

Overrides:
setVerticalAlignment in class TextComponentBase

setScrollOffset

public void setScrollOffset(int offset)
Set number of lines to scroll up 0 <= offset <= # buffered lines - lines on screen


getScrollOffset

public int getScrollOffset()
Gets the current scroll offset


scrollUp

public void scrollUp()
Scroll up by one line


scrollDown

public void scrollDown()
Scroll down by one line