Simbody  3.4 (development)
Force_MobilityConstantForce.h
Go to the documentation of this file.
00001 #ifndef SimTK_SIMBODY_FORCE_MOBILITY_CONSTANT_FORCE_H_
00002 #define SimTK_SIMBODY_FORCE_MOBILITY_CONSTANT_FORCE_H_
00003 
00004 /* -------------------------------------------------------------------------- *
00005  *                               Simbody(tm)                                  *
00006  * -------------------------------------------------------------------------- *
00007  * This is part of the SimTK biosimulation toolkit originating from           *
00008  * Simbios, the NIH National Center for Physics-Based Simulation of           *
00009  * Biological Structures at Stanford, funded under the NIH Roadmap for        *
00010  * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody.  *
00011  *                                                                            *
00012  * Portions copyright (c) 2008-13 Stanford University and the Authors.        *
00013  * Authors: Peter Eastman, Michael Sherman                                    *
00014  * Contributors:                                                              *
00015  *                                                                            *
00016  * Licensed under the Apache License, Version 2.0 (the "License"); you may    *
00017  * not use this file except in compliance with the License. You may obtain a  *
00018  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0.         *
00019  *                                                                            *
00020  * Unless required by applicable law or agreed to in writing, software        *
00021  * distributed under the License is distributed on an "AS IS" BASIS,          *
00022  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
00023  * See the License for the specific language governing permissions and        *
00024  * limitations under the License.                                             *
00025  * -------------------------------------------------------------------------- */
00026 
00027 #include "SimTKcommon.h"
00028 #include "simbody/internal/Force.h"
00029 
00035 namespace SimTK {
00036 
00045 class SimTK_SIMBODY_EXPORT Force::MobilityConstantForce : public Force {
00046 public:
00053     MobilityConstantForce(GeneralForceSubsystem&    forces, 
00054                           const MobilizedBody&      mobod, 
00055                           MobilizerUIndex           whichU, 
00056                           Real                      defaultForce);
00057 
00061     MobilityConstantForce(GeneralForceSubsystem&    forces, 
00062                           const MobilizedBody&      mobod, 
00063                           Real                      defaultForce)    
00064     {   // Invoke the other constructor.
00065         new(this) MobilityConstantForce(forces, mobod, MobilizerUIndex(0),
00066                                         defaultForce);
00067     }
00068 
00070     MobilityConstantForce() {}
00071 
00082     MobilityConstantForce& setDefaultForce(Real defaultForce);
00083 
00087     Real getDefaultForce() const;
00088 
00098     void setForce(State& state, Real force) const;
00099 
00104     Real getForce(const State& state) const;
00105 
00113     MobilityConstantForce(GeneralForceSubsystem&    forces, 
00114                           const MobilizedBody&      mobod, 
00115                           int                       whichU, 
00116                           Real                      defaultForce)
00117     {   // Invoke the other constructor.
00118         new(this) MobilityConstantForce(forces, mobod, MobilizerUIndex(whichU),
00119                                         defaultForce);
00120     } // Hide from Doxygen.
00124     SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(MobilityConstantForce, 
00125                                              MobilityConstantForceImpl, Force);
00127 };
00128 
00129 } // namespace SimTK
00130 
00131 #endif // SimTK_SIMBODY_FORCE_MOBILITY_CONSTANT_FORCE_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines