Simbody
3.4 (development)
|
00001 #ifndef SimTK_SIMBODY_GENERAL_FORCE_ELEMENTS_H_ 00002 #define SimTK_SIMBODY_GENERAL_FORCE_ELEMENTS_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) 2006-12 Stanford University and the Authors. * 00013 * Authors: 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 "simbody/internal/common.h" 00028 #include "simbody/internal/ForceSubsystem.h" 00029 00030 #include <cassert> 00031 00032 namespace SimTK { 00033 00034 class MultibodySystem; 00035 class SimbodyMatterSubsystem; 00036 class Force; 00037 00047 class SimTK_SIMBODY_EXPORT GeneralForceSubsystem : public ForceSubsystem { 00048 public: 00049 GeneralForceSubsystem(); 00050 explicit GeneralForceSubsystem(MultibodySystem&); 00051 00064 ForceIndex adoptForce(Force& force); 00065 00068 int getNumForces() const; 00069 00071 const Force& getForce(ForceIndex index) const; 00072 00074 Force& updForce(ForceIndex index); 00075 00078 bool isForceDisabled(const State& state, ForceIndex index) const; 00079 00086 void setForceIsDisabled 00087 (State& state, ForceIndex index, bool shouldBeDisabled) const; 00088 00093 const MultibodySystem& getMultibodySystem() const; 00094 // don't show in Doxygen docs 00096 SimTK_PIMPL_DOWNCAST(GeneralForceSubsystem, ForceSubsystem); 00098 private: 00099 // OBSOLETE; use getNumForces() instead. 00100 int getNForces() const {return getNumForces();} 00101 00102 class GeneralForceSubsystemRep& updRep(); 00103 const GeneralForceSubsystemRep& getRep() const; 00104 }; 00105 00106 } // namespace SimTK 00107 00108 #endif // SimTK_SIMBODY_GENERAL_FORCE_ELEMENTS_H_