Simbody  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MobilizedBody_FunctionBased.h
Go to the documentation of this file.
1 #ifndef SimTK_SIMBODY_MOBILIZED_BODY_FUNCTIONBASED_H_
2 #define SimTK_SIMBODY_MOBILIZED_BODY_FUNCTIONBASED_H_
3 
4 /* -------------------------------------------------------------------------- *
5  * Simbody(tm) *
6  * -------------------------------------------------------------------------- *
7  * This is part of the SimTK biosimulation toolkit originating from *
8  * Simbios, the NIH National Center for Physics-Based Simulation of *
9  * Biological Structures at Stanford, funded under the NIH Roadmap for *
10  * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
11  * *
12  * Portions copyright (c) 2007-13 Stanford University and the Authors. *
13  * Authors: Peter Eastman *
14  * Contributors: Ajay Seth *
15  * *
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may *
17  * not use this file except in compliance with the License. You may obtain a *
18  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
19  * *
20  * Unless required by applicable law or agreed to in writing, software *
21  * distributed under the License is distributed on an "AS IS" BASIS, *
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
23  * See the License for the specific language governing permissions and *
24  * limitations under the License. *
25  * -------------------------------------------------------------------------- */
26 
32 
33 namespace SimTK {
34 
47 : public MobilizedBody::Custom {
48 public:
52 
66  FunctionBased(MobilizedBody& parent, const Body& bodyInfo,
67  int nmobilities, const Array_<const Function*>& functions,
68  const Array_<Array_<int> >& coordIndices,
69  Direction direction=Forward);
70 
72  FunctionBased(MobilizedBody& parent, const Body& bodyInfo,
73  int nmobilities, const std::vector<const Function*>& functions,
74  const std::vector<std::vector<int> >& coordIndices,
75  Direction direction=Forward)
76  {
77  Array_< Array_<int> > coordCopy(coordIndices); // sorry, must copy
78  // Use the above constructor.
79  new(this) FunctionBased(parent,bodyInfo,nmobilities,
81  coordCopy, direction);
82  }
83 
99  FunctionBased(MobilizedBody& parent, const Transform& X_PF,
100  const Body& bodyInfo, const Transform& X_BM,
101  int nmobilities, const Array_<const Function*>& functions,
102  const Array_<Array_<int> >& coordIndices,
103  Direction direction=Forward);
104 
106  FunctionBased(MobilizedBody& parent, const Transform& X_PF,
107  const Body& bodyInfo, const Transform& X_BM,
108  int nmobilities, const std::vector<const Function*>& functions,
109  const std::vector<std::vector<int> >& coordIndices,
110  Direction direction=Forward)
111  {
112  Array_< Array_<int> > coordCopy(coordIndices); // sorry, must copy
113  // Use the above constructor.
114  new(this) FunctionBased(parent,X_PF,bodyInfo,X_BM,
115  nmobilities, ArrayViewConst_<const Function*>(functions),
116  coordCopy, direction);
117  }
118 
134  FunctionBased(MobilizedBody& parent, const Body& bodyInfo,
135  int nmobilities, const Array_<const Function*>& functions,
136  const Array_<Array_<int> >& coordIndices, const Array_<Vec3>& axes,
137  Direction direction=Forward);
138 
140  FunctionBased(MobilizedBody& parent, const Body& bodyInfo,
141  int nmobilities, const std::vector<const Function*>& functions,
142  const std::vector<std::vector<int> >& coordIndices, const std::vector<Vec3>& axes,
143  Direction direction=Forward)
144  {
145  Array_< Array_<int> > coordCopy(coordIndices); // sorry, must copy
146  // Use the above constructor.
147  new(this) FunctionBased(parent,bodyInfo,
148  nmobilities, ArrayViewConst_<const Function*>(functions),
149  coordCopy, ArrayViewConst_<Vec3>(axes),
150  direction);
151  }
152 
170  FunctionBased(MobilizedBody& parent, const Transform& X_PF,
171  const Body& bodyInfo, const Transform& X_BM,
172  int nmobilities, const Array_<const Function*>& functions,
173  const Array_<Array_<int> >& coordIndices, const Array_<Vec3>& axes,
174  Direction direction=Forward);
175 
177  FunctionBased(MobilizedBody& parent, const Transform& X_PF,
178  const Body& bodyInfo, const Transform& X_BM,
179  int nmobilities, const std::vector<const Function*>& functions,
180  const std::vector<std::vector<int> >& coordIndices, const std::vector<Vec3>& axes,
181  Direction direction=Forward)
182  {
183  Array_< Array_<int> > coordCopy(coordIndices); // sorry, must copy
184  // Use the above constructor.
185  new(this) FunctionBased(parent,X_PF,bodyInfo,X_BM,
186  nmobilities, ArrayViewConst_<const Function*>(functions),
187  coordCopy, ArrayViewConst_<Vec3>(axes),
188  direction);
189  }
190 };
191 
192 } // namespace SimTK
193 
194 #endif // SimTK_SIMBODY_MOBILIZED_BODY_FUNCTIONBASED_H_
195 
196 
197 
The Body class represents a reference frame that can be used to describe mass properties and geometry...
Definition: Body.h:55
FunctionBased(MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, int nmobilities, const std::vector< const Function * > &functions, const std::vector< std::vector< int > > &coordIndices, Direction direction=Forward)
For compatibility with std::vector.
Definition: MobilizedBody_FunctionBased.h:106
FunctionBased(MobilizedBody &parent, const Body &bodyInfo, int nmobilities, const std::vector< const Function * > &functions, const std::vector< std::vector< int > > &coordIndices, const std::vector< Vec3 > &axes, Direction direction=Forward)
For compatibility with std::vector.
Definition: MobilizedBody_FunctionBased.h:140
The SimTK::Array_<T> container class is a plug-compatible replacement for the C++ standard template l...
Definition: Array.h:50
FunctionBased()
Default constructor provides an empty handle that can be assigned to reference any MobilizedBody::Fun...
Definition: MobilizedBody_FunctionBased.h:51
Direction
Constructors can take an argument of this type to indicate that the mobilizer is being defined in the...
Definition: MobilizedBody.h:180
This is a subclass of MobilizedBody::Custom which uses a set of Function objects to define the behavi...
Definition: MobilizedBody_FunctionBased.h:46
This defines the MobilizedBody class, which associates a new body (the "child", "outboard", or "successor" body) with a mobilizer and a reference frame on an existing body (the "parent", "inboard", or "predecessor" body) that is already part of a SimbodyMatterSubsystem.
This Array_ helper class is the base class for ArrayView_ which is the base class for Array_; here we...
Definition: Array.h:48
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:72
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:167
FunctionBased(MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, int nmobilities, const std::vector< const Function * > &functions, const std::vector< std::vector< int > > &coordIndices, const std::vector< Vec3 > &axes, Direction direction=Forward)
For compatibility with std::vector.
Definition: MobilizedBody_FunctionBased.h:177
The handle class MobilizedBody::Custom (dataless) and its companion class MobilizedBody::Custom::Impl...
Definition: MobilizedBody_Custom.h:72
FunctionBased(MobilizedBody &parent, const Body &bodyInfo, int nmobilities, const std::vector< const Function * > &functions, const std::vector< std::vector< int > > &coordIndices, Direction direction=Forward)
For compatibility with std::vector.
Definition: MobilizedBody_FunctionBased.h:72
Declares the MobilizedBody::Custom and MobilizedBody::Custom::Implementation subclasses.