Ignore:
Timestamp:
07/13/20 13:51:43 (4 years ago)
Author:
Maciej Komosinski
Message:

More consistent usage of "shapetype" (vs. "shape")

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/modelparts.h

    r997 r999  
    3434{
    3535public:
    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        };
    3940};
    4041
     
    7374};
    7475
    75 /// Part is the only real physical object in the Framsticks creature.
     76/// Part is the only real physical object in creatures in Framsticks.
    7677/// You can use this class for querying and adjusting constructed
    77 /// model properties
     78/// model properties.
    7879class Part : public PartBase
    7980{
     
    9697        ///
    9798        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
    100103        };
    101104        static const char* getShapeName(Shape sh);
     
    110113        double vsize;
    111114
    112         Part(enum Shape s = SHAPE_BALL_AND_STICK);
     115        Part(enum Shape s = SHAPE_BALL);
    113116        Part(const Part &src) :PartBase(getDefaultStyle()) { operator=(src); }
    114117        void operator=(const Part &src);
     
    151154        class Pt3D rot; ///< orientation delta between parts expressed as 3 angles
    152155        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>0
     156                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.
    154157                SHAPE_FIXED = 1, ///< merge parts into one physical entity
    155158                SHAPE_HINGE_X = 2, ///< hinge connection, revolving around X axis defined by hinge_pos and hinge_rot
    156159                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
     160                SHAPE_FIRST = SHAPE_STICK, SHAPE_LAST = SHAPE_HINGE_XY // for iteration
    158161        };
    159162        paInt shape;///< values of type Shape (paInt for integration with Param)
     
    230233        paInt preflocation;
    231234
    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;
    237240        paInt supported_shape_types; //< bitfield of 'Model::shape' values: NeuroClass::SUPPORTED_SHAPE_xxx = 1 << Model::SHAPE_xxx
    238241
     
    241244        static constexpr int SUPPORTED_JOINT_HINGE_X = 4;
    242245        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;
    244247        paInt supported_joint_shapes; //< bitfield of 'Joint::shape' values: NeuroClass::SUPPORTED_JOINT_xxx = 1 << JOINT::SHAPE_xxx
    245248
     
    257260        NeuroClass();
    258261        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);
    260263        /** class name for use in Neuro::setClassName(), Neuro::setDetails() (former 'moredata' field),
    261264                eg. "N","-",G" */
Note: See TracChangeset for help on using the changeset viewer.