Changeset 934 for cpp/frams/model/modelparts.h
- Timestamp:
- 05/29/20 15:18:48 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/modelparts.h
r932 r934 26 26 typedef UserTags<Model, void *, 5> ModelUserTags; 27 27 28 29 /// Introduced only because we can't have a forward declaration of enum in the Model class, 30 /// and we would need a forward declaration because of mutual (cyclic) dependence of declarations of Model and NeuroClass. 31 /// https://stackoverflow.com/questions/27019292/is-in-class-enum-forward-declaration-possible 32 /// Use Model::... instead of ModelEnum::... 33 class ModelEnum 34 { 35 public: 36 enum ShapeType { SHAPE_BALL_AND_STICK, SHAPE_SOLIDS, SHAPE_UNKNOWN, SHAPE_ILLEGAL }; 37 }; 38 39 28 40 /** Common base for model elements. */ 29 41 class PartBase … … 102 114 103 115 static Param &getStaticParam(); 116 }; 117 118 class Part_MinMaxDef : public Part //contains additional information for Model::getMinPart()/getMaxPart()/getDefPart() 119 { 120 public: 121 double volume; ///< Introduced to limit the range of volumes (~mass) in simulation of solids. Genetic operators should observe this min,max volume by calculating and limiting the volume of Parts based on their type and sx,sy,sz. 122 123 void defassign(); 124 Part_MinMaxDef() { defassign(); } 104 125 }; 105 126 … … 256 277 */ 257 278 int getSupportedShapeTypes() { return (int)supported_shape_types; } 279 bool isShapeTypeSupported(ModelEnum::ShapeType t) { return (1 << (int)t) & supported_shape_types; } 258 280 int *getSymbolGlyph() 259 281 { … … 511 533 }; 512 534 513 extern ParamEntry f0_part_paramtab[], f0_ joint_paramtab[], f0_nodeltajoint_paramtab[], f0_neuro_paramtab[], f0_neuroconn_paramtab[], f0_neuroitem_paramtab[];535 extern ParamEntry f0_part_paramtab[], f0_part_minmaxdef_paramtab[], f0_joint_paramtab[], f0_nodeltajoint_paramtab[], f0_neuro_paramtab[], f0_neuroconn_paramtab[], f0_neuroitem_paramtab[]; 514 536 515 537 #endif
Note: See TracChangeset
for help on using the changeset viewer.