Changeset 8461 for issm/trunk/src/c/objects/KML/KML_MultiGeometry.cpp
- Timestamp:
- 06/01/11 09:13:35 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/KML/KML_MultiGeometry.cpp
r8293 r8461 81 81 if (geometry->Size()) 82 82 for (i=0; i<geometry->Size(); i++) { 83 _printf_(flag,"%s geometry: [%d] begin\n" ,indent,i);83 _printf_(flag,"%s geometry: -------- begin [%d] --------\n" ,indent,i); 84 84 ((KML_Geometry *)geometry->GetObjectByOffset(i))->DeepEcho(indent2); 85 _printf_(flag,"%s geometry: [%d] end\n",indent,i);85 _printf_(flag,"%s geometry: -------- end [%d] --------\n" ,indent,i); 86 86 } 87 87 else … … 98 98 char indent2[81]; 99 99 100 if (this->id && strlen(this->id)) 101 fprintf(filout,"%s<MultiGeometry id=\"%s\">\n",indent,this->id); 102 else 103 fprintf(filout,"%s<MultiGeometry>\n",indent); 100 fprintf(filout,"%s<MultiGeometry",indent); 101 WriteAttrib(filout," "); 102 fprintf(filout,">\n"); 104 103 105 104 KML_Geometry::Write(filout,indent); … … 122 121 void KML_MultiGeometry::Read(FILE* fid,char* kstr){ 123 122 123 char* kstri; 124 KML_Object* kobj; 125 126 /* get object attributes */ 127 128 KMLFileTagAttrib(this, 129 kstr); 130 131 /* loop over and process fields within opening and closing tags */ 132 133 while (kstri=KMLFileToken(fid)) { 134 if (!strncmp(kstri,"</MultiGeometry",15)) { 135 xfree((void**)&kstri); 136 break; 137 } 138 else if (!strncmp(kstri,"</",2)) 139 _error_("KML_MultiGeometry::Read -- Unexpected closing tag %s.\n",kstri); 140 else if (strncmp(kstri,"<",1)) 141 _error_("KML_MultiGeometry::Read -- Unexpected field \"%s\".\n",kstri); 142 143 // else if (!strncmp(kstri,"<Point", 6)) { 144 // kobj=(KML_Object*)new KML_Point(); 145 // kobj->Read(fid,kstri); 146 // geometry ->AddObject((Object*)kobj); 147 // } 148 149 else if (!strncmp(kstri,"<LineString",11)) { 150 kobj=(KML_Object*)new KML_LineString(); 151 kobj->Read(fid,kstri); 152 geometry ->AddObject((Object*)kobj); 153 } 154 155 else if (!strncmp(kstri,"<LinearRing",11)) { 156 kobj=(KML_Object*)new KML_LinearRing(); 157 kobj->Read(fid,kstri); 158 geometry ->AddObject((Object*)kobj); 159 } 160 161 else if (!strncmp(kstri,"<Polygon", 8)) { 162 kobj=(KML_Object*)new KML_Polygon(); 163 kobj->Read(fid,kstri); 164 geometry ->AddObject((Object*)kobj); 165 } 166 167 else if (!strncmp(kstri,"<MultiGeometry",14)) { 168 kobj=(KML_Object*)new KML_MultiGeometry(); 169 kobj->Read(fid,kstri); 170 geometry ->AddObject((Object*)kobj); 171 } 172 173 else if (!strncmp(kstri,"<",1)) 174 KML_Geometry::Read(fid,kstri); 175 176 xfree((void**)&kstri); 177 } 124 178 125 179 return;
Note:
See TracChangeset
for help on using the changeset viewer.