Volume Cartographer 2.27.0
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
volcart::segmentation::ForceChain Class Reference

A simple class for tracking a list of offset vectors ("forces") More...

#include <vc/segmentation/stps/ForceChain.hpp>

Public Types

using Chain = std::vector< Force >
 

Public Member Functions

 ForceChain ()=default
 Default constructor.
 
 ForceChain (Chain c)
 Constructor with chain initialization. More...
 
auto operator+= (const ForceChain &rhs) -> ForceChain &
 Add a list of offset vectors to each element in the chain. More...
 
auto operator*= (const double &rhs) -> ForceChain &
 Multiply each element of chain by a constant scale factor.
 
auto operator[] (std::size_t i)
 Element access operator. More...
 
auto operator[] (std::size_t i) const
 Element access operator. More...
 
auto begin ()
 Returns an iterator to the beginning of the chain. More...
 
auto begin () const
 Returns an iterator to the beginning of the chain. More...
 
auto end ()
 Returns an iterator to the end of the chain. More...
 
auto end () const
 Returns an iterator to the end of the chain. More...
 
template<class... Args>
void emplace_back (Args &&... args)
 Constructs an element at the end of the chain. More...
 
void push_back (const Force &val)
 Adds an element to the end of the chain. More...
 
auto size () -> std::size_t
 Returns the number of elements in the chain. More...
 
auto size () const -> std::size_t
 Returns the number of elements in the chain. More...
 
void clear ()
 Empties and resets the chain. More...
 

Static Public Member Functions

static void Normalize (ForceChain &c, double alpha=1.0)
 Normalize the magnitude of each Force in the chain. More...
 

Private Attributes

Chain data_
 

Detailed Description

A simple class for tracking a list of offset vectors ("forces")

Vectors in this class are assumed to be 3D offsets to the position of elements in a ParticleChain.

Definition at line 23 of file ForceChain.hpp.

Member Typedef Documentation

◆ Chain

Data storage type

Definition at line 27 of file ForceChain.hpp.

Constructor & Destructor Documentation

◆ ForceChain()

volcart::segmentation::ForceChain::ForceChain ( Chain  c)
inlineexplicit

Constructor with chain initialization.

Definition at line 33 of file ForceChain.hpp.

Member Function Documentation

◆ begin() [1/2]

auto volcart::segmentation::ForceChain::begin ( )
inline

Returns an iterator to the beginning of the chain.

Definition at line 54 of file ForceChain.hpp.

◆ begin() [2/2]

auto volcart::segmentation::ForceChain::begin ( ) const
inline

Returns an iterator to the beginning of the chain.

Definition at line 57 of file ForceChain.hpp.

◆ clear()

void volcart::segmentation::ForceChain::clear ( )
inline

Empties and resets the chain.

Definition at line 82 of file ForceChain.hpp.

◆ emplace_back()

template<class... Args>
void volcart::segmentation::ForceChain::emplace_back ( Args &&...  args)
inline

Constructs an element at the end of the chain.

Definition at line 67 of file ForceChain.hpp.

◆ end() [1/2]

auto volcart::segmentation::ForceChain::end ( )
inline

Returns an iterator to the end of the chain.

Definition at line 60 of file ForceChain.hpp.

◆ end() [2/2]

auto volcart::segmentation::ForceChain::end ( ) const
inline

Returns an iterator to the end of the chain.

Definition at line 63 of file ForceChain.hpp.

◆ Normalize()

static void volcart::segmentation::ForceChain::Normalize ( ForceChain c,
double  alpha = 1.0 
)
static

Normalize the magnitude of each Force in the chain.

Parameters
alphaUpper value to which the magnitude is normalized

◆ operator+=()

auto volcart::segmentation::ForceChain::operator+= ( const ForceChain rhs) -> ForceChain &

Add a list of offset vectors to each element in the chain.

Offset vectors are added per element: C1[0] + C2[0]; C1[1] + C2[1]; ... Throws std::domain_error if ForceChain size doesn't match the size of this ForceChain.

◆ operator[]() [1/2]

auto volcart::segmentation::ForceChain::operator[] ( std::size_t  i)
inline

Element access operator.

Definition at line 48 of file ForceChain.hpp.

◆ operator[]() [2/2]

auto volcart::segmentation::ForceChain::operator[] ( std::size_t  i) const
inline

Element access operator.

Definition at line 51 of file ForceChain.hpp.

◆ push_back()

void volcart::segmentation::ForceChain::push_back ( const Force val)
inline

Adds an element to the end of the chain.

Definition at line 73 of file ForceChain.hpp.

◆ size() [1/2]

auto volcart::segmentation::ForceChain::size ( ) -> std::size_t
inline

Returns the number of elements in the chain.

Definition at line 76 of file ForceChain.hpp.

◆ size() [2/2]

auto volcart::segmentation::ForceChain::size ( ) const -> std::size_t
inline

Returns the number of elements in the chain.

Definition at line 79 of file ForceChain.hpp.

Member Data Documentation

◆ data_

Chain volcart::segmentation::ForceChain::data_
private

Data storage vector

Definition at line 93 of file ForceChain.hpp.


The documentation for this class was generated from the following file: