Changeset 999 for cpp/frams/model/modelparts.h
- Timestamp:
- 07/13/20 13:51:43 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/modelparts.h
r997 r999 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 SHAPE_FIRST = SHAPE_BALL_AND_STICK, SHAPE_LAST = SHAPE_SOLIDS // for iteration 38 }; 36 enum ShapeType { 37 SHAPETYPE_BALL_AND_STICK = 0, SHAPETYPE_SOLIDS = 1, SHAPETYPE_UNKNOWN, SHAPETYPE_ILLEGAL, ///< 0 and 1 have special significance - these values allow for bit operations. 38 SHAPETYPE_FIRST = SHAPETYPE_BALL_AND_STICK, SHAPETYPE_LAST = SHAPETYPE_SOLIDS // for iteration 39 }; 39 40 }; 40 41 … … 73 74 }; 74 75 75 /// Part is the only real physical object in the Framsticks creature.76 /// Part is the only real physical object in creatures in Framsticks. 76 77 /// You can use this class for querying and adjusting constructed 77 /// model properties 78 /// model properties. 78 79 class Part : public PartBase 79 80 { … … 96 97 /// 97 98 paInt shape;///default=old Framsticks compatible, do not mix with shapes>0 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 99 enum Shape { 100 SHAPE_BALL = 0, ///< for "ball and stick" shape type model only. 101 SHAPE_ELLIPSOID = 1, SHAPE_CUBOID = 2, SHAPE_CYLINDER = 3, 102 SHAPE_FIRST = SHAPE_BALL, SHAPE_LAST = SHAPE_CYLINDER // for iteration 100 103 }; 101 104 static const char* getShapeName(Shape sh); … … 110 113 double vsize; 111 114 112 Part(enum Shape s = SHAPE_BALL _AND_STICK);115 Part(enum Shape s = SHAPE_BALL); 113 116 Part(const Part &src) :PartBase(getDefaultStyle()) { operator=(src); } 114 117 void operator=(const Part &src); … … 151 154 class Pt3D rot; ///< orientation delta between parts expressed as 3 angles 152 155 enum Shape { 153 SHAPE_ BALL_AND_STICK = 0, ///< old Framsticks compatible, creates a physical rod between parts (cylinder or cuboid), do not mix with part.shape>0156 SHAPE_STICK = 0, ///< for "ball and stick" shape type model, creates a physical (cylinder or cuboid) rod between parts. Do not mix with part.shape>0. 154 157 SHAPE_FIXED = 1, ///< merge parts into one physical entity 155 158 SHAPE_HINGE_X = 2, ///< hinge connection, revolving around X axis defined by hinge_pos and hinge_rot 156 159 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 iteration160 SHAPE_FIRST = SHAPE_STICK, SHAPE_LAST = SHAPE_HINGE_XY // for iteration 158 161 }; 159 162 paInt shape;///< values of type Shape (paInt for integration with Param) … … 230 233 paInt preflocation; 231 234 232 enum PrefLocation { PREFER_UNATTACHED =0, PREFER_PART=1, PREFER_JOINT=2 };233 234 static constexpr int SUPPORTED_SHAPE _BALL_AND_STICK = 1;235 static constexpr int SUPPORTED_SHAPE _SOLIDS = 2;236 static constexpr int SUPPORTED_SHAPE _ALL = SUPPORTED_SHAPE_BALL_AND_STICK | SUPPORTED_SHAPE_SOLIDS;235 enum PrefLocation { PREFER_UNATTACHED = 0, PREFER_PART = 1, PREFER_JOINT = 2 }; 236 237 static constexpr int SUPPORTED_SHAPETYPE_BALL_AND_STICK = 1; 238 static constexpr int SUPPORTED_SHAPETYPE_SOLIDS = 2; 239 static constexpr int SUPPORTED_SHAPETYPE_ALL = SUPPORTED_SHAPETYPE_BALL_AND_STICK | SUPPORTED_SHAPETYPE_SOLIDS; 237 240 paInt supported_shape_types; //< bitfield of 'Model::shape' values: NeuroClass::SUPPORTED_SHAPE_xxx = 1 << Model::SHAPE_xxx 238 241 … … 241 244 static constexpr int SUPPORTED_JOINT_HINGE_X = 4; 242 245 static constexpr int SUPPORTED_JOINT_HINGE_XY = 8; 243 static constexpr int SUPPORTED_JOINT _ALL = SUPPORTED_JOINT_BALL_AND_STICK + SUPPORTED_JOINT_FIXED + SUPPORTED_JOINT_HINGE_X + SUPPORTED_JOINT_HINGE_XY;246 static constexpr int SUPPORTED_JOINTSHAPE_ALL = SUPPORTED_JOINT_BALL_AND_STICK + SUPPORTED_JOINT_FIXED + SUPPORTED_JOINT_HINGE_X + SUPPORTED_JOINT_HINGE_XY; 244 247 paInt supported_joint_shapes; //< bitfield of 'Joint::shape' values: NeuroClass::SUPPORTED_JOINT_xxx = 1 << JOINT::SHAPE_xxx 245 248 … … 257 260 NeuroClass(); 258 261 NeuroClass(ParamEntry *_props, SString _description, 259 int _prefinputs, int _prefoutput, int _preflocation, int *_vectordata, bool own_vd = 1, int vhints = 0, int sup_shapes = NeuroClass::SUPPORTED_SHAPE_ALL, int sup_joints = NeuroClass::SUPPORTED_JOINT_ALL);262 int _prefinputs, int _prefoutput, int _preflocation, int *_vectordata, bool own_vd = 1, int vhints = 0, int sup_shapes = NeuroClass::SUPPORTED_SHAPETYPE_ALL, int sup_joints = NeuroClass::SUPPORTED_JOINTSHAPE_ALL); 260 263 /** class name for use in Neuro::setClassName(), Neuro::setDetails() (former 'moredata' field), 261 264 eg. "N","-",G" */
Note: See TracChangeset
for help on using the changeset viewer.