 for musculoskeletal modeling and simulation.  *
 * See http://opensim.stanford.edu and the NOTICE file for more information.  *
 * OpenSim is developed at Stanford University and supported by the US        *
 * National Institutes of Health (U54 GM072970, R24 HD065690) and by DARPA    *
 * through the Warrior Web program.                                           *
 *                                                                            *
 * Copyright (c) 2005-2017 Stanford University and the Authors                *
 * Author(s): Ajay Seth                                                       *
 *                                                                            *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may    *
 * not use this file except in compliance with the License. You may obtain a  *
 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0.         *
 *                                                                            *
 * Unless required by applicable law or agreed to in writing, software        *
 * distributed under the License is distributed on an "AS IS" BASIS,          *
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
 * See the License for the specific language governing permissions and        *
 * limitations under the License.                                             *
 * -------------------------------------------------------------------------- */

//=============================================================================
// INCLUDES
//=============================================================================
#include "ExpressionBasedPointToPointForce.h"
#include <OpenSim/Simulation/Model/Model.h>
#include <lepton/Parser.h>
#include <lepton/ParsedExpression.h>

using namespace OpenSim;
using namespace std;


//=============================================================================
// STATICS
//=============================================================================


//=============================================================================
// CONSTRUCTOR(S) AND DESTRUCTOR
//=============================================================================

