8#include <opencv2/core.hpp>
27 using Chain = std::vector<Force>;
66 template <
class... Args>
69 data_.emplace_back(std::forward<Args>(args)...);
79 auto size() const -> std::
size_t {
return data_.size(); }
A simple class for tracking a list of offset vectors ("forces")
void clear()
Empties and resets the chain.
auto operator[](std::size_t i)
Element access operator.
void push_back(const Force &val)
Adds an element to the end of the chain.
static void Normalize(ForceChain &c, double alpha=1.0)
Normalize the magnitude of each Force in the chain.
ForceChain()=default
Default constructor.
auto begin()
Returns an iterator to the beginning of the chain.
auto end()
Returns an iterator to the end of the chain.
void emplace_back(Args &&... args)
Constructs an element at the end of the chain.
auto operator*=(const double &rhs) -> ForceChain &
Multiply each element of chain by a constant scale factor.
auto size() const -> std::size_t
Returns the number of elements in the chain.
auto size() -> std::size_t
Returns the number of elements in the chain.
auto operator+=(const ForceChain &rhs) -> ForceChain &
Add a list of offset vectors to each element in the chain.
auto operator[](std::size_t i) const
Element access operator.
auto begin() const
Returns an iterator to the beginning of the chain.
auto end() const
Returns an iterator to the end of the chain.
ForceChain(Chain c)
Constructor with chain initialization.
std::vector< Force > Chain
Segmentation algorithms and utilities library
auto operator+(ForceChain lhs, const ForceChain &rhs) -> ForceChain
auto operator*(ForceChain lhs, const double &rhs) -> ForceChain