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

A simple class for keeping track of a connected chain of Particle objects. More...

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

Public Types

using Chain = std::vector< Particle >
 

Public Member Functions

 ParticleChain ()=default
 Default constructor.
 
 ParticleChain (Chain c)
 Constructor with chain initialization. More...
 
auto operator+= (const ForceChain &rhs) -> ParticleChain &
 Add a list of offset vectors to each element in the chain. More...
 
auto operator*= (const double &rhs) -> ParticleChain &
 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 Particle &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...
 

Private Attributes

Chain data_
 

Detailed Description

A simple class for keeping track of a connected chain of Particle objects.

Definition at line 22 of file ParticleChain.hpp.

Member Typedef Documentation

◆ Chain

Data storage type

Definition at line 26 of file ParticleChain.hpp.

Constructor & Destructor Documentation

◆ ParticleChain()

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

Constructor with chain initialization.

Definition at line 32 of file ParticleChain.hpp.

Member Function Documentation

◆ begin() [1/2]

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

Returns an iterator to the beginning of the chain.

Definition at line 53 of file ParticleChain.hpp.

◆ begin() [2/2]

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

Returns an iterator to the beginning of the chain.

Definition at line 56 of file ParticleChain.hpp.

◆ clear()

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

Empties and resets the chain.

Definition at line 81 of file ParticleChain.hpp.

◆ emplace_back()

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

Constructs an element at the end of the chain.

Definition at line 66 of file ParticleChain.hpp.

◆ end() [1/2]

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

Returns an iterator to the end of the chain.

Definition at line 59 of file ParticleChain.hpp.

◆ end() [2/2]

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

Returns an iterator to the end of the chain.

Definition at line 62 of file ParticleChain.hpp.

◆ operator+=()

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

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

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

◆ operator[]() [1/2]

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

Element access operator.

Definition at line 47 of file ParticleChain.hpp.

◆ operator[]() [2/2]

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

Element access operator.

Definition at line 50 of file ParticleChain.hpp.

◆ push_back()

void volcart::segmentation::ParticleChain::push_back ( const Particle val)
inline

Adds an element to the end of the chain.

Definition at line 72 of file ParticleChain.hpp.

◆ size() [1/2]

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

Returns the number of elements in the chain.

Definition at line 75 of file ParticleChain.hpp.

◆ size() [2/2]

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

Returns the number of elements in the chain.

Definition at line 78 of file ParticleChain.hpp.

Member Data Documentation

◆ data_

Chain volcart::segmentation::ParticleChain::data_
private

Data storage vector

Definition at line 85 of file ParticleChain.hpp.


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