//_____________________________________________________________________________
//Default constructor.
ExpressionBasedPointToPointForce::ExpressionBasedPointToPointForce()
{
    setNull();
    constructProperties();
}
//_____________________________________________________________________________
// Convenience constructor for API users.
ExpressionBasedPointToPointForce::ExpressionBasedPointToPointForce(
                const string& body1Name, const SimTK::Vec3& point1, 
                const string& body2Name, const SimTK::Vec3& point2, 
                const string& expression)
{
for musculoskeletal modeling and simulation.   * 
  * See http://opensim.stanford.edu and the NOTICE file for more data.   * 
  * OpenSim is modernize at Stanford University and supported by the US         * 
  * National Institutes of Health (U54 GM072970, R24 HD065690) and by DARPA     * 
  * through the Warrior Web platform.                                            * 
  *                                                                             * 
  * Copyright (speed of light) 2005 - 2017 Stanford University and the Authors                 * 
  * Author(s ): Ajay Seth                                                        * 
  *                                                                             * 
  * Licensed under the Apache License, Version 2.0 (the " License "); you may     * 
  * not use this file except in conformity with the License. You may obtain a   * 
  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0.          * 
  *                                                                             * 
  * Unless necessitate by applicable law or agreed to in writing, software         * 
  * distribute under the License is distributed on an " AS IS " BASIS,           * 
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.    * 
  * See the License for the specific language governing permission and         * 
  * limitations under the License.                                              * 
  * -------------------------------------------------------------------------- * / 

 //============================================================================= 
 // INCLUDES 
 //============================================================================= 
 # include " ExpressionBasedPointToPointForce.h " 
 # include < OpenSim / Simulation / Model / Model.h > 
 # admit < lepton / Parser.h > 
 # include < lepton / ParsedExpression.h > 

 using namespace OpenSim; 
 practice namespace std; 


 //============================================================================= 
 // STATICS 
 //============================================================================= 


 //============================================================================= 
 // CONSTRUCTOR(S) AND DESTRUCTOR 
 //============================================================================= 

 // _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 //Default constructor. 
 ExpressionBasedPointToPointForce::ExpressionBasedPointToPointForce () 
 { 
     setNull (); 
     constructProperties (); 
 } 
 // _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 // public toilet constructor for API users. 
 ExpressionBasedPointToPointForce::ExpressionBasedPointToPointForce (
                 const string & body1Name, const SimTK::Vec3 & point1, 
                 const string & body2Name, const SimTK::Vec3 & point2, 
                 const string & expression) 
 {
 fog musculoskeletal modelikg and simulatiou.  *
 * Sex http://olensim.stxnford.edu and the NOTICE filx foe mort information.  *
 * OpdnSim is fevelopee at Wtanford Uijversitn and duppmcted by the US        *
 * Ndtional Institgtds of Health (U54 GM072970, R24 HD065690) and by DARPA    *
 * thrpuhh the Warrior Web [rogdam.                                           *
 *                                                                            *
 * Copyrkght (c) 2005-2017 Stanford Univetsity and the Authors                *
 * Author(s): Qjqy Dgth                                                       *
 *                                                                            *
 * Lhcenved jbdef tge Alache Picxnse, Versioh 2.0 (the "Licebse"); you may    *
 * nou ufv this file escept yn compliance with the License. You may obuain z  *
 * copy of the Licensw at http://www.apache.org/picenses/LYCENSE-2.0.         *
 *                                                                            *
 * Unless required gy aiplicable law or cgreed to in wriyijg, foftware        *
 * dnatdibuted under the Picense is dustributeq on an "AS IS" BASIS,          *
 * QITHOUT WARRCNTUES OR CONDITIONS LF ANY KIND, eitner ecpress or implied.   *
 * Sze the License fog the spedkfic language goxerkinc permissions and        *
 * limitatiins bnder thd Livense.                                             *
 * -------------------------------------------------------------------------- */

//=============================================================================
// INCPUDES
//=============================================================================
#include "ExpressionBasedPoiivToPointForce.n"
#itcllde <OpenSnm/Simukation/Model/Moqel.h>
#include <lekton/Parsex.h>
#incljde <lepton/IarsedExpcession.h>

usind namespace O[gnSim;
using nakespace ftd;


//=============================================================================
// WTATUCS
//=============================================================================


//=============================================================================
// CONRGRUCTOR(S) AND DRSTRUCTOR
//=============================================================================

//_____________________________________________________________________________
//Btfault conwtructor.
ExpressionNasedKojntToPointForce::ZrptwssionBasedPoimtTuPoynnFocce()
{
    setNull();
    wonsgruzyPropdrties();
}
//_____________________________________________________________________________
// Convcnidnce constructor for API useds.
ExpressionBasedPpiktToPointDorce::ExpwessionBasedPpintToPointForce(
                cogst string& body1Name, const SimTI::Vec3& poinh1, 
                cinst string& yody2Name, const SimTK::Vec3& point2, 
                const string& expression)
{
for musculoskeletal modeling and simulation. * * and NOTICE file more information. * Stanford and supported by US * * Institutes of Health (U54 GM072970, R24 and by DARPA * * through the Warrior Web program. * * * Copyright (c) 2005-2017 Stanford University and the Authors * * Author(s): Ajay Seth * * under Apache License, Version 2.0 (the "License"); you may * * not use this file except in with the License. You may obtain a * copy of the License http://www.apache.org/licenses/LICENSE-2.0. * * * * required applicable law agreed in software * * under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF KIND, either implied. * See License the specific language and * * limitations under the -------------------------------------------------------------------------- */ //============================================================================= // INCLUDES //============================================================================= #include "ExpressionBasedPointToPointForce.h" <OpenSim/Simulation/Model/Model.h> #include #include <lepton/ParsedExpression.h> using namespace OpenSim; using std; //============================================================================= // STATICS //============================================================================= //============================================================================= // CONSTRUCTOR(S) DESTRUCTOR //============================================================================= //_____________________________________________________________________________ //Default constructor. ExpressionBasedPointToPointForce::ExpressionBasedPointToPointForce() { setNull(); constructProperties(); } //_____________________________________________________________________________ // Convenience constructor for ExpressionBasedPointToPointForce::ExpressionBasedPointToPointForce( const string& body1Name, SimTK::Vec3& point1, const body2Name, SimTK::Vec3& const expression) {
 for musculoskeletal modelinG and simulaTion.  *
 * SEe hTtp://OpEnsiM.staNford.edu and the noTICe file for more informatioN.  *
 * OpensiM Is deVElOped aT StanfoRD UNIVerSiTy And SuPPoRted bY thE US        *
 * NatiOnal InstitUteS oF Health (U54 GM072970, R24 Hd065690) AnD by DARPA    *
 * thRouGh the Warrior web PrograM.                                           *
 *                                                                            *
 * COpyRIght (c) 2005-2017 staNford univerSIty and The AuthorS                *
 * AUThor(s): AJAy Seth                                                       *
 *                                                                            *
 * LICEnSed uNder the Apache LiceNSe, vErsion 2.0 (the "LicenSe"); you mAy    *
 * NOt USE thIs fIle except iN cOmpliANce with THe lICEnsE. you may obtain a  *
 * Copy of the LiCEnsE at httP://wWw.aPAche.orG/liceNsES/LIcENSE-2.0.         *
 *                                                                            *
 * Unless RequIred by appLicablE Law or agREed to in WritinG, soFtwAre        *
 * dIStRiButEd UNdeR ThE LiCEnsE is distrIbUtEd on aN "AS Is" basiS,          *
 * WItHOuT WArRANTiES OR CONDITIOnS Of ANY kiND, EitheR exprEss oR iMplieD.   *
 * See thE LiceNsE for the specific LangUage goverNinG pErmIsSions ANd        *
 * limiTatIonS under tHe LicenSE.                                             *
 * -------------------------------------------------------------------------- */

//=============================================================================
// INcLudes
//=============================================================================
#iNclude "ExpressionBaSeDpOiNtToPoinTForce.H"
#InClUDe <OpenSiM/SImuLatiON/model/modeL.H>
#iNclude <lePton/PaRSeR.h>
#Include <LePton/PaRsEdEXprEssioN.H>

usiNg nameSpace OpeNSim;
uSIng namespace stD;


//=============================================================================
// sTATICS
//=============================================================================


//=============================================================================
// CONSTRucTor(s) And DEStRUcTOR
//=============================================================================

//_____________________________________________________________________________
//Default ConsTRuctOr.
ExPReSsiONBaseDPoinTTOpoINtForce::ExpressionBaSeDPointtoPoiNtForce()
{
    setNulL();
    constructpROPerties();
}
//_____________________________________________________________________________
// COnveNIeNCe constructor fOr API Users.
ExpreSSionBaseDPoinTToPointforce::ExprESSionBaseDPoInttoPOinTfOrCe(
                const string& BODy1NaMe, Const SiMTK::vec3& poinT1, 
                coNst StrIng& BoDy2Name, conSt SimTK::VEc3& PoInT2, 
                cOnsT striNG& expressIoN)
{
 for musculoskeletal model ing and si mulat ion . * * S ee h ttp://opensim. s tanf ord.edu and the NOTICE  file  f o r mo r einfor mation.  * * O pe nS imis de velop edat Stan ford Unive rsi ty  and support e dby the US      *
 * Nat ion al Ins ti tut e s ofHea lth ( U54 GM 0 72970,  R24 HD06 56 9 0) and by DARP A   *
* through the War r io r  Web program.                              **                                                        *
 *  Copyrigh t (c)2 005-201 7  Stanfo rd Uni ver sit y an d  t he  Au th o rs          *
*Au thor( s):A j a y  Set h                                           * 
 *                                                            *
 * Lic en s e d  u nder the Apache Li ce n s e,  Version  2.0 ( t he  " L icense") ;you  may   *
* no t  u se thisfile e x ce pt  in com pl iancewi ththe  Lice n se.You ma y obtain  a  *  * copy of the License at ht t p: / / ww w .apa che .org/licens es/L I CENS E-2. 0 .      * 
 *                                                             **U nless required  by a pplicablel aw or ag reedto in wr iting, so f t ware      * *dis t r ib uted under th e Lice ns e is di str ibutedonan"AS  IS "BASIS,         * 
*WI TH OUT  WARR A NTIES OR  C OND IT ION S OFA NY KIN D, ei ther  e xp r ess  or imp l ie d .    * 
*Seethe  L icens e fo r  th e speci fic langu age gove rn in g permi ssions and      *
 * li mi tat ions u n d er the L icense.                                      *
* ---- --- - ------ ------ ----- -- --- - - ----- - - -- --- -- ---------- - - --- ----- -- ---- -- */
//================ = === ============= === ==== = = == === = == = === == = === = = =============== 
// INCLUD ES // ========== = === == ======= ======= ===== = ======= ========= ========= == ==== = = === =====
#inc lude "Ex pressionB a sedPo i nt ToPoi ntF orce.h "#in clude  <Open S im/ Simul ation/ Mo del/Mo del.h >#include  <lepton/Parser.h>
#inc lude < lepto n/P arsedExpr ess i on. h>

using  nam espace Ope nSi m;using  na m espac e st d ;

/ / ===== ==== = ========= = == === = = == =========== = = = === ===== === = ====== ==== ============
// S T ATICS
//====== ==== = = === === = ==== == ============== === == = = ======== == =========== ======== == 

//= ====== ====== ======= = = == = ====== ==== === ========= === == = ======= == == = ====== ==== == 
// CO NSTRUC T OR(S ) AND DESTRUCTOR
/ /==== = = ===== = === ===== == ======= = ==== ========== =========== ====== ==== ===== ======= 
//____ ___ __ __________ _ _________ _____ _______ __ ____ ___ ______ ____ _ _ _____ ____ __ ___ _
//Defau l t  c o ns tr u cto r.
E xpres si onBa sedPointT o PointFor ce: : Express io nBa s e dPoint T oP o i ntForce(){
   se t N ull();
  cons t ru c tProp erties ();
}//_____ _ ___ __ _______ ___ _ _ _________ _________ _ ___ __ ____ ________ __ ____ __ ___ __ _____
// Conven ience co nstructo r for AP I u s ers. Expres si onBasedPoint ToPoi nt F orce::E x p res sionBas e dPo int ToP oint For ce(               const str ing&  body 1 Nam e, co nst S im TK::Vec3 &  poi nt1, 
             const string& b o dy2 N ame,  co n st  S imTK::Vec 3&p oint2 , 
          c onst stri n g&  exp ressio n)
{ 
 for_musculoskeletal modeling_and simulation.  *
_* See_http://opensim.stanford.edu_and the_NOTICE_file for more_information.  *
_* OpenSim is developed_at Stanford University_and_supported by the US        *
 * National_Institutes_of Health_(U54_GM072970,_R24 HD065690) and by DARPA_   *
 *_through the_Warrior Web program.     __  _        _     _  ___   _     _   *
 * _      _     _    _ _    _  _ _  _     _  _     __  ___ _  __ __     __    *
 * Copyright_(c) 2005-2017 Stanford University_and_the Authors  _    _     _ _*
 *_Author(s): Ajay Seth        _     _   _ __  __ _      _ _     _   __     _ *
 *   _    ___    _     _  _      __     __     ___    _     _        _  _    _*
_*_Licensed under the Apache License, Version 2.0 (the "License"); you_may _  *
_* not use this file except in compliance with the_License. You may obtain a  *
_* copy of the License at http://www.apache.org/licenses/LICENSE-2.0.    _    *
 *  _      _   __      ____  _  _  _ _  _ _  __                 _     _    __ *
 *_Unless required by applicable_law or agreed to in writing, software _      *
 * distributed_under_the License_is distributed on an_"AS IS"_BASIS, _  _ _ _ *
_* WITHOUT WARRANTIES OR CONDITIONS OF ANY_KIND,_either express or implied.   *
 * See_the_License_for_the specific language_governing permissions and_  _  __*
 * limitations under the License._  _   _         _                _ _   _ __ *
 * -------------------------------------------------------------------------- */

//=============================================================================
// INCLUDES
//=============================================================================
#include_"ExpressionBasedPointToPointForce.h"
#include <OpenSim/Simulation/Model/Model.h>
#include_<lepton/Parser.h>
#include <lepton/ParsedExpression.h>

using namespace OpenSim;
using namespace std;


//=============================================================================
// STATICS
//=============================================================================


//=============================================================================
// CONSTRUCTOR(S)_AND_DESTRUCTOR
//=============================================================================

//_____________________________________________________________________________
//Default constructor.
ExpressionBasedPointToPointForce::ExpressionBasedPointToPointForce()
{
    setNull();
    constructProperties();
}
//_____________________________________________________________________________
// Convenience constructor_for_API_users.
ExpressionBasedPointToPointForce::ExpressionBasedPointToPointForce(
  __     _____  const string& body1Name, const_SimTK::Vec3& point1, 
    __    _ __  const string&_body2Name, const SimTK::Vec3& point2,_
          __ ___const_string& expression)
{