org.xistrat.util.d3.vrmlgraph
Class VRMLLayout

java.lang.Object
  extended by org.xistrat.util.d3.vrmlgraph.VRMLLayout

public class VRMLLayout
extends java.lang.Object

This class contains layout methods for outputting VRML

Since:
0.6.90

Constructor Summary
VRMLLayout(java.io.BufferedWriter bw, double fontSize, java.lang.String fontColour, double nodeSize, java.lang.String nodeColour, double nodeTransparency, double edgeWidth, java.lang.String edgeColour, double edgeTransparency, boolean showLabels)
          Constructor for the VRMLLayout object
 
Method Summary
 void writeBackground(java.lang.String colour)
          Writes the Background into the VRML document
 void writeEdge(double midX, double midY, double midZ, double distance, double width, double deltaZ, double deltaY, double rotateX, double rotateFunny)
          Writes an Edge to the VRML document
 void writeFooter()
          Write a footer to the VRML document
 void writeHeader()
          Writes a VRML version 2.0 header followed by a blank line
 void writeNode(double x, double y, double z, java.lang.String label)
          Writes a Node to the VRML document
 void writeViewpoint(double zDropBack)
          Writes the initial viewpoint into the VRML document
 void writeWorldInfo(java.lang.String title, java.lang.String info)
          Writes WorldInfo to the VRML file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VRMLLayout

public VRMLLayout(java.io.BufferedWriter bw,
                  double fontSize,
                  java.lang.String fontColour,
                  double nodeSize,
                  java.lang.String nodeColour,
                  double nodeTransparency,
                  double edgeWidth,
                  java.lang.String edgeColour,
                  double edgeTransparency,
                  boolean showLabels)
Constructor for the VRMLLayout object

Parameters:
bw - The BufferedWriter to write to
fontSize - The font size for Node labels
fontColour - The font colour for Node labels
nodeSize - The size of Nodes
nodeColour - The colour of Nodes
nodeTransparency - The transparency of Nodes
edgeWidth - The thickness of Edges
edgeColour - The colour of Edges
edgeTransparency - The transparency of Edges
showLabels - Specifies whether or not labels are to be displayed on the graph
Method Detail

writeHeader

public void writeHeader()
                 throws java.io.IOException
Writes a VRML version 2.0 header followed by a blank line

Throws:
java.io.IOException - Throws an IOException if an error occurs

writeWorldInfo

public void writeWorldInfo(java.lang.String title,
                           java.lang.String info)
                    throws java.io.IOException
Writes WorldInfo to the VRML file

Parameters:
title - The title of the VRML world
info - Information about the VRML world
Throws:
java.io.IOException - Throws an IOException if an error occurs

writeViewpoint

public void writeViewpoint(double zDropBack)
                    throws java.io.IOException
Writes the initial viewpoint into the VRML document

Parameters:
zDropBack - The distance between the viewer and the origin
Throws:
java.io.IOException - Throws an IOException if an error occurs

writeBackground

public void writeBackground(java.lang.String colour)
                     throws java.io.IOException
Writes the Background into the VRML document

Parameters:
colour - The background colour of the VRML world
Throws:
java.io.IOException - Throws an IOException if an error occurs

writeNode

public void writeNode(double x,
                      double y,
                      double z,
                      java.lang.String label)
               throws java.io.IOException
Writes a Node to the VRML document

Parameters:
x - The X coordinate of the Node
y - The Y coordinate of the Node
z - The Z coordinate of the Node
label - The label of the Node to be drawn
Throws:
java.io.IOException - Throws an IOException if an error occurs

writeEdge

public void writeEdge(double midX,
                      double midY,
                      double midZ,
                      double distance,
                      double width,
                      double deltaZ,
                      double deltaY,
                      double rotateX,
                      double rotateFunny)
               throws java.io.IOException
Writes an Edge to the VRML document

Parameters:
midX - The X coordinate of the midpoint of the Edge
midY - The Y coordinate of the midpoint of the Edge
midZ - The Z coordinate of the midpoint of the Edge
distance - The distance between the centres of the two nodes that the edge connects
width - The thickness of the Edge
deltaZ - The Z axis rotation
deltaY - The Y axis rotation
rotateX - The X axis rotation
rotateFunny - The rotation to perform after the X rotation has already been done.
Throws:
java.io.IOException - Throws an IOException if an error occurs

writeFooter

public void writeFooter()
                 throws java.io.IOException
Write a footer to the VRML document

Throws:
java.io.IOException - Throws an IOException if an error occurs