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

#include <Core/Geometry/Volume.hpp>

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

Public Types

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

 AbstractVolume (const AbstractVolume &data)=default
 
AbstractVolumeoperator= (const AbstractVolume &)=default
 
VolumeStorageType getType () const
 Return the type of geometry.
 
virtual Utils::optional< ValueTypegetValue (Eigen::Ref< const Vector3 > p) const =0
 
void displayInfo () const
 Print info to the Debug output. Need to be extended by child classes.
 
Status queries
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)
 
virtual void clear ()=0
 Erases all data, making the geometry empty.
 
virtual Aabb computeAabb () const =0
 Compute bounding box.
 
Ra::Core::Utils::ObservableVoid & getAabbObservable ()
 

Protected Member Functions

 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
 

Protected Attributes

VolumeStorageType m_type
 The type of geometry for the object.
 

Detailed Description

AbstractVolume is an abstract class for Volumetric data (can be parametric or discrete, with dense or sparse storage).

Note
Right now the encoded function \(f\) is dimension 1, ie. \(f:\Re^3->\Re\). If needed, the class can be templated so the built-in typedef ValueType is replaced by a parameter.
This class could also be modified to encode n-dimensionnal textures. See this for an implementation of n-dimensionnal grids with neighbhorood queries (compile-time loop unrolling): http://github.com/STORM-IRIT/OpenGR/blob/master/src/gr/accelerators/normalset.h

Definition at line 30 of file Volume.hpp.

Member Typedef Documentation

◆ ValueType

Type of value encoded in the volume.

Definition at line 44 of file Volume.hpp.

Member Enumeration Documentation

◆ VolumeStorageType

The type of geometry.

Enumerator
DISCRETE_DENSE 

<

volume defined as a function f : R^2 -> R

DISCRETE_SPARSE 

<

volume defined as a function sampled in a regular grid

Definition at line 35 of file Volume.hpp.

Constructor & Destructor Documentation

◆ AbstractVolume()

Ra::Core::Geometry::AbstractVolume::AbstractVolume ( const VolumeStorageType & type)
protected

Definition at line 9 of file Volume.cpp.

Member Function Documentation

◆ displayInfo()

void Ra::Core::Geometry::AbstractVolume::displayInfo ( ) const

Print info to the Debug output. Need to be extended by child classes.

Definition at line 28 of file Volume.cpp.

◆ getType()

VolumeStorageType Ra::Core::Geometry::AbstractVolume::getType ( ) const
inline

Return the type of geometry.

Definition at line 55 of file Volume.hpp.

◆ getValue()

virtual Utils::optional< ValueType > Ra::Core::Geometry::AbstractVolume::getValue ( Eigen::Ref< const Vector3 > p) const
pure virtual

Get the function value at a given position p

Set to invalid when the query position p is out of bound

Implemented in Ra::Core::Geometry::AbstractDiscreteVolume.

◆ isDense()

bool Ra::Core::Geometry::AbstractVolume::isDense ( ) const

Return true if the volume is dense (implies isDiscrete to be true)

Definition at line 20 of file Volume.cpp.

◆ isDiscrete()

bool Ra::Core::Geometry::AbstractVolume::isDiscrete ( ) const

Return true if the volume is discrete. Can be cast as AbstractDiscreteVolume.

Definition at line 16 of file Volume.cpp.

◆ isParametric()

bool Ra::Core::Geometry::AbstractVolume::isParametric ( ) const

Return true if the volume is parametric

Definition at line 12 of file Volume.cpp.

◆ isSparse()

bool Ra::Core::Geometry::AbstractVolume::isSparse ( ) const

Return true if the volume is sparse (implies isDiscrete to be true)

Definition at line 24 of file Volume.cpp.

◆ setType()

void Ra::Core::Geometry::AbstractVolume::setType ( const VolumeStorageType & type)
inlineprotected

Set the type of geometry.

Definition at line 59 of file Volume.hpp.

Member Data Documentation

◆ m_type

VolumeStorageType Ra::Core::Geometry::AbstractVolume::m_type
protected

The type of geometry for the object.

Definition at line 85 of file Volume.hpp.


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