WXP C++ Library Version 6.74.6
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
WXP::VectPlot Class Reference

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)
 

Detailed Description

This class plots vectors and streamlines from U and V grids.

Author
Dan Vietor

Member Enumeration Documentation

◆ Type

Vector plot type

Enumerator
VECTOR 

Wind vectors

BARB 

Wind barbs

STREAM 

Streamlines

Constructor & Destructor Documentation

◆ VectPlot() [1/2]

VectPlot::VectPlot ( )

Constructor

References init().

◆ VectPlot() [2/2]

VectPlot::VectPlot ( const char *  param)

Constructor

Parameters
paramThe parameters to initialize the object

References init(), and setParam().

Member Function Documentation

◆ draw()

int VectPlot::draw ( Plot plot,
Grid ugrid,
Grid vgrid 
)

◆ drawBar()

int VectPlot::drawBar ( Plot plot,
const char *  locate 
)

Draws the color bar legend. Only useful when coloring vectors based on speed.

Parameters
plotPlot object
locateLocation of bar (ll, lr)

◆ drawLabels()

int VectPlot::drawLabels ( Plot plot,
Grid grid 
)

◆ drawStreamline()

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.

Parameters
plotThe plot object
ugridThe U component grid
vgridThe V component grid
iI gridpoint to start streamline
jJ gridpoint to start streamline
lengthMaximum 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().

◆ drawVect()

int VectPlot::drawVect ( Plot plot,
const char *  loc 
)

◆ getMax()

float WXP::VectPlot::getMax ( )
inline

Returns the maximum wind of the current plot

◆ getType()

int WXP::VectPlot::getType ( )
inline

Returns the plot type

◆ init()

int VectPlot::init ( )

◆ setArrowScale()

int VectPlot::setArrowScale ( float  val)

Sets the arrow scaling factor.

Parameters
valArrow scale factor

Referenced by setParam().

◆ setBase()

int VectPlot::setBase ( float  val)

Sets the vector coloring base value.

Parameters
valColoring base

Referenced by init(), and setParam().

◆ setColor()

int VectPlot::setColor ( const char *  str)

Sets the color for the vectors

Parameters
strColor string

References WXP::String::set().

Referenced by init(), and setParam().

◆ setColorFill()

int VectPlot::setColorFill ( const char *  str)

Sets the color fill parameters. Used to set colors for vectors.

Parameters
strColor fill string

References WXP::String::set().

Referenced by init(), WXP::GridVect::setColorFill(), and setParam().

◆ setColorTable()

int VectPlot::setColorTable ( const char *  str)

Sets the color table parameters

Parameters
strColor table string

References WXP::String::set().

Referenced by WXP::GridVect::setColorTable(), and setParam().

◆ setDensity()

int VectPlot::setDensity ( int  val)

Sets the streamline density. This is the number of streamlines that can pass through a grid box.

Parameters
valSkip factor

Referenced by setParam().

◆ setInterval()

int VectPlot::setInterval ( float  val)

Sets the vector coloring interval. If set, vectors and streamlines will be colored based on speed.

Parameters
valColor interval

Referenced by init(), and setParam().

◆ setMagnitude()

int VectPlot::setMagnitude ( float  val)

Sets the vector vect_mag. Used to lock a certain speed to vector size

Parameters
valMagnitude

Referenced by init(), and setParam().

◆ setParam()

int VectPlot::setParam ( const char *  str)

Sets the object parameters

Parameters
strParameter 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().

◆ setScale()

int VectPlot::setScale ( float  val)

Sets the vector scaling factor.

Parameters
valScale factor

Referenced by setParam().

◆ setSkip() [1/2]

int VectPlot::setSkip ( int  val)

Sets the vector skip. Used to thin out vectors in dense grids

Parameters
valSkip factor

◆ setSkip() [2/2]

int VectPlot::setSkip ( int  x,
int  y 
)

Sets the vector skip. Used to thin out vectors in dense grids

Parameters
xX skip factor
yY skip factor

Referenced by setParam().

◆ setType() [1/2]

int VectPlot::setType ( const char *  str)

Sets the type of vector plot

Parameters
strType (vect, barb, stream)

References BARB, WXP::StrLib::equal(), STREAM, and VECTOR.

Referenced by init().

◆ setType() [2/2]

int WXP::VectPlot::setType ( int  rtype)
inline

Set the plot type

See also
Type

The documentation for this class was generated from the following files: