Radium Engine  1.5.0
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

Return true if the volume is parametric

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 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.

Member Function Documentation

◆ 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.


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