Blue Brain BioExplorer
core::SharedDataVolume Class Referenceabstract

#include <SharedDataVolume.h>

Inheritance diagram for core::SharedDataVolume:
Collaboration diagram for core::SharedDataVolume:

Public Member Functions

virtual PLATFORM_API void setVoxels (const void *voxels)=0
 Sets the voxels of the volume. More...
 
PLATFORM_API void mapData (const std::string &filename)
 Convenience function to map data from file. More...
 
PLATFORM_API void mapData (const uint8_ts &buffer)
 Convenience function to map data from a buffer. More...
 
PLATFORM_API void mapData (uint8_ts &&buffer)
 Convenience function to map data from a movable buffer. More...
 
const uint8_tsgetMemoryBuffer () const
 Get the Memory Buffer object. More...
 
- Public Member Functions inherited from core::Volume
PLATFORM_API Volume (const Vector3ui &dimensions, const Vector3f &spacing, const DataType type)
 Constructs a Volume object. More...
 
virtual PLATFORM_API void setDataRange (const Vector2f &range)=0
 
PLATFORM_API Vector2f getDataRange () const
 
virtual PLATFORM_API void commit ()=0
 Commits changes to the volume. More...
 
PLATFORM_API size_t getSizeInBytes () const
 Gets the size of the volume in bytes. More...
 
PLATFORM_API Boxd getBounds () const
 Gets the bounding box of the volume. More...
 
PLATFORM_API Vector3f getDimensions () const
 Get the Dimensions object. More...
 
PLATFORM_API Vector3f getElementSpacing () const
 Get the Element Spacing object. More...
 
PLATFORM_API Vector3f getOffset () const
 Get the Offset object. More...
 
PLATFORM_API Vector2f getValueRange () const
 Get the Value Range object. More...
 
- Public Member Functions inherited from core::BaseObject
 BaseObject ()=default
 
virtual ~BaseObject ()=default
 
 BaseObject (const BaseObject &)
 
BaseObjectoperator= (const BaseObject &rhs)
 
bool isModified () const
 
void resetModified ()
 
void markModified (const bool triggerCallback=true)
 
void onModified (const ModifiedCallback &callback)
 
void clearModifiedCallback ()
 

Protected Member Functions

 SharedDataVolume (const Vector3ui &dimensions, const Vector3f &spacing, const DataType type)
 Constructs a new SharedDataVolume object. More...
 
 ~SharedDataVolume ()
 Destructs the SharedDataVolume object. Unmaps the data from memory and closes the mapped file. More...
 
- Protected Member Functions inherited from core::BaseObject
template<typename T >
void _updateValue (T &member, const T &newValue, const bool triggerCallback=true)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if< std::is_floating_point< T >::value >::type *=0)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if<!std::is_floating_point< T >::value >::type *=0)
 

Protected Attributes

uint8_ts _memoryBuffer
 
- Protected Attributes inherited from core::Volume
std::atomic_size_t _sizeInBytes {0}
 
const Vector3ui _dimensions
 
const Vector3f _spacing
 
Vector3f _offset
 
const DataType _dataType
 
Vector2f _valueRange {-1e6f, 1e6f}
 

Additional Inherited Members

- Public Types inherited from core::BaseObject
using ModifiedCallback = std::function< void(const BaseObject &)>
 

Detailed Description

A volume type where the voxels are set once and only referenced from the source location. Inherits from virtual Volume class.

Definition at line 35 of file SharedDataVolume.h.

Constructor & Destructor Documentation

◆ SharedDataVolume()

core::SharedDataVolume::SharedDataVolume ( const Vector3ui dimensions,
const Vector3f spacing,
const DataType  type 
)
inlineprotected

Constructs a new SharedDataVolume object.

Parameters
dimensionsThe dimensions of the volume as a Vector3ui object.
spacingThe spacing between voxels as a Vector3f object.
typeThe data type of the volume.

Definition at line 76 of file SharedDataVolume.h.

◆ ~SharedDataVolume()

core::SharedDataVolume::~SharedDataVolume ( )
protected

Destructs the SharedDataVolume object. Unmaps the data from memory and closes the mapped file.

Definition at line 40 of file SharedDataVolume.cpp.

Member Function Documentation

◆ getMemoryBuffer()

const uint8_ts& core::SharedDataVolume::getMemoryBuffer ( ) const
inline

Get the Memory Buffer object.

Returns
const uint8_ts& Memory buffer

Definition at line 67 of file SharedDataVolume.h.

◆ mapData() [1/3]

void core::SharedDataVolume::mapData ( const std::string &  filename)

Convenience function to map data from file.

Parameters
filenameThe file path to the data.

Definition at line 54 of file SharedDataVolume.cpp.

◆ mapData() [2/3]

void core::SharedDataVolume::mapData ( const uint8_ts buffer)

Convenience function to map data from a buffer.

Parameters
bufferThe buffer containing the data.

Definition at line 81 of file SharedDataVolume.cpp.

◆ mapData() [3/3]

void core::SharedDataVolume::mapData ( uint8_ts &&  buffer)

Convenience function to map data from a movable buffer.

Parameters
bufferThe movable buffer containing the data.

Definition at line 87 of file SharedDataVolume.cpp.

◆ setVoxels()

virtual PLATFORM_API void core::SharedDataVolume::setVoxels ( const void *  voxels)
pure virtual

Sets the voxels of the volume.

Parameters
voxelsA pointer to the location of the voxels to be set.

Implemented in core::engine::ospray::OSPRaySharedDataVolume, and core::engine::optix::OptiXSharedDataVolume.

Member Data Documentation

◆ _memoryBuffer

uint8_ts core::SharedDataVolume::_memoryBuffer
protected

Definition at line 88 of file SharedDataVolume.h.


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