WXP C++ Library Version 6.74.9
|
This class plots vectors and streamlines from U and V grids. More...
#include "../include/VectPlot.h"
Public Types | |
enum | Type { VECTOR , BARB , STREAM } |
Public Member Functions | |
VectPlot () | |
VectPlot (const char *param) | |
int | init () |
int | setParam (const char *param) |
int | setColorTable (const char *str) |
int | setColorFill (const char *str) |
int | setColor (const char *str) |
int | setSkip (int x, int y) |
int | setSkip (int val) |
int | setInterval (float val) |
int | setBase (float val) |
int | setMagnitude (float val) |
int | setDensity (int val) |
int | setScale (float val) |
int | setArrowScale (float val) |
int | getType () |
int | setType (const char *str) |
int | setType (int rtype) |
float | getMax () |
int | drawLabels (Plot &plot, Grid &grid) |
int | draw (Plot &plot, Grid &ugrid, Grid &vgrid) |
int | drawStreamline (Plot &plot, Grid &ugrid, Grid &vgrid, int i, int j, float length) |
int | drawBar (Plot &plot, const char *locate) |
int | drawVect (Plot &plot, const char *locate) |
This class plots vectors and streamlines from U and V grids.
enum WXP::VectPlot::Type |
VectPlot::VectPlot | ( | ) |
Constructor
References init().
VectPlot::VectPlot | ( | const char * | param | ) |
Constructor
param | The parameters to initialize the object |
References init(), and setParam().
Draws vectors
plot | The plot object |
ugrid | The U component grid |
vgrid | The V component grid |
References BARB, WXP::WindPlot::drawBarb(), drawStreamline(), WXP::WindPlot::drawVect(), WXP::String::get(), WXP::Plot::getColorMap(), WXP::Grid::getDomain(), WXP::Grid::getDx(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Wind::getSpd(), WXP::Grid::getValue(), WXP::GridMath::isDomainEqual(), WXP::GridMath::maxSpd(), WXP::Const::MISS, WXP::Wxp::outDebug(), WXP::ColorFile::read(), WXP::GridPoint::set(), WXP::Plot::setColorMap(), WXP::Plot::setFill(), WXP::Plot::setLine(), WXP::Wind::setSpd(), WXP::Wind::setVect(), STREAM, WXP::Grid::tran(), WXP::String::valid(), and VECTOR.
Referenced by drawVect().
int VectPlot::drawBar | ( | Plot & | plot, |
const char * | locate | ||
) |
Draws the color bar legend. Only useful when coloring vectors based on speed.
plot | Plot object |
locate | Location of bar (ll, lr) |
Draws the label annotations
plot | The plot object |
grid | The grid to extract labels |
References WXP::Plot::addLabel(), WXP::Date::addSeconds(), WXP::StrLib::append(), BARB, WXP::StrLib::clear(), WXP::String::get(), WXP::VarName::get(), WXP::Grid::getDatim(), WXP::Grid::getForeSeconds(), WXP::Grid::getForeTime(), WXP::Grid::getLevel(), WXP::Variable::setUnits(), STREAM, WXP::Level::toLabel(), WXP::Variable::toLabel(), WXP::ForeTime::toVarLabel(), WXP::String::valid(), and VECTOR.
int VectPlot::drawStreamline | ( | Plot & | plot, |
Grid & | ugrid, | ||
Grid & | vgrid, | ||
int | i, | ||
int | j, | ||
float | length | ||
) |
Draws a streamline starting at a specific point and continuing to either the edge of the grid, a box has too many streamlines or length has been exceeded.
plot | The plot object |
ugrid | The U component grid |
vgrid | The V component grid |
i | I gridpoint to start streamline |
j | J gridpoint to start streamline |
length | Maximum length of streamline |
References WXP::WindPlot::drawVect(), WXP::String::get(), WXP::Grid::getDx(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Const::MISS, WXP::Const::RDC, WXP::Wind::set(), WXP::GridPoint::set(), WXP::EarthPoint::set(), WXP::Plot::setLine(), WXP::Grid::tran(), WXP::String::valid(), WXP::Point::x, and WXP::Point::y.
Referenced by draw().
int VectPlot::drawVect | ( | Plot & | plot, |
const char * | loc | ||
) |
Draws a scaling vector in label area (lower right of plot)
plot | The plot object |
loc | Where to plot it (lr) |
References draw(), WXP::Plot::drawFormText(), WXP::WindPlot::drawVect(), WXP::StrLib::equal(), WXP::String::get(), WXP::Const::MISS, WXP::Point::offset(), WXP::Wind::set(), WXP::Point::set(), WXP::Plot::setText(), WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
|
inline |
Returns the maximum wind of the current plot
|
inline |
Returns the plot type
int VectPlot::init | ( | ) |
Initializes the object
References WXP::Const::MISS, setBase(), setColor(), setColorFill(), setInterval(), setMagnitude(), setParam(), setType(), and VECTOR.
Referenced by WXP::GridVect::init(), VectPlot(), and VectPlot().
int VectPlot::setArrowScale | ( | float | val | ) |
int VectPlot::setBase | ( | float | val | ) |
Sets the vector coloring base value.
val | Coloring base |
Referenced by init(), and setParam().
int VectPlot::setColor | ( | const char * | str | ) |
Sets the color for the vectors
str | Color string |
References WXP::String::set().
Referenced by init(), and setParam().
int VectPlot::setColorFill | ( | const char * | str | ) |
Sets the color fill parameters. Used to set colors for vectors.
str | Color fill string |
References WXP::String::set().
Referenced by init(), WXP::GridVect::setColorFill(), and setParam().
int VectPlot::setColorTable | ( | const char * | str | ) |
Sets the color table parameters
str | Color table string |
References WXP::String::set().
Referenced by WXP::GridVect::setColorTable(), and setParam().
int VectPlot::setDensity | ( | int | val | ) |
Sets the streamline density. This is the number of streamlines that can pass through a grid box.
val | Skip factor |
Referenced by setParam().
int VectPlot::setInterval | ( | float | val | ) |
Sets the vector coloring interval. If set, vectors and streamlines will be colored based on speed.
val | Color interval |
Referenced by init(), and setParam().
int VectPlot::setMagnitude | ( | float | val | ) |
Sets the vector vect_mag. Used to lock a certain speed to vector size
val | Magnitude |
Referenced by init(), and setParam().
int VectPlot::setParam | ( | const char * | str | ) |
Sets the object parameters
str | Parameter string vect - Plot vectors barb - Plot wind barbs stream - Plot streamlines strm - Plot streamlines ct=file - Color table file cof=colors - Color fill values co=color - Vector colors sk=## - The skip between grid boxes ci=## - The interval to color vectors and streamlines ba=## - The color base value cb=## - The color base value sp=## - The magnitude to scale vectors to de=## - The streamline density sc=## - The vector scale factor sa=## - The scale factor for arrows |
References BARB, WXP::Strings::equal(), WXP::Strings::getNum(), WXP::Strings::getString(), setArrowScale(), setBase(), setColor(), setColorFill(), setColorTable(), setDensity(), setInterval(), setMagnitude(), setScale(), setSkip(), STREAM, and VECTOR.
Referenced by init(), WXP::GridVect::setParam(), and VectPlot().
int VectPlot::setScale | ( | float | val | ) |
int VectPlot::setSkip | ( | int | val | ) |
Sets the vector skip. Used to thin out vectors in dense grids
val | Skip factor |
int VectPlot::setSkip | ( | int | x, |
int | y | ||
) |
Sets the vector skip. Used to thin out vectors in dense grids
x | X skip factor |
y | Y skip factor |
Referenced by setParam().
int VectPlot::setType | ( | const char * | str | ) |
Sets the type of vector plot
str | Type (vect, barb, stream) |
References BARB, WXP::StrLib::equal(), STREAM, and VECTOR.
Referenced by init().
|
inline |
Set the plot type