Changeset 4943
- Timestamp:
- 08/03/10 09:43:56 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Container/Inputs.cpp
r4927 r4943 315 315 } 316 316 /*}}}*/ 317 /*FUNCTION Inputs::ChangeEnum{{{1*/ 318 void Inputs::ChangeEnum(int oldenumtype,int newenumtype){ 319 320 /*Go through dataset of inputs and look for input with 321 * same enum as input enum, once found, just change its name */ 322 vector<Object*>::iterator object; 323 Input* input=NULL; 324 325 /*Delete existing input of newenumtype if it exists*/ 326 for ( object=objects.begin() ; object < objects.end(); object++ ){ 327 input=(Input*)(*object); 328 329 if (input->EnumType()==newenumtype){ 330 this->DeleteObject(input); 331 break; 332 } 333 } 334 335 /*Change enum_type of input of oldenumtype*/ 336 for ( object=objects.begin() ; object < objects.end(); object++ ){ 337 338 input=(Input*)(*object); 339 340 if (input->EnumType()==oldenumtype){ 341 input->ChangeEnum(newenumtype); 342 break; 343 } 344 } 345 } 346 /*}}}*/ 317 347 /*FUNCTION Inputs::GetInput{{{1*/ 318 348 Input* Inputs::GetInput(int enum_name){ … … 352 382 } 353 383 /*}}}*/ 354 /*FUNCTION Inputs::ChangeEnum{{{1*/ 355 void Inputs::ChangeEnum(int oldenumtype,int newenumtype){ 356 357 /*Go through dataset of inputs and look for input with 358 * same enum as input enum, once found, just change its name */ 359 vector<Object*>::iterator object; 360 Input* input=NULL; 361 362 /*Delete existing input of newenumtype if it exists*/ 363 for ( object=objects.begin() ; object < objects.end(); object++ ){ 364 input=(Input*)(*object); 365 366 if (input->EnumType()==newenumtype){ 367 this->DeleteObject(input); 368 break; 369 } 370 } 371 372 /*Change enum_type of input of oldenumtype*/ 373 for ( object=objects.begin() ; object < objects.end(); object++ ){ 374 375 input=(Input*)(*object); 376 377 if (input->EnumType()==oldenumtype){ 378 input->ChangeEnum(newenumtype); 379 break; 380 } 381 } 384 /*FUNCTION Inputs::DuplicateInput{{{1*/ 385 void Inputs::DuplicateInput(int original_enum,int new_enum){ 386 387 Input* original=NULL; 388 Input* copy=NULL; 389 390 /*Make a copy of the original input: */ 391 original=(Input*)this->GetInput(original_enum); 392 if(!original)ISSMERROR("could not find input with enum: %s",EnumAsString(original_enum)); 393 copy=(Input*)original->copy(); 394 395 /*Change copy enum to reinitialized_enum: */ 396 copy->ChangeEnum(new_enum); 397 398 /*Add copy into inputs, it will wipe off the one already there: */ 399 this->AddInput((Input*)copy); 382 400 } 383 401 /*}}}*/ -
issm/trunk/src/c/Container/Inputs.h
r4927 r4943 29 29 /*numerics: {{{1*/ 30 30 int AddInput(Input* in_input); 31 void ChangeEnum(int enumtype,int new_enumtype); 31 32 int DeleteInput(int enum_type); 33 void DuplicateInput(int original_enum,int new_enum); 32 34 Input* GetInput(int enum_name); 33 35 Inputs* SpawnTriaInputs(int* indices); 34 36 37 void GetParameterAverage(double* pvalue, int enum_type); 35 38 void GetParameterValue(bool* pvalue,int enum_type); 36 39 void GetParameterValue(int* pvalue,int enum_type); … … 38 41 void GetParameterValue(double* pvalue,double* gauss,int enum_type); 39 42 void GetParameterValue(double* pvalue,double* gauss,int enum_type,double defaultvalue); 40 void GetParameterAverage(double* pvalue, int enum_type);41 42 43 void GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type); 43 44 void GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues); 44 45 45 void GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type); 46 47 void ChangeEnum(int enumtype,int new_enumtype);48 49 46 /*}}}*/ 50 47 -
issm/trunk/src/c/objects/Elements/Penta.cpp
r4942 r4943 1130 1130 void Penta::InputDuplicate(int original_enum,int new_enum){ 1131 1131 1132 Input* original=NULL; 1133 Input* copy=NULL; 1134 1135 /*Make a copy of the original input: */ 1136 original=(Input*)this->inputs->GetInput(original_enum); 1137 if(!original)ISSMERROR(" could not find old input with enum: %s",EnumAsString(original_enum)); 1138 copy=(Input*)original->copy(); 1139 1140 /*Change copy enum to reinitialized_enum: */ 1141 copy->ChangeEnum(new_enum); 1142 1143 /*Add copy into inputs, it will wipe off the one already there: */ 1144 inputs->AddInput((Input*)copy); 1132 /*Call inputs method*/ 1133 inputs->DuplicateInput(original_enum,new_enum); 1134 1145 1135 } 1146 1136 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Tria.cpp
r4941 r4943 1318 1318 void Tria::InputDuplicate(int original_enum,int new_enum){ 1319 1319 1320 Input* original=NULL; 1321 Input* copy=NULL; 1322 1323 /*Make a copy of the original input: */ 1324 original=(Input*)this->inputs->GetInput(original_enum); 1325 if(!original)ISSMERROR(" could not find old input with enum: %s",EnumAsString(original_enum)); 1326 copy=(Input*)original->copy(); 1327 1328 /*Change copy enum to reinitialized_enum: */ 1329 copy->ChangeEnum(new_enum); 1330 1331 /*Add copy into inputs, it will wipe off the one already there: */ 1332 inputs->AddInput((Input*)copy); 1320 /*Call inputs method*/ 1321 inputs->DuplicateInput(original_enum,new_enum); 1322 1333 1323 } 1334 1324 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.