Carna Version 3.3.3
Loading...
Searching...
No Matches
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, SegmentNormalsVolumeTypeSegment
 Reflects the data type that represents a single partition.
 

Public Member Functions

 VolumeGrid (const math::Vector3ui &maxSegmentSize, const math::Vector3ui &segmentCounts)
 Instantiates.
 
virtual ~VolumeGrid ()
 Deletes this and all partitions.
 
SegmentsegmentAt (const base::math::Vector3ui &location)
 References the partition at location.
 
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.

Member Typedef Documentation

◆ Segment

Reflects the data type that represents a single partition.

Definition at line 83 of file VolumeGrid.h.

◆ SegmentIntensityVolume

Reflects the type to use for storing the intensity volume of a single partition.

Definition at line 73 of file VolumeGrid.h.

◆ SegmentNormalsVolume

Reflects the type to use for storing the normal map of a single partition.

Definition at line 78 of file VolumeGrid.h.

Constructor & Destructor Documentation

◆ VolumeGrid()

Instantiates.

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

Definition at line 203 of file VolumeGrid.h.

◆ ~VolumeGrid()

Deletes this and all partitions.

Definition at line 225 of file VolumeGrid.h.

Member Function Documentation

◆ getVoxel() [1/2]

Reads the voxel of the volume that the Selector selects from the partition at location.

Definition at line 305 of file VolumeGrid.h.

◆ getVoxel() [2/2]

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 287 of file VolumeGrid.h.

◆ segmentAt() [1/4]

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 252 of file VolumeGrid.h.

◆ segmentAt() [2/4]

References the partition at location.

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

Definition at line 243 of file VolumeGrid.h.

◆ segmentAt() [3/4]

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 261 of file VolumeGrid.h.

◆ segmentAt() [4/4]

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 274 of file VolumeGrid.h.

◆ setVoxel() [1/2]

Writes the voxel of the volume that the Selector selects from the partition at location.

Definition at line 377 of file VolumeGrid.h.

◆ setVoxel() [2/2]

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 314 of file VolumeGrid.h.

Member Data Documentation

◆ maxSegmentSize

Holds the maximum resolution of a single partition.

Definition at line 98 of file VolumeGrid.h.

◆ segmentCounts

Holds the number of partitions along each dimension.

Definition at line 99 of file VolumeGrid.h.


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