Browse Source

Gmt module: Add function GMT_Datadir.

gmtdatadir
Michael Uleysky 8 years ago
parent
commit
a9c04cfb90
  1. 2
      modules/gmt/modgmt.cpp
  2. 5
      modules/gmt/modgmt_func.cpp
  3. 1
      modules/gmt/modgmt_func.h
  4. 1
      modules/gmt/modgmt_internals.cpp
  5. 1
      modules/gmt/modgmt_internals.h

2
modules/gmt/modgmt.cpp

@ -15,6 +15,7 @@ int gmt_module_init(void* p)
if(0==gmtapi) return 1; if(0==gmtapi) return 1;
if(0==ret) ret=callgmtmodule(gmtapi,"psclip","-C -P -K",&header,gmt_filter_headfoot); if(0==ret) ret=callgmtmodule(gmtapi,"psclip","-C -P -K",&header,gmt_filter_headfoot);
if(0==ret) ret=callgmtmodule(gmtapi,"psclip","-C -P -O",&footer,gmt_filter_headfoot); if(0==ret) ret=callgmtmodule(gmtapi,"psclip","-C -P -O",&footer,gmt_filter_headfoot);
if(0==ret) callgmtmodule(gmtapi,"psclip","--show-datadir",&datadir);
GMT_Destroy_Session(gmtapi); GMT_Destroy_Session(gmtapi);
if(0!=ret) return ret; if(0!=ret) return ret;
@ -23,6 +24,7 @@ int gmt_module_init(void* p)
RegisterFunction("GMT_Header",GMT_Header); RegisterFunction("GMT_Header",GMT_Header);
RegisterFunction("GMT_Footer",GMT_Footer); RegisterFunction("GMT_Footer",GMT_Footer);
RegisterFunction("GMT_Datadir",GMT_Datadir);
RegisterFunction("GET",Get<ObjectGMTCoord>); RegisterFunction("GET",Get<ObjectGMTCoord>);
RegisterFunction("GET",Get<ObjectGMTRegion>); RegisterFunction("GET",Get<ObjectGMTRegion>);
RegisterFunction("GET",Get<ObjectGMTProjection>); RegisterFunction("GET",Get<ObjectGMTProjection>);

5
modules/gmt/modgmt_func.cpp

@ -21,6 +21,11 @@ const ObjectBase* GMT_Footer(const ObjectList* input)
return new ObjectString(footer); return new ObjectString(footer);
} }
const ObjectBase* GMT_Datadir(const ObjectList* input)
{
return new ObjectString(datadir);
}
const ObjectBase* GMT_ColorGray(const ObjectList* input) const ObjectBase* GMT_ColorGray(const ObjectList* input)
{ {
struct gmt_color c; struct gmt_color c;

1
modules/gmt/modgmt_func.h

@ -6,6 +6,7 @@
const ObjectBase* GMT_Header(const ObjectList* input); const ObjectBase* GMT_Header(const ObjectList* input);
const ObjectBase* GMT_Footer(const ObjectList* input); const ObjectBase* GMT_Footer(const ObjectList* input);
const ObjectBase* GMT_Datadir(const ObjectList* input);
const ObjectBase* GMT_ColorGray(const ObjectList* input); const ObjectBase* GMT_ColorGray(const ObjectList* input);
const ObjectBase* GMT_ColorRGB(const ObjectList* input); const ObjectBase* GMT_ColorRGB(const ObjectList* input);
const ObjectBase* GMT_ColorHSV(const ObjectList* input); const ObjectBase* GMT_ColorHSV(const ObjectList* input);

1
modules/gmt/modgmt_internals.cpp

@ -3,6 +3,7 @@
#include "modgmt_internals.h" #include "modgmt_internals.h"
std::string header,footer; std::string header,footer;
std::string datadir;
// Workaround exit() in GMT_Call_Module. May need because return mode of gmt api is not very reliable // Workaround exit() in GMT_Call_Module. May need because return mode of gmt api is not very reliable
#if defined MODGMT_WORKAROUND_EXIT #if defined MODGMT_WORKAROUND_EXIT

1
modules/gmt/modgmt_internals.h

@ -7,6 +7,7 @@
// here we save header and footer of gmt-produced eps files // here we save header and footer of gmt-produced eps files
extern std::string header,footer; extern std::string header,footer;
extern std::string datadir;
extern const int GMTMODE; extern const int GMTMODE;
// Parameters for working thread // Parameters for working thread

Loading…
Cancel
Save