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

This class stores and manipulates domain data. More...

#include "../include/Domain.h"

Inheritance diagram for WXP::Domain:
WXP::DomainVal

Public Types

enum  TranLocate {
  UL , UR , LL , LR ,
  CENTER
}
 

Public Member Functions

 Domain ()
 
 Domain (const char *str)
 
 Domain (DomainVal &val)
 
int init ()
 
int set (DomainVal &val)
 
int set (const char *str)
 
int set (EarthPoint &ul, EarthPoint &lr, int rnx, int rny)
 
int set (int rnx, int rny)
 
DomainVal get ()
 
bool isSet ()
 
int setParam ()
 
int setLimits ()
 
int getLimits (Rect &rect)
 
Rect getLimits ()
 
int setView (Rect &rect)
 
int getProj ()
 
float getPLat ()
 
float getPLon ()
 
float getCLat ()
 
float getCLon ()
 
int getNx ()
 
int getNy ()
 
float getDx ()
 
float getDy ()
 
float getParam (int i)
 
int tranCenter (Point &pt)
 
float getAspect ()
 
int tran (EarthPoint &ept, Point &pt)
 
int tran (Point &pt, EarthPoint &ept)
 
int tran (GridPoint &gpt, Point &pt)
 
int tran (Point &pt, GridPoint &gpt)
 
int tran (EarthPoint &ept, GridPoint &gpt)
 
int tran (GridPoint &gpt, EarthPoint &ept)
 
int tran (EarthPoints &epts, Points &pts)
 
int tran (EarthPoints &epts, GridPoints &gpts)
 
int tran (int w, EarthPoint &ept)
 
int tran (int w, GridPoint &gpt)
 
int tran (int w, Point &pt)
 
bool within (Point &pt)
 
bool within (EarthPoint &ept)
 
bool withinExt (Point &pt, int ext)
 
bool withinExt (EarthPoint &ept, int ext)
 
int where (Point &pt)
 
int where (EarthPoint &ept)
 
int scaleSize (int width, int height)
 
int scaleGrid (float scale)
 
int zoom (Point &pt, float zfac)
 
int pan (Point &pt)
 
int adjust (Point &pt)
 
int adjust (Points &pts)
 
float adjustDir (float dir, Point &pt)
 
float adjustDir (float dir, EarthPoint &ept)
 
float unadjustDir (float dir, Point &pt)
 
float unadjustDir (float dir, EarthPoint &ept)
 
int offset (Point &pt, float dir, float rad, Point &opt)
 
float direct (Point &pt1, Point &pt2)
 
float getVert ()
 
float getMapFactor (EarthPoint &ept)
 
int wrapLine (Point &pt1, Point &pt2)
 
int wrapLine (Points &pts)
 
int offsetLine (Point &pt1, Point &pt2, int flag)
 
int offsetLine (Points &pts, int flag)
 
int toString (String &string)
 
int print ()
 
int printLimits ()
 
int isProj (int p)
 
int isMap ()
 
int isTherm ()
 
int isCoord ()
 
int isPolar ()
 

Static Public Member Functions

static int getProj (const char *proj)
 
static bool compare (Domain &dom1, Domain &dom2)
 
static bool compareProj (Domain &dom1, Domain &dom2)
 
static int translate (Domain &dom1, Domain &dom2, Point &pt1, Point &pt2)
 
static int translate (Domain &dom1, Domain &dom2, GridPoint &gpt1, GridPoint &gpt2)
 
static float calcEarthDist (EarthPoint &ept1, EarthPoint &ept2)
 
static int offsetLatLon (EarthPoint &ept, float dir, float rad, EarthPoint &opt)
 
static bool isMap (int a)
 
static bool isTherm (int a)
 
static bool isCoord (int a)
 
static bool isPolar (int a)
 

Static Public Attributes

static double earth_rad = 63.7122
 
static double earth_maj = 63.78137
 
static double earth_min = 63.56752
 
static const int PSTEREO = DomainVal::PSTEREO
 
static const int LATLON = DomainVal::LATLON
 
static const int MERC = DomainVal::MERC
 
static const int LAMB = DomainVal::LAMB
 
static const int ORTHO = DomainVal::ORTHO
 
static const int GNOM = DomainVal::GNOM
 
static const int MOLL = DomainVal::MOLL
 
static const int LAMBAZ = DomainVal::LAMBAZ
 
static const int ALBERS = DomainVal::ALBERS
 
static const int SAT = DomainVal::SAT
 
