Changeset 977 for cpp/frams/model/modelparts.h
- Timestamp:
- 07/06/20 23:39:36 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.