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

Stores per-voxel mask information for a volume. More...

#include <vc/core/types/VolumetricMask.hpp>

Public Types

using Voxel = cv::Vec3i
 
using iterator = MaskSet::iterator
 
using const_iterator = MaskSet::const_iterator
 
using Pointer = std::shared_ptr< VolumetricMask >
 

Public Member Functions

 VolumetricMask ()=default
 Default constructor.
 
template<class Container >
 VolumetricMask (const Container &ps)
 Constructor with existing Voxel container. More...
 
void setIn (const Voxel &v)
 Add Voxel to mask.
 
void setOut (const Voxel &v)
 Remove Voxel from mask.
 
template<class Container >
void setIn (const Container &ps)
 Add Voxels to mask. More...
 
template<class Container >
void setOut (const Container &ps)
 Remove Voxels from the mask. More...
 
auto isIn (const Voxel &v) const -> bool
 Check whether a Voxel is in the mask.
 
auto isOut (const Voxel &v) const -> bool
 Check whether a Voxel is not in the mask.
 
auto isIn (const cv::Vec3d &v) const -> bool
 Check whether a sub-voxel is in the mask.
 
auto isOut (const cv::Vec3d &v) const -> bool
 Check whether a sub-voxel is not in the mask.
 
auto begin () noexcept -> iterator
 Get a const-iterator to the first element in the mask.
 
auto begin () const noexcept -> const_iterator
 Get a const-iterator to the first element in the mask. More...
 
auto cbegin () const noexcept -> const_iterator
 Get a const-iterator to the first element in the mask. More...
 
auto end () noexcept -> iterator
 Get a const-iterator to one past the last element in the mask.
 
auto end () const noexcept -> const_iterator
 Get a const-iterator to one past the last element in the mask. More...
 
auto cend () const noexcept -> const_iterator
 Get a const-iterator to one past the last element in the mask. More...
 
void clear ()
 Clear the mask of all voxels.
 
auto empty () const -> bool
 Check if mask is empty.
 
auto as_vector () const -> std::vector< Voxel >
 Get the list of masked points as a vector.
 

Static Public Member Functions

template<typename... Args>
static auto New (Args... args) -> Pointer
 

Private Types

using MaskSet = std::unordered_set< Voxel, Vec3iHash >
 

Private Attributes

MaskSet mask_
 

Detailed Description

Stores per-voxel mask information for a volume.

Warning
This container is built on std::unordered_set, so it's very fast once built, but not very memory friendly.

Definition at line 20 of file VolumetricMask.hpp.

Member Typedef Documentation

◆ const_iterator

using volcart::VolumetricMask::const_iterator = MaskSet::const_iterator

Const-iterator type

Definition at line 34 of file VolumetricMask.hpp.

◆ iterator

using volcart::VolumetricMask::iterator = MaskSet::iterator

Iterator type

Definition at line 32 of file VolumetricMask.hpp.

◆ MaskSet

using volcart::VolumetricMask::MaskSet = std::unordered_set<Voxel, Vec3iHash>
private

Custom set type

Definition at line 28 of file VolumetricMask.hpp.

◆ Pointer

Pointer type

Definition at line 37 of file VolumetricMask.hpp.

◆ Voxel

using volcart::VolumetricMask::Voxel = cv::Vec3i

Voxel type

Definition at line 24 of file VolumetricMask.hpp.

Constructor & Destructor Documentation

◆ VolumetricMask()

template<class Container >
volcart::VolumetricMask::VolumetricMask ( const Container &  ps)
inlineexplicit

Constructor with existing Voxel container.

Definition at line 51 of file VolumetricMask.hpp.

Member Function Documentation

◆ begin()

auto volcart::VolumetricMask::begin ( ) const -> const_iterator
noexcept

Get a const-iterator to the first element in the mask.

◆ cbegin()

auto volcart::VolumetricMask::cbegin ( ) const -> const_iterator
noexcept

Get a const-iterator to the first element in the mask.

◆ cend()

auto volcart::VolumetricMask::cend ( ) const -> const_iterator
noexcept

Get a const-iterator to one past the last element in the mask.

◆ end()

auto volcart::VolumetricMask::end ( ) const -> const_iterator
noexcept

Get a const-iterator to one past the last element in the mask.

◆ New()

template<typename... Args>
static auto volcart::VolumetricMask::New ( Args...  args) -> Pointer
inlinestatic

Static New function for all constructors of T

Definition at line 41 of file VolumetricMask.hpp.

◆ setIn()

template<class Container >
void volcart::VolumetricMask::setIn ( const Container &  ps)
inline

Add Voxels to mask.

Definition at line 64 of file VolumetricMask.hpp.

◆ setOut()

template<class Container >
void volcart::VolumetricMask::setOut ( const Container &  ps)
inline

Remove Voxels from the mask.

Definition at line 72 of file VolumetricMask.hpp.

Member Data Documentation

◆ mask_

MaskSet volcart::VolumetricMask::mask_
private

Mask storage container

Definition at line 114 of file VolumetricMask.hpp.


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