Simbody
3.4 (development)
|
00001 #ifndef SimTK_SIMBODY_MOBILIZED_BODY_LINEORIENTATION_H_ 00002 #define SimTK_SIMBODY_MOBILIZED_BODY_LINEORIENTATION_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 * 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 00059 class SimTK_SIMBODY_EXPORT MobilizedBody::LineOrientation : public MobilizedBody { 00060 public: 00063 LineOrientation() {} 00064 00071 LineOrientation(MobilizedBody& parent, const Transform& X_PF, 00072 const Body& bodyInfo, const Transform& X_BM, 00073 Direction=Forward); 00074 00077 LineOrientation(MobilizedBody& parent, const Body& bodyInfo, 00078 Direction=Forward); 00079 00080 LineOrientation& addBodyDecoration(const Transform& X_BD, const DecorativeGeometry& g) { 00081 (void)MobilizedBody::addBodyDecoration(X_BD,g); return *this; 00082 } 00083 LineOrientation& addOutboardDecoration(const Transform& X_MD, const DecorativeGeometry& g) { 00084 (void)MobilizedBody::addOutboardDecoration(X_MD,g); return *this; 00085 } 00086 LineOrientation& addInboardDecoration (const Transform& X_FD, const DecorativeGeometry& g) { 00087 (void)MobilizedBody::addInboardDecoration(X_FD,g); return *this; 00088 } 00089 00090 LineOrientation& setDefaultInboardFrame(const Transform& X_PF) { 00091 (void)MobilizedBody::setDefaultInboardFrame(X_PF); return *this; 00092 } 00093 00094 LineOrientation& setDefaultOutboardFrame(const Transform& X_BM) { 00095 (void)MobilizedBody::setDefaultOutboardFrame(X_BM); return *this; 00096 } 00097 00098 // This is just a nicer name for the generalized coordinate. 00099 LineOrientation& setDefaultRotation(const Rotation& R_FM) { 00100 return setDefaultQ(R_FM.convertRotationToQuaternion()); 00101 } 00102 Rotation getDefaultRotation() const {return Rotation(getDefaultQ());} 00103 00104 // Generic default state Topology methods. 00105 const Quaternion& getDefaultQ() const; 00106 LineOrientation& setDefaultQ(const Quaternion& q); 00107 00108 const Vec4& getQ(const State&) const; 00109 const Vec4& getQDot(const State&) const; 00110 const Vec4& getQDotDot(const State&) const; 00111 const Vec2& getU(const State&) const; 00112 const Vec2& getUDot(const State&) const; 00113 00114 void setQ(State&, const Vec4&) const; 00115 void setU(State&, const Vec2&) const; 00116 00117 const Vec4& getMyPartQ(const State&, const Vector& qlike) const; 00118 const Vec2& getMyPartU(const State&, const Vector& ulike) const; 00119 00120 Vec4& updMyPartQ(const State&, Vector& qlike) const; 00121 Vec2& updMyPartU(const State&, Vector& ulike) const; 00122 // hide from Doxygen 00124 SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS(LineOrientation, 00125 LineOrientationImpl, MobilizedBody); 00127 }; 00128 00129 } // namespace SimTK 00130 00131 #endif // SimTK_SIMBODY_MOBILIZED_BODY_LINEORIENTATION_H_ 00132 00133 00134