Simbody  3.4 (development)
MobilizedBody_Screw.h
Go to the documentation of this file.
00001 #ifndef SimTK_SIMBODY_MOBILIZED_BODY_SCREW_H_
00002 #define SimTK_SIMBODY_MOBILIZED_BODY_SCREW_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: Michael Sherman                                                   *
00014  * Contributors: Paul Mitiguy, Peter Eastman                                  *
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 
00032 namespace SimTK {
00033 
00039 class SimTK_SIMBODY_EXPORT MobilizedBody::Screw : public MobilizedBody {
00040 public:
00043     Screw() {}
00044 
00050     Screw(MobilizedBody& parent, const Transform& X_PF,
00051           const Body& bodyInfo,  const Transform& X_BM,
00052           Real pitch, Direction=Forward);
00053 
00056     Screw(MobilizedBody& parent, const Body& bodyInfo, Real pitch, 
00057           Direction=Forward);
00058 
00059 
00060     Screw& addBodyDecoration(const Transform& X_BD, const DecorativeGeometry& g) {
00061         (void)MobilizedBody::addBodyDecoration(X_BD,g); return *this;
00062     }
00063     Screw& addOutboardDecoration(const Transform& X_MD,  const DecorativeGeometry& g) {
00064         (void)MobilizedBody::addOutboardDecoration(X_MD,g); return *this;
00065     }
00066     Screw& addInboardDecoration (const Transform& X_FD, const DecorativeGeometry& g) {
00067         (void)MobilizedBody::addInboardDecoration(X_FD,g); return *this;
00068     }
00069 
00070     Screw& setDefaultInboardFrame(const Transform& X_PF) {
00071         (void)MobilizedBody::setDefaultInboardFrame(X_PF); return *this;
00072     }
00073 
00074     Screw& setDefaultOutboardFrame(const Transform& X_BM) {
00075         (void)MobilizedBody::setDefaultOutboardFrame(X_BM); return *this;
00076     }
00077 
00078     Screw& setDefaultPitch(Real pitch);
00079     Real   getDefaultPitch() const;
00080 
00081     Screw& setDefaultQ(Real);
00082     Real   getDefaultQ() const;
00083 
00084     Real getQ(const State&) const;
00085     Real getQDot(const State&) const;
00086     Real getQDotDot(const State&) const;
00087     Real getU(const State&) const;
00088     Real getUDot(const State&) const;
00089 
00090     void setQ(State&, Real) const;
00091     void setU(State&, Real) const;
00092 
00093     Real getMyPartQ(const State&, const Vector& qlike) const;
00094     Real getMyPartU(const State&, const Vector& ulike) const;
00095    
00096     Real& updMyPartQ(const State&, Vector& qlike) const;
00097     Real& updMyPartU(const State&, Vector& ulike) const;
00098  // Don't let doxygen see this
00100     SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(Screw, ScrewImpl, MobilizedBody);
00102 };
00103 
00104 } // namespace SimTK
00105 
00106 #endif // SimTK_SIMBODY_MOBILIZED_BODY_SCREW_H_
00107 
00108 
00109 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines