Classes | Public Member Functions | Static Public Attributes

pav::lib::visualizer::Boxes Class Reference

List of all members.

Classes

class  Box

Public Member Functions

 Boxes ()
 Boxes (int num, int size, int spacing)
 Boxes (int num, int size, int spacing, int rows)
void setCamera (float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
void resetCamera ()
void rotate (float speed)
void setColor (int color)
void setColor (int a, int b, int mode)
void setColor (int a, int b, int mode, int interpolation)
void setColor (float[] thresholds, int[] colors, int mode)
void setColor (float[] thresholds, int[] colors, int mode, int interpolation)
void setEdgeColor (int color)
void setMaxHeight (int height)
void quantize (int steps)
void filter (float[] filter)
void setLinkMode (int mode)
void process () throws PAVException
void drawTo (PApplet applet) throws PAVException
String toString ()
void dispose ()

Static Public Attributes

static final int COLOR_INTERPOLATION_CONTINUOUS = 1
static final int COLOR_INTERPOLATION_ROW = 2
static final int LINK_LINEAR = 1

Detailed Description

Draws a 3D grid of boxes with sizes linked to intensities of frequency bands.

As of the current version this visualizer only works with the GLGraphics renderer.

Author:
christopher

Constructor & Destructor Documentation

pav::lib::visualizer::Boxes::Boxes (  )  [inline]

Ctor.

pav::lib::visualizer::Boxes::Boxes ( int  num,
int  size,
int  spacing 
) [inline]

Ctor.

Parameters:
num The number of boxes to create. Must be > 0
size The length of the box edges. Must be > 0
spacing The spacing between boxes
pav::lib::visualizer::Boxes::Boxes ( int  num,
int  size,
int  spacing,
int  rows 
) [inline]

Ctor.

Parameters:
num The number of boxes to create. Must be > 0
size The length of the box edges. Must be > 0
spacing The spacing between boxes
rows The number of box rows to create. Must be > 0

Member Function Documentation

void pav::lib::visualizer::Boxes::dispose (  )  [inline]

Disposes this visualizer, releasing all resources that were used exclusively by this visualiter. Subsequent calls to any methods of the visualizer might cause exceptions.

Implements pav::lib::visualizer::Visualizer.

void pav::lib::visualizer::Boxes::drawTo ( PApplet  applet  )  throws PAVException [inline]

Sets the PApplet to draw to. Must be called before process().

Parameters:
applet Where to draw to. Must not be null
Exceptions:
PAVException If the visualizer does not work with this applet

Reimplemented from pav::lib::visualizer::VisualizerAbstract.

void pav::lib::visualizer::Boxes::filter ( float[]  filter  )  [inline]

Filters the calculated spectrum intensities before displaying them. The process is simply carried out by multiplying the i-th spectrum intensity with the i-th value in the filter. Thus, the filter length must not be longer than the number of calculated bands (that is the number of boxes), but it can be lower. The link mode (see setLinkMode()) determines what box will be modified by what filter value.

Parameters:
filter The filter to use or null to disable filtering. Filter length must not be larger than the number of boxes
void pav::lib::visualizer::Boxes::process (  )  throws PAVException [inline]

Draws to the PApplet specified by drawTo.

Exceptions:
PAVException If an error occures while drawing

Implements pav::lib::visualizer::Visualizer.

void pav::lib::visualizer::Boxes::quantize ( int  steps  )  [inline]

Sets the number of steps to use for quantization of the spectrum values or disables quantization.

Parameters:
steps The number of quantization steps. Set to <= 0 to disable quantization
void pav::lib::visualizer::Boxes::resetCamera (  )  [inline]

Resets the camera position.

The eyeX position is set to the width of the grid. eyeY is set to h/-5 where h is the display height. All other position are set to 0 (see setCamera()), with upY being 1. These settings are fitting only if the grid is nearly rectangular (which it is by default).

void pav::lib::visualizer::Boxes::rotate ( float  speed  )  [inline]

Starts or stops rotating. The speed is set via speed, which is a value in radians that specifies how the angle will change every time process() is called. A fitting value is Pi/360. If speed is set to 0 the rotation stops.

Parameters:
speed The rotation speed
void pav::lib::visualizer::Boxes::setCamera ( float  eyeX,
float  eyeY,
float  eyeZ,
float  centerX,
float  centerY,
float  centerZ,
float  upX,
float  upY,
float  upZ 
) [inline]

Sets the camera to use. See PApplet.camera() for more infos.

Note that the camera is reset every time the display size changes, therefore calls to this method before the visualization is drawn for the first time have no effect.

Parameters:
eyeX The eye x position
eyeY The eye y position
eyeZ The eye z position
centerX The center x position
centerY The center y position
centerZ The center z position
upX The up x position
upY The up y position
upZ The up z position
void pav::lib::visualizer::Boxes::setColor ( float[]  thresholds,
int[]  colors,
int  mode,
int  interpolation 
) [inline]

Sets the fill color of the boxes.

Parameters:
thresholds The relative thresholds to use. Values must be between 0 and 1 and sorted. The first element must be 0, the last 1. Must be of same length as colors
colors The The colors to use. Must be of same length as thresholds
mode The color mode to use. Must bei either PApplet.RGB or PApplet.HSB
interpolation The interpolation used. See COLOR_INTERPOLATION constants of this class. Must be valid
void pav::lib::visualizer::Boxes::setColor ( int  color  )  [inline]

Sets the fill color of the boxes.

Parameters:
color The color to use

Reimplemented from pav::lib::visualizer::VisualizerAbstract.

void pav::lib::visualizer::Boxes::setColor ( int  a,
int  b,
int  mode 
) [inline]

Sets the fill color of the boxes using continuous interpolation mode.

Parameters:
a The color to start from
b The color to interpolate to
mode The color mode to use. Must bei either PApplet.RGB or PApplet.HSB

Reimplemented from pav::lib::visualizer::VisualizerAbstract.

void pav::lib::visualizer::Boxes::setColor ( float[]  thresholds,
int[]  colors,
int  mode 
) [inline]

Sets the fill color of the boxes.

Parameters:
thresholds The relative thresholds to use. Values must be between 0 and 1 and sorted. The first element must be 0, the last 1. Must be of same length as colors
colors The The colors to use. Must be of same length as thresholds
mode The color mode to use. Must bei either PApplet.RGB or PApplet.HSB

Reimplemented from pav::lib::visualizer::VisualizerAbstract.

void pav::lib::visualizer::Boxes::setColor ( int  a,
int  b,
int  mode,
int  interpolation 
) [inline]

Sets the fill color of the boxes.

Parameters:
a The color to start from
b The color to interpolate to
mode The color mode to use. Must bei either PApplet.RGB or PApplet.HSB
interpolation The interpolation used. See COLOR_INTERPOLATION constants of this class. Must be valid
void pav::lib::visualizer::Boxes::setEdgeColor ( int  color  )  [inline]

Sets the color of the box edges.

Parameters:
color Box edge color
void pav::lib::visualizer::Boxes::setLinkMode ( int  mode  )  [inline]

Sets the link mode. See LINK_ constants of this class.

Currently only linear linking mode is supported.

Parameters:
mode The link mode to use. Must be valid
void pav::lib::visualizer::Boxes::setMaxHeight ( int  height  )  [inline]

Sets the maximum height of the boxes.

Parameters:
height The maximum box height
String pav::lib::visualizer::Boxes::toString (  )  [inline]

Returns a short string representation of this visualizer.

Returns:
visualizer info

Implements pav::lib::visualizer::Visualizer.


Member Data Documentation

Use continuous color interpolation. Every box will have a different color.

Interpolate colors according to rows. Every row will have a different color.

Use linear linking between boxes and frequency ranges. Boxes linked to low frequencies will be positioned at the far distance with default camera settings.


The documentation for this class was generated from the following file:
 All Classes Functions Variables