Ignore:
Timestamp:
05/28/20 18:00:45 (4 years ago)
Author:
Maciej Komosinski
Message:

Neuron classes now have a property (a bit field) that says whether each neuron class supports model shape BALL_AND_STICK, SOLIDS, or both

File:
1 edited

Legend:

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

    r920 r932  
    124124        class Pt3D d;           ///< position delta between parts
    125125        class Pt3D rot; ///< orientation delta between parts expressed as 3 angles
    126         enum Shape { SHAPE_BALL_AND_STICK = 0, ///<  old Framsticks compatible, creates a physical rod between parts (cylinder or cuboid), do not mix with part.shape>0
    127                      SHAPE_FIXED = 1, ///< merge parts into one physical entity
    128                      SHAPE_HINGE_X = 2, ///< hinge connection, revolving around X axis defined by hinge_pos and hinge_rot
    129                      SHAPE_HINGE_XY = 3 }; ///< double hinge connection, revolving around X and Y axes defined by hinge_pos and hinge_rot
     126        enum Shape {
     127                SHAPE_BALL_AND_STICK = 0, ///<  old Framsticks compatible, creates a physical rod between parts (cylinder or cuboid), do not mix with part.shape>0
     128                SHAPE_FIXED = 1, ///< merge parts into one physical entity
     129                SHAPE_HINGE_X = 2, ///< hinge connection, revolving around X axis defined by hinge_pos and hinge_rot
     130                SHAPE_HINGE_XY = 3 ///< double hinge connection, revolving around X and Y axes defined by hinge_pos and hinge_rot
     131        };
    130132        paInt shape;///< values of type Shape (paInt for integration with Param)
    131133        class Pt3D hinge_pos; ///< hinge position (relative to part1) for HINGE_X and HINGE_XY
     
    199201        paInt prefinputs, prefoutput;
    200202        paInt preflocation;
     203
     204        static constexpr int SUPPORTED_SHAPE_BALL_AND_STICK = 1;
     205        static constexpr int SUPPORTED_SHAPE_SOLIDS = 2;
     206        static constexpr int SUPPORTED_SHAPE_ALL = SUPPORTED_SHAPE_BALL_AND_STICK | SUPPORTED_SHAPE_SOLIDS;
     207        paInt supported_shape_types; //< bitfield of 'Model::shape' values: NeuroClass::SUPPORTED_SHAPE_xxx = 1 << Model::SHAPE_xxx
    201208        int *vectordata;
    202209        paInt visualhints;
     
    212219        NeuroClass();
    213220        NeuroClass(ParamEntry *_props, SString _description,
    214                 int _prefinputs, int _prefoutput, int _preflocation, int *_vectordata, bool own_vd = 1, int vhints = 0);
     221                int _prefinputs, int _prefoutput, int _preflocation, int *_vectordata, bool own_vd = 1, int vhints = 0, int sup_shapes = NeuroClass::SUPPORTED_SHAPE_ALL);
    215222        /** class name for use in Neuro::setClassName(), Neuro::setDetails() (former 'moredata' field),
    216223                eg. "N","-",G" */
     
    248255                }
    249256                */
     257        int getSupportedShapeTypes() { return (int)supported_shape_types; }
    250258        int *getSymbolGlyph()
    251259        {
Note: See TracChangeset for help on using the changeset viewer.