Simbody
3.4 (development)
|
00001 #ifndef SimTK_SIMBODY_MOBILIZED_BODY_FUNCTIONBASED_H_ 00002 #define SimTK_SIMBODY_MOBILIZED_BODY_FUNCTIONBASED_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) 2007-13 Stanford University and the Authors. * 00013 * Authors: Peter Eastman * 00014 * Contributors: Ajay Seth * 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 00030 #include "simbody/internal/MobilizedBody.h" 00031 #include "simbody/internal/MobilizedBody_Custom.h" 00032 00033 namespace SimTK { 00034 00046 class SimTK_SIMBODY_EXPORT MobilizedBody::FunctionBased 00047 : public MobilizedBody::Custom { 00048 public: 00051 FunctionBased() {} 00052 00066 FunctionBased(MobilizedBody& parent, const Body& bodyInfo, 00067 int nmobilities, const Array_<const Function*>& functions, 00068 const Array_<Array_<int> >& coordIndices, 00069 Direction direction=Forward); 00070 00072 FunctionBased(MobilizedBody& parent, const Body& bodyInfo, 00073 int nmobilities, const std::vector<const Function*>& functions, 00074 const std::vector<std::vector<int> >& coordIndices, 00075 Direction direction=Forward) 00076 { 00077 Array_< Array_<int> > coordCopy(coordIndices); // sorry, must copy 00078 // Use the above constructor. 00079 new(this) FunctionBased(parent,bodyInfo,nmobilities, 00080 ArrayViewConst_<const Function*>(functions), 00081 coordCopy, direction); 00082 } 00083 00099 FunctionBased(MobilizedBody& parent, const Transform& X_PF, 00100 const Body& bodyInfo, const Transform& X_BM, 00101 int nmobilities, const Array_<const Function*>& functions, 00102 const Array_<Array_<int> >& coordIndices, 00103 Direction direction=Forward); 00104 00106 FunctionBased(MobilizedBody& parent, const Transform& X_PF, 00107 const Body& bodyInfo, const Transform& X_BM, 00108 int nmobilities, const std::vector<const Function*>& functions, 00109 const std::vector<std::vector<int> >& coordIndices, 00110 Direction direction=Forward) 00111 { 00112 Array_< Array_<int> > coordCopy(coordIndices); // sorry, must copy 00113 // Use the above constructor. 00114 new(this) FunctionBased(parent,X_PF,bodyInfo,X_BM, 00115 nmobilities, ArrayViewConst_<const Function*>(functions), 00116 coordCopy, direction); 00117 } 00118 00134 FunctionBased(MobilizedBody& parent, const Body& bodyInfo, 00135 int nmobilities, const Array_<const Function*>& functions, 00136 const Array_<Array_<int> >& coordIndices, const Array_<Vec3>& axes, 00137 Direction direction=Forward); 00138 00140 FunctionBased(MobilizedBody& parent, const Body& bodyInfo, 00141 int nmobilities, const std::vector<const Function*>& functions, 00142 const std::vector<std::vector<int> >& coordIndices, const std::vector<Vec3>& axes, 00143 Direction direction=Forward) 00144 { 00145 Array_< Array_<int> > coordCopy(coordIndices); // sorry, must copy 00146 // Use the above constructor. 00147 new(this) FunctionBased(parent,bodyInfo, 00148 nmobilities, ArrayViewConst_<const Function*>(functions), 00149 coordCopy, ArrayViewConst_<Vec3>(axes), 00150 direction); 00151 } 00152 00170 FunctionBased(MobilizedBody& parent, const Transform& X_PF, 00171 const Body& bodyInfo, const Transform& X_BM, 00172 int nmobilities, const Array_<const Function*>& functions, 00173 const Array_<Array_<int> >& coordIndices, const Array_<Vec3>& axes, 00174 Direction direction=Forward); 00175 00177 FunctionBased(MobilizedBody& parent, const Transform& X_PF, 00178 const Body& bodyInfo, const Transform& X_BM, 00179 int nmobilities, const std::vector<const Function*>& functions, 00180 const std::vector<std::vector<int> >& coordIndices, const std::vector<Vec3>& axes, 00181 Direction direction=Forward) 00182 { 00183 Array_< Array_<int> > coordCopy(coordIndices); // sorry, must copy 00184 // Use the above constructor. 00185 new(this) FunctionBased(parent,X_PF,bodyInfo,X_BM, 00186 nmobilities, ArrayViewConst_<const Function*>(functions), 00187 coordCopy, ArrayViewConst_<Vec3>(axes), 00188 direction); 00189 } 00190 }; 00191 00192 } // namespace SimTK 00193 00194 #endif // SimTK_SIMBODY_MOBILIZED_BODY_FUNCTIONBASED_H_ 00195 00196 00197