Changeset 7460
- Timestamp:
- 02/16/11 10:00:20 (14 years ago)
- Location:
- issm/trunk/src/m/kml
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/kml/kml_colorstyle.m
r7297 r7460 1 1 % 2 % definition for the kml_colorstyle super (base) and sub (derived) class.2 % definition for the kml_colorstyle super (base) and sub (derived) abstract class. 3 3 % 4 4 % [kml]=kml_colorstyle(varargin) … … 96 96 % set the properties of the object 97 97 98 function [kml]=set (kml,varargin)98 function [kml]=setprops(kml,varargin) 99 99 100 100 kmlref=feval(class(kml)); … … 139 139 140 140 for i=1:numel(kml) 141 if strcmp(class(kml),'kml_colorstyle') 142 if ~isempty(kml(i).id) 143 fprintf(fid,'%s<!ColorStyle id="%s">\n',indent,kml(i).id); 141 kmli=kml(i); 142 if strcmp(class(kml),'kml_colorstyle') 143 if ~isempty(kmli.id) 144 fprintf(fid,'%s<!ColorStyle id="%s">\n',indent,kmli.id); 144 145 else 145 146 fprintf(fid,'%s<!ColorStyle>\n',indent); 146 147 end 147 148 end 148 kml_write@kml_substyle(kml (i),fid,indent);149 if ~isempty(kml (i).color)150 fprintf(fid,'%s <color>%s</color>\n',indent,kml (i).color);151 end 152 if ~isempty(kml (i).colormode)153 fprintf(fid,'%s <colorMode>%s</colorMode>\n',indent,kml (i).colormode);149 kml_write@kml_substyle(kmli,fid,indent); 150 if ~isempty(kmli.color) 151 fprintf(fid,'%s <color>%s</color>\n',indent,kmli.color); 152 end 153 if ~isempty(kmli.colormode) 154 fprintf(fid,'%s <colorMode>%s</colorMode>\n',indent,kmli.colormode); 154 155 end 155 156 if strcmp(class(kml),'kml_colorstyle') -
issm/trunk/src/m/kml/kml_container.m
r7297 r7460 1 1 % 2 % definition for the kml_container super (base) and sub (derived) class.2 % definition for the kml_container super (base) and sub (derived) abstract class. 3 3 % 4 4 % [kml]=kml_container(varargin) … … 92 92 % set the properties of the object 93 93 94 function [kml]=set (kml,varargin)94 function [kml]=setprops(kml,varargin) 95 95 96 96 kmlref=feval(class(kml)); … … 135 135 136 136 for i=1:numel(kml) 137 kmli=kml(i); 137 138 if strcmp(class(kml),'kml_container') 138 if ~isempty(kml (i).id)139 fprintf(fid,'%s<!Container id="%s">\n',indent,kml (i).id);139 if ~isempty(kmli.id) 140 fprintf(fid,'%s<!Container id="%s">\n',indent,kmli.id); 140 141 else 141 142 fprintf(fid,'%s<!Container>\n',indent); 142 143 end 143 144 end 144 kml_write@kml_feature(kml (i),fid,indent);145 kml_write@kml_feature(kmli,fid,indent); 145 146 if strcmp(class(kml),'kml_container') 146 147 fprintf(fid,'%s<!/Container>\n',indent); … … 180 181 end 181 182 183 % delete the object 184 185 function []=delete(kml) 186 187 % loop over the containers 188 189 for i=numel(kml):-1:1 190 kmli=kml(i); 191 delete@kml_feature(kmli); 192 end 193 194 end 195 182 196 end 183 197 -
issm/trunk/src/m/kml/kml_document.m
r7297 r7460 94 94 % set the properties of the object 95 95 96 function [kml]=set (kml,varargin)96 function [kml]=setprops(kml,varargin) 97 97 98 98 kmlref=feval(class(kml)); … … 137 137 138 138 for i=1:numel(kml) 139 if ~isempty(kml(i).id) 140 fprintf(fid,'%s<Document id="%s">\n',indent,kml(i).id); 139 kmli=kml(i); 140 if ~isempty(kmli.id) 141 fprintf(fid,'%s<Document id="%s">\n',indent,kmli.id); 141 142 else 142 143 fprintf(fid,'%s<Document>\n',indent); 143 144 end 144 kml_write@kml_container(kml (i),fid,indent);145 kml_write@kml_container(kmli,fid,indent); 145 146 146 147 % loop over the features for each document 147 148 148 for j=1:numel(kml (i).feature)149 if ~isempty(kml (i).feature{j})150 if isa(kml (i).feature{j},'kml_feature')151 kml_write(kml (i).feature{j},fid,[indent ' ']);149 for j=1:numel(kmli.feature) 150 if ~isempty(kmli.feature{j}) 151 if isa(kmli.feature{j},'kml_feature') 152 kml_write(kmli.feature{j},fid,[indent ' ']); 152 153 else 153 154 warning('kml(%d).feature{%d} is a ''%s'' class object, not ''%s''.',... 154 i,j,class(kml (i).feature{j}),'kml_feature');155 i,j,class(kmli.feature{j}),'kml_feature'); 155 156 end 156 157 end … … 202 203 end 203 204 205 % delete the object 206 207 function []=delete(kml) 208 209 % loop over the documents 210 211 for i=numel(kml):-1:1 212 kmli=kml(i); 213 delete@kml_container(kmli); 214 215 % loop over the features for each document 216 217 for j=numel(kmli.feature):-1:1 218 if ~isempty(kmli.feature{j}) 219 if isa(kmli.feature{j},'kml_feature') 220 delete(kmli.feature{j}); 221 else 222 warning('kml(%d).feature{%d} is a ''%s'' class object, not ''%s''.',... 223 i,j,class(kmli.feature{j}),'kml_feature'); 224 end 225 end 226 end 227 kmli.feature ={}; 228 229 end 230 231 end 232 204 233 end 205 234 -
issm/trunk/src/m/kml/kml_feature.m
r7297 r7460 1 1 % 2 % definition for the kml_feature super (base) and sub (derived) class.2 % definition for the kml_feature super (base) and sub (derived) abstract class. 3 3 % 4 4 % [kml]=kml_feature(varargin) … … 118 118 % set the properties of the object 119 119 120 function [kml]=set (kml,varargin)120 function [kml]=setprops(kml,varargin) 121 121 122 122 kmlref=feval(class(kml)); … … 161 161 162 162 for i=1:numel(kml) 163 if strcmp(class(kml),'kml_feature') 164 if ~isempty(kml(i).id) 165 fprintf(fid,'%s<!Feature id="%s">\n',indent,kml(i).id); 163 kmli=kml(i); 164 if strcmp(class(kml),'kml_feature') 165 if ~isempty(kmli.id) 166 fprintf(fid,'%s<!Feature id="%s">\n',indent,kmli.id); 166 167 else 167 168 fprintf(fid,'%s<!Feature>\n',indent); 168 169 end 169 170 end 170 kml_write@kml_object(kml (i),fid,indent);171 if ~isempty(kml (i).name)172 fprintf(fid,'%s <name>%s</name>\n',indent,kml (i).name);173 end 174 fprintf(fid,'%s <visibility>%d</visibility>\n',indent,kml (i).visibility);175 fprintf(fid,'%s <open>%d</open>\n',indent,kml (i).open);176 if ~isempty(kml (i).snippet)177 fprintf(fid,'%s <Snippet maxLines="2">%s</Snippet>\n',indent,kml (i).snippet);178 end 179 if ~isempty(kml (i).descript)180 fprintf(fid,'%s <description>%s</description>\n',indent,kml (i).descript);181 end 182 if ~isempty(kml (i).styleurl)183 fprintf(fid,'%s <styleUrl>%s</styleUrl>\n',indent,kml (i).styleurl);171 kml_write@kml_object(kmli,fid,indent); 172 if ~isempty(kmli.name) 173 fprintf(fid,'%s <name>%s</name>\n',indent,kmli.name); 174 end 175 fprintf(fid,'%s <visibility>%d</visibility>\n',indent,kmli.visibility); 176 fprintf(fid,'%s <open>%d</open>\n',indent,kmli.open); 177 if ~isempty(kmli.snippet) 178 fprintf(fid,'%s <Snippet maxLines="2">%s</Snippet>\n',indent,kmli.snippet); 179 end 180 if ~isempty(kmli.descript) 181 fprintf(fid,'%s <description>%s</description>\n',indent,kmli.descript); 182 end 183 if ~isempty(kmli.styleurl) 184 fprintf(fid,'%s <styleUrl>%s</styleUrl>\n',indent,kmli.styleurl); 184 185 end 185 186 186 187 % loop over the styles for each feature 187 188 188 for j=1:numel(kml (i).style)189 if ~isempty(kml (i).style{j})190 if isa(kml (i).style{j},'kml_styleselector')191 kml_write(kml (i).style{j},fid,[indent ' ']);189 for j=1:numel(kmli.style) 190 if ~isempty(kmli.style{j}) 191 if isa(kmli.style{j},'kml_styleselector') 192 kml_write(kmli.style{j},fid,[indent ' ']); 192 193 else 193 194 warning('kml(%d).style{%d} is a ''%s'' class object, not ''%s''.',... 194 i,j,class(kml (i).style{j}),'kml_styleselector');195 i,j,class(kmli.style{j}),'kml_styleselector'); 195 196 end 196 197 end … … 262 263 end 263 264 265 % delete the object 266 267 function []=delete(kml) 268 269 % loop over the features 270 271 for i=numel(kml):-1:1 272 kmli=kml(i); 273 274 % loop over the styles for each feature 275 276 for j=numel(kmli.style):-1:1 277 if ~isempty(kmli.style{j}) 278 if isa(kmli.style{j},'kml_styleselector') 279 delete(kmli.style{j}); 280 else 281 warning('kml(%d).style{%d} is a ''%s'' class object, not ''%s''.',... 282 i,j,class(kmli.style{j}),'kml_styleselector'); 283 end 284 end 285 end 286 kmli.style ={}; 287 288 end 289 290 end 291 264 292 end 265 293 -
issm/trunk/src/m/kml/kml_folder.m
r7297 r7460 94 94 % set the properties of the object 95 95 96 function [kml]=set (kml,varargin)96 function [kml]=setprops(kml,varargin) 97 97 98 98 kmlref=feval(class(kml)); … … 137 137 138 138 for i=1:numel(kml) 139 if ~isempty(kml(i).id) 140 fprintf(fid,'%s<Folder id="%s">\n',indent,kml(i).id); 139 kmli=kml(i); 140 if ~isempty(kmli.id) 141 fprintf(fid,'%s<Folder id="%s">\n',indent,kmli.id); 141 142 else 142 143 fprintf(fid,'%s<Folder>\n',indent); 143 144 end 144 kml_write@kml_container(kml (i),fid,indent);145 kml_write@kml_container(kmli,fid,indent); 145 146 146 147 % loop over the features for each folder 147 148 148 for j=1:numel(kml (i).feature)149 if ~isempty(kml (i).feature{j})150 if isa(kml (i).feature{j},'kml_feature')151 kml_write(kml (i).feature{j},fid,[indent ' ']);149 for j=1:numel(kmli.feature) 150 if ~isempty(kmli.feature{j}) 151 if isa(kmli.feature{j},'kml_feature') 152 kml_write(kmli.feature{j},fid,[indent ' ']); 152 153 else 153 154 warning('kml(%d).feature{%d} is a ''%s'' class object, not ''%s''.',... 154 i,j,class(kml (i).feature{j}),'kml_feature');155 i,j,class(kmli.feature{j}),'kml_feature'); 155 156 end 156 157 end … … 202 203 end 203 204 205 % delete the object 206 207 function []=delete(kml) 208 209 % loop over the folders 210 211 for i=numel(kml):-1:1 212 kmli=kml(i); 213 delete@kml_container(kmli); 214 215 % loop over the features for each folder 216 217 for j=numel(kmli.feature):-1:1 218 if ~isempty(kmli.feature{j}) 219 if isa(kmli.feature{j},'kml_feature') 220 delete(kmli.feature{j}); 221 else 222 warning('kml(%d).feature{%d} is a ''%s'' class object, not ''%s''.',... 223 i,j,class(kmli.feature{j}),'kml_feature'); 224 end 225 end 226 end 227 kmli.feature ={}; 228 229 end 230 231 end 232 204 233 end 205 234 -
issm/trunk/src/m/kml/kml_geometry.m
r7297 r7460 1 1 % 2 % definition for the kml_geometry super (base) and sub (derived) class.2 % definition for the kml_geometry super (base) and sub (derived) abstract class. 3 3 % 4 4 % [kml]=kml_geometry(varargin) … … 85 85 % set the properties of the object 86 86 87 function [kml]=set (kml,varargin)87 function [kml]=setprops(kml,varargin) 88 88 89 89 kmlref=feval(class(kml)); … … 128 128 129 129 for i=1:numel(kml) 130 kmli=kml(i); 130 131 if strcmp(class(kml),'kml_geometry') 131 if ~isempty(kml (i).id)132 fprintf(fid,'%s<!Geometry id="%s">\n',indent,kml (i).id);132 if ~isempty(kmli.id) 133 fprintf(fid,'%s<!Geometry id="%s">\n',indent,kmli.id); 133 134 else 134 135 fprintf(fid,'%s<!Geometry>\n',indent); 135 136 end 136 137 end 137 kml_write@kml_object(kml (i),fid,indent);138 kml_write@kml_object(kmli,fid,indent); 138 139 if strcmp(class(kml),'kml_geometry') 139 140 fprintf(fid,'%s</!Geometry>\n',indent); -
issm/trunk/src/m/kml/kml_linearring.m
r7297 r7460 99 99 % set the properties of the object 100 100 101 function [kml]=set (kml,varargin)101 function [kml]=setprops(kml,varargin) 102 102 103 103 kmlref=feval(class(kml)); … … 142 142 143 143 for i=1:numel(kml) 144 if ~isempty(kml(i).id) 145 fprintf(fid,'%s<LinearRing id="%s">\n',indent,kml(i).id); 144 kmli=kml(i); 145 if ~isempty(kmli.id) 146 fprintf(fid,'%s<LinearRing id="%s">\n',indent,kmli.id); 146 147 else 147 148 fprintf(fid,'%s<LinearRing>\n',indent); 148 149 end 149 kml_write@kml_geometry(kml(i),fid,indent); 150 fprintf(fid,'%s <extrude>%d</extrude>\n',indent,kml(i).extrude); 151 fprintf(fid,'%s <tessellate>%d</tessellate>\n',indent,kml(i).tessellate); 152 fprintf(fid,'%s <altitudeMode>%s</altitudeMode>\n',indent,kml(i).altmode); 150 kml_write@kml_geometry(kmli,fid,indent); 151 % fprintf(fid,'%s <extrude>%d</extrude>\n',indent,kmli.extrude); 152 % fprintf(fid,'%s <tessellate>%d</tessellate>\n',indent,kmli.tessellate); 153 % fprintf(fid,'%s <altitudeMode>%s</altitudeMode>\n',indent,kmli.altmode); 154 fprintf(fid,'%s <extrude>%d</extrude>\n',indent,0); 155 fprintf(fid,'%s <tessellate>%d</tessellate>\n',indent,0); 156 fprintf(fid,'%s <altitudeMode>%s</altitudeMode>\n',indent,'clampToGround'); 153 157 fprintf(fid,'%s <coordinates>\n',indent); 154 158 155 159 % loop over the coordinates for each linearring 156 160 157 for j=1:size(kml (i).coords,1)158 fprintf(fid,'%s %0.16g,%0.16g,%0.16g\n',indent,kml (i).coords(j,:));161 for j=1:size(kmli.coords,1) 162 fprintf(fid,'%s %0.16g,%0.16g,%0.16g\n',indent,kmli.coords(j,:)); 159 163 end 160 164 -
issm/trunk/src/m/kml/kml_linestring.m
r7297 r7460 99 99 % set the properties of the object 100 100 101 function [kml]=set (kml,varargin)101 function [kml]=setprops(kml,varargin) 102 102 103 103 kmlref=feval(class(kml)); … … 142 142 143 143 for i=1:numel(kml) 144 if ~isempty(kml(i).id) 145 fprintf(fid,'%s<LineString id="%s">\n',indent,kml(i).id); 144 kmli=kml(i); 145 if ~isempty(kmli.id) 146 fprintf(fid,'%s<LineString id="%s">\n',indent,kmli.id); 146 147 else 147 148 fprintf(fid,'%s<LineString>\n',indent); 148 149 end 149 kml_write@kml_geometry(kml (i),fid,indent);150 fprintf(fid,'%s <extrude>%d</extrude>\n',indent,kml (i).extrude);151 fprintf(fid,'%s <tessellate>%d</tessellate>\n',indent,kml (i).tessellate);152 fprintf(fid,'%s <altitudeMode>%s</altitudeMode>\n',indent,kml (i).altmode);150 kml_write@kml_geometry(kmli,fid,indent); 151 fprintf(fid,'%s <extrude>%d</extrude>\n',indent,kmli.extrude); 152 fprintf(fid,'%s <tessellate>%d</tessellate>\n',indent,kmli.tessellate); 153 fprintf(fid,'%s <altitudeMode>%s</altitudeMode>\n',indent,kmli.altmode); 153 154 fprintf(fid,'%s <coordinates>\n',indent); 154 155 155 156 % loop over the coordinates for each linestring 156 157 157 for j=1:size(kml (i).coords,1)158 fprintf(fid,'%s %0.16g,%0.16g,%0.16g\n',indent,kml (i).coords(j,:));158 for j=1:size(kmli.coords,1) 159 fprintf(fid,'%s %0.16g,%0.16g,%0.16g\n',indent,kmli.coords(j,:)); 159 160 end 160 161 -
issm/trunk/src/m/kml/kml_linestyle.m
r7297 r7460 88 88 % set the properties of the object 89 89 90 function [kml]=set (kml,varargin)90 function [kml]=setprops(kml,varargin) 91 91 92 92 kmlref=feval(class(kml)); … … 131 131 132 132 for i=1:numel(kml) 133 if ~isempty(kml(i).id) 134 fprintf(fid,'%s<LineStyle id="%s">\n',indent,kml(i).id); 133 kmli=kml(i); 134 if ~isempty(kmli.id) 135 fprintf(fid,'%s<LineStyle id="%s">\n',indent,kmli.id); 135 136 else 136 137 fprintf(fid,'%s<LineStyle>\n',indent); 137 138 end 138 kml_write@kml_colorstyle(kml (i),fid,indent);139 fprintf(fid,'%s <width>%d</width>\n',indent,kml (i).width);139 kml_write@kml_colorstyle(kmli,fid,indent); 140 fprintf(fid,'%s <width>%d</width>\n',indent,kmli.width); 140 141 fprintf(fid,'%s</LineStyle>\n',indent); 141 142 end -
issm/trunk/src/m/kml/kml_mesh_elem.m
r7418 r7460 125 125 kfold.descript =sprintf('Elements=%d, Grids=%d',... 126 126 md.numberofelements,md.numberofgrids); 127 kfold.feature ={repmat(kml_placemark(),1,size(md.elements,1))}; 127 % see matlab_oop, "initializing a handle object array" 128 %kfold.feature ={repmat(kml_placemark(),1,size(md.elements,1))}; 129 kfeat(size(md.elements,1))=kml_placemark(); 130 kfold.feature={kfeat}; 128 131 129 132 % write each element as a polygon placemark … … 131 134 disp(['Writing ' num2str(size(md.elements,1)) ' tria elements as KML polygons.']); 132 135 for i=1:size(md.elements,1) 136 %for i=1:5000 133 137 kplace=kml_placemark(); 134 138 kplace.name =sprintf('Element %d',i); 135 139 kplace.visibility=1; 136 140 if exist('edata','var') 137 kplace.descript =sprintf('Element data: %g',edata(i)); 141 % kplace.descript =sprintf('Element data: %g',edata(i)); 142 kplace.descript =sprintf('campaign{\n deformation %g quad_pol ascending right asap;\n}',edata(i)); 138 143 imap = fix((edata(i)-cmin)/(cmax-cmin)*size(cmap,1))+1; 139 144 if (imap >= 1) && (imap <= size(cmap,1)) … … 163 168 kplace.geometry=kpoly; 164 169 kfold.feature{1}(i)=kplace; 165 clear kring kpoly kplace 170 % clear kring kpoly kplace 171 172 if ~mod(i,1000) 173 disp([' ' num2str(i) ' tria elements written.']); 174 end 166 175 end 167 176 -
issm/trunk/src/m/kml/kml_mesh_write.m
r7418 r7460 153 153 kstyle.poly =kpsty; 154 154 kdoc.style{1}(end+1)=kstyle; 155 clear kstyle kp oly kline155 clear kstyle kpsty klsty 156 156 157 157 klsty=kml_linestyle(); … … 167 167 kstyle.poly =kpsty; 168 168 kdoc.style{1}(end+1)=kstyle; 169 clear kstyle kp oly kline169 clear kstyle kpsty klsty 170 170 171 171 klsty=kml_linestyle(); … … 181 181 kstyle.poly =kpsty; 182 182 kdoc.style{1}(end+1)=kstyle; 183 clear kstyle kp oly kline183 clear kstyle kpsty klsty 184 184 185 185 % colormap command operates on a figure, so create an invisible one … … 209 209 kstyle.poly =kpsty; 210 210 kdoc.style{1}(end+1)=kstyle; 211 clear kstyle kp oly kline211 clear kstyle kpsty klsty 212 212 end 213 213 end … … 256 256 kml_file_write(kdoc,filek); 257 257 % kml_file_swrite(kdoc,filek); 258 259 end 260 258 delete(kdoc); 259 260 end 261 -
issm/trunk/src/m/kml/kml_multigeometry.m
r7297 r7460 87 87 % set the properties of the object 88 88 89 function [kml]=set (kml,varargin)89 function [kml]=setprops(kml,varargin) 90 90 91 91 kmlref=feval(class(kml)); … … 130 130 131 131 for i=1:numel(kml) 132 if ~isempty(kml(i).id) 133 fprintf(fid,'%s<MultiGeometry id="%s">\n',indent,kml(i).id); 132 kmli=kml(i); 133 if ~isempty(kmli.id) 134 fprintf(fid,'%s<MultiGeometry id="%s">\n',indent,kmli.id); 134 135 else 135 136 fprintf(fid,'%s<MultiGeometry>\n',indent); 136 137 end 137 kml_write@kml_geometry(kml (i),fid,indent);138 kml_write@kml_geometry(kmli,fid,indent); 138 139 139 140 % loop over the geometry elements for each multigeometry 140 141 141 for j=1:numel(kml(i).geometry) 142 if ~isempty(kml(i).geometry{j}) 143 if isa(kml(i).geometry{j},'kml_geometry') 144 kml_write(kml(i).geometry{j},fid,[indent ' ']); 142 for j=1:numel(kmli.geometry) 143 kmlij=kmli.geometry{j}; 144 if ~isempty(kmlij) 145 if isa(kmlij,'kml_geometry') 146 kml_write(kmlij,fid,[indent ' ']); 145 147 else 146 148 warning('kml(%d).geometry{%d} is a ''%s'' class object, not ''%s''.',... 147 i,j,class(kml (i).geometry{j}),'kml_geometry');149 i,j,class(kmlij),'kml_geometry'); 148 150 end 149 151 end … … 196 198 end 197 199 200 % delete the object 201 202 function []=delete(kml) 203 204 % loop over the multigeometry 205 206 for i=numel(kml):-1:1 207 kmli=kml(i); 208 209 % loop over the geometry elements for each multigeometry 210 211 for j=numel(kmli.geometry):-1:1 212 kmlij=kmli.geometry{j}; 213 if ~isempty(kmlij) 214 if isa(kmlij,'kml_geometry') 215 delete(kmlij); 216 else 217 warning('kml(%d).geometry{%d} is a ''%s'' class object, not ''%s''.',... 218 i,j,class(kmlij),'kml_geometry'); 219 end 220 end 221 end 222 kmli.geometry ={}; 223 224 end 225 226 end 227 198 228 end 199 229 -
issm/trunk/src/m/kml/kml_object.m
r7336 r7460 1 1 % 2 % definition for the kml_object super (base) class.2 % definition for the kml_object super (base) abstract class. 3 3 % 4 4 % [kml]=kml_object(varargin) … … 86 86 % set the properties of the object 87 87 88 function [kml]=set (kml,varargin)88 function [kml]=setprops(kml,varargin) 89 89 90 90 kmlref=feval(class(kml)); … … 129 129 130 130 for i=1:numel(kml) 131 kmli=kml(i); 131 132 if strcmp(class(kml),'kml_object') 132 if ~isempty(kml (i).id)133 fprintf(fid,'%s<!Object id="%s">\n',indent,kml (i).id);133 if ~isempty(kmli.id) 134 fprintf(fid,'%s<!Object id="%s">\n',indent,kmli.id); 134 135 else 135 136 fprintf(fid,'%s<!Object>\n',indent); -
issm/trunk/src/m/kml/kml_part_edges.m
r7418 r7460 471 471 472 472 kmgeom.geometry{1}(i)=kline; 473 clear kline473 % clear kline 474 474 end 475 475 476 476 kplace.geometry=kmgeom; 477 477 kfold.feature{1}(k)=kplace; 478 clear kmgeom kplace479 end 480 end 481 482 end 483 478 % clear kmgeom kplace 479 end 480 end 481 482 end 483 -
issm/trunk/src/m/kml/kml_part_elems.m
r7418 r7460 205 205 kpoly.outer=kring; 206 206 kmgeom.geometry{1}(i)=kpoly; 207 clear kring kpoly207 % clear kring kpoly 208 208 end 209 209 210 210 kplace.geometry=kmgeom; 211 211 kfold.feature{1}(k)=kplace; 212 clear kmgeom kplace213 end 214 end 215 216 end 217 212 % clear kmgeom kplace 213 end 214 end 215 216 end 217 -
issm/trunk/src/m/kml/kml_part_flagedges.m
r7418 r7460 103 103 kplace.geometry=kline; 104 104 kfold.feature{1}(i)=kplace; 105 clear kline kplace105 % clear kline kplace 106 106 end 107 107 end -
issm/trunk/src/m/kml/kml_partitions.m
r7418 r7460 474 474 kpoly.outer=kring; 475 475 kmgeom.geometry{1}(i)=kpoly; 476 clear kring kpoly476 % clear kring kpoly 477 477 end 478 478 479 479 kplace.geometry=kmgeom; 480 480 kfold.feature{1}(k)=kplace; 481 clear kmgeom kplace482 end 483 end 484 485 end 486 481 % clear kmgeom kplace 482 end 483 end 484 485 end 486 -
issm/trunk/src/m/kml/kml_placemark.m
r7297 r7460 94 94 % set the properties of the object 95 95 96 function [kml]=set (kml,varargin)96 function [kml]=setprops(kml,varargin) 97 97 98 98 kmlref=feval(class(kml)); … … 137 137 138 138 for i=1:numel(kml) 139 if ~isempty(kml(i).id) 140 fprintf(fid,'%s<Placemark id="%s">\n',indent,kml(i).id); 139 kmli=kml(i); 140 if ~isempty(kmli.id) 141 fprintf(fid,'%s<Placemark id="%s">\n',indent,kmli.id); 141 142 else 142 143 fprintf(fid,'%s<Placemark>\n',indent); 143 144 end 144 kml_write@kml_feature(kml (i),fid,indent);145 kml_write@kml_feature(kmli,fid,indent); 145 146 146 147 % loop over the geometry elements for each placemark 147 148 148 for j=1:min(1,numel(kml(i).geometry)) 149 if ~isempty(kml(i).geometry(j)) 150 if isa(kml(i).geometry(j),'kml_geometry') 151 kml_write(kml(i).geometry(j),fid,[indent ' ']); 149 for j=1:min(1,numel(kmli.geometry)) 150 kmlij=kmli.geometry(j); 151 if ~isempty(kmlij) 152 if isa(kmlij,'kml_geometry') 153 kml_write(kmlij,fid,[indent ' ']); 152 154 else 153 155 warning('kml(%d).geometry(%d) is a ''%s'' class object, not ''%s''.',... 154 i,j,class(kml (i).geometry(j)),'kml_geometry');156 i,j,class(kmlij),'kml_geometry'); 155 157 end 156 158 end … … 203 205 end 204 206 207 % delete the object 208 209 function []=delete(kml) 210 211 % loop over the placemarks 212 213 for i=numel(kml):-1:1 214 kmli=kml(i); 215 delete@kml_feature(kmli); 216 217 % loop over the geometry elements for each placemark 218 219 for j=min(1,numel(kmli.geometry)):-1:1 220 kmlij=kmli.geometry(j); 221 if ~isempty(kmlij) 222 if isa(kmlij,'kml_geometry') 223 delete(kmlij); 224 else 225 warning('kml(%d).geometry(%d) is a ''%s'' class object, not ''%s''.',... 226 i,j,class(kmlij),'kml_geometry'); 227 end 228 end 229 end 230 kmli.geometry =kml_geometry.empty(); 231 232 end 233 234 end 235 205 236 end 206 237 -
issm/trunk/src/m/kml/kml_polygon.m
r7297 r7460 21 21 tessellate=false; 22 22 altmode ='clampToGround'; 23 outer =kml_linearring ();23 outer =kml_linearring.empty(); 24 24 inner =kml_linearring.empty(); 25 25 end … … 104 104 % set the properties of the object 105 105 106 function [kml]=set (kml,varargin)106 function [kml]=setprops(kml,varargin) 107 107 108 108 kmlref=feval(class(kml)); … … 147 147 148 148 for i=1:numel(kml) 149 if ~isempty(kml(i).id) 150 fprintf(fid,'%s<Polygon id="%s">\n',indent,kml(i).id); 149 kmli=kml(i); 150 if ~isempty(kmli.id) 151 fprintf(fid,'%s<Polygon id="%s">\n',indent,kmli.id); 151 152 else 152 153 fprintf(fid,'%s<Polygon>\n',indent); 153 154 end 154 kml_write@kml_geometry(kml (i),fid,indent);155 fprintf(fid,'%s <extrude>%d</extrude>\n',indent,kml (i).extrude);156 fprintf(fid,'%s <tessellate>%d</tessellate>\n',indent,kml (i).tessellate);157 fprintf(fid,'%s <altitudeMode>%s</altitudeMode>\n',indent,kml (i).altmode);155 kml_write@kml_geometry(kmli,fid,indent); 156 fprintf(fid,'%s <extrude>%d</extrude>\n',indent,kmli.extrude); 157 fprintf(fid,'%s <tessellate>%d</tessellate>\n',indent,kmli.tessellate); 158 fprintf(fid,'%s <altitudeMode>%s</altitudeMode>\n',indent,kmli.altmode); 158 159 fprintf(fid,'%s <outerBoundaryIs>\n',indent); 159 if isa(kml (i).outer,'kml_linearring')160 kml_write(kml (i).outer,fid,[indent ' ']);160 if isa(kmli.outer,'kml_linearring') 161 kml_write(kmli.outer,fid,[indent ' ']); 161 162 else 162 163 warning('kml(%d).outer is a ''%s'' class object, not ''%s''.',... 163 i,class(kml (i).outer),'kml_linearring');164 i,class(kmli.outer),'kml_linearring'); 164 165 end 165 166 fprintf(fid,'%s </outerBoundaryIs>\n',indent); … … 167 168 % loop over any inner boundaries for each polygon 168 169 169 if isa(kml (i).inner,'kml_linearring')170 for j=1:numel(kml (i).inner)170 if isa(kmli.inner,'kml_linearring') 171 for j=1:numel(kmli.inner) 171 172 fprintf(fid,'%s <innerBoundaryIs>\n',indent); 172 kml_write(kml (i).inner(j),fid,[indent ' ']);173 kml_write(kmli.inner(j),fid,[indent ' ']); 173 174 fprintf(fid,'%s </innerBoundaryIs>\n',indent); 174 175 end 175 176 else 176 177 warning('kml(%d).inner is a ''%s'' class object, not ''%s''.',... 177 i,class(kml (i).inner),'kml_linearring');178 i,class(kmli.inner),'kml_linearring'); 178 179 end 179 180 … … 234 235 end 235 236 237 % delete the object 238 239 function []=delete(kml) 240 241 % loop over the polygons 242 243 for i=numel(kml):-1:1 244 kmli=kml(i); 245 if isa(kmli.outer,'kml_linearring') 246 delete(kmli.outer); 247 else 248 warning('kml(%d).outer is a ''%s'' class object, not ''%s''.',... 249 i,class(kmli.outer),'kml_linearring'); 250 end 251 kmli.outer =kml_linearring.empty(); 252 253 % loop over any inner boundaries for each polygon 254 255 if isa(kmli.inner,'kml_linearring') 256 for j=numel(kmli.inner):-1:1 257 delete(kmli.inner(j)); 258 end 259 else 260 warning('kml(%d).inner is a ''%s'' class object, not ''%s''.',... 261 i,class(kmli.inner),'kml_linearring'); 262 end 263 kmli.inner =kml_linearring.empty(); 264 265 end 266 267 end 268 236 269 end 237 270 -
issm/trunk/src/m/kml/kml_polystyle.m
r7297 r7460 92 92 % set the properties of the object 93 93 94 function [kml]=set (kml,varargin)94 function [kml]=setprops(kml,varargin) 95 95 96 96 kmlref=feval(class(kml)); … … 135 135 136 136 for i=1:numel(kml) 137 if ~isempty(kml(i).id) 138 fprintf(fid,'%s<PolyStyle id="%s">\n',indent,kml(i).id); 137 kmli=kml(i); 138 if ~isempty(kmli.id) 139 fprintf(fid,'%s<PolyStyle id="%s">\n',indent,kmli.id); 139 140 else 140 141 fprintf(fid,'%s<PolyStyle>\n',indent); 141 142 end 142 kml_write@kml_colorstyle(kml (i),fid,indent);143 fprintf(fid,'%s <fill>%d</fill>\n',indent,kml (i).fill);144 fprintf(fid,'%s <outline>%d</outline>\n',indent,kml (i).outline);143 kml_write@kml_colorstyle(kmli,fid,indent); 144 fprintf(fid,'%s <fill>%d</fill>\n',indent,kmli.fill); 145 fprintf(fid,'%s <outline>%d</outline>\n',indent,kmli.outline); 145 146 fprintf(fid,'%s</PolyStyle>\n',indent); 146 147 end -
issm/trunk/src/m/kml/kml_style.m
r7297 r7460 116 116 % set the properties of the object 117 117 118 function [kml]=set (kml,varargin)118 function [kml]=setprops(kml,varargin) 119 119 120 120 kmlref=feval(class(kml)); … … 159 159 160 160 for i=1:numel(kml) 161 if ~isempty(kml(i).id) 162 fprintf(fid,'%s<Style id="%s">\n',indent,kml(i).id); 161 kmli=kml(i); 162 if ~isempty(kmli.id) 163 fprintf(fid,'%s<Style id="%s">\n',indent,kmli.id); 163 164 else 164 165 fprintf(fid,'%s<Style>\n',indent); 165 166 end 166 kml_write@kml_styleselector(kml (i),fid,indent);167 % if isa(kml (i).icon,'kml_iconstyle')168 % kml_write(kml (i).icon,fid,[indent ' ']);167 kml_write@kml_styleselector(kmli,fid,indent); 168 % if isa(kmli.icon,'kml_iconstyle') 169 % kml_write(kmli.icon,fid,[indent ' ']); 169 170 % else 170 171 % warning('kml(%d).icon is a ''%s'' class object, not ''%s''.',... 171 % i,class(kml (i).icon),'kml_iconstyle');172 % end 173 % if isa(kml (i).label,'kml_labelstyle')174 % kml_write(kml (i).label,fid,[indent ' ']);172 % i,class(kmli.icon),'kml_iconstyle'); 173 % end 174 % if isa(kmli.label,'kml_labelstyle') 175 % kml_write(kmli.label,fid,[indent ' ']); 175 176 % else 176 177 % warning('kml(%d).label is a ''%s'' class object, not ''%s''.',... 177 % i,class(kml (i).label),'kml_labelstyle');178 % end 179 if isa(kml (i).line,'kml_linestyle')180 kml_write(kml (i).line,fid,[indent ' ']);178 % i,class(kmli.label),'kml_labelstyle'); 179 % end 180 if isa(kmli.line,'kml_linestyle') 181 kml_write(kmli.line,fid,[indent ' ']); 181 182 else 182 183 warning('kml(%d).line is a ''%s'' class object, not ''%s''.',... 183 i,class(kml (i).line),'kml_linestyle');184 end 185 if isa(kml (i).poly,'kml_polystyle')186 kml_write(kml (i).poly,fid,[indent ' ']);184 i,class(kmli.line),'kml_linestyle'); 185 end 186 if isa(kmli.poly,'kml_polystyle') 187 kml_write(kmli.poly,fid,[indent ' ']); 187 188 else 188 189 warning('kml(%d).poly is a ''%s'' class object, not ''%s''.',... 189 i,class(kml (i).poly),'kml_polystyle');190 end 191 % if isa(kml (i).balloon,'kml_balloonstyle')192 % kml_write(kml (i).balloon,fid,[indent ' ']);190 i,class(kmli.poly),'kml_polystyle'); 191 end 192 % if isa(kmli.balloon,'kml_balloonstyle') 193 % kml_write(kmli.balloon,fid,[indent ' ']); 193 194 % else 194 195 % warning('kml(%d).balloon is a ''%s'' class object, not ''%s''.',... 195 % i,class(kml (i).balloon),'kml_balloonstyle');196 % end 197 % if isa(kml (i).list,'kml_liststyle')198 % kml_write(kml (i).list,fid,[indent ' ']);196 % i,class(kmli.balloon),'kml_balloonstyle'); 197 % end 198 % if isa(kmli.list,'kml_liststyle') 199 % kml_write(kmli.list,fid,[indent ' ']); 199 200 % else 200 201 % warning('kml(%d).list is a ''%s'' class object, not ''%s''.',... 201 % i,class(kml (i).list),'kml_liststyle');202 % i,class(kmli.list),'kml_liststyle'); 202 203 % end 203 204 fprintf(fid,'%s</Style>\n',indent); … … 268 269 end 269 270 271 % delete the object 272 273 function []=delete(kml) 274 275 % loop over the styles 276 277 for i=numel(kml):-1:1 278 kmli=kml(i); 279 % if isa(kmli.icon,'kml_iconstyle') 280 % delete(kmli.icon); 281 % else 282 % warning('kml(%d).icon is a ''%s'' class object, not ''%s''.',... 283 % i,class(kmli.icon),'kml_iconstyle'); 284 % end 285 % kmli.icon =kml_iconstyle.empty(); 286 % if isa(kmli.label,'kml_labelstyle') 287 % delete(kmli.label); 288 % else 289 % warning('kml(%d).label is a ''%s'' class object, not ''%s''.',... 290 % i,class(kmli.label),'kml_labelstyle'); 291 % end 292 % kmli.label =kml_labelstyle.empty(); 293 if isa(kmli.line,'kml_linestyle') 294 delete(kmli.line); 295 else 296 warning('kml(%d).line is a ''%s'' class object, not ''%s''.',... 297 i,class(kmli.line),'kml_linestyle'); 298 end 299 kmli.line =kml_linestyle.empty(); 300 if isa(kmli.poly,'kml_polystyle') 301 delete(kmli.poly); 302 else 303 warning('kml(%d).poly is a ''%s'' class object, not ''%s''.',... 304 i,class(kmli.poly),'kml_polystyle'); 305 end 306 kmli.poly =kml_polystyle.empty(); 307 % if isa(kmli.balloon,'kml_balloonstyle') 308 % delete(kmli.balloon); 309 % else 310 % warning('kml(%d).balloon is a ''%s'' class object, not ''%s''.',... 311 % i,class(kmli.balloon),'kml_balloonstyle'); 312 % end 313 % kmli.balloon =kml_balloonstyle.empty(); 314 % if isa(kmli.list,'kml_liststyle') 315 % delete(kmli.list); 316 % else 317 % warning('kml(%d).list is a ''%s'' class object, not ''%s''.',... 318 % i,class(kmli.list),'kml_liststyle'); 319 % end 320 % kmli.list =kml_liststyle.empty(); 321 end 322 323 end 324 270 325 end 271 326 -
issm/trunk/src/m/kml/kml_styleselector.m
r7297 r7460 1 1 % 2 % definition for the kml_styleselector super (base) and sub (derived) class.2 % definition for the kml_styleselector super (base) and sub (derived) abstract class. 3 3 % 4 4 % [kml]=kml_styleselector(varargin) … … 85 85 % set the properties of the object 86 86 87 function [kml]=set (kml,varargin)87 function [kml]=setprops(kml,varargin) 88 88 89 89 kmlref=feval(class(kml)); … … 128 128 129 129 for i=1:numel(kml) 130 kmli=kml(i); 130 131 if strcmp(class(kml),'kml_styleselector') 131 if ~isempty(kml (i).id)132 fprintf(fid,'%s<!StyleSelector id="%s">\n',indent,kml (i).id);132 if ~isempty(kmli.id) 133 fprintf(fid,'%s<!StyleSelector id="%s">\n',indent,kmli.id); 133 134 else 134 135 fprintf(fid,'%s<!StyleSelector>\n',indent); 135 136 end 136 137 end 137 kml_write@kml_object(kml (i),fid,indent);138 kml_write@kml_object(kmli,fid,indent); 138 139 if strcmp(class(kml),'kml_styleselector') 139 140 fprintf(fid,'%s</!StyleSelector>\n',indent); -
issm/trunk/src/m/kml/kml_substyle.m
r7297 r7460 1 1 % 2 % definition for the kml_substyle super (base) and sub (derived) class.2 % definition for the kml_substyle super (base) and sub (derived) abstract class. 3 3 % 4 4 % [kml]=kml_substyle(varargin) … … 85 85 % set the properties of the object 86 86 87 function [kml]=set (kml,varargin)87 function [kml]=setprops(kml,varargin) 88 88 89 89 kmlref=feval(class(kml)); … … 128 128 129 129 for i=1:numel(kml) 130 kmli=kml(i); 130 131 if strcmp(class(kml),'kml_substyle') 131 if ~isempty(kml (i).id)132 fprintf(fid,'%s<!SubStyle id="%s">\n',indent,kml (i).id);132 if ~isempty(kmli.id) 133 fprintf(fid,'%s<!SubStyle id="%s">\n',indent,kmli.id); 133 134 else 134 135 fprintf(fid,'%s<!SubStyle>\n',indent); 135 136 end 136 137 end 137 kml_write@kml_object(kml (i),fid,indent);138 kml_write@kml_object(kmli,fid,indent); 138 139 if strcmp(class(kml),'kml_substyle') 139 140 fprintf(fid,'%s<!/SubStyle>\n',indent); -
issm/trunk/src/m/kml/kml_unsh_edges.m
r7418 r7460 109 109 kplace.geometry=kline; 110 110 kfold.feature{1}(i)=kplace; 111 clear kline kplace111 % clear kline kplace 112 112 end 113 113 end
Note:
See TracChangeset
for help on using the changeset viewer.