static const int RADIAL = DomainVal::RADIAL
 
static const int PIXEL = DomainVal::PIXEL
 
static const int XY = DomainVal::XY
 
static const int XZ = DomainVal::XZ
 
static const int XP = DomainVal::XP
 
static const int XLOGP = DomainVal::XLOGP
 
static const int POLAR = DomainVal::POLAR
 
static const int CAT = DomainVal::CAT
 
static const int SKEWT = DomainVal::SKEWT
 
static const int STUVE = DomainVal::STUVE
 
static const int EMA = DomainVal::EMA
 
static const int TEPH = DomainVal::TEPH
 
static const int RTEPH = DomainVal::RTEPH
 
static const int ZOOM = DomainVal::ZOOM
 
static const int SIZE = DomainVal::SIZE
 
static float OFFSET_LL = 360
 
static float OFFSET_MERC = 360*63.7122*.017453293
 

Detailed Description

This class stores and manipulates domain data.

Author
Dan Vietor

Member Enumeration Documentation

◆ TranLocate

Translation location

Enumerator
UL 

Upper left point

UR 

Upper right point

LL 

Lower left point

LR 

Lower right point

CENTER 

Center point

Constructor & Destructor Documentation

◆ Domain() [1/3]

Domain::Domain ( )

Constructor. Initializes parameters.

References init().

◆ Domain() [2/3]

Domain::Domain ( const char *  str)

Constructor. Initializes parameters.

Parameters
strDomain string to be decoded

References init(), and set().

◆ Domain() [3/3]

Domain::Domain ( DomainVal val)

Constructor. Initializes parameters.

Parameters
valDomainVal struct containing domain parameters

References init(), and set().

Member Function Documentation

◆ adjust() [1/2]

int Domain::adjust ( Point pt)

Resets a point to make sure its within the domain

Parameters
ptPoint

References LATLON, MERC, OFFSET_MERC, WXP::DomainVal::proj, and WXP::Point::x.

Referenced by adjust().

◆ adjust() [2/2]

int Domain::adjust ( Points pts)

Resets points to make sure they are in domain

Parameters
ptsSet of points to check

References adjust(), WXP::Points::get(), WXP::Points::getNum(), and WXP::Points::set().

◆ adjustDir() [1/2]

float Domain::adjustDir ( float  dir,
EarthPoint ept 
)

Adjusts a direction from earth direction to projection direction (0=up in projection)

Parameters
dirWind direction relative to north
eptLocation in lat/lon
Returns
Output new direction relative to projection

References adjustDir(), and tran().

◆ adjustDir() [2/2]

float Domain::adjustDir ( float  dir,
Point pt 
)

Adjusts a direction from earth direction to projection direction (0=up in projection)

Parameters
dirWind direction relative to north
ptLocation on the projection
Returns
Output new direction relative to projection

References WXP::Const::DRC, LAMB, WXP::EarthPoint::lat, WXP::EarthPoint::lon, WXP::Const::MISS, WXP::DomainVal::plat, WXP::DomainVal::plon, WXP::DomainVal::proj, PSTEREO, WXP::Const::RDC, SAT, tran(), WXP::Point::x, and WXP::Point::y.

Referenced by WXP::NidsImage::addSite(), adjustDir(), WXP::Grid::adjustDir(), WXP::GridMath::adjustUV(), WXP::MosRaw::compute(), WXP::SfcRaw::compute(), WXP::UpaRaw::compute(), WXP::Lev2Plot::draw(), and WXP::NidsImage::setImage().

◆ calcEarthDist()

float Domain::calcEarthDist ( EarthPoint ept1,
EarthPoint ept2 
)
static

Compute the spherical distance between two points in meters

Parameters
ept1First point (lat,lon)
ept2Second point (lat,lon)

References WXP::Calc::earthDist(), WXP::EarthPoint::lat, and WXP::EarthPoint::lon.

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

◆ compare()

bool Domain::compare ( Domain dom1,
Domain dom2 
)
static

Compares two domain specifications for full domain match.

Parameters
dom1First domain
dom2Second domain
Returns
Are they equivalent??

References WXP::DomainVal::compare().

◆ compareProj()

bool Domain::compareProj ( Domain dom1,
Domain dom2 
)
static

Compares two domain specifications for projection match.

Parameters
dom1First domain
dom2Second domain
Returns
Are the projections equivalent??

References WXP::DomainVal::compareProj().

Referenced by translate(), and translate().

◆ direct()

