WXP C++ Library Version 6.74.9
|
This class contours a grid. More...
#include "../include/ContPlot.h"
Public Types | |
enum | ContType { NONE , VALUE , LINE , FILL , BOTH } |
Public Member Functions | |
ContPlot () | |
ContPlot (const char *params) | |
int | init () |
int | setParam (const char *str) |
int | setType (int rtype) |
int | setType (const char *str) |
int | getType () |
bool | isTypeFill () |
int | setInterval (float val) |
float | getInterval () |
int | setBase (float val) |
int | setBase (const char *str) |
float | getBase () |
float | getMax () |
float | getMin () |
int | setLabelParam (int skip, int rad) |
int | setLabelSpace (int x, int y) |
int | setFillStyle (int type) |
int | setLineWidth (float width) |
int | setTextFormat (const char *fm) |
int | setColorTable (const char *str) |
int | setColorFill (const char *str) |
int | setColorLine (const char *str) |
int | setColorLabel (const char *str) |
int | setScaleFactor (float sc) |
int | draw (Plot &plot, Grid &grid) |
int | drawLabels (Plot &plot, Grid &grid) |
int | drawFill (Plot &plot, Grid &grid) |
int | drawBoxFill (Plot &plot) |
int | drawLine (Plot &plot, Grid &grid) |
int | drawBoxLine (Plot &plot) |
int | drawValues (Plot &plot, Grid &grid) |
int | drawLineLabels (Plot &plot, Grid &grid) |
int | drawMaxMin (Plot &plot, Grid &grid) |
float | getLevel (int ind) |
PlotAttr | getColorFill (int ind) |
Static Public Member Functions | |
static int | decodeType (const char *str) |
This class contours a grid.
ContPlot::ContPlot | ( | ) |
Constructor
References init().
|
static |
Decodes the contour type from a string
str | The plot type |
References BOTH, WXP::StrLib::equal(), FILL, LINE, NONE, and VALUE.
Referenced by WXP::MosPlot::draw(), WXP::RawPlot::draw(), WXP::SfcPlot::draw(), WXP::UpaPlot::draw(), WXP::UpaXSectPlot::draw(), and setType().
Contours the grid
References BOTH, drawFill(), drawLine(), drawValues(), LINE, and VALUE.
Referenced by WXP::UpaXSectCont::draw(), and WXP::UpaXSectPlot::draw().
int ContPlot::drawBoxFill | ( | Plot & | plot | ) |
Draw fill contours for a grid box
plot | The plot object |
References WXP::Points::add1(), WXP::Points::clear(), and WXP::Plot::drawFill().
Referenced by drawFill().
int ContPlot::drawBoxLine | ( | Plot & | plot | ) |
Plots contour lines within a grid box
plot | The plot object |
References WXP::Plot::drawLine().
Referenced by drawLine().
Draw color fill contours
plot | The plot object |
grid | The grid to contour |
References WXP::Points::add1(), WXP::Grid::allocLocate(), WXP::Tools::calcInterval(), WXP::Points::clear(), drawBoxFill(), WXP::Plot::drawFill(), WXP::Plot::drawLine(), drawLineLabels(), drawMaxMin(), WXP::String::get(), WXP::Plot::getColorMap(), getLevel(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getRange(), WXP::GridMath::isDomainEqual(), WXP::Const::MISS, WXP::Wxp::outWarning(), WXP::ColorFile::read(), WXP::GridPoint::set(), WXP::GridBox::set(), WXP::Plot::setColorMap(), WXP::Plot::setFill(), WXP::Plot::setFillColor(), WXP::Plot::setFillStyle(), WXP::Plot::setLine(), WXP::Plot::setLineColor(), WXP::Grid::setLocate(), WXP::Plot::setText(), WXP::Domain::tran(), WXP::Grid::tran(), and WXP::String::valid().
Referenced by draw().
Draw the labels on the plot
References WXP::Plot::addLabel(), WXP::String::get(), WXP::Grid::getDatim(), WXP::Grid::getForeHours(), WXP::Grid::getInfo(), WXP::Grid::getRange(), and WXP::Const::MISS.
Draws line contours
plot | The plot object |
grid | The grid to contour |
References WXP::Tools::calcInterval(), drawBoxLine(), drawLineLabels(), drawMaxMin(), WXP::String::equal(), FILL, WXP::String::get(), WXP::Plot::getColorMap(), getLevel(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getRange(), WXP::Const::MISS, WXP::Wxp::outWarning(), WXP::ColorFile::read(), WXP::GridBox::set(), WXP::Plot::setColorMap(), WXP::Plot::setLine(), WXP::Plot::setLineStyle(), WXP::Plot::setLineWidth(), and WXP::String::valid().
Referenced by draw().
Sets the input file type
str | The file type |
References WXP::Plot::drawText(), WXP::String::equal(), FILL, WXP::String::get(), getLevel(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Point::interp(), WXP::Const::MISS, WXP::GridBox::set(), WXP::Plot::setText(), and WXP::String::valid().
Referenced by drawFill(), and drawLine().
Draws the local max and min values on the plot
plot | The plot object |
grid | The grid |
References WXP::Plot::drawText(), WXP::String::equal(), FILL, WXP::String::get(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getValue(), WXP::Const::MISS, WXP::GridPoint::set(), WXP::Plot::setText(), WXP::Grid::tran(), WXP::String::valid(), and WXP::Point::y.
Referenced by drawFill(), and drawLine().
Plots gridpoint values
plot | The plot object |
grid | The grid |
References WXP::Tools::calcInterval(), WXP::Plot::drawFormText(), WXP::Plot::drawText(), WXP::String::get(), WXP::Plot::getColorMap(), WXP::Grid::getDomain(), WXP::Grid::getNx(), WXP::Grid::getNy(), WXP::Grid::getRange(), WXP::Grid::getValue(), WXP::Const::MISS, WXP::Wxp::outWarning(), WXP::ColorFile::read(), WXP::GridPoint::set(), WXP::Plot::setColorMap(), WXP::Plot::setText(), WXP::Grid::tran(), WXP::Domain::translate(), WXP::String::valid(), WXP::StrLib::valid(), and WXP::Point::x.
Referenced by draw().
|
inline |
Returns the contour base value
|
inline |
Returns the plot attributes for a specific color fill
|
inline |
Returns the contour interval
float ContPlot::getLevel | ( | int | ind | ) |
Gets the contour level
ind | The level number, either first value in color fill or lowest contour level |
Referenced by drawFill(), drawLine(), and drawLineLabels().
|
inline |
Returns the maximum value in the grid
|
inline |
Returns the minimum value in the grid
|
inline |
Returns the contour type
int ContPlot::init | ( | ) |
Initializes the object
References WXP::ColorFill::init(), WXP::String::init(), LINE, WXP::Const::MISS, setBase(), setColorFill(), setColorLabel(), setColorLine(), setColorTable(), setInterval(), setParam(), setTextFormat(), and setType().
Referenced by ContPlot(), and WXP::GridCont::init().
|
inline |
int ContPlot::setBase | ( | float | val | ) |
Sets the contour base value used in color fill and other parameters
val | Base value |
Referenced by WXP::UpaXSectCont::draw(), init(), and setParam().
int ContPlot::setColorFill | ( | const char * | str | ) |
Sets the color fill parameters
str | Color fill string |
References WXP::String::set().
Referenced by init(), WXP::GridCont::setColorFill(), and setParam().
int ContPlot::setColorLabel | ( | const char * | str | ) |
Sets the color for contour labels
str | Color string |
References WXP::String::set().
Referenced by init(), and setParam().
int ContPlot::setColorLine | ( | const char * | str | ) |
Sets the color for line contours
str | Color string |
References WXP::String::set().
Referenced by init(), and setParam().
int ContPlot::setColorTable | ( | const char * | str | ) |
Sets the color table parameters
str | Color table parameter |
References WXP::String::set().
Referenced by init(), WXP::GridCont::setColorTable(), and setParam().
int ContPlot::setFillStyle | ( | int | type | ) |
int ContPlot::setInterval | ( | float | val | ) |
Sets the contour interval
val | Contour interval |
Referenced by WXP::UpaXSectCont::draw(), init(), and setParam().
int ContPlot::setLabelParam | ( | int | skip, |
int | rad | ||
) |
Sets the label parameters
skip | Contour value skip factor |
rad | Search radius for max/min labels |
Referenced by setParam().
int ContPlot::setLabelSpace | ( | int | x, |
int | y | ||
) |
Sets the spacing factors for contour line labels
x | X skip factor |
y | Y skip factor |
Referenced by setParam().
int ContPlot::setLineWidth | ( | float | width | ) |
int ContPlot::setParam | ( | const char * | str | ) |
Sets the contouring parameters
str | Parameter string cf - Contour type is color fill lcf - Contour type is lines and color fill ln - Contour type is lines dln - Contour type is dashed lines ndln - Contour type is negative dashed lines gvalue - Contour type is plotted values value - Contour type is plotted values ty=type - Contour type pl=type - Contour type int=intrvl - Contour interval ci=intrvl - Contour interval base=val - Contour base cb=val - Contour base sc=scale - Scale factor of text values fm=format - Format of text values (C printf) wi=width - Width of contour lines fill=type - Contour fill type ct=file - Color table file coco=color - Line contour color coln=color - Line contour color co=color - Line contour color cof=color - Fill contour colors lab=s:r:x:y - Label parameters: skip, rad, x, y |
References WXP::Strings::equal(), WXP::Strings::getNum(), WXP::Strings::getString(), WXP::Strings::getStringAfter(), WXP::Strings::iequal(), WXP::Strings::scanf(), setBase(), setColorFill(), setColorLabel(), setColorLine(), setColorTable(), setFillStyle(), setInterval(), setLabelParam(), setLabelSpace(), setLineWidth(), setScaleFactor(), setTextFormat(), and setType().
Referenced by WXP::UpaXSectCont::draw(), init(), and WXP::GridCont::setParam().
int ContPlot::setScaleFactor | ( | float | sc | ) |
int ContPlot::setTextFormat | ( | const char * | fm | ) |
Sets the format for text values
fm | The text format (see printf) |
References WXP::StrLib::copy().
Referenced by init(), and setParam().
int ContPlot::setType | ( | const char * | str | ) |
Sets the contour type
str | Type of contours (cf, ln, dln, ndln, value, gvalue) |
References decodeType(), and WXP::StrLib::equal().
int ContPlot::setType | ( | int | rtype | ) |
Sets the contour type
rtype | Type of contours (from enum) |
Referenced by WXP::UpaXSectCont::draw(), init(), and setParam().