Browse Source

Gmt module: Rename incorrect template name Base2NonNeg to right Base2Pos.

gmtdatadir
Michael Uleysky 8 years ago
parent
commit
55eef96865
  1. 14
      modules/gmt/modgmt_func.h

14
modules/gmt/modgmt_func.h

@ -195,7 +195,7 @@ class Base2CoordD: public DefaultConverter<Base2Coord>
};
// Convertors for double non-negative value
class Base2NonNeg: public Base2Double
class Base2Pos: public Base2Double
{
public:
double Convert(const ObjectBase* ob, bool* res, std::string& err)
@ -209,7 +209,7 @@ class Base2NonNeg: public Base2Double
return t;
}
};
using Base2NonNegD=DefaultConverter<Base2NonNeg>;
using Base2PosD=DefaultConverter<Base2Pos>;
// Convertors for double values which must be in some interval
template<int32_t Min, int32_t Max>
@ -383,7 +383,7 @@ class Convert2Struct<struct gmt_projection, ObjectList>
ONFPar<Base2Proj,ObjectGMTProjection> proj("projection");
ONFPar<Base2Region,ObjectGMTRegion> region("region");
ONPar<Base2StringD> type("[projection][( |_)]t[ype]","mercator");
ONPar<Base2NonNegD> width("width",gmt_projection::default_width),height("height",gmt_projection::default_width);
ONPar<Base2PosD> width("width",gmt_projection::default_width),height("height",gmt_projection::default_width);
{ParseNamedParameters params(input,type,region,proj,width,height); if(!params) {err=params.Error(); goto fail;}} // Fail to parse by variant 3
@ -433,7 +433,7 @@ class Convert2Struct<struct gmt_projection, ObjectList>
}
case(gmt_projection::TRANSMERCATOR): // t Parameters: central meridian (cmer, default is center of region), latitude of origin (orlat, default is 0.0), scale factor (scale, default is 1.0)
{
ONPar<Base2NonNegD> scale("scale",1.0);
ONPar<Base2PosD> scale("scale",1.0);
ONPar<Base2CoordD> orlat("(l[atitude][( |_)][of( |_)]origin|o[rigin][( |_)]latitude)",0.0);
{ParseNamedParameters apar(input,cmer,scale,orlat); if(!apar) {err=apar.Error(); goto fail;}} // Fail to parse additional parameters
if( cmer.Exist() || changetype) p.t.cmer =cmer;
@ -572,7 +572,7 @@ class Convert2Struct<struct gmt_projection, ObjectList>
{
RPosPar<Base2String> type("projection type");
RPosPar<Base2NonNeg> width("width");
RPosPar<Base2Pos> width("width");
RPosPar<Base2Region> region("region");
{ParsePositionalParameters params(input,0,3,type,width,region); if(!params) {err=params.Error(); goto fail;}} // Fail to parse by variant 4
@ -586,7 +586,7 @@ class Convert2Struct<struct gmt_projection, ObjectList>
{
case(gmt_projection::XY): // x Parameter 4 is height (by default equal width)
{
OPosPar<Base2NonNegD> height("height",p.width);
OPosPar<Base2PosD> height("height",p.width);
{ParsePositionalParameters params(input,3,input->Size(),height); if(!params) {err=params.Error(); goto fail;}} // Fail to parse additional parameters
p.x.height=height;
break;
@ -611,7 +611,7 @@ class Convert2Struct<struct gmt_projection, ObjectList>
{
OPosPar<Base2CoordD> cmer("central meridian",(p.region.xb+p.region.xe)*0.5);
OPosPar<Base2CoordD> orlat("latitude of origin",0.0);
OPosPar<Base2NonNegD> scale("scale",1.0);
OPosPar<Base2PosD> scale("scale",1.0);
{ParsePositionalParameters params(input,3,input->Size(),cmer,orlat,scale); if(!params) {err=params.Error(); goto fail;}} // Fail to parse additional parameters
p.t.cmer=cmer; p.t.orlat=orlat; p.t.scale=scale;
break;

Loading…
Cancel
Save