Blue Brain BioExplorer
core::engine::optix::OptiXModel Class Reference

#include <OptiXModel.h>

Inheritance diagram for core::engine::optix::OptiXModel:
Collaboration diagram for core::engine::optix::OptiXModel:

Public Member Functions

 OptiXModel (AnimationParameters &animationParameters, VolumeParameters &volumeParameters, GeometryParameters &geometryParameters, FieldParameters &fieldParameters)
 
 ~OptiXModel ()
 
void commitGeometry () final
 
void buildBoundingBox () final
 Pure virtual function to build bounding box. More...
 
virtual MaterialPtr createMaterialImpl (const PropertyMap &properties={}) final
 
virtual SharedDataVolumePtr createSharedDataVolume (const Vector3ui &dimensions, const Vector3f &spacing, const DataType type) final
 Create a volume with the given dimensions, voxel spacing and data type where the voxels are set via setVoxels() from any memory location. More...
 
virtual BrickedVolumePtr createBrickedVolume (const Vector3ui &dimensions, const Vector3f &spacing, const DataType type) final
 Create a volume with the given dimensions, voxel spacing and data type where the voxels are copied via setBrick() into an optimized internal storage. More...
 
virtual FieldPtr createField (const Vector3ui &dimensions, const Vector3f &spacing, const Vector3f &offset, const uint32_ts &indices, const floats &values, const OctreeDataType dataType) final
 Create a computed field with the given dimensions, voxel spacing and data type. More...
 
::optix::GeometryGroup getGeometryGroup () const
 
::optix::GeometryGroup getBoundingBoxGroup () const
 
- Public Member Functions inherited from core::Model
PLATFORM_API Model (AnimationParameters &animationParameters, VolumeParameters &volumeParameters, GeometryParameters &geometryParameters, FieldParameters &fieldParameters)
 Constructor for Model class. More...
 
virtual PLATFORM_API ~Model ()
 Virtual destructor for Model class. More...
 
PLATFORM_API bool commitTransferFunction ()
 Function to commit transfer function. More...
 
PLATFORM_API bool commitSimulationData ()
 Function to commit simulation data. More...
 
PLATFORM_API MaterialPtr createMaterial (const size_t materialId, const std::string &name, const PropertyMap &properties={})
 Factory method to create an engine-specific material. More...
 
PLATFORM_API bool empty () const
 
PLATFORM_API bool isDirty () const
 
PLATFORM_API const BoxdgetBounds () const
 Returns the bounds for the Model. More...
 
void mergeBounds (const Boxd &bounds)
 Merges model bounds with the given bounds. More...
 
PLATFORM_API const SpheresMapgetSpheres () const
 Returns spheres handled by the Model. More...
 
PLATFORM_API SpheresMapgetSpheres ()
 
PLATFORM_API uint64_t addSphere (const size_t materialId, const Sphere &sphere)
 Adds a sphere to the model. More...
 
PLATFORM_API const CylindersMapgetCylinders () const
 Returns cylinders handled by the model. More...
 
PLATFORM_API CylindersMapgetCylinders ()
 
PLATFORM_API uint64_t addCylinder (const size_t materialId, const Cylinder &cylinder)
 Adds a cylinder to the model. More...
 
PLATFORM_API const ConesMapgetCones () const
 Returns cones handled by the model. More...
 
PLATFORM_API ConesMapgetCones ()
 
PLATFORM_API uint64_t addCone (const size_t materialId, const Cone &cone)
 Adds a cone to the model. More...
 
PLATFORM_API void addStreamline (const size_t materialId, const Streamline &streamline)
 Adds a streamline to the model. More...
 
PLATFORM_API const StreamlinesDataMapgetStreamlines () const
 Returns streamlines handled by the model. More...
 
PLATFORM_API StreamlinesDataMapgetStreamlines ()
 
PLATFORM_API void addCurve (const size_t materialId, const Curve &curve)
 Adds a curve to the model. More...
 
PLATFORM_API const CurvesMapgetCurves () const
 Returns curves handled by the model. More...
 
PLATFORM_API CurvesMapgetCurves ()
 
PLATFORM_API uint64_t addSDFGeometry (const size_t materialId, const SDFGeometry &geom, const uint64_ts &neighbourIndices)
 Adds an SDFGeometry to the scene. More...
 
PLATFORM_API const SDFGeometryDatagetSDFGeometryData () const
 Returns SDF geometry data handled by the model. More...
 
PLATFORM_API SDFGeometryDatagetSDFGeometryData ()
 
