de.lmu.ifi.dbs.elki.visualization.svg
Class SVGHyperCube

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.visualization.svg.SVGHyperCube

public class SVGHyperCube
extends Object

Utility class to draw hypercubes, wireframe and filled.


Constructor Summary
SVGHyperCube()
           
 
Method Summary
static Element drawFilled(SVGPlot svgp, String cls, Projection2D proj, Vector min, Vector max)
          Filled hypercube.
static
<V extends NumberVector<V,?>>
Element
drawFilled(SVGPlot svgp, String cls, Projection2D proj, V min, V max)
          Filled hypercube.
static Element drawFrame(SVGPlot svgp, Projection2D proj, Vector min, Vector max)
          Wireframe hypercube.
static
<V extends NumberVector<V,?>>
Element
drawFrame(SVGPlot svgp, Projection2D proj, V min, V max)
          Wireframe hypercube.
private static ArrayList<double[]> getVisibleEdges(Projection2D proj, Vector s_min, Vector s_max)
          Get the visible (non-0) edges of a hypercube
private static void recDrawEdges(SVGPath path, double[] r_min, List<double[]> r_edges, int off, BitSet b)
          Recursive helper for hypercube drawing.
private static void recDrawSides(SVGPlot plot, Element group, String cls, double[] r_min, List<double[]> r_edges, int off, BitSet b)
          Recursive helper for hypercube drawing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVGHyperCube

public SVGHyperCube()
Method Detail

drawFrame

public static Element drawFrame(SVGPlot svgp,
                                Projection2D proj,
                                Vector min,
                                Vector max)
Wireframe hypercube.

Parameters:
svgp - SVG Plot
proj - Visualization projection
min - First corner
max - Opposite corner
Returns:
path element

drawFrame

public static <V extends NumberVector<V,?>> Element drawFrame(SVGPlot svgp,
                                                              Projection2D proj,
                                                              V min,
                                                              V max)
Wireframe hypercube.

Type Parameters:
V - vector type
Parameters:
svgp - SVG Plot
proj - Visualization projection
min - First corner
max - Opposite corner
Returns:
path element

drawFilled

public static Element drawFilled(SVGPlot svgp,
                                 String cls,
                                 Projection2D proj,
                                 Vector min,
                                 Vector max)
Filled hypercube.

Parameters:
svgp - SVG Plot
cls - CSS class to use.
proj - Visualization projection
min - First corner
max - Opposite corner
Returns:
group element

drawFilled

public static <V extends NumberVector<V,?>> Element drawFilled(SVGPlot svgp,
                                                               String cls,
                                                               Projection2D proj,
                                                               V min,
                                                               V max)
Filled hypercube.

Type Parameters:
V - vector type
Parameters:
svgp - SVG Plot
cls - CSS class to use.
proj - Visualization projection
min - First corner
max - Opposite corner
Returns:
group element

getVisibleEdges

private static ArrayList<double[]> getVisibleEdges(Projection2D proj,
                                                   Vector s_min,
                                                   Vector s_max)
Get the visible (non-0) edges of a hypercube

Parameters:
proj - Projection
s_min - Minimum value (in scaled space)
s_max - Maximum value (in scaled space)
Returns:
Edge list

recDrawEdges

private static void recDrawEdges(SVGPath path,
                                 double[] r_min,
                                 List<double[]> r_edges,
                                 int off,
                                 BitSet b)
Recursive helper for hypercube drawing.

Parameters:
path - path
r_min - starting corner
r_edges - edge vectors
off - recursion offset (to avoid multi-recursion)
b - bit set of drawn edges

recDrawSides

private static void recDrawSides(SVGPlot plot,
                                 Element group,
                                 String cls,
                                 double[] r_min,
                                 List<double[]> r_edges,
                                 int off,
                                 BitSet b)
Recursive helper for hypercube drawing.

Parameters:
plot - Plot
group - Group element
cls - CSS class
r_min - starting corner
r_edges - edge vectors
off - recursion offset (to avoid multi-recursion)
b - bit set of drawn edges

Release 0.4.0 (2011-09-20_1324)