Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Core::Geometry::AbstractDiscreteVolume Class Referenceabstract

#include <Core/Geometry/Volume.hpp>

+ Inheritance diagram for Ra::Core::Geometry::AbstractDiscreteVolume:
+ Collaboration diagram for Ra::Core::Geometry::AbstractDiscreteVolume:

Public Types

using ValueType = AbstractVolume::ValueType
 
using IndexType = Vector3i
 
- Public Types inherited from Ra::Core::Geometry::AbstractVolume
enum  VolumeStorageType { UNKNOWN = 1 << 0 , PARAMETRIC = 1 << 1 , DISCRETE_DENSE = 1 << 2 , DISCRETE_SPARSE = 1 << 3 }
 The type of geometry. More...
 
using ValueType = Scalar
 Type of value encoded in the volume.
 

Public Member Functions

 AbstractDiscreteVolume (const AbstractDiscreteVolume &data)=default
 
AbstractDiscreteVolumeoperator= (const AbstractDiscreteVolume &)=default
 
void clear () override
 Erases all data, making the geometry empty.
 
Aabb computeAabb () const override
 Compute the aabb of the volume.
 
const Vector3i & size () const
 return the size (number of bins ni each dimension) of the volume
 
void setSize (Eigen::Ref< const Vector3i > size)
 
const Vector3 & binSize () const
 return the bin size
 
void setBinSize (Eigen::Ref< const Vector3 > binSize)
 Set the bin size.
 
Utils::optional< ValueType > getBinValue (Eigen::Ref< const IndexType > p) const
 Get the value of the given bin.
 
Utils::optional< ValueType > getValue (Eigen::Ref< const Vector3 > p) const override final
 
bool addToBin (const ValueType &value, Eigen::Ref< const IndexType > p)
 
- Public Member Functions inherited from Ra::Core::Geometry::AbstractVolume
 AbstractVolume (const AbstractVolume &data)=default
 
AbstractVolumeoperator= (const AbstractVolume &)=default
 
VolumeStorageType getType () const
 Return the type of geometry.
 
void displayInfo () const
 Print info to the Debug output. Need to be extended by child classes.
 
bool isParametric () const
 
bool isDiscrete () const
 Return true if the volume is discrete. Can be cast as AbstractDiscreteVolume.
 
bool isDense () const
 Return true if the volume is dense (implies isDiscrete to be true)
 
bool isSparse () const
 Return true if the volume is sparse (implies isDiscrete to be true)
 
- Public Member Functions inherited from Ra::Core::Geometry::AbstractGeometry
 AbstractGeometry (const AbstractGeometry &other)
 
AbstractGeometryoperator= (const AbstractGeometry &other)
 
Ra::Core::Utils::ObservableVoid & getAabbObservable ()
 

Protected Member Functions

 AbstractDiscreteVolume (const VolumeStorageType &type)
 
Utils::optional< typename IndexType::Scalar > linearIndex (Eigen::Ref< const IndexType > p) const
 Convert the 3D position into a linear index on the bin set.
 
virtual Utils::optional< ValueType > getBinValue (typename IndexType::Scalar idx) const =0
 Get the bin value.
 
virtual void addToBin (const ValueType &value, typename IndexType::Scalar idx)=0
 Add a value to the bin.
 
virtual void updateStorage ()=0
 Method called when size as been updated.
 
- Protected Member Functions inherited from Ra::Core::Geometry::AbstractVolume
 AbstractVolume (const VolumeStorageType &type)
 
void setType (const VolumeStorageType &type)
 Set the type of geometry.
 
- Protected Member Functions inherited from Ra::Core::Geometry::AbstractGeometry
bool isAabbValid () const
 
Core::Aabb getAabb () const
 
void invalidateAabb () const
 
void setAabb (const Core::Aabb &aabb) const
 

Additional Inherited Members

- Protected Attributes inherited from Ra::Core::Geometry::AbstractVolume
VolumeStorageType m_type
 The type of geometry for the object.
 

Detailed Description

General interface for discrete volume that store the information into a set of bins indexed in 3D.

Definition at line 92 of file Volume.hpp.

Member Typedef Documentation

◆ IndexType

using Ra::Core::Geometry::AbstractDiscreteVolume::IndexType = Vector3i

