Blue Brain BioExplorer
core::engine::ospray::OSPRayModel Class Reference

#include <OSPRayModel.h>

Inheritance diagram for core::engine::ospray::OSPRayModel:
Collaboration diagram for core::engine::ospray::OSPRayModel:

Public Member Functions

 OSPRayModel (AnimationParameters &animationParameters, VolumeParameters &volumeParameters, GeometryParameters &geometryParameters, FieldParameters &fieldParameters)
 
 ~OSPRayModel () final
 
void setMemoryFlags (const size_t memoryManagementFlags)
 
void commitGeometry () final
 Pure virtual function to commit geometry. More...
 
void commitFieldParameters ()
 
void commitMaterials (const std::string &renderer)
 
OSPModel getPrimaryModel () const
 
OSPModel getSecondaryModel () const
 
OSPModel getBoundingBoxModel () const
 
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...
 
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...
 
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...
 
void buildBoundingBox () final
 Pure virtual function to build bounding box. More...
 
OSPData simulationData () const
 
OSPTransferFunction transferFunction () 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

void _commitTransferFunctionImpl (const Vector3fs &colors, const floats &opacities, const Vector2d valueRange) final
 
void _commitSimulationDataImpl (const float *frameData, const size_t frameSize) final
 
- 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 35 of file OSPRayModel.h.

Constructor & Destructor Documentation

◆ OSPRayModel()

core::engine::ospray::OSPRayModel::OSPRayModel ( AnimationParameters animationParameters,
VolumeParameters volumeParameters,
GeometryParameters geometryParameters,
FieldParameters fieldParameters 
)

Definition at line 56 of file OSPRayModel.cpp.

◆ ~OSPRayModel()

core::engine::ospray::OSPRayModel::~OSPRayModel ( )
final

Definition at line 65 of file OSPRayModel.cpp.

Member Function Documentation

◆ _commitSimulationDataImpl()

void core::engine::ospray::OSPRayModel::_commitSimulationDataImpl ( const float *  frameData,
const size_t  frameSize 
)
finalprotectedvirtual

Implements core::Model.

Definition at line 616 of file OSPRayModel.cpp.

◆ _commitTransferFunctionImpl()

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

Implements core::Model.

Definition at line 597 of file OSPRayModel.cpp.

◆ buildBoundingBox()

void core::engine::ospray::OSPRayModel::buildBoundingBox ( )
finalvirtual

Pure virtual function to build bounding box.

Implements core::Model.

Definition at line 94 of file OSPRayModel.cpp.

◆ commitFieldParameters()

void core::engine::ospray::OSPRayModel::commitFieldParameters ( )

Definition at line 434 of file OSPRayModel.cpp.

◆ commitGeometry()

void core::engine::ospray::OSPRayModel::commitGeometry ( )
finalvirtual

Pure virtual function to commit geometry.

Implements core::Model.

Definition at line 464 of file OSPRayModel.cpp.

◆ commitMaterials()

void core::engine::ospray::OSPRayModel::commitMaterials ( const std::string &  renderer)

Definition at line 529 of file OSPRayModel.cpp.

◆ createBrickedVolume()

BrickedVolumePtr core::engine::ospray::OSPRayModel::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 585 of file OSPRayModel.cpp.

◆ createField()

FieldPtr core::engine::ospray::OSPRayModel::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 591 of file OSPRayModel.cpp.

◆ createSharedDataVolume()

SharedDataVolumePtr core::engine::ospray::OSPRayModel::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 579 of file OSPRayModel.cpp.

◆ getBoundingBoxModel()

OSPModel core::engine::ospray::OSPRayModel::getBoundingBoxModel ( ) const
inline

Definition at line 50 of file OSPRayModel.h.

◆ getPrimaryModel()

OSPModel core::engine::ospray::OSPRayModel::getPrimaryModel ( ) const
inline

Definition at line 48 of file OSPRayModel.h.

◆ getSecondaryModel()

OSPModel core::engine::ospray::OSPRayModel::getSecondaryModel ( ) const
inline

Definition at line 49 of file OSPRayModel.h.

◆ setMemoryFlags()

void core::engine::ospray::OSPRayModel::setMemoryFlags ( const size_t  memoryManagementFlags)

Definition at line 89 of file OSPRayModel.cpp.

◆ simulationData()

OSPData core::engine::ospray::OSPRayModel::simulationData ( ) const
inline

Definition at line 61 of file OSPRayModel.h.

◆ transferFunction()

OSPTransferFunction core::engine::ospray::OSPRayModel::transferFunction ( ) const
inline

Definition at line 62 of file OSPRayModel.h.


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