 |
Ice Sheet System Model
4.18
Code documentation
|
Go to the documentation of this file.
10 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
15 #include "../shared/shared.h"
22 memcpy(
altmode,
"clampToGround",(strlen(
"clampToGround")+1)*
sizeof(
char));
65 if(flag)
_printf0_(indent <<
"KML_Point:\n");
68 if(flag)
_printf0_(indent <<
" extrude: " << (
extrude ?
"true" :
"false") <<
"\n");
77 fprintf(filout,
"%s<Point",indent);
79 fprintf(filout,
">\n");
84 fprintf(filout,
"%s <extrude>%d</extrude>\n",indent,(
extrude ? 1 : 0));
85 fprintf(filout,
"%s <altitudeMode>%s</altitudeMode>\n",indent,
altmode);
86 fprintf(filout,
"%s <coordinates>%0.16g,%0.16g,%0.16g</coordinates>\n",
89 fprintf(filout,
"%s</Point>\n",indent);
96 double* pcoords=&
coords[0];
110 if (!strncmp(kstri,
"</Point", 7)) {
111 xDelete<char>(kstri);
114 else if (!strncmp(kstri,
"</",2))
115 {
_error_(
"KML_Point::Read -- Unexpected closing tag " << kstri <<
".\n");}
116 else if (strncmp(kstri,
"<",1))
117 {
_error_(
"KML_Point::Read -- Unexpected field \"" << kstri <<
"\".\n");}
119 else if (!strcmp(kstri,
"<extrude>"))
121 else if (!strcmp(kstri,
"<altitudeMode>"))
123 else if (!strcmp(kstri,
"<coordinates>"))
126 else if (!strncmp(kstri,
"<",1))
129 xDelete<char>(kstri);
134 for(ncom=ncom; ncom>0; ncom--)
135 xDelete<char>(pcom[ncom-1]);
136 xDelete<char*>(pcom);
155 Ll2xyx(&x,&y,&lat,&lon,1,sgn,cm,sp);
164 memcpy(nstr2,nstr,(strlen(nstr)+1)*
sizeof(
char));
166 for (i=0; i<strlen(nstr2); i++)
167 if ((nstr2[i] ==
' ') || (nstr2[i] ==
'\t'))
169 fprintf(fid,
"## Name:%s\n",nstr2);
170 fprintf(fid,
"## Icon:0\n");
171 fprintf(fid,
"# Points Count Value\n");
172 fprintf(fid,
"%u %s\n",1,
"1.");
173 fprintf(fid,
"# X pos Y pos\n");
177 fprintf(fid,
"%lf\t%lf\n",x,y);
int Ll2xyx(double *x, double *y, double *lat, double *lon, int ncoord, int sgn)
#define _printf0_(StreamArgs)
virtual void WriteAttrib(FILE *fid, const char *indent)
void Write(FILE *fid, const char *indent)
: header file for kml file reading utilities.
int KMLFileTagAttrib(KML_Object *kobj, char *ktag)
#define KML_POINT_ALTMODE_LENGTH
char altmode[KML_POINT_ALTMODE_LENGTH+1]
char * KMLFileToken(FILE *fid, int *pncom=NULL, char ***ppcom=NULL)
void Read(FILE *fid, char *kstr)
int KMLFileTokenParse(int *pival, char *ktag, FILE *fid)
void Write(FILE *fid, const char *indent)
#define _error_(StreamArgs)
: header file for kml_point object
virtual void AddCommnt(int ncom, char **pcom)
virtual void WriteCommnt(FILE *fid, const char *indent)
void WriteExp(FILE *fid, const char *nstr, int sgn, double cm, double sp)
void Read(FILE *fid, char *kstr)