mil.navy.nps.rra
Class PrintVRML

java.lang.Object
  |
  +--mil.navy.nps.rra.PrintVRML

public class PrintVRML
extends java.lang.Object

Utility methods used to build a VRML scene, each returning standard VRML node strings.

Specifically, PrintVRML sends VRML strings for various header, DirectionalLight, NavigationInfo, Viewpoint and legend-building PROTO nodes to standard output.

Version:
1.0

Author:
LT Timothy M. Holliday USN

Contact: Don Brutzman (web.nps.navy.mil/~brutzman) brutzman@nps.navy.mil

Source Code:
~vrtp/mil/navy/nps/rra/PrintVRML.java
http://devo.stl.nps.navy.mil/~brutzman/vrtp/mil/navy/nps/rra/PrintVRML.java

History:
15 Jan 98 Timothy M. Holliday New
14 May 98 Timothy M. Holliday Added color and intensity schemes
18 May 98 Timothy M. Holliday Added VRML colorBarView and textNode
10 Oct 98 Don Brutzman Javadoc updates for jdk1.2b4
Fixed PROTO initialization/repetition problems
26 April 99 Don Brutzman Javadoc updates for jdk1.2.1, revised some method names to match get/set naming convention.

Reference:
Holliday, Timothy, Real-Time 3D Sonar Modeling and Visualization, Master's Thesis, Naval Postgraduate School, Monterey California, June 1998. Available at vrtp/rra/HollidayRRAthesis.pdf. and devo.stl.nps.navy.mil/~brutzman/vrtp/rra/HollidayRRAthesis.pdf. Slideset available in Powerpoint and Acrobat .pdf formats.

See Also:
Bottom, Surface, SSP, Lobe, ExampleColorBar, ExampleLobeStatic, ExampleLobeDynamic

Field Summary
static int BLUE
           
static java.lang.String CENTER
           
static int CONSTANT
           
static int GREEN
           
static java.lang.String HORIZONTAL
           
static java.lang.String LEFT
           
static int LINEAR
           
 int protoColorBarCount
           
static boolean protoLegendViewpointFirstInvocation
           
static int RAINBOW
           
static int RED
           
static java.lang.String RIGHT
           
static int TRICOLOR
           
static java.lang.String VERTICAL
           
 
Constructor Summary
PrintVRML()
           
 
Method Summary
 java.lang.String colorBar(java.lang.String verticalLabel, java.lang.String horizontalLabel, java.lang.String detectionLabel, java.lang.String counterDetectionLabel)
          Produce colorbar; only includes detectionLabel and counterDetectionLabel if colorScheme is case TRICOLOR.
 boolean getAppendLineFeed()
          Return what character is used for end-of-line.
 java.lang.String getBackground()
          Return Background node with default values.
 java.lang.String getBackground(double r, double g, double b)
          Return Background node with specified (r, g, b) values.
 java.lang.String getColor()
          Return color value for current point based on color scheme.
 java.lang.String getColorBarViewpoint(java.lang.String title, double x, double y, double z, double xAxis, double yAxis, double zAxis, double theta)
          Return colorBar Viewpoint node, requires protoColorBar for initialization first.
 java.lang.String getLegendViewpoint(java.lang.String title, java.lang.String info1, java.lang.String info2, java.lang.String info3, java.lang.String info4, java.lang.String info5, double x, double y, double z)
          Initialization prior to producing viewpoint for scene legend (color scales and description), by defining a PROTO node.
 java.lang.String getScaleGeometry(java.lang.String label, double maximum, double minimum, double x, double y, double z, double xAxis, double yAxis, double zAxis, double theta, int divisions)
          Return VRML string for the in-scene spatial scale.
 java.lang.String getSceneHeader()
          Return standard VRML file header, DirectionalLight, NavigationInfo.
 java.lang.String protoColorBar(java.lang.String verticalLabel, java.lang.String horizontalLabel, java.lang.String vSubLabel1, java.lang.String vSubLabel2)
          Return another sequentially numbered protoColorBar.
 void setAppendLineFeed(boolean pAppendLineFeed)
          Specify whether linefeeds are appended to lines.
 void setColorScheme(int scheme)
          Default stub to set counterdetection color scheme - needs work.
 void setColorScheme(int scheme, double maximum, double minimum)
          User-selectable stub to set counterdetection color scheme - needs work.
 void setColorScheme(int scheme, double maximum, double detection, double counterDetection, double minimum)
          User-selectable stub to set counterdetection color scheme - needs work.
 void setColorValue(double value)
          Set color intensity if capped.
 void setIntensityScheme(int scheme)
          User-selectable stub to set color intensity scheme, current values for scheme are LINEAR and CONSTANT - needs work.
 void setIntensityScheme(int scheme, double maximum, double minimum)
          User-selectable stub to set color intensity scheme, current values for scheme are LINEAR and CONSTANT - needs work.
 void setIntensityValue(double value)
          Intensity factor is multiplied against all color components.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RAINBOW

