[bfdf16]: / Body / AAUHuman / BodyModels / GenericBodyModel / BodyModel.any

Download this file

234 lines (157 with data), 6.0 kB

AnyFolder BodyModel = {
  
  #if (ANYBODY_V1 > 7)|(ANYBODY_V1 == 7 & ANYBODY_V2 > 1)
  #include "<ANYBODY_PATH_BODY_GENERICBODYMODEL>\ComponentTreeConfig.any"
  #endif
  
  // The folder containing the selected human model output.
  AnyFolder SelectedOutput = {
    
    AnyFolder Trunk = {};
  };
  
 
  // Check for non-allowed combinations
  // **********************************
    
  #ifdef ERROR_UNALLOWED_COMBINATION
  #undef ERROR_UNALLOWED_COMBINATION
  #endif
  #define ERROR_UNALLOWED_COMBINATION (ErrorMessage) AnyMessage UnallowedCombination = { TriggerPreProcess = On; Type = MSG_ErrorFatal; Message = ErrorMessage; };
  
  
  #if (BM_LEG_RIGHT > 1) | (BM_LEG_LEFT > 1)
    #ifndef FORBIDDEN_COMBINATION
    ERROR_UNALLOWED_COMBINATION ("BM_LEG_RIGHT/LEFT are only used switch Legs ON/OFF. Please use BM_LEG_MODEL to set the model type.")
    #define FORBIDDEN_COMBINATION
    #endif
  #endif  
    
  
  #if BM_TRUNK_CERVICAL_MUSCLES != OFF
    #if !((BM_ARM_RIGHT & BM_ARM_MUSCLES_RIGHT) | (BM_ARM_LEFT & BM_ARM_MUSCLES_LEFT))
    #ifdef FORBIDDEN_COMBINATION
      #else
      ERROR_UNALLOWED_COMBINATION ("Combination is forbidden: As some neck muscles are in the shoulder model, the neck model with muscles must be used with the neck part of the shoulder muscles to be complete.")
      #define FORBIDDEN_COMBINATION
      #endif
    #endif
  #endif

  #ifdef _FOOT_MODEL_GMFOOT_
  #if BM_FOOT_MODEL == _FOOT_MODEL_GMFOOT_
    #if (BM_LEG_RIGHT | BM_LEG_LEFT) & (BM_LEG_MODEL != _LEG_MODEL_TLEM2_)
    #ifdef FORBIDDEN_COMBINATION
      #else
      ERROR_UNALLOWED_COMBINATION ("Combination is forbidden: The GM Foot model only works with the TLEM2 leg model")
      #define FORBIDDEN_COMBINATION
      #endif
    #endif
  #endif
  #endif
  
//  #if BM_FOOT_MODEL == _FOOT_MODEL_NONE_
//    #if (BM_LEG_RIGHT | BM_LEG_LEFT) & (BM_LEG_MODEL != _LEG_MODEL_TLEM2_ & BM_LEG_MODEL != _LEG_MODEL_TLEM1_)
//    #ifdef FORBIDDEN_COMBINATION
//      #else
//      ERROR_UNALLOWED_COMBINATION ("Combination is forbidden: Disabling the default feet are only allowed with the TLEM1/2 leg models")
//      #define FORBIDDEN_COMBINATION
//      #endif
//    #endif
//  #endif
  
  
  // Include the selected body parts
  // *******************************
  
  // The body parts are included only if there is no unallowed combination detected
  #ifdef FORBIDDEN_COMBINATION
  #else
  
  #include "TrunkModel.any"
  IndividualMasses = {AnyVar TrunkMass = .Trunk.MassSummation.Mass;};
  
  
  #if BM_ARM_RIGHT == ON
  
    #include "RightArmModel.any"
    
    IndividualMasses = {AnyVar RightArmMass = .Right.ShoulderArm.MassSummation.Mass;};
  
  #else
  IndividualMasses = {AnyVar RightArmMass = 0;};
  #endif
  
  
  
  
  #if BM_ARM_LEFT == ON
  
    #include "LeftArmModel.any"    

    IndividualMasses = {AnyVar LeftArmMass = .Left.ShoulderArm.MassSummation.Mass;};
  
  #else
  IndividualMasses = {AnyVar LeftArmMass = 0;};
  #endif
  
  
  #if BM_LEG_RIGHT & (BM_LEG_MODEL == _LEG_MODEL_LEG_)
  
    #include "RightLegModel.any"
    
    IndividualMasses = {
      AnyVar RightLegMass = .Right.Leg.MassSummation.Mass;
    };
  
  #else
    IndividualMasses = {AnyVar RightLegMass = 0;};
  
    #if BM_LEG_RIGHT == OFF
     Trunk = 
     {
       AnyRefNode &PsoasMajorRightReference=.Trunk.SegmentsLumbar.PelvisSeg.Right;
     };
    #else
    #endif
    
  #endif
  
  
  
  
  #if BM_LEG_LEFT & (BM_LEG_MODEL == _LEG_MODEL_LEG_)
  
    #include "LeftLegModel.any"
    
    IndividualMasses = {
      AnyVar LeftLegMass = .Left.Leg.MassSummation.Mass;
    };
  
  #else
    IndividualMasses = {AnyVar LeftLegMass = 0;};
  
    #if BM_LEG_LEFT == OFF
      Trunk = 
      {
        AnyRefNode &PsoasMajorLeftReference=.Trunk.SegmentsLumbar.PelvisSeg.Left;
      };
    #else
    #endif
  
  #endif
  
  
  
  #if BM_LEG_RIGHT & BM_LEG_MODEL_IS_TLEM
      
    #include "RightLegTDModel.any"
    
    IndividualMasses = {AnyVar RightLegTDMass = .Right.Leg.MassSummation.Mass;};

  #else
    IndividualMasses = {AnyVar RightLegTDMass = 0;};
  #endif
  
  
  
  #if BM_LEG_LEFT & BM_LEG_MODEL_IS_TLEM
      
    #include "LeftLegTDModel.any"
    
    IndividualMasses = {AnyVar LeftLegTDMass = .Left.Leg.MassSummation.Mass;};
      
  #else
    IndividualMasses = {AnyVar LeftLegTDMass = 0;};
  #endif
  
      
  // Create the needed folders
  // *************************
  
  #if ((BM_ARM_RIGHT != OFF) | (BM_LEG_RIGHT != OFF)) 
  #include "RightFolder.any"
  #endif
  
  #if ((BM_ARM_LEFT != OFF) | (BM_LEG_LEFT != OFF)) 
  #include "LeftFolder.any"
  #endif
  
  
  AnyFolder MannequinValuesFromModel = {
    AnyFolder AnyFolder_Posture = {  
    };
  };
  
  
  AnyFolder Interface = {
    AnyKinCoM CenterOfMass = {
      RefFrames = ObjSearchRecursive( &...BodyModel, "*", "AnySeg");
    };  
 
  };
  
  AnyFolder IndividualMasses = {};
  
  // Total mass of the human model
  AnyVar TotalBodyMass = IndividualMasses.RightLegMass 
  + IndividualMasses.LeftLegMass 
  + IndividualMasses.RightLegTDMass 
  + IndividualMasses.LeftLegTDMass 
  + IndividualMasses.RightArmMass 
  + IndividualMasses.LeftArmMass 
  + IndividualMasses.TrunkMass; 
  //+ IndividualMasses.TrunkNeckMass;
//  + IndividualMasses.PelvisWithoutTrunkMass;
    
#endif

}; // end BodyModel




//include the calibration study
//AnyFolder &HumanFolderRef=BodyModel;
#include "CalibrationSequence.any"
// Include moment arm study
#ifndef EVALUATE_MOMENT_ARMS
  #define EVALUATE_MOMENT_ARMS 0
#endif
#if EVALUATE_MOMENT_ARMS
  #include "EvaluateMomentArmsSequence.any"
#endif


// Include moment arm study
#ifndef EVALUATE_JOINT_STRENGTH
  #define EVALUATE_JOINT_STRENGTH 0
#endif
#if EVALUATE_JOINT_STRENGTH
  #include "EvaluateJointStrengthSequence.any"
#endif