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

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)
 

Detailed Description

This class contours a grid.

Author
Dan Vietor

Member Enumeration Documentation

◆ ContType

Contour types

Enumerator
NONE 

No contour output

VALUE 

Plot grid values

LINE 

Plot line contours

FILL 

Plot fill contours

BOTH 

Plot both line and fill contours

Constructor & Destructor Documentation

◆ ContPlot()

ContPlot::ContPlot ( )

Constructor

References init().

Member Function Documentation

◆ decodeType()

int ContPlot::decodeType ( const char *  str)
static

Decodes the contour type from a string

Parameters
strThe plot type
Returns
Plot type (NONE, VALUE, FILL, LINE, BOTH)

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

◆ draw()

int ContPlot::draw ( Plot plot,
Grid grid 
)

Contours the grid

Parameters
plotPlot object
gridGrid to contour

References BOTH, drawFill(), drawLine(), drawValues(), LINE, and VALUE.

Referenced by WXP::UpaXSectCont::draw(), and WXP::UpaXSectPlot::draw().

◆ drawBoxFill()

int ContPlot::drawBoxFill ( Plot plot)

Draw fill contours for a grid box

Parameters
plotThe plot object

References WXP::Points::add1(), WXP::Points::clear(), and WXP::Plot::drawFill().

Referenced by drawFill().

◆ drawBoxLine()

int ContPlot::drawBoxLine ( Plot plot)

Plots contour lines within a grid box

Parameters
plotThe plot object

References WXP::Plot::drawLine().

Referenced by drawLine().

◆ drawFill()

int ContPlot::drawFill ( Plot plot,
Grid grid 
)

◆ drawLabels()

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

Draw the labels on the plot

Parameters
plotPlot object
gridGrid to extract labels

References WXP::Plot::addLabel(), WXP::String::get(), WXP::Grid::getDatim(), WXP::Grid::getForeHours(), WXP::Grid::getInfo(), WXP::Grid::getRange(), and WXP::Const::MISS.

◆ drawLine()

int ContPlot::drawLine ( Plot plot,
Grid grid 
)

◆ drawLineLabels()

int ContPlot::drawLineLabels ( Plot plot,
Grid grid 
)

◆ drawMaxMin()

int ContPlot::drawMaxMin ( Plot plot,
Grid grid 
)

◆ drawValues()

int ContPlot::drawValues ( Plot plot,
Grid grid 
)

◆ getBase()

float WXP::ContPlot::getBase ( )
inline

Returns the contour base value

◆ getColorFill()

PlotAttr WXP::ContPlot::getColorFill ( int  ind)
inline

Returns the plot attributes for a specific color fill

◆ getInterval()

float WXP::ContPlot::getInterval ( )
inline

Returns the contour interval

◆ getLevel()

float ContPlot::getLevel ( int  ind)

Gets the contour level

Parameters
indThe level number, either first value in color fill or lowest contour level
Returns
Contour level

Referenced by drawFill(), drawLine(), and drawLineLabels().

◆ getMax()

float WXP::ContPlot::getMax ( )
inline

Returns the maximum value in the grid

◆ getMin()

float WXP::ContPlot::getMin ( )
inline

Returns the minimum value in the grid

◆ getType()

int WXP::ContPlot::getType ( )
inline

Returns the contour type

◆ init()

int ContPlot::init ( )

◆ isTypeFill()

bool WXP::ContPlot::isTypeFill ( )
inline

Returns whether the plot is a color fill

References BOTH, and FILL.

◆ setBase()

int ContPlot::setBase ( float  val)

Sets the contour base value used in color fill and other parameters

Parameters
valBase value

Referenced by WXP::UpaXSectCont::draw(), init(), and setParam().

◆ setColorFill()

int ContPlot::setColorFill ( const char *  str)

Sets the color fill parameters

Parameters
strColor fill string

References WXP::String::set().

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

◆ setColorLabel()

int ContPlot::setColorLabel ( const char *  str)

Sets the color for contour labels

Parameters
strColor string

References WXP::String::set().

Referenced by init(), and setParam().

◆ setColorLine()

int ContPlot::setColorLine ( const char *  str)

Sets the color for line contours

Parameters
strColor string

References WXP::String::set().

Referenced by init(), and setParam().

◆ setColorTable()

int ContPlot::setColorTable ( const char *  str)

Sets the color table parameters

Parameters
strColor table parameter

References WXP::String::set().

Referenced by init(), WXP::GridCont::setColorTable(), and setParam().

◆ setFillStyle()

int ContPlot::setFillStyle ( int  type)

Sets the fill contour style

Parameters
typeFill pattern type

Referenced by setParam().

◆ setInterval()

int ContPlot::setInterval ( float  val)

Sets the contour interval

Parameters
valContour interval

Referenced by WXP::UpaXSectCont::draw(), init(), and setParam().

◆ setLabelParam()

int ContPlot::setLabelParam ( int  skip,
int  rad 
)

Sets the label parameters

Parameters
skipContour value skip factor
radSearch radius for max/min labels

Referenced by setParam().

◆ setLabelSpace()

int ContPlot::setLabelSpace ( int  x,
int  y 
)

Sets the spacing factors for contour line labels

Parameters
xX skip factor
yY skip factor

Referenced by setParam().

◆ setLineWidth()

int ContPlot::setLineWidth ( float  width)

Sets the line width

Parameters
typeFill pattern type

Referenced by setParam().

◆ setParam()

int ContPlot::setParam ( const char *  str)

Sets the contouring parameters

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

◆ setScaleFactor()

int ContPlot::setScaleFactor ( float  sc)

Sets the scale factor

Parameters
strColor string

Referenced by setParam().

◆ setTextFormat()

int ContPlot::setTextFormat ( const char *  fm)

Sets the format for text values

Parameters
fmThe text format (see printf)

References WXP::StrLib::copy().

Referenced by init(), and setParam().

◆ setType() [1/2]

int ContPlot::setType ( const char *  str)

Sets the contour type

Parameters
strType of contours (cf, ln, dln, ndln, value, gvalue)

References decodeType(), and WXP::StrLib::equal().

◆ setType() [2/2]

int ContPlot::setType ( int  rtype)

Sets the contour type

Parameters
rtypeType of contours (from enum)

Referenced by WXP::UpaXSectCont::draw(), init(), and setParam().


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