Carna  Version 3.3.2
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Carna::base::VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType > Class Template Reference

Represents a particular partitioning of volumetric data. More...

#include <VolumeGrid.h>

Classes

struct  IntensitySelector
 References the intensity volume of a given partition. More...
 
struct  NormalSelector
 References the normal map of a given partition. More...
 

Public Types

typedef SegmentIntensityVolumeType SegmentIntensityVolume
 Reflects the type to use for storing the intensity volume of a single partition.
 
typedef SegmentNormalsVolumeType SegmentNormalsVolume
 Reflects the type to use for storing the normal map of a single partition.
 
typedef VolumeSegment< SegmentIntensityVolumeType, SegmentNormalsVolumeType > Segment
 Reflects the data type that represents a single partition.
 

Public Member Functions

 VolumeGrid (const math::Vector3ui &maxSegmentSize, const math::Vector3ui &segmentCounts)
 Instantiates. More...
 
virtual ~VolumeGrid ()
 Deletes this and all partitions.
 
SegmentsegmentAt (const base::math::Vector3ui &location)
 References the partition at location. More...
 
const SegmentsegmentAt (const base::math::Vector3ui &) const
 
SegmentsegmentAt (unsigned int segmentX, unsigned int segmentY, unsigned int segmentZ)
 
const SegmentsegmentAt (unsigned int segmentX, unsigned int segmentY, unsigned int segmentZ) const
 
template<typename Selector >
Selector::VoxelType getVoxel (const math::Vector3ui &location)
 Reads the voxel of the volume that the Selector selects from the partition at location.
 
template<typename Selector >
Selector::VoxelType getVoxel (unsigned int x, unsigned int y, unsigned int z)
 
template<typename Selector >
void setVoxel (const math::Vector3ui &location, const typename Selector::VoxelType &voxel)
 Writes the voxel of the volume that the Selector selects from the partition at location.
 
template<typename Selector >
void setVoxel (unsigned int x, unsigned int y, unsigned int z, const typename Selector::VoxelType &voxel)
 

Public Attributes

const math::Vector3ui maxSegmentSize
 Holds the maximum resolution of a single partition.
 
const math::Vector3ui segmentCounts
 Holds the number of partitions along each dimension.
 

Detailed Description

template<typename SegmentIntensityVolumeType, typename SegmentNormalsVolumeType>
class Carna::base::VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >

Represents a particular partitioning of volumetric data.

Parameters
SegmentIntensityVolumeTypeis the base::BufferedIntensityVolume compatible type to use for storing the Intensity volume of a single partition.
SegmentNormalsVolumeTypeis the base::BufferedNormalMap3D compatible type to use for storing the normal map of a single partition. Set to void if the normal map is not required.

Volume Partitioning

Rendering volume data requires us to upload this data to the GPU. Instead of creating a single, occasionally huge 3D texture, it is a better idea to partition the data into smaller volumes. This reduces the probability of out-of-memory exceptions due to memory fragmentation. Such partitioning induces a grid-like structure, that this class represents. Objects from base::VolumeSegment class represent the cells of such grids.

Author
Leonid Kostrykin
Date
8.3.15 - 29.3.15

Definition at line 63 of file VolumeGrid.h.

Constructor & Destructor Documentation

◆ VolumeGrid()

template<typename SegmentIntensityVolumeType , typename SegmentNormalsVolumeType >
Carna::base::VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::VolumeGrid ( const math::Vector3ui maxSegmentSize,
const math::Vector3ui segmentCounts 
)

Instantiates.

Parameters
maxSegmentSizeis the maximum resolution of a single partition.
segmentCountsis the number of partitions along each dimension.

Definition at line 204 of file VolumeGrid.h.

Member Function Documentation

◆ getVoxel()

template<typename SegmentIntensityVolumeType , typename SegmentNormalsVolumeType >
template<typename Selector >
Selector::VoxelType Carna::base::VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::getVoxel ( unsigned int  x,
unsigned int  y,
unsigned int  z 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 288 of file VolumeGrid.h.

◆ segmentAt() [1/4]

template<typename SegmentIntensityVolumeType , typename SegmentNormalsVolumeType >
VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::Segment & Carna::base::VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::segmentAt ( const base::math::Vector3ui location)

References the partition at location.

Precondition
location.x() < segmentCounts.x() && location.y() < segmentCounts.y() && location.z() < segmentCounts.z()

Definition at line 244 of file VolumeGrid.h.

◆ segmentAt() [2/4]

template<typename SegmentIntensityVolumeType , typename SegmentNormalsVolumeType >
const VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::Segment & Carna::base::VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::segmentAt ( const base::math::Vector3ui p) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 253 of file VolumeGrid.h.

◆ segmentAt() [3/4]

template<typename SegmentIntensityVolumeType , typename SegmentNormalsVolumeType >
VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::Segment & Carna::base::VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::segmentAt ( unsigned int  segmentX,
unsigned int  segmentY,
unsigned int  segmentZ 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 262 of file VolumeGrid.h.

◆ segmentAt() [4/4]

template<typename SegmentIntensityVolumeType , typename SegmentNormalsVolumeType >
const VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::Segment & Carna::base::VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::segmentAt ( unsigned int  segmentX,
unsigned int  segmentY,
unsigned int  segmentZ 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 275 of file VolumeGrid.h.

◆ setVoxel()

template<typename SegmentIntensityVolumeType , typename SegmentNormalsVolumeType >
template<typename Selector >
void Carna::base::VolumeGrid< SegmentIntensityVolumeType, SegmentNormalsVolumeType >::setVoxel ( unsigned int  x,
unsigned int  y,
unsigned int  z,
const typename Selector::VoxelType &  voxel 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 315 of file VolumeGrid.h.


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