Changeset 977
- Timestamp:
- 07/06/20 23:39:36 (4 years ago)
- Location:
- cpp/frams
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/genomanipulation.cpp
r972 r977 195 195 printf(" (getPreferredInputs()) "); 196 196 printf(cl->getPreferredOutput() ? "and provides meaningful output signal (getPreferredOutput()==1).\n" : "and doesn't provide useful output signal (getPreferredOutput()==0).\n"); 197 printf("Instances of '%s' can be used in models having ", cl->getName().c_str()); 198 if (cl->getSupportedShapeTypes() == NeuroClass::SUPPORTED_SHAPE_ALL) 199 printf("any shape types.\n"); 200 else 201 { 202 printf("shape types:"); 203 for(int i=Model::SHAPE_FIRST; i<= Model::SHAPE_LAST; i++) 204 if (cl->isShapeTypeSupported((Model::ShapeType)i)) 205 printf(" '%s'",Model::getShapeTypeName((Model::ShapeType)i)); 206 printf(".\n"); 207 } 208 if (cl->preflocation == NeuroClass::PREFER_JOINT) 209 { 210 printf("Instances of '%s' can be attached to Joints having ", cl->getName().c_str()); 211 if (cl->getSupportedJointShapes() == NeuroClass::SUPPORTED_JOINT_ALL) 212 printf("any shapes"); 213 else 214 { 215 printf("shapes:"); 216 for(int i=Joint::SHAPE_FIRST; i<= Joint::SHAPE_LAST; i++) 217 if (cl->isJointShapeSupported((Joint::Shape)i)) 218 printf(" '%s'",Joint::getShapeName((Joint::Shape)i)); 219 } 220 printf(".\n"); 221 } 222 else if (cl->preflocation == NeuroClass::PREFER_PART) 223 printf("Instances of '%s' can be attached to Parts.\n", cl->getName().c_str()); 197 224 198 225 SyntParam p = n->classProperties(); -
cpp/frams/genetics/genman.cpp
r966 r977 20 20 #ifdef USE_GENMAN_f0 21 21 #include "f0/f0_oper.h" 22 #endif 23 #ifdef USE_GENMAN_f0s 24 #include "f0s/f0s_oper.h" 22 25 #endif 23 26 #ifdef USE_GENMAN_f0FUZZY … … 132 135 #ifdef USE_GENMAN_f0 133 136 oper_fx_list.push_back(new Geno_f0); 137 #endif 138 #ifdef USE_GENMAN_f0s 139 oper_fx_list.push_back(new Geno_f0s); 134 140 #endif 135 141 #ifdef USE_GENMAN_f0FUZZY -
cpp/frams/model/modelparts.cpp
r975 r977 107 107 preflocation(_preflocation), 108 108 supported_shape_types(sup_shapes), 109 supported_joint_shapes(sup_joints), 109 110 vectordata(_vectordata), 110 111 visualhints(vhints), impl_count(0),/*impl(0),*/active(1), genactive(0) … … 624 625 } 625 626 627 const char* Part::getShapeName(Shape sh) 628 { 629 switch (sh) 630 { 631 case SHAPE_BALL_AND_STICK: return "ball-and-stick"; 632 case SHAPE_ELLIPSOID: return "ellipsoid"; 633 case SHAPE_CUBOID: return "cuboid"; 634 case SHAPE_CYLINDER: return "cylinder"; 635 636 default: 637 return "unknown shape"; 638 } 639 } 626 640 627 641 /////////////////////////// … … 709 723 } 710 724 725 const char* Joint::getShapeName(Shape sh) 726 { 727 switch (sh) 728 { 729 case SHAPE_BALL_AND_STICK: return "ball-and-stick"; 730 case SHAPE_FIXED: return "fixed"; 731 case SHAPE_HINGE_X: return "hinge x"; 732 case SHAPE_HINGE_XY: return "hinge xy"; 733 734 default: 735 return "unknown shape"; 736 } 737 } 738 739 711 740 ///////////////////////////////////////////////////////////////// 712 741 -
cpp/frams/model/modelparts.h
r975 r977 34 34 { 35 35 public: 36 enum ShapeType { SHAPE_BALL_AND_STICK = 0, SHAPE_SOLIDS = 1, SHAPE_UNKNOWN, SHAPE_ILLEGAL }; ///< 0 and 1 have special significance - these values allow for bit operations. 37 }; 38 36 enum ShapeType { SHAPE_BALL_AND_STICK = 0, SHAPE_SOLIDS = 1, SHAPE_UNKNOWN, SHAPE_ILLEGAL, ///< 0 and 1 have special significance - these values allow for bit operations. 37 SHAPE_FIRST = SHAPE_BALL_AND_STICK, SHAPE_LAST = SHAPE_SOLIDS // for iteration 38 }; 39 }; 39 40 40 41 /** Common base for model elements. */ … … 95 96 /// 96 97 paInt shape;///default=old Framsticks compatible, do not mix with shapes>0 97 enum Shape { SHAPE_BALL_AND_STICK = 0, SHAPE_ELLIPSOID = 1, SHAPE_CUBOID = 2, SHAPE_CYLINDER = 3 }; 98 enum Shape { SHAPE_BALL_AND_STICK = 0, SHAPE_ELLIPSOID = 1, SHAPE_CUBOID = 2, SHAPE_CYLINDER = 3, 99 SHAPE_FIRST = SHAPE_BALL_AND_STICK, SHAPE_LAST = SHAPE_CYLINDER // for iteration 100 }; 101 static const char* getShapeName(Shape sh); 102 98 103 double mass, size, density, friction, ingest, assim, hollow; 99 104 Pt3D scale; … … 149 154 SHAPE_FIXED = 1, ///< merge parts into one physical entity 150 155 SHAPE_HINGE_X = 2, ///< hinge connection, revolving around X axis defined by hinge_pos and hinge_rot 151 SHAPE_HINGE_XY = 3 ///< double hinge connection, revolving around X and Y axes defined by hinge_pos and hinge_rot 156 SHAPE_HINGE_XY = 3, ///< double hinge connection, revolving around X and Y axes defined by hinge_pos and hinge_rot 157 SHAPE_FIRST = SHAPE_BALL_AND_STICK, SHAPE_LAST = SHAPE_HINGE_XY // for iteration 152 158 }; 153 159 paInt shape;///< values of type Shape (paInt for integration with Param) 160 static const char* getShapeName(Shape sh); 154 161 class Pt3D hinge_pos; ///< hinge position (relative to part1) for HINGE_X and HINGE_XY 155 162 class Pt3D hinge_rot; ///< hinge orientation (relative to part1) for HINGE_X and HINGE_XY … … 223 230 paInt preflocation; 224 231 232 enum PrefLocation { PREFER_UNATTACHED=0, PREFER_PART=1, PREFER_JOINT=2 }; 233 225 234 static constexpr int SUPPORTED_SHAPE_BALL_AND_STICK = 1; 226 235 static constexpr int SUPPORTED_SHAPE_SOLIDS = 2; … … 233 242 static constexpr int SUPPORTED_JOINT_HINGE_XY = 8; 234 243 static constexpr int SUPPORTED_JOINT_ALL = SUPPORTED_JOINT_BALL_AND_STICK + SUPPORTED_JOINT_FIXED + SUPPORTED_JOINT_HINGE_X + SUPPORTED_JOINT_HINGE_XY; 235 paInt supported_joint_ types; //< bitfield of 'Joint::shape' values: NeuroClass::SUPPORTED_JOINT_xxx = 1 << JOINT::SHAPE_xxx244 paInt supported_joint_shapes; //< bitfield of 'Joint::shape' values: NeuroClass::SUPPORTED_JOINT_xxx = 1 << JOINT::SHAPE_xxx 236 245 237 246 int *vectordata; … … 286 295 int getSupportedShapeTypes() { return (int)supported_shape_types; } 287 296 bool isShapeTypeSupported(ModelEnum::ShapeType t) { return (1 << (int)t) & supported_shape_types; } 288 int getSupportedJoint Types() { return (int)supported_joint_types; }289 bool isJoint TypeSupported(Joint::Shape t) { return (1 << (int)t) & supported_joint_types; }297 int getSupportedJointShapes() { return (int)supported_joint_shapes; } 298 bool isJointShapeSupported(Joint::Shape t) { return (1 << (int)t) & supported_joint_shapes; } 290 299 int *getSymbolGlyph() 291 300 {
Note: See TracChangeset
for help on using the changeset viewer.