1 #ifndef SimTK_SIMBODY_CONTACT_TRACKER_SUBSYSTEM_H_ 
    2 #define SimTK_SIMBODY_CONTACT_TRACKER_SUBSYSTEM_H_ 
   34 class MultibodySystem;
 
   38 class ContactSnapshot;
 
  206                                            int contactSurfaceOrdinal) 
const;
 
  245                                         bool& reverseOrder) 
const;
 
  270                            Real&        stepAdvice) 
const;
 
  277                               Real&        stepAdvice) 
const;
 
  288 class ContactTrackerSubsystemImpl& updImpl();
 
  289 const ContactTrackerSubsystemImpl& getImpl() 
const;
 
  309 typedef std::map<ContactId,int>     ContactMap;
 
  312 typedef std::map<std::pair<ContactSurfaceIndex,ContactSurfaceIndex>, 
 
  322     m_id2contact.clear();
 
  323     m_surfPair2id.clear();
 
  340     assert(
id.isValid() && surf1.isValid() && surf2.isValid());
 
  343     if (surf1 > surf2) std::swap(surf1,surf2);
 
  345     assert(!hasContact(
id));
 
  346     assert(!hasContact(surf1,surf2));
 
  348     const int indx = m_contacts.size();
 
  349     m_contacts.push_back(contact); 
 
  350     m_id2contact[id] = indx;
 
  351     m_surfPair2id[std::make_pair(surf1,surf2)] = id;
 
  356 {   
return m_id2contact.find(
id) != m_id2contact.end(); }
 
  360 {   
if (surf1 > surf2) std::swap(surf1,surf2);
 
  361     return m_surfPair2id.find(std::make_pair(surf1,surf2)) 
 
  362         != m_surfPair2id.end(); }
 
  376     ContactMap::const_iterator p = m_id2contact.find(
id);
 
  377     return p==m_id2contact.end() ? empty : m_contacts[p->second]; }
 
  383 {   
if (surf1 > surf2) std::swap(surf1,surf2);
 
  384     SurfaceMap::const_iterator p = 
 
  385         m_surfPair2id.find(std::make_pair(surf1,surf2));
 
  386     return p==m_surfPair2id.end() ? 
ContactId() : p->second; }
 
  394 void removeContact(
int n) {
 
  395     assert(0 <= n && n < m_contacts.size());
 
  396     if (n+1 == m_contacts.size()) {
 
  397         m_contacts.pop_back(); 
 
  401     m_contacts[n] = m_contacts.back();  
 
  402     m_contacts.pop_back();              
 
  403     m_id2contact[m_contacts[n].getContactId()] = n;
 
  408 Array_<Contact,int> m_contacts;     
 
  409 ContactMap          m_id2contact;   
 
  410 SurfaceMap          m_surfPair2id;  
 
Every Simbody header and source file should include this header before any other Simbody header.
 
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:68
 
This is for arrays indexed by mobilized body number within a subsystem (typically the SimbodyMatterSu...
 
A MobilizedBody is Simbody's fundamental body-and-joint object used to parameterize a system's motion...
Definition: MobilizedBody.h:169
 
The job of the MultibodySystem class is to coordinate the activities of various subsystems which can ...
Definition: MultibodySystem.h:48
 
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:280
 
A Subsystem is expected to be part of a larger System and to have interdependencies with other subsys...
Definition: Subsystem.h:55
 
const Real NaN
This is the IEEE "not a number" constant for this implementation of the default-precision Real type; ...
 
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
 
std::ostream & operator<<(std::ostream &o, const ContactForce &f)
Definition: CompliantContactSubsystem.h:387
 
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:607