float Domain::direct ( Point pt1,
Point pt2 
)

Outputs direction between two points. actual distance on the face of earth.

Parameters
pt1First location on projection plane
pt2Second location on projection plane
Returns
Direction relative to north

References WXP::DomainVal::plat, WXP::DomainVal::proj, PSTEREO, WXP::Const::RDC, WXP::Point::x, and WXP::Point::y.

◆ get()

DomainVal Domain::get ( )

◆ getAspect()

float Domain::getAspect ( )

Gets the aspext ratio of the domain.

Returns
The aspect ratio

References WXP::DomainVal::nx, and WXP::DomainVal::ny.

◆ getCLat()

float WXP::Domain::getCLat ( )
inline

Returns central latitude

References WXP::DomainVal::clat.

Referenced by WXP::ImgWxpFile::write().

◆ getCLon()

float WXP::Domain::getCLon ( )
inline

Returns central longitude

References WXP::DomainVal::clon.

Referenced by WXP::ImgWxpFile::write().

◆ getDx()

float WXP::Domain::getDx ( )
inline

◆ getDy()

float WXP::Domain::getDy ( )
inline

◆ getLimits() [1/2]

Rect Domain::getLimits ( )

Gets the domain limits

Returns
Rect containing limits of domain.

◆ getLimits() [2/2]

int Domain::getLimits ( Rect rect)

Gets the domain limits

Return values
rectRect containing limits of domain.

Referenced by WXP::ImagePlot::drawImage(), and WXP::Image::getLimits().

◆ getMapFactor()

float Domain::getMapFactor ( EarthPoint ept)

Outputs map factor. This is a correction from projection space to actual distance on the face of earth.

Parameters
eptLocation on the earth (lat,lon)
Returns
Correction relative to 1 of real distance on earth to proj dist

References WXP::Const::DRC, LAMB, WXP::EarthPoint::lat, MERC, WXP::DomainVal::plat, WXP::DomainVal::proj, PSTEREO, and RADIAL.

Referenced by WXP::NidsPlot::callback().

◆ getNx()

int WXP::Domain::getNx ( )
inline

◆ getNy()

int WXP::Domain::getNy ( )
inline

◆ getParam()

float WXP::Domain::getParam ( int  i)
inline

Returns projection parameters

References WXP::Const::MISS, and WXP::DomainVal::param.

Referenced by WXP::ImgWxpFile::write().

◆ getPLat()

float WXP::Domain::getPLat ( )
inline

Returns projection latitude

References WXP::DomainVal::plat.

Referenced by WXP::ImgWxpFile::write().

◆ getPLon()

float WXP::Domain::getPLon ( )
inline

Returns projection longitude

References WXP::DomainVal::plon.

Referenced by WXP::ImgWxpFile::write().

◆ getProj() [1/2]

int WXP::Domain::getProj ( )
inline

◆ getProj() [2/2]

int Domain::getProj ( const char *  proj)
static

Returns the projection type given a descriptive string

Parameters
projProjection string
Returns
Projection type code

References ALBERS, CAT, EMA, GNOM, WXP::StrLib::iequal(), LAMB, LAMBAZ, LATLON, MERC, WXP::Const::MISS, MOLL, ORTHO, PIXEL, POLAR, WXP::DomainVal::proj, PSTEREO, RADIAL, RTEPH, SAT, SIZE, SKEWT, STUVE, TEPH, XLOGP, XP, XY, and ZOOM.

◆ getVert()

float Domain::getVert ( )

Calculate the vertical distance of the domain

Returns
Distance

References WXP::Rect::ymax, and WXP::Rect::ymin.

◆ init()

int Domain::init ( )

◆ isCoord() [1/2]

int WXP::Domain::isCoord ( )
inline

Is the projection a coordinate plot

References isCoord(), and WXP::DomainVal::proj.

Referenced by isCoord().

◆ isCoord() [2/2]

static bool WXP::Domain::isCoord ( int  a)
inlinestatic

Is the projection a coordinate plot

References CAT, and PIXEL.

◆ isMap() [1/2]

int WXP::Domain::isMap ( )
inline

Is the projection a map

References isMap(), and WXP::DomainVal::proj.

Referenced by WXP::MapPlot::draw(), WXP::MapPlot::drawLatLon(), isMap(), tran(), and tran().

◆ isMap() [2/2]

static bool WXP::Domain::isMap ( int  a)
inlinestatic

Is the projection a map

References PSTEREO, and SAT.

◆ isPolar() [1/2]

int WXP::Domain::isPolar ( )
inline

Is the projection a polar plot

References isPolar(), and WXP::DomainVal::proj.

Referenced by isPolar().

◆ isPolar() [2/2]

static bool WXP::Domain::isPolar ( int  a)
inlinestatic

Is the projection a polar plot

References POLAR.

◆ isProj()

int WXP::Domain::isProj ( int  p)
inline

Returns if projection matches p

References WXP::DomainVal::proj.

◆ isSet()

bool WXP::Domain::isSet ( )
inline

◆ isTherm() [1/2]

int WXP::Domain::isTherm ( )
inline

Is the projection a thermo diagram

References isTherm(), and WXP::DomainVal::proj.

Referenced by isTherm().

◆ isTherm() [2/2]

static bool WXP::Domain::isTherm ( int  a)
inlinestatic

Is the projection a thermo diagram

References RTEPH, and SKEWT.

◆ offset()

int Domain::offset ( Point pt,
float  dir,
float  rad,
Point opt 
)

Offsets a point a specific radius and distance

Parameters
ptThe original point
dirDirection in degrees
radRadius in km
Return values
optNew point

References offsetLatLon(), and tran().

Referenced by offsetLine(), offsetLine(), wrapLine(), and wrapLine().

◆ offsetLatLon()

int Domain::offsetLatLon ( EarthPoint ept,
float  dir,
float  rad,
EarthPoint opt 
)
static

Offsets a point a specific radius and distance

Parameters
eptThe original point
dirDirection in degrees
radRadius in km
Return values
optNew point

References WXP::Const::DRC, WXP::EarthPoint::lat, and WXP::EarthPoint::lon.

Referenced by WXP::Plot::drawCircle(), WXP::MdrData::getRegLoc(), WXP::MdrData::getTopsLoc(), and offset().

◆ offsetLine() [1/2]

int Domain::offsetLine ( Point pt1,
Point pt2,
int  flag 
)

Offsets a line to draw at other edge of projection. This is used with wrapLine to draw a line crossing through the edge of a domain.

Parameters
pt1First point
pt2Second point
flagWhich type of offset, 1=right to left, -1=left to right

References earth_rad, LAMB, LATLON, MERC, MOLL, offset(), OFFSET_LL, OFFSET_MERC, WXP::Const::PI, WXP::DomainVal::proj, WXP::Point::x, and WXP::Point::y.

Referenced by WXP::Plot::drawFill(), WXP::Plot::drawLine(), WXP::Plot::drawLine(), and WXP::Plot::drawSpline().

◆ offsetLine() [2/2]

int Domain::offsetLine ( Points pts,
int  flag 
)

Adjusts the date according to new hour

Parameters
rhourNew hour

References earth_rad, WXP::Points::getNum(), WXP::Points::getY(), LAMB, LATLON, MERC, MOLL, WXP::Points::offset(), offset(), OFFSET_LL, OFFSET_MERC, WXP::Const::PI, and WXP::DomainVal::proj.

◆ pan()

int Domain::pan ( Point pt)

