Changeset 999 for cpp/frams/model/model.cpp
- Timestamp:
- 07/13/20 13:51:43 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/model.cpp
r988 r999 17 17 } 18 18 19 void Model::init(ShapeType sh )19 void Model::init(ShapeType shtype) 20 20 { 21 21 partmappingchanged = 0; … … 29 29 f0map = 0; 30 30 f0genoknown = 1; 31 shape = SHAPE_UNKNOWN;32 declared_shape = sh;33 } 34 35 void Model::declareShapeType(ShapeType sh )36 { 37 declared_shape = sh;31 shapetype = SHAPETYPE_UNKNOWN; 32 declared_shapetype = shtype; 33 } 34 35 void Model::declareShapeType(ShapeType shtype) 36 { 37 declared_shapetype = shtype; 38 38 } 39 39 … … 56 56 geno = mod.geno; 57 57 f0genoknown = 0; 58 shape = mod.shape;59 declared_shape = mod.declared_shape;58 shapetype = mod.shapetype; 59 declared_shapetype = mod.declared_shapetype; 60 60 startenergy = mod.startenergy; 61 61 modelfromgenotype = mod.modelfromgenotype; … … 117 117 :autobuildmaps(buildmaps) 118 118 { 119 init(mod.declared_shape );119 init(mod.declared_shapetype); 120 120 open(_using_checkpoints, _is_checkpoint); 121 121 internalCopy(mod); … … 169 169 delMap(); 170 170 delF0Map(); 171 init(declared_shape );171 init(declared_shapetype); 172 172 geno = Geno(); 173 173 f0geno = Geno(); … … 340 340 f0warnposition = -1; 341 341 MultiMap *convmap = autobuildmaps ? new MultiMap() : NULL; 342 if (declared_shape == SHAPE_UNKNOWN)342 if (declared_shapetype == SHAPETYPE_UNKNOWN) 343 343 f0geno = geno.getConverted(Geno::F0_FORMAT_LIST, convmap, using_checkpoints); 344 344 else 345 f0geno = geno.getConverted(genoFormatForShapeType(declared_shape ), convmap, using_checkpoints);345 f0geno = geno.getConverted(genoFormatForShapeType(declared_shapetype), convmap, using_checkpoints); 346 346 f0genoknown = 1; 347 347 if (f0geno.isInvalid()) … … 351 351 return; 352 352 } 353 if (declared_shape == SHAPE_UNKNOWN)353 if (declared_shapetype == SHAPETYPE_UNKNOWN) 354 354 declareShapeType(shapeTypeForGenoFormat(f0geno.getFormat())); 355 355 SString f0txt = f0geno.getGenes(); … … 560 560 switch (st) 561 561 { 562 case SHAPE _BALL_AND_STICK:562 case SHAPETYPE_BALL_AND_STICK: 563 563 return "0"; 564 case SHAPE _SOLIDS:564 case SHAPETYPE_SOLIDS: 565 565 return "0s"; 566 566 default: … … 572 572 { 573 573 if (format == "0") 574 return SHAPE _BALL_AND_STICK;574 return SHAPETYPE_BALL_AND_STICK; 575 575 else if (format == "0s") 576 return SHAPE _SOLIDS;576 return SHAPETYPE_SOLIDS; 577 577 else 578 return SHAPE _UNKNOWN;578 return SHAPETYPE_UNKNOWN; 579 579 580 580 } … … 584 584 switch (sh) 585 585 { 586 case SHAPE _BALL_AND_STICK: return "ball-and-stick";587 case SHAPE _SOLIDS: return "solid shapes";588 case SHAPE _UNKNOWN: return "unknown";589 590 case SHAPE _ILLEGAL:586 case SHAPETYPE_BALL_AND_STICK: return "ball-and-stick"; 587 case SHAPETYPE_SOLIDS: return "solid shapes"; 588 case SHAPETYPE_UNKNOWN: return "unknown"; 589 590 case SHAPETYPE_ILLEGAL: 591 591 default: 592 592 return "illegal"; … … 894 894 int i, k; 895 895 int ret = 1; 896 shape = SHAPE_UNKNOWN;896 shapetype = SHAPETYPE_UNKNOWN; 897 897 updateRefno(); 898 898 if ((parts.size() == 0) && (neurons.size() == 0)) return 0; … … 931 931 if (p->p.y + p->size > bbmax.y) bbmax.y = p->p.y + p->size; 932 932 if (p->p.z + p->size > bbmax.z) bbmax.z = p->p.z + p->size; 933 if (shape == SHAPE_UNKNOWN)934 shape = (p->shape == Part::SHAPE_BALL_AND_STICK) ? SHAPE_BALL_AND_STICK : SHAPE_SOLIDS;935 else if (shape != SHAPE_ILLEGAL)933 if (shapetype == SHAPETYPE_UNKNOWN) 934 shapetype = (p->shape == Part::SHAPE_BALL) ? SHAPETYPE_BALL_AND_STICK : SHAPETYPE_SOLIDS; 935 else if (shapetype != SHAPETYPE_ILLEGAL) 936 936 { 937 if ((p->shape == Part::SHAPE_BALL _AND_STICK) ^ (shape == SHAPE_BALL_AND_STICK))937 if ((p->shape == Part::SHAPE_BALL) ^ (shapetype == SHAPETYPE_BALL_AND_STICK)) 938 938 { 939 shape = SHAPE_ILLEGAL;939 shapetype = SHAPETYPE_ILLEGAL; 940 940 logPrintf("Model", "internalCheck", LOG_WARN, "Inconsistent part shapes (mixed ball-and-stick and solids shape types)%s", nameForErrors().c_str()); 941 941 } … … 1002 1002 if ((check != LIVE_CHECK) && (check != CHECKPOINT_CHECK)) 1003 1003 { 1004 if (j->shape == Joint::SHAPE_ BALL_AND_STICK)1004 if (j->shape == Joint::SHAPE_STICK) 1005 1005 { 1006 1006 if (j->d() > getMaxJoint().d.x) … … 1017 1017 ret = 0; 1018 1018 } 1019 if (shape != SHAPE_ILLEGAL)1019 if (shapetype != SHAPETYPE_ILLEGAL) 1020 1020 { 1021 if ((j->shape == Joint::SHAPE_ BALL_AND_STICK) ^ (shape == SHAPE_BALL_AND_STICK))1021 if ((j->shape == Joint::SHAPE_STICK) ^ (shapetype == SHAPETYPE_BALL_AND_STICK)) 1022 1022 { 1023 shape = SHAPE_ILLEGAL;1023 shapetype = SHAPETYPE_ILLEGAL; 1024 1024 logPrintf("Model", "internalCheck", LOG_WARN, "Inconsistent joint shapes (mixed old and new shapes)%s", nameForErrors().c_str()); 1025 1025 } … … 1109 1109 } 1110 1110 1111 if (shape == SHAPE_ILLEGAL)1111 if (shapetype == SHAPETYPE_ILLEGAL) 1112 1112 ret = 0; 1113 else if ((declared_shape != SHAPE_UNKNOWN) && (declared_shape != shape))1114 { 1115 logPrintf("Model", "internalCheck", LOG_ERROR, "Model shape type '%s' does not match the declared type '%s'", getShapeTypeName(shape ), getShapeTypeName(declared_shape));1113 else if ((declared_shapetype != SHAPETYPE_UNKNOWN) && (declared_shapetype != shapetype)) 1114 { 1115 logPrintf("Model", "internalCheck", LOG_ERROR, "Model shape type '%s' does not match the declared type '%s'", getShapeTypeName(shapetype), getShapeTypeName(declared_shapetype)); 1116 1116 ret = 0; 1117 1117 } … … 1335 1335 { 1336 1336 using_model = converted_model = NULL; 1337 if (m.getShapeType() == Model::SHAPE _BALL_AND_STICK)1337 if (m.getShapeType() == Model::SHAPETYPE_BALL_AND_STICK) 1338 1338 { 1339 1339 converted_model = new Model;
Note: See TracChangeset
for help on using the changeset viewer.