Simbody
3.5
|
00001 #ifndef SimTK_SIMBODY_CONSTRAINT_POINT_IN_PLANE_H_ 00002 #define SimTK_SIMBODY_CONSTRAINT_POINT_IN_PLANE_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-14 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 00030 #include "simbody/internal/Constraint.h" 00031 00032 namespace SimTK { 00033 00034 //============================================================================== 00035 // CONSTRAINT:: POINT IN PLANE 00036 //============================================================================== 00037 00047 class SimTK_SIMBODY_EXPORT Constraint::PointInPlane : public Constraint { 00048 public: 00049 // no default constructor 00050 PointInPlane(MobilizedBody& planeBody_B, 00051 const UnitVec3& defaultPlaneNormal_B, Real defaultHeight, 00052 MobilizedBody& followerBody_F, const Vec3& defaultFollowerPoint_F); 00053 00055 PointInPlane() {} 00056 00057 // These affect only generated decorative geometry for visualization; 00058 // the plane is really infinite in extent with zero depth and the 00059 // point is really of zero radius. 00060 PointInPlane& setPlaneDisplayHalfWidth(Real); 00061 PointInPlane& setPointDisplayRadius(Real); 00062 Real getPlaneDisplayHalfWidth() const; 00063 Real getPointDisplayRadius() const; 00064 00065 // Defaults for Instance variables. 00066 PointInPlane& setDefaultPlaneNormal(const UnitVec3&); 00067 PointInPlane& setDefaultPlaneHeight(Real); 00068 PointInPlane& setDefaultFollowerPoint(const Vec3&); 00069 00070 // Stage::Topology 00071 MobilizedBodyIndex getPlaneMobilizedBodyIndex() const; 00072 MobilizedBodyIndex getFollowerMobilizedBodyIndex() const; 00073 00074 const UnitVec3& getDefaultPlaneNormal() const; 00075 Real getDefaultPlaneHeight() const; 00076 const Vec3& getDefaultFollowerPoint() const; 00077 00078 // Stage::Instance 00079 const UnitVec3& getPlaneNormal(const State&) const; 00080 Real getPlaneHeight(const State&) const; 00081 const Vec3& getFollowerPoint(const State&) const; 00082 00083 // Stage::Position, Velocity 00084 Real getPositionError(const State&) const; 00085 Real getVelocityError(const State&) const; 00086 00087 // Stage::Acceleration 00088 Real getAccelerationError(const State&) const; 00089 Real getMultiplier(const State&) const; 00090 Real getForceOnFollowerPoint(const State&) const; // in normal direction 00091 // hide from Doxygen 00093 SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS 00094 (PointInPlane, PointInPlaneImpl, Constraint); 00096 }; 00097 00098 00099 } // namespace SimTK 00100 00101 #endif // SimTK_SIMBODY_CONSTRAINT_POINT_IN_PLANE_H_ 00102 00103 00104