Changeset 10633
- Timestamp:
- 11/14/11 14:49:25 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/KMLMeshWritex/KMLFileReadx.cpp
r9761 r10633 11 11 KML_Object* KMLFileReadx(FILE* fid){ 12 12 13 int c;14 13 char* kstr; 15 int ival; 16 bool bval; 17 char* pstr=NULL; 18 double (*pdval3)[3]=NULL; 19 KML_Object* kobj=NULL; 20 KML_Document* kdoc=NULL; 14 KML_File* kxml=NULL; 15 KML_File* kdtd=NULL; 21 16 KML_File* kfil=NULL; 22 17 … … 30 25 /* read kml file */ 31 26 32 // while ((c=getc(fid)) != EOF)33 // _printf_(true,"%c",c);34 27 while (kstr=KMLFileToken(fid)) { 35 if (!strncmp(kstr,"<?xml" ,5) || 36 // !strncmp(kstr,"<kml" ,4) || 37 !strncmp(kstr,"<LineString",11) || 38 !strncmp(kstr,"<LinearRing",11)) 39 KMLFileTagAttrib(NULL, 28 if (!strncmp(kstr,"<?xml" ,5)) { 29 kxml=new KML_File(); 30 KMLFileTagAttrib(kxml, 40 31 kstr); 41 if (!strcmp(kstr,"<extrude>"))42 KMLFileTokenParse(&ival,43 kstr,44 fid);45 if (!strcmp(kstr,"<tessellate>"))46 KMLFileTokenParse(&bval,47 kstr,48 fid);49 if (!strcmp(kstr,"<altitudeMode>"))50 pstr=KMLFileTokenParse((char *)NULL,NULL,0,51 kstr,52 fid);53 if (!strcmp(kstr,"<coordinates>"))54 KMLFileTokenParse(&pdval3,NULL,0,55 kstr,56 fid);57 if (!strncmp(kstr,"<LinearRing",11))58 KMLFileTagSkip(kstr,59 fid);60 if (!strncmp(kstr,"<Document",9)) {61 kdoc=new KML_Document();62 kdoc->Read(fid,kstr);63 // kdoc->DeepEcho();64 kobj=kdoc;65 32 } 66 if (!strncmp(kstr,"<kml",4)) { 33 else if (!strncmp(kstr,"<!DOCTYPE",9)) { 34 kdtd=new KML_File(); 35 KMLFileTagAttrib(kdtd, 36 kstr); 37 } 38 else if (!strncmp(kstr,"<kml" ,4)) { 67 39 kfil=new KML_File(); 68 40 kfil->Read(fid,kstr); 69 41 // kfil->DeepEcho(); 70 kobj=kfil;71 42 } 72 43 73 44 // _printf_(true,"%s\n",kstr); 74 45 xfree((void**)&kstr); 46 } 47 48 if (kxml) { 49 _printf_(true,"XML declaration:\n"); 50 kxml->DeepEcho(" "); 51 delete kxml; 52 } 53 if (kdtd) { 54 _printf_(true,"DTD declaration (not yet implemented):\n"); 55 kdtd->DeepEcho(" "); 56 delete kdtd; 75 57 } 76 58 … … 80 62 ((double)(clock1-clock0))/CLOCKS_PER_SEC,difftime(time1,time0)); 81 63 82 return(k obj);64 return(kfil); 83 65 } 84 66
Note:
See TracChangeset
for help on using the changeset viewer.