Changeset 2546 in Sophya for trunk/SophyaPI/PI/pi3ddrw.cc
- Timestamp:
- Jun 2, 2004, 3:22:07 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pi3ddrw.cc
r2544 r2546 262 262 } 263 263 264 /* --Methode-- */ 265 int PIDrawer3D::DecodeOptionString(vector<string> & opt, bool rmdecopt) 266 { 267 int optsz1 = opt.size(); 268 if(optsz1<1) return(0); 269 // On appelle d'abord le decodage de la classe PIDrawer de laquelle 270 // on herite. (Pas obligatoire) on decode donc ici les attributs de 271 // couleur, fontes ... 272 int ndec1 = PIDrawer::DecodeOptionString(opt, rmdecopt); 273 if(optsz1-ndec1<1) return(ndec1); // si tout a ete decode 274 275 vector<string> udopt; // On gardera ici les options non decodees 276 unsigned int k = 0; 277 int ndec = opt.size(); 278 for( k=0; k<opt.size(); k++ ) { 279 string opts = opt[k]; 280 if ( (opts == "rescale") || (opts == "autoscale") ) aScxy = aScz = true; 281 else if ( (opts == "norescale") || (opts == "noautoscale") ) aScxy = aScz = false; 282 else if ( (opts == "rescalexy") || (opts == "autoscalexy") ) aScxy = true; 283 else if ( (opts == "norescalexy") || (opts == "noautoscalexy") ) aScxy = false; 284 else if ( (opts == "rescalez") || (opts == "autoscalez") ) aScz = true; 285 else if ( (opts == "norescalez") || (opts == "noautoscalez") ) aScz = false; 286 else { 287 // Si option non decode 288 ndec--; 289 // S'il faut supprimer les options decodees 290 if (rmdecopt) udopt.push_back(opts); 291 } 292 } 293 // S'il faut supprimer les options decodees, on remplace l'argument opt 294 // par le vecteur des options non decodees. 295 if (rmdecopt) opt = udopt; 296 return(ndec+ndec1); 297 } 298 299 /* --Methode-- */ 300 int PIDrawer3D::OptionToString(vector<string> & opt) const 301 { 302 PIDrawer::OptionToString(opt); 303 if ( aScxy || aScz ) opt.push_back("autoscale"); 304 else if (!aScxy && !aScz ) opt.push_back("noautoscale"); 305 else { 306 if(aScxy) opt.push_back("autoscalexy"); else opt.push_back("noautoscalexy"); 307 if(aScz) opt.push_back("autoscalez"); else opt.push_back("noautoscalez"); 308 } 309 return 1; 310 } 311 312 /* --Methode-- */ 313 void PIDrawer3D::GetOptionsHelpInfo(string& info) 314 { 315 info += " ---- PIDrawer3D options help info : \n" ; 316 info += " X/Y,Z axis rescaling option (-> cubic 3D box) \n"; 317 info += " rescale=autoscale/ norescale=noautoscale : X/Y and Z axis \n"; 318 info += " rescalexy=autoscalexy / norescalexy=noautoscalexy : X/Y axis \n"; 319 info += " rescalexy=autoscalexy / norescalexy=noautoscalexy : Z axis \n"; 320 info += " --- + Usual color/line/marker/... attribute decoding \n"; 321 // On recupere ensuite la chaine info de la classe de base 322 PIDrawer::GetOptionsHelpInfo(info); 323 return; 324 } 325 264 326 /* -------------------------------------------------------------- */ 265 327 /* ------------------- Classe PIElDrawer3D ------------------------ */ … … 319 381 int nopt0 = opt.size(); 320 382 if (nopt0 < 1) return(0); 321 int ndec1 = PIDrawer ::DecodeOptionString(opt, rmdecopt);383 int ndec1 = PIDrawer3D::DecodeOptionString(opt, rmdecopt); 322 384 if ((nopt0 - ndec1) < 1) return(ndec1); // si tout a ete decode 323 385 vector<string> udopt;
Note:
See TracChangeset
for help on using the changeset viewer.