Volume Cartographer 2.27.0
Particle.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <opencv2/core.hpp>
6
8{
18{
19public:
21 Particle() = default;
22
24 explicit Particle(const cv::Vec3d& p) : pos_(p) {}
25
27 Particle& operator+=(const cv::Vec3d& rhs);
29 Particle& operator*=(const double& rhs);
30
32 cv::Vec3d& pos() { return pos_; }
34 const cv::Vec3d& pos() const { return pos_; }
35
40 double& restingL() { return restingL_; }
42 const double& restingL() const { return restingL_; }
43
48 double& restingR() { return restingR_; }
50 const double& restingR() const { return restingR_; }
51
52private:
54 cv::Vec3d pos_{0, 0, 0};
56 double restingL_{0};
58 double restingR_{0};
59};
60
62Particle operator+(Particle lhs, const cv::Vec3d& rhs);
64Particle operator*(Particle lhs, const double& rhs);
65} // namespace volcart::segmentation
A simple particle class.
Definition: Particle.hpp:18
const double & restingR() const
Get the resting length between this and the next particle in the chain.
Definition: Particle.hpp:50
cv::Vec3d & pos()
Get the particle position.
Definition: Particle.hpp:32
Particle & operator+=(const cv::Vec3d &rhs)
Add a vector offset to the particle position.
const cv::Vec3d & pos() const
Get the particle position.
Definition: Particle.hpp:34
Particle(const cv::Vec3d &p)
Constructor with position initialization.
Definition: Particle.hpp:24
double & restingR()
Get the resting length between this and the next particle in the chain.
Definition: Particle.hpp:48
Particle()=default
Default constructor.
double & restingL()
Get the resting length between this and the previous particle in the chain.
Definition: Particle.hpp:40
Particle & operator*=(const double &rhs)
Scale all elements of the particle position.
const double & restingL() const
Get the resting length between this and the previous particle in the chain.
Definition: Particle.hpp:42
Segmentation algorithms and utilities library
auto operator+(ForceChain lhs, const ForceChain &rhs) -> ForceChain
auto operator*(ForceChain lhs, const double &rhs) -> ForceChain