Pans a domain (resets centerpoint

Parameters
ptNew center point in projection space

References WXP::DomainVal::clat, WXP::DomainVal::clon, WXP::EarthPoint::lat, WXP::EarthPoint::lon, setLimits(), and tran().

Referenced by WXP::Figure::callback().

◆ print()

int Domain::print ( )

◆ printLimits()

int Domain::printLimits ( )

Prints the domain limits in projection coordinates

References WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.

◆ scaleGrid()

int Domain::scaleGrid ( float  scale)

Scales the number of grid points (domain stays the same)

Parameters
scaleScale factor to apply to gridpoints

References WXP::DomainVal::dx, WXP::DomainVal::dy, WXP::DomainVal::nx, and WXP::DomainVal::ny.

Referenced by WXP::RawGrid::compute(), WXP::MosGrid::compute(), WXP::SfcGrid::compute(), and WXP::UpaGrid::compute().

◆ scaleSize()

int Domain::scaleSize ( int  width,
int  height 
)

Resets the number of gridpoints in each direction

Parameters
widthNew width
heightNew height

References WXP::DomainVal::dx, WXP::DomainVal::dy, WXP::DomainVal::nx, and WXP::DomainVal::ny.

◆ set() [1/4]

int Domain::set ( const char *  str)

Sets the domain, parsing a string. The string can be a full domain specification (proj:param:param,clat,clon,nx,ny,dx,dy) or projection specification (proj:param:param:...).

Parameters
strThe string to parse

References WXP::DomainVal::clat, WXP::DomainVal::clon, WXP::StrLib::contains(), WXP::DomainVal::dx, WXP::DomainVal::dy, WXP::DomainVal::ellipse, getProj(), init(), WXP::Const::MISS, WXP::DomainVal::nx, WXP::DomainVal::ny, WXP::DomainVal::param, WXP::DomainVal::plat, WXP::DomainVal::plon, WXP::DomainVal::proj, and setParam().

◆ set() [2/4]

int Domain::set ( DomainVal val)

◆ set() [3/4]

int Domain::set ( EarthPoint ul,
EarthPoint lr,
int  rnx,
int  rny 
)

Sets the domain based on two opposite points and number of gridpoints

Parameters
ulThe upper left hand coordinate
lrThe lower right hand coordinate
rnxThe number of gridpoints in x
rnyThe number of gridpoints in y

References WXP::DomainVal::clat, WXP::DomainVal::clon, WXP::DomainVal::dx, WXP::DomainVal::dy, WXP::EarthPoint::lat, WXP::EarthPoint::lon, WXP::DomainVal::nx, WXP::DomainVal::ny, WXP::Point::set(), setParam(), tran(), WXP::Point::x, and WXP::Point::y.

◆ set() [4/4]

int Domain::set ( int  rnx,
int  rny 
)

Sets an XY projection with grid space of 1

Parameters
rnxNumber of X gridpoints
rnyNumber of Y gridpoints

References WXP::DomainVal::clat, WXP::DomainVal::clon, WXP::DomainVal::dx, WXP::DomainVal::dy, WXP::DomainVal::nx, WXP::DomainVal::ny, WXP::DomainVal::proj, setParam(), and XY.

◆ setLimits()

int Domain::setLimits ( )

◆ setParam()

int Domain::setParam ( )

◆ toString()

int Domain::toString ( String string)

◆ tran() [1/9]

int Domain::tran ( EarthPoint ept,
GridPoint gpt 
)

Translates a EarthPoint to a GridPoint

Parameters
eptThe latitude and longitude
gptThe gridpoint location of ept

References tran().

◆ tran() [2/9]

int Domain::tran ( EarthPoint ept,
Point pt 
)

Translates an EarthPoint to a projection Point

Parameters
eptThe latitude and longitude
ptThe projection location of ept in the domain.

References ALBERS, CAT, WXP::DomainVal::clon, WXP::Convert::CtoK(), WXP::Const::DRC, WXP::DomainVal::dx, WXP::DomainVal::dy, earth_maj, earth_min, earth_rad, WXP::DomainVal::ellipse, EMA, isMap(), LAMB, LAMBAZ, WXP::EarthPoint::lat, LATLON, WXP::EarthPoint::lon, MERC, WXP::Const::MISS, MOLL, WXP::DomainVal::nx, ORTHO, WXP::DomainVal::param, WXP::Const::PI, PIXEL, WXP::DomainVal::plat, WXP::DomainVal::plon, POLAR, WXP::Calc::potTemp(), WXP::DomainVal::proj, PSTEREO, RADIAL, WXP::Const::RDC, RTEPH, SAT, WXP::Angle::set(), SKEWT, STUVE, TEPH, WXP::Point::x, XLOGP, WXP::Rect::xmin, XP, XY, WXP::Point::y, and WXP::Rect::ymin.

Referenced by WXP::NidsImage::addSite(), adjustDir(), adjustDir(), WXP::GridMath::adjustUV(), WXP::AreaFile::calcDomain(), WXP::Plot::callback(), WXP::ObjectAnal::compute(), WXP::Lev2Plot::draw(), WXP::RedbookPlot::draw(), WXP::ContPlot::drawFill(), WXP::Plot::drawLine(), WXP::Grid::getValue(), WXP::Grid::getValue(), offset(), pan(), WXP::TiffFile::read(), WXP::GribFile::readGDB(), WXP::GribFile::readGDS(), WXP::GiniFile::readHeader(), WXP::SatCdfFile::readHeader(), WXP::LritFile::readHeader(), set(), WXP::ImagePiece::set(), WXP::NidsImage::setImage(), WXP::CityHash::setup(), tran(), WXP::Grid::tran(), WXP::Image::tran(), WXP::Grid::tran(), WXP::Image::tran(), tran(), WXP::Grid::tran(), WXP::Image::tran(), WXP::Grid::tran(), WXP::Image::tran(), tran(), tran(), WXP::Grid::tran(), WXP::Image::tran(), WXP::Grid::tran(), WXP::Image::tran(), tranCenter(), translate(), translate(), unadjustDir(), where(), within(), withinExt(), and zoom().

◆ tran() [3/9]

int Domain::tran ( GridPoint gpt,
EarthPoint ept 
)

Translates a GridPoint to an EarthPoint

Parameters
gptThe gridpoint location
eptThe latitude and longitude of gpt

References tran().

◆ tran() [4/9]

int Domain::tran ( GridPoint gpt,
Point pt 
)

Translates a GridPoint to a projection Point

Parameters
gptThe gridpoint location in the domain.
ptThe projection location from gpt

References WXP::DomainVal::dx, WXP::DomainVal::dy, WXP::Const::MISS, WXP::DomainVal::proj, RADIAL, WXP::Point::x, WXP::Rect::xmin, WXP::Point::y, and WXP::Rect::ymax.

◆ tran() [5/9]

int Domain::tran ( int  w,
EarthPoint ept 
)

Translates a location to EarthPoint

Parameters
wLocation (see TranLocate)
Return values
eptEarthPoint

References CENTER, WXP::DomainVal::clat, WXP::DomainVal::clon, LL, LR, WXP::EarthPoint::set(), WXP::Point::set(), tran(), UL, UR, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.

◆ tran() [6/9]

int Domain::tran ( int  w,
GridPoint gpt 
)

Translates a location to GridPoint

Parameters
wLocation (see TranLocate)
Return values
gptGridPoint

References CENTER, WXP::DomainVal::clat, WXP::DomainVal::clon, LL, LR, WXP::EarthPoint::set(), WXP::Point::set(), tran(), UL, UR, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.

◆ tran() [7/9]

int Domain::tran ( int  w,
Point pt 
)

Translates a location to Point

Parameters
wLocation (see TranLocate)
Return values
ptPoint

References CENTER, LL, LR, WXP::Point::set(), tranCenter(), UL, UR, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.

◆ tran() [8/9]

int Domain::tran ( Point pt,
EarthPoint ept 
)

◆ tran() [9/9]

int Domain::tran ( Point pt,
GridPoint gpt 
)

Translates a projection Point to a GridPoint

Parameters
ptThe projection location in the domain.
gptThe gridpoint location of pt

References WXP::DomainVal::dx, WXP::DomainVal::dy, LATLON, WXP::Const::MISS, WXP::DomainVal::proj, RADIAL, WXP::Point::x, WXP::Rect::xmin, WXP::Point::y, and WXP::Rect::ymax.

◆ tranCenter()

int Domain::tranCenter ( Point pt)

Returns the center of the domain in projection coordinates.

Return values
ptPoint structure containing the coordinates of the center.

References WXP::DomainVal::clat, WXP::DomainVal::clon, and tran().

Referenced by setLimits(), and tran().

◆ translate() [1/2]

int Domain::translate ( Domain dom1,
Domain dom2,
GridPoint gpt1,
GridPoint gpt2 
)
static

Translates projection points between two different projections

Parameters
dom1Initial domain
dom2New domain
gpt1Point within initial domain
Return values
gpt2Location within new domain

References compareProj(), and tran().

◆ translate() [2/2]

int Domain::translate ( Domain dom1,
Domain dom2,
Point pt1,
Point pt2 
)
static

Translates projection points between two different projections

Parameters
dom1Initial domain
dom2New domain
pt1Point within initial domain
Return values
pt2Location within new domain

References compareProj(), and tran().

Referenced by WXP::ContPlot::drawValues(), WXP::Grid::tran(), and WXP::Grid::tran().

◆ unadjustDir() [1/2]

float Domain::unadjustDir ( float  dir,
EarthPoint ept 
)

Readjusts a wind direction back to 0=north

Parameters
dirWind direction relative to north
eptLocation in lat/lon
Returns
Output new direction relative to projection

References tran(), and unadjustDir().

◆ unadjustDir() [2/2]

float Domain::unadjustDir ( float  dir,
Point pt 
)

Readjusts wind direction back to 0=north

Parameters
dirAdjusted wind direction
ptPoint on projection direction was adjusted to
Returns
Unadjusted wind direction (0=north)

References WXP::Const::DRC, LAMB, WXP::Const::MISS, WXP::DomainVal::plat, WXP::DomainVal::plon, WXP::DomainVal::proj, PSTEREO, WXP::Const::RDC, WXP::Point::x, and WXP::Point::y.

Referenced by unadjustDir(), and WXP::Grid::unadjustDir().

◆ where() [1/2]

int Domain::where ( EarthPoint ept)

Determines relative location of point to domain

Parameters
eptEarthPoint to locate.
Returns
Region: 1=NW, 2=N, 3=NE, 4=W, 5=within, 6=E, 7=SW, 8=S, 9=SE

References tran(), and where().

◆ where() [2/2]

int Domain::where ( Point pt)

Determines relative location of point to domain

Parameters
ptPoint to locate.
Returns
Region: 1=NW, 2=N, 3=NE, 4=W, 5=within, 6=E, 7=SW, 8=S, 9=SE

References WXP::Const::MISS, WXP::DomainVal::proj, WXP::Point::x, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Point::y, WXP::Rect::ymax, and WXP::Rect::ymin.

Referenced by where().

◆ within() [1/2]

bool Domain::within ( EarthPoint ept)

Determines whether point is within domain

Parameters
eptEarthPoint to locate.
Returns
True if point within domain

References tran(), and within().

◆ within() [2/2]

bool Domain::within ( Point pt)

Determines whether point is within domain

Parameters
ptPoint to locate.
Returns
True if point within domain

References WXP::Const::MISS, WXP::DomainVal::proj, WXP::Point::x, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Point::y, WXP::Rect::ymax, and WXP::Rect::ymin.

Referenced by within().

◆ withinExt() [1/2]

bool Domain::withinExt ( EarthPoint ept,
int  ext 
)

Determines whether point is within extended domain

Parameters
eptEarthPoint to locate.
extHow much beyond the edge of domain to search (grid spaces)
Returns
True if point within domain

References tran(), and withinExt().

◆ withinExt() [2/2]

bool Domain::withinExt ( Point pt,
int  ext 
)

Determines whether point is within extended domain

Parameters
ptPoint to locate.
extHow much beyond the edge of domain to search (grid spaces)
Returns
True if point within domain

References WXP::DomainVal::dx, WXP::DomainVal::dy, WXP::Const::MISS, WXP::DomainVal::proj, WXP::Point::x, WXP::Rect::xmax, WXP::Rect::xmin, WXP::Point::y, WXP::Rect::ymax, and WXP::Rect::ymin.

Referenced by WXP::CityHash::setup(), and withinExt().

◆ wrapLine() [1/2]

int Domain::wrapLine ( Point pt1,
Point pt2 
)

Wraps line around the edge of a projection. It will adjust either point to draw through projection edge. It returns what correction has been done.

Parameters
pt1First point
pt2Second point
Returns
1=wrap on right, -1 = wrap on left

References earth_rad, LAMB, LATLON, MERC, MOLL, offset(), OFFSET_LL, OFFSET_MERC, WXP::Const::PI, WXP::DomainVal::proj, WXP::Point::x, and WXP::Point::y.

Referenced by WXP::Plot::drawFill(), WXP::Plot::drawLine(), WXP::Plot::drawLine(), and WXP::Plot::drawSpline().

◆ wrapLine() [2/2]

int Domain::wrapLine ( Points pts)

Wraps line around the edge of a projection. It will adjust either point to draw through projection edge. It returns what correction has been done.

Parameters
ptsSet of points in line
Returns
1=wrap on right, -1 = wrap on left

References earth_rad, WXP::Points::getNum(), WXP::Points::getX(), WXP::Points::getY(), LAMB, LATLON, MERC, MOLL, WXP::Points::offset(), offset(), OFFSET_LL, OFFSET_MERC, WXP::Const::PI, and WXP::DomainVal::proj.

◆ zoom()

int Domain::zoom ( Point pt,
float  zfac 
)

Zooms a domain (resets size)

Parameters
ptNew centerpoint
zfacZoom factor (>1=zoom in, <1=zoom out)

References WXP::DomainVal::clat, WXP::DomainVal::clon, WXP::DomainVal::dx, WXP::DomainVal::dy, WXP::EarthPoint::lat, WXP::EarthPoint::lon, setLimits(), and tran().

Referenced by WXP::Figure::callback().

Member Data Documentation

◆ ALBERS

const int WXP::Domain::ALBERS = DomainVal::ALBERS
static

Albers equal area

Referenced by getProj(), print(), setParam(), tran(), and tran().

◆ CAT

const int WXP::Domain::CAT = DomainVal::CAT
static

Category plot

Referenced by getProj(), isCoord(), print(), toString(), tran(), and tran().

◆ earth_maj

double Domain::earth_maj = 63.78137
static

Major axis earth radius

Referenced by init(), setParam(), tran(), and tran().

◆ earth_min

double Domain::earth_min = 63.56752
static

Minor axis earth radius

Referenced by init(), and tran().

◆ earth_rad

double Domain::earth_rad = 63.7122
static

◆ EMA

const int WXP::Domain::EMA = DomainVal::EMA
static

Emagram thermodynamic diagram

Referenced by getProj(), print(), toString(), tran(), and tran().

◆ GNOM

const int WXP::Domain::GNOM = DomainVal::GNOM
static

Gnomic

Referenced by getProj(), print(), and toString().

◆ LAMB

const int WXP::Domain::LAMB = DomainVal::LAMB
static

◆ LAMBAZ

const int WXP::Domain::LAMBAZ = DomainVal::LAMBAZ
static

Lambert azithumal

Referenced by getProj(), print(), toString(), tran(), and tran().

◆ LATLON

const int WXP::Domain::LATLON = DomainVal::LATLON
static

◆ MERC

const int WXP::Domain::MERC = DomainVal::MERC
static

◆ MOLL

const int WXP::Domain::MOLL = DomainVal::MOLL
static

◆ OFFSET_LL

float Domain::OFFSET_LL = 360
static

Projection limit for Lat/Lon

Referenced by offsetLine(), offsetLine(), WXP::GridBox::set(), wrapLine(), and wrapLine().

◆ OFFSET_MERC

float Domain::OFFSET_MERC = 360*63.7122*.017453293
static

Projection limit for Mercator

Referenced by adjust(), offsetLine(), offsetLine(), WXP::GridBox::set(), wrapLine(), and wrapLine().

◆ ORTHO

const int WXP::Domain::ORTHO = DomainVal::ORTHO
static

Orthographic

Referenced by getProj(), print(), toString(), tran(), and tran().

◆ PIXEL

const int WXP::Domain::PIXEL = DomainVal::PIXEL
static

◆ POLAR

const int WXP::Domain::POLAR = DomainVal::POLAR
static

Polar coordinate

Referenced by getProj(), isPolar(), print(), toString(), tran(), and tran().

◆ PSTEREO

const int WXP::Domain::PSTEREO = DomainVal::PSTEREO
static

◆ RADIAL

const int WXP::Domain::RADIAL = DomainVal::RADIAL
static

Radar Radial

Referenced by getMapFactor(), getProj(), print(), setParam(), tran(), tran(), tran(), and tran().

◆ RTEPH

const int WXP::Domain::RTEPH = DomainVal::RTEPH
static

Rotated Tephigram thermodynamic diagram

Referenced by getProj(), isTherm(), print(), toString(), tran(), and tran().

◆ SAT

const int WXP::Domain::SAT = DomainVal::SAT
static

◆ SIZE

const int WXP::Domain::SIZE = DomainVal::SIZE
static

Specifies size of grid/image only

Referenced by WXP::DomainTool::decode(), and getProj().

◆ SKEWT

const int WXP::Domain::SKEWT = DomainVal::SKEWT
static

SkewT thermodynamic diagram

Referenced by WXP::DomainTool::decode(), getProj(), isTherm(), print(), toString(), tran(), and tran().

◆ STUVE

const int WXP::Domain::STUVE = DomainVal::STUVE
static

Stuve thermodynamic diagram

Referenced by getProj(), print(), toString(), tran(), and tran().

◆ TEPH

const int WXP::Domain::TEPH = DomainVal::TEPH
static

Tephigram thermodynamic diagram

Referenced by getProj(), print(), toString(), tran(), and tran().

◆ XLOGP

const int WXP::Domain::XLOGP = DomainVal::XLOGP
static

◆ XP

const int WXP::Domain::XP = DomainVal::XP
static

X-Pres Cartesian

Referenced by getProj(), tran(), and tran().

◆ XY

const int WXP::Domain::XY = DomainVal::XY
static

XY Cartesian

Referenced by WXP::MapPlot::draw(), getProj(), print(), set(), toString(), tran(), and tran().

◆ XZ

const int WXP::Domain::XZ = DomainVal::XZ
static

XZ Cartesian

Referenced by print(), and toString().

◆ ZOOM

const int WXP::Domain::ZOOM = DomainVal::ZOOM
static

Specifies zoom parameters

Referenced by WXP::DomainTool::decode(), getProj(), print(), and toString().


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