16 #ifndef SURGSIM_PHYSICS_MLCPMAPPING_H 17 #define SURGSIM_PHYSICS_MLCPMAPPING_H 19 #include <unordered_map> 35 m_indexMapping.clear();
41 typename std::unordered_map<const T*, ptrdiff_t>::iterator found = m_indexMapping.find(key);
42 if (found == m_indexMapping.end())
44 m_indexMapping.insert(std::make_pair(key, value));
48 (*found).second = value;
55 typename std::unordered_map<const T*, ptrdiff_t>::const_iterator returnValue = m_indexMapping.find(key);
56 return (returnValue == m_indexMapping.end() ? -1 : (*returnValue).second);
62 std::unordered_map<const T*, ptrdiff_t> m_indexMapping;
68 #endif // SURGSIM_PHYSICS_MLCPMAPPING_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
void clear()
Clear the mapping.
Definition: MlcpMapping.h:33
void setValue(const T *key, size_t value)
Sets the key/value (add an entry if the key is not found, change the value otherwise) ...
Definition: MlcpMapping.h:39
Definition: MlcpMapping.h:27
ptrdiff_t getValue(const T *key) const
Gets the value from a given key.
Definition: MlcpMapping.h:53