PLATFORM_API void updateSDFGeometryNeighbours (size_t geometryIdx, const uint64_ts &neighbourIndices)
 Update the list of neighbours for an SDF geometry. More...
 
PLATFORM_API const TriangleMeshMapgetTriangleMeshes () const
 
PLATFORM_API TriangleMeshMapgetTriangleMeshes ()
 
PLATFORM_API void addVolume (const size_t materialId, VolumePtr)
 Add a volume to the model. More...
 
PLATFORM_API void addField (const size_t materialId, FieldPtr)
 Add a field to the model. More...
 
PLATFORM_API void removeVolume (const size_t materialId)
 Remove a volume from the model. More...
 
PLATFORM_API void logInformation ()
 Logs information about the model, like the number of primitives, and the associated memory footprint. More...
 
PLATFORM_API void setMaterialsColorMap (const MaterialsColorMap colorMap)
 Sets the materials handled by the model, and available to the geometry. More...
 
PLATFORM_API const MaterialMapgetMaterials () const
 Returns a reference to the map of materials handled by the model. More...
 
PLATFORM_API MaterialPtr getMaterial (const size_t materialId) const
 Returns a pointer to a specific material. More...
 
PLATFORM_API TransferFunctiongetTransferFunction ()
 Returns the transfer function used for volumes and simulations. More...
 
PLATFORM_API const TransferFunctiongetTransferFunction () const
 Returns the transfer function used for volumes and simulations. More...
 
PLATFORM_API AbstractSimulationHandlerPtr getSimulationHandler () const
 Returns the simulation handler. More...
 
PLATFORM_API void setSimulationHandler (AbstractSimulationHandlerPtr handler)
 Sets the simulation handler. More...
 
PLATFORM_API size_t getSizeInBytes () const
 Returns the size in bytes of all geometries. More...
 
PLATFORM_API void markInstancesDirty ()
 Marks the instances as dirty. More...
 
PLATFORM_API void markInstancesClean ()
 Marks the instances as clean. More...
 
PLATFORM_API const VolumesMapgetVolumes () const
 Returns a const reference to the list of volumes. More...
 
PLATFORM_API bool isVolumesDirty () const
 Returns whether the volumes are dirty. More...
 
PLATFORM_API void resetVolumesDirty ()
 Resets the dirty status of the volumes. More...
 
PLATFORM_API void setBVHFlags (std::set< BVHFlag > bvhFlags)
 Sets the BVH flags. More...
 
PLATFORM_API const std::set< BVHFlag > & getBVHFlags () const
 Gets the BVH flags. More...
 
PLATFORM_API void updateBounds ()
 Updates the bounds of the geometries. More...
 
PLATFORM_API void copyFrom (const Model &rhs)
 Copies the model data from another model. More...
 
PLATFORM_API void applyDefaultColormap ()
 Applies a default color map (rainbow) to the model. More...
 

Protected Member Functions

size_t _createSampler (const size_t materialId, const ::optix::Buffer &buffer, const TextureType textureType, const RTtextureindexmode textureIndexMode, const Vector2f &valueRange=Vector2f())
 
void _commitTransferFunctionImpl (const Vector3fs &colors, const floats &opacities, const Vector2d valueRange) final
 
void _commitSimulationDataImpl (const float *frameData, const size_t frameSize) final
 
void _commitVolumesBuffers (const size_t materialId)
 
void _commitFieldsBuffers (const size_t materialId)
 
- Protected Member Functions inherited from core::Model
void _updateSizeInBytes ()
 
void _markGeometriesClean ()
 
bool _areGeometriesDirty () const
 

Additional Inherited Members

- Protected Attributes inherited from core::Model
AnimationParameters_animationParameters
 
VolumeParameters_volumeParameters
 
GeometryParameters_geometryParameters
 
FieldParameters_fieldParameters
 
AbstractSimulationHandlerPtr _simulationHandler
 
TransferFunction _transferFunction
 
MaterialMap _materials
 
std::shared_ptr< Geometries_geometries {std::make_shared<Geometries>()}
 
bool _spheresDirty {false}
 
bool _cylindersDirty {false}
 
bool _conesDirty {false}
 
bool _triangleMeshesDirty {false}
 
bool _streamlinesDirty {false}
 
bool _sdfGeometriesDirty {false}
 
bool _volumesDirty {false}
 
bool _curvesDirty {false}
 
bool _fieldsDirty {false}
 
Boxd _bounds
 
bool _instancesDirty {true}
 
std::set< BVHFlag_bvhFlags
 
size_t _sizeInBytes {0}
 
bool _isReadyCallbackSet {false}
 

