9 #include "imstkPbdConstraint.h" 11 #include <unordered_set> 27 using iterator = std::vector<std::shared_ptr<PbdConstraint>>::iterator;
28 using const_iterator = std::vector<std::shared_ptr<PbdConstraint>>::const_iterator;
34 virtual void addConstraint(std::shared_ptr<PbdConstraint> constraint);
45 std::shared_ptr<std::unordered_set<size_t>> vertices,
const int bodyId);
std::vector< std::shared_ptr< PbdConstraint > > m_constraints
Not partitioned constraints.
Container for pbd constraints.
virtual void reserve(const size_t n)
Reserve an amount of constraints in the pool, if you know ahead of time the number of constraints...
std::vector< std::vector< std::shared_ptr< PbdConstraint > > > m_partitionedConstraints
Partitioned pbd constraints.
virtual iterator eraseConstraint(iterator iter)
Removes a constraint from the system by iterator, thread safe.
const std::vector< std::shared_ptr< PbdConstraint > > & getConstraints() const
Get the underlying container.
ParallelUtils::SpinLock m_constraintLock
Used to deal with concurrent addition/removal of constraints.
void clearPartitions()
Clear the parition vectors.
const std::vector< std::vector< std::shared_ptr< PbdConstraint > > > getPartitionedConstraints() const
Get the partitioned constraints.
virtual void removeConstraints(std::shared_ptr< std::unordered_set< size_t >> vertices, const int bodyId)
Removes all constraints associated with vertex ids.
virtual void removeConstraint(std::shared_ptr< PbdConstraint > constraint)
Linear searches for and removes a constraint from the system, thread safe.
const bool empty() const
Returns if there are no constraints.
virtual void addConstraint(std::shared_ptr< PbdConstraint > constraint)
Adds a constraint to the system, thread safe.
void partitionConstraints(const int partitionThreshold)
Partitions pbd constraints into separate vectors via graph coloring.