Simbody  3.4 (development)
GeneralContactSubsystem.h
Go to the documentation of this file.
00001 #ifndef SimTK_SIMBODY_GENERAL_CONTACT_SUBSYSTEM_H_
00002 #define SimTK_SIMBODY_GENERAL_CONTACT_SUBSYSTEM_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) 2008-12 Stanford University and the Authors.        *
00013  * Authors: Peter Eastman                                                     *
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 
00027 #include "SimTKmath.h"
00028 #include "simbody/internal/common.h"
00029 
00030 namespace SimTK {
00031 
00032 class MultibodySystem;
00033 class MobilizedBody;
00034 class ContactGeometry;
00035 
00057 class SimTK_SIMBODY_EXPORT GeneralContactSubsystem : public Subsystem {
00058 public:
00059     GeneralContactSubsystem();
00060     explicit GeneralContactSubsystem(MultibodySystem&);
00065     ContactSetIndex createContactSet();
00069     int getNumContactSets() const;
00078     void addBody(ContactSetIndex index, const MobilizedBody& body, const ContactGeometry& geom, Transform transform);
00082     int getNumBodies(ContactSetIndex set) const;
00089     const MobilizedBody& getBody(ContactSetIndex set, ContactSurfaceIndex index) const;
00096     const ContactGeometry& getBodyGeometry(ContactSetIndex set, ContactSurfaceIndex index) const;
00103     ContactGeometry& updBodyGeometry(ContactSetIndex set, ContactSurfaceIndex index);
00110     const Transform& getBodyTransform(ContactSetIndex set, ContactSurfaceIndex index) const;
00117     Transform& updBodyTransform(ContactSetIndex set, ContactSurfaceIndex index);
00124     const Array_<Contact>& getContacts(const State& state, ContactSetIndex set) const;
00125     SimTK_PIMPL_DOWNCAST(GeneralContactSubsystem, Subsystem);
00126 private:
00127     class GeneralContactSubsystemImpl& updImpl();
00128     const GeneralContactSubsystemImpl& getImpl() const;
00129 };
00130 
00131 } // namespace SimTK
00132 
00133 #endif // SimTK_SIMBODY_GENERAL_CONTACT_SUBSYSTEM_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines