Ignore:
Timestamp:
09/05/16 03:39:14 (8 years ago)
Author:
Maciej Komosinski
Message:
  • Introduced levels of checking the validity of a Model
  • If a Joint is too long, print how much it exceeds the maximum allowed length
File:
1 edited

Legend:

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

    r546 r610  
    120120public:
    121121        enum ShapeType { SHAPE_UNKNOWN, SHAPE_ILLEGAL, SHAPE_BALL_AND_STICK, SHAPE_SOLIDS };
     122        /// used in internalCheck()
     123        enum CheckType {
     124         EDITING_CHECK, ///< Used in Model::validate(). Default validation - does not modify elements of the Model.
     125         FINAL_CHECK,   ///< Used in Model::close() when a Model is built from a genotype. Like EDITING_CHECK, but also calculates Joint::d and Joint::rot.
     126         LIVE_CHECK     ///< used in Model::close() when a Model is built from a Creature. Like FINAL_CHECK but does not limit joint length which could make some liveModels invalid.
     127        };
    122128protected:
    123129        ShapeType shape;
     
    125131        void updateNeuroRefno(); // set Neuro::refno for all neurons
    126132        SString nameForErrors() const;
    127         int internalcheck(int final);
     133        int internalcheck(CheckType check);
    128134
    129135        void moveNeuro(int oldpos, int newpos);
     
    304310        /// It also calls "validate" with all side effects.
    305311        /// @return > 0 means "valid"
    306         int close();
     312        int close(bool building_live_model=false);
    307313
    308314        /// Enable model building.
Note: See TracChangeset for help on using the changeset viewer.