/*!\file KML_LatLonBox.cpp * \brief: implementation of the kml_feature abstract object */ /*Headers:*/ /*{{{*/ #ifdef HAVE_CONFIG_H #include #else #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" #endif #include "./KML_LatLonBox.h" #include "./KMLFileReadUtils.h" #include "../shared/shared.h" /*}}}*/ /*Constructors/destructor/copy*/ /*FUNCTION KML_LatLonBox::KML_LatLonBox(){{{*/ KML_LatLonBox::KML_LatLonBox(){ north = 0.; south = 0.; east = 0.; west = 0.; rotation = 0.; } /*}}}*/ /*FUNCTION KML_LatLonBox::~KML_LatLonBox(){{{*/ KML_LatLonBox::~KML_LatLonBox(){ ; } /*}}}*/ /*Other*/ /*FUNCTION KML_LatLonBox::Echo {{{*/ void KML_LatLonBox::Echo(){ _printf_("KML_LatLonBox:\n"); KML_Object::Echo(); _printf_(" north: " << north << "\n"); _printf_(" south: " << south << "\n"); _printf_(" east: " << east << "\n"); _printf_(" west: " << west << "\n"); _printf_(" rotation: " << rotation << "\n"); } /*}}}*/ /*FUNCTION KML_LatLonBox::DeepEcho {{{*/ void KML_LatLonBox::DeepEcho(){ char indent[81]=""; KML_LatLonBox::DeepEcho(indent); return; } /*}}}*/ /*FUNCTION KML_LatLonBox::DeepEcho {{{*/ void KML_LatLonBox::DeepEcho(const char* indent){ _printf_(indent << "KML_LatLonBox:\n"); KML_Object::DeepEcho(indent); _printf_(" north: " << north << "\n"); _printf_(" south: " << south << "\n"); _printf_(" east: " << east << "\n"); _printf_(" west: " << west << "\n"); _printf_(" rotation: " << rotation << "\n"); } /*}}}*/ /*FUNCTION KML_LatLonBox::Write {{{*/ void KML_LatLonBox::Write(FILE* filout,const char* indent){ fprintf(filout,"%s\n"); WriteCommnt(filout,indent); KML_Object::Write(filout,indent); fprintf(filout,"%s %0.16g\n",indent,north); fprintf(filout,"%s %0.16g\n",indent,south); fprintf(filout,"%s %0.16g\n",indent,east); fprintf(filout,"%s %0.16g\n",indent,west); fprintf(filout,"%s %0.16g\n",indent,rotation); fprintf(filout,"%s\n",indent); return; } /*}}}*/ /*FUNCTION KML_LatLonBox::Read {{{*/ void KML_LatLonBox::Read(FILE* fid,char* kstr){ char* kstri; int ncom=0; char** pcom=NULL; /* get object attributes and check for solo tag */ if (KMLFileTagAttrib(this, kstr)) return; /* loop over and process fields within opening and closing tags */ while((kstri=KMLFileToken(fid, &ncom,&pcom))){ if (!strncmp(kstri,"(kstri); break; } else if (!strncmp(kstri,"")) KMLFileTokenParse(&north , kstri, fid); else if (!strcmp(kstri,"")) KMLFileTokenParse(&south , kstri, fid); else if (!strcmp(kstri,"")) KMLFileTokenParse(&east , kstri, fid); else if (!strcmp(kstri,"")) KMLFileTokenParse(&west , kstri, fid); else if (!strcmp(kstri,"")) KMLFileTokenParse(&rotation , kstri, fid); else if (!strncmp(kstri,"<",1)) KML_Object::Read(fid,kstri); xDelete(kstri); } this->AddCommnt(ncom,pcom); for (ncom=ncom; ncom>0; ncom--) xDelete(pcom[ncom-1]); xDelete(pcom); return; } /*}}}*/