public static final int RAINBOW

RED

public static final int RED

GREEN

public static final int GREEN

BLUE

public static final int BLUE

TRICOLOR

public static final int TRICOLOR

CONSTANT

public static final int CONSTANT

LINEAR

public static final int LINEAR

HORIZONTAL

public static final java.lang.String HORIZONTAL

VERTICAL

public static final java.lang.String VERTICAL

RIGHT

public static final java.lang.String RIGHT

CENTER

public static final java.lang.String CENTER

LEFT

public static final java.lang.String LEFT

protoLegendViewpointFirstInvocation

public static boolean protoLegendViewpointFirstInvocation

protoColorBarCount

public int protoColorBarCount
Constructor Detail

PrintVRML

public PrintVRML()
Method Detail

getSceneHeader

public java.lang.String getSceneHeader()
Return standard VRML file header, DirectionalLight, NavigationInfo.

getBackground

public java.lang.String getBackground()
Return Background node with default values.

getBackground

public java.lang.String getBackground(double r,
                                      double g,
                                      double b)
Return Background node with specified (r, g, b) values.

getLegendViewpoint

public java.lang.String getLegendViewpoint(java.lang.String title,
                                           java.lang.String info1,
                                           java.lang.String info2,
                                           java.lang.String info3,
                                           java.lang.String info4,
                                           java.lang.String info5,
                                           double x,
                                           double y,
                                           double z)
Initialization prior to producing viewpoint for scene legend (color scales and description), by defining a PROTO node.

protoColorBar

public java.lang.String protoColorBar(java.lang.String verticalLabel,
                                      java.lang.String horizontalLabel,
                                      java.lang.String vSubLabel1,
                                      java.lang.String vSubLabel2)
Return another sequentially numbered protoColorBar.

getColorBarViewpoint

public java.lang.String getColorBarViewpoint(java.lang.String title,
                                             double x,
                                             double y,
                                             double z,
                                             double xAxis,
                                             double yAxis,
                                             double zAxis,
                                             double theta)
Return colorBar Viewpoint node, requires protoColorBar for initialization first.

setAppendLineFeed

public void setAppendLineFeed(boolean pAppendLineFeed)
Specify whether linefeeds are appended to lines.

getAppendLineFeed

public boolean getAppendLineFeed()
Return what character is used for end-of-line.

setColorScheme

public void setColorScheme(int scheme)
Default stub to set counterdetection color scheme - needs work.

setColorScheme

public void setColorScheme(int scheme,
                           double maximum,
                           double minimum)
User-selectable stub to set counterdetection color scheme - needs work.

setColorScheme

public void setColorScheme(int scheme,
                           double maximum,
                           double detection,
                           double counterDetection,
                           double minimum)
User-selectable stub to set counterdetection color scheme - needs work.

setColorValue

public void setColorValue(double value)
Set color intensity if capped.

setIntensityScheme

public void setIntensityScheme(int scheme)
User-selectable stub to set color intensity scheme, current values for scheme are LINEAR and CONSTANT - needs work.

setIntensityScheme

public void setIntensityScheme(int scheme,
                               double maximum,
                               double minimum)
User-selectable stub to set color intensity scheme, current values for scheme are LINEAR and CONSTANT - needs work.

setIntensityValue

public void setIntensityValue(double value)
Intensity factor is multiplied against all color components.

getColor

public java.lang.String getColor()
Return color value for current point based on color scheme.

colorBar

public java.lang.String colorBar(java.lang.String verticalLabel,
                                 java.lang.String horizontalLabel,
                                 java.lang.String detectionLabel,
                                 java.lang.String counterDetectionLabel)
Produce colorbar; only includes detectionLabel and counterDetectionLabel if colorScheme is case TRICOLOR.

getScaleGeometry

public java.lang.String getScaleGeometry(java.lang.String label,
                                         double maximum,
                                         double minimum,
                                         double x,
                                         double y,
                                         double z,
                                         double xAxis,
                                         double yAxis,
                                         double zAxis,
                                         double theta,
                                         int divisions)
Return VRML string for the in-scene spatial scale.