Definition at line 97 of file Volume.hpp.

◆ ValueType

using Ra::Core::Geometry::AbstractDiscreteVolume::ValueType = AbstractVolume::ValueType

Definition at line 96 of file Volume.hpp.

Constructor & Destructor Documentation

◆ AbstractDiscreteVolume()

Ra::Core::Geometry::AbstractDiscreteVolume::AbstractDiscreteVolume ( const VolumeStorageType & type)
inlineprotected

Definition at line 100 of file Volume.hpp.

Member Function Documentation

◆ addToBin() [1/2]

bool Ra::Core::Geometry::AbstractDiscreteVolume::addToBin ( const ValueType & value,
Eigen::Ref< const IndexType > p )
inline

Increment bin p by value.

Note
: does nothing if p is out of bounds.

Definition at line 150 of file Volume.hpp.

◆ addToBin() [2/2]

virtual void Ra::Core::Geometry::AbstractDiscreteVolume::addToBin ( const ValueType & value,
typename IndexType::Scalar idx )
protectedpure virtual

Add a value to the bin.

Implemented in Ra::Core::Geometry::VolumeGrid, and Ra::Core::Geometry::VolumeSparse.

◆ binSize()

const Vector3 & Ra::Core::Geometry::AbstractDiscreteVolume::binSize ( ) const
inline

return the bin size

Definition at line 123 of file Volume.hpp.

◆ clear()

void Ra::Core::Geometry::AbstractDiscreteVolume::clear ( )
overridevirtual

Erases all data, making the geometry empty.

Implements Ra::Core::Geometry::AbstractGeometry.

Definition at line 49 of file Volume.cpp.

◆ computeAabb()

Aabb Ra::Core::Geometry::AbstractDiscreteVolume::computeAabb ( ) const
overridevirtual

Compute the aabb of the volume.

Implements Ra::Core::Geometry::AbstractGeometry.

Definition at line 55 of file Volume.cpp.

◆ getBinValue() [1/2]

Utils::optional< ValueType > Ra::Core::Geometry::AbstractDiscreteVolume::getBinValue ( Eigen::Ref< const IndexType > p) const
inline

Get the value of the given bin.

Definition at line 133 of file Volume.hpp.

◆ getBinValue() [2/2]

virtual Utils::optional< ValueType > Ra::Core::Geometry::AbstractDiscreteVolume::getBinValue ( typename IndexType::Scalar idx) const
protectedpure virtual

Get the bin value.

Implemented in Ra::Core::Geometry::VolumeGrid, and Ra::Core::Geometry::VolumeSparse.

◆ getValue()

Utils::optional< ValueType > Ra::Core::Geometry::AbstractDiscreteVolume::getValue ( Eigen::Ref< const Vector3 > p) const
inlinefinaloverridevirtual

Get the function value at a given position p (discrete implementation).

Warning
no bounds checking on the parameter p
See also
getBinValue

Implements Ra::Core::Geometry::AbstractVolume.

Definition at line 142 of file Volume.hpp.

◆ linearIndex()

Utils::optional< typename IndexType::Scalar > Ra::Core::Geometry::AbstractDiscreteVolume::linearIndex ( Eigen::Ref< const IndexType > p) const
inlineprotected

Convert the 3D position into a linear index on the bin set.

Definition at line 162 of file Volume.hpp.

◆ setBinSize()

void Ra::Core::Geometry::AbstractDiscreteVolume::setBinSize ( Eigen::Ref< const Vector3 > binSize)
inline

Set the bin size.

Definition at line 126 of file Volume.hpp.

◆ setSize()

void Ra::Core::Geometry::AbstractDiscreteVolume::setSize ( Eigen::Ref< const Vector3i > size)
inline
Warning
Clears existing data

Definition at line 117 of file Volume.hpp.

◆ size()

const Vector3i & Ra::Core::Geometry::AbstractDiscreteVolume::size ( ) const
inline

return the size (number of bins ni each dimension) of the volume

Definition at line 115 of file Volume.hpp.

◆ updateStorage()

virtual void Ra::Core::Geometry::AbstractDiscreteVolume::updateStorage ( )
protectedpure virtual

Method called when size as been updated.

Implemented in Ra::Core::Geometry::VolumeGrid, and Ra::Core::Geometry::VolumeSparse.


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