Detailed Description

Definition at line 39 of file OptiXModel.h.

Constructor & Destructor Documentation

◆ OptiXModel()

core::engine::optix::OptiXModel::OptiXModel ( AnimationParameters animationParameters,
VolumeParameters volumeParameters,
GeometryParameters geometryParameters,
FieldParameters fieldParameters 
)

Definition at line 72 of file OptiXModel.cpp.

◆ ~OptiXModel()

core::engine::optix::OptiXModel::~OptiXModel ( )

Definition at line 78 of file OptiXModel.cpp.

Member Function Documentation

◆ _commitFieldsBuffers()

void core::engine::optix::OptiXModel::_commitFieldsBuffers ( const size_t  materialId)
protected

Definition at line 856 of file OptiXModel.cpp.

◆ _commitSimulationDataImpl()

void core::engine::optix::OptiXModel::_commitSimulationDataImpl ( const float *  frameData,
const size_t  frameSize 
)
finalprotectedvirtual

Implements core::Model.

Definition at line 927 of file OptiXModel.cpp.

◆ _commitTransferFunctionImpl()

void core::engine::optix::OptiXModel::_commitTransferFunctionImpl ( const Vector3fs colors,
const floats opacities,
const Vector2d  valueRange 
)
finalprotectedvirtual

Implements core::Model.

Definition at line 877 of file OptiXModel.cpp.

◆ _commitVolumesBuffers()

void core::engine::optix::OptiXModel::_commitVolumesBuffers ( const size_t  materialId)
protected

Definition at line 842 of file OptiXModel.cpp.

◆ _createSampler()

size_t core::engine::optix::OptiXModel::_createSampler ( const size_t  materialId,
const ::optix::Buffer &  buffer,
const TextureType  textureType,
const RTtextureindexmode  textureIndexMode,
const Vector2f valueRange = Vector2f() 
)
protected

Definition at line 934 of file OptiXModel.cpp.

◆ buildBoundingBox()

void core::engine::optix::OptiXModel::buildBoundingBox ( )
finalvirtual

Pure virtual function to build bounding box.

Implements core::Model.

Definition at line 620 of file OptiXModel.cpp.

◆ commitGeometry()

void core::engine::optix::OptiXModel::commitGeometry ( )
finalvirtual

Implements core::Model.

Definition at line 129 of file OptiXModel.cpp.

◆ createBrickedVolume()

BrickedVolumePtr core::engine::optix::OptiXModel::createBrickedVolume ( const Vector3ui dimensions,
const Vector3f spacing,
const DataType  type 
)
finalvirtual

Create a volume with the given dimensions, voxel spacing and data type where the voxels are copied via setBrick() into an optimized internal storage.

Parameters
dimensionsDimensions of volume
spacingSpacing of volume
typeData type of volume
Returns
Pointer to created BrickedVolume

Implements core::Model.

Definition at line 870 of file OptiXModel.cpp.

◆ createField()

FieldPtr core::engine::optix::OptiXModel::createField ( const Vector3ui dimensions,
const Vector3f spacing,
const Vector3f offset,
const uint32_ts indices,
const floats values,
const OctreeDataType  dataType 
)
finalvirtual

Create a computed field with the given dimensions, voxel spacing and data type.

Returns
Pointer to created field

Implements core::Model.

Definition at line 697 of file OptiXModel.cpp.

◆ createMaterialImpl()

MaterialPtr core::engine::optix::OptiXModel::createMaterialImpl ( const PropertyMap properties = {})
finalvirtual

Factory method to create an engine-specific material.

Implements core::Model.

Definition at line 663 of file OptiXModel.cpp.

◆ createSharedDataVolume()

SharedDataVolumePtr core::engine::optix::OptiXModel::createSharedDataVolume ( const Vector3ui dimensions,
const Vector3f spacing,
const DataType  type 
)
finalvirtual

Create a volume with the given dimensions, voxel spacing and data type where the voxels are set via setVoxels() from any memory location.

Parameters
dimensionsDimensions of volume
spacingSpacing of volume
typeData type of volume
Returns
Pointer to created SharedDataVolume

Implements core::Model.

Definition at line 671 of file OptiXModel.cpp.

◆ getBoundingBoxGroup()

::optix::GeometryGroup core::engine::optix::OptiXModel::getBoundingBoxGroup ( ) const
inline

Definition at line 69 of file OptiXModel.h.

◆ getGeometryGroup()

::optix::GeometryGroup core::engine::optix::OptiXModel::getGeometryGroup ( ) const
inline

Definition at line 68 of file OptiXModel.h.


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