Changeset 975 for cpp/frams/model


Ignore:
Timestamp:
07/06/20 23:32:03 (4 years ago)
Author:
Maciej Komosinski
Message:

Added NeuroClass::getSupportedJointTypes() and NeuroClass::isJointTypeSupported() for use in genetic operators

Location:
cpp/frams/model
Files:
3 edited

Legend:

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

    r972 r975  
    415415        {
    416416                *f0map = *map;
    417                 if (geno.getFormat() != '0')
     417                if (!Geno::formatIsOneOf(geno.getFormat(), Geno::F0_FORMAT_LIST))
    418418                {
    419419                        MultiMap tmp;
  • cpp/frams/model/modelparts.cpp

    r973 r975  
    9999NeuroClass::NeuroClass(ParamEntry *_props, SString _description,
    100100        int _prefinputs, int _prefoutput, int _preflocation,
    101         int *_vectordata, bool own_vd, int vhints, int sup_shapes)
     101        int *_vectordata, bool own_vd, int vhints, int sup_shapes, int sup_joints)
    102102        :ownedvectordata(own_vd),
    103103        name(_props->name), longname(_props->id), description(_description),
  • cpp/frams/model/modelparts.h

    r972 r975  
    227227        static constexpr int SUPPORTED_SHAPE_ALL = SUPPORTED_SHAPE_BALL_AND_STICK | SUPPORTED_SHAPE_SOLIDS;
    228228        paInt supported_shape_types; //< bitfield of 'Model::shape' values: NeuroClass::SUPPORTED_SHAPE_xxx = 1 << Model::SHAPE_xxx
     229
     230        static constexpr int SUPPORTED_JOINT_BALL_AND_STICK = 1;
     231        static constexpr int SUPPORTED_JOINT_FIXED = 2;
     232        static constexpr int SUPPORTED_JOINT_HINGE_X = 4;
     233        static constexpr int SUPPORTED_JOINT_HINGE_XY = 8;
     234        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_xxx
     236
    229237        int *vectordata;
    230238        paInt visualhints;
     
    240248        NeuroClass();
    241249        NeuroClass(ParamEntry *_props, SString _description,
    242                 int _prefinputs, int _prefoutput, int _preflocation, int *_vectordata, bool own_vd = 1, int vhints = 0, int sup_shapes = NeuroClass::SUPPORTED_SHAPE_ALL);
     250                   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);
    243251        /** class name for use in Neuro::setClassName(), Neuro::setDetails() (former 'moredata' field),
    244252                eg. "N","-",G" */
     
    278286        int getSupportedShapeTypes() { return (int)supported_shape_types; }
    279287        bool isShapeTypeSupported(ModelEnum::ShapeType t) { return (1 << (int)t) & supported_shape_types; }
     288        int getSupportedJointTypes() { return (int)supported_joint_types; }
     289        bool isJointTypeSupported(Joint::Shape t) { return (1 << (int)t) & supported_joint_types; }
    280290        int *getSymbolGlyph()
    281291        {
Note: See TracChangeset for help on using the changeset viewer.