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

#include <OSPRayScene.h>

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

Public Member Functions

 OSPRayScene (AnimationParameters &animationParameters, GeometryParameters &geometryParameters, VolumeParameters &volumeParameters, FieldParameters &fieldParameters)
 
 ~OSPRayScene ()
 
void commit () final
 Called after scene-related changes have been made before rendering the scene. More...
 
bool commitLights () final
 Commits lights to renderers. More...
 
bool supportsConcurrentSceneUpdates () const final
 
ModelPtr createModel () const final
 Factory method to create an engine-specific model. More...
 
OSPModel getModel ()
 
OSPData lightData ()
 
ModelDescriptorPtr getSimulatedModel ()
 
- Public Member Functions inherited from core::Scene
PLATFORM_API Scene (AnimationParameters &animationParameters, GeometryParameters &geometryParameters, VolumeParameters &volumeParameters, FieldParameters &fieldParameters)
 Creates a scene object responsible for handling models, simulations and light sources. More...
 
PLATFORM_API const BoxdgetBounds () const
 Returns the bounding box of the scene. More...
 
PLATFORM_API LightManagergetLightManager ()
 Gets the light manager. More...
 
PLATFORM_API size_t addModel (ModelDescriptorPtr model)
 Adds a model to the scene. More...
 
PLATFORM_API bool removeModel (const size_t id)
 Removes a model from the scene. More...
 
PLATFORM_API const ModelDescriptorsgetModelDescriptors () const
 Get all model descriptors. More...
 
PLATFORM_API ModelDescriptorPtr getModel (const size_t id) const
 Get a model descriptor given its ID. More...
 
PLATFORM_API void buildDefault ()
 Builds a default scene made of a Cornell box, a reflective cube, and a transparent sphere. More...
 
PLATFORM_API bool empty () const
 Checks whether the scene is empty. More...
 
PLATFORM_API size_t addClipPlane (const Plane &plane)
 Add a clip plane to the scene. More...
 
PLATFORM_API ClipPlanePtr getClipPlane (const size_t id) const
 Get a clip plane by its ID. More...
 
PLATFORM_API void removeClipPlane (const size_t id)
 Remove a clip plane by its ID, or no-op if not found. More...
 
PLATFORM_API const ClipPlanesgetClipPlanes () const
 Get all clip planes in the scene. More...
 
PLATFORM_API size_t getSizeInBytes () const
 Get the current size in bytes of the loaded geometry. More...
 
PLATFORM_API size_t getNumModels () const
 Get the current number of models in the scene. More...
 
PLATFORM_API void setMaterialsColorMap (MaterialsColorMap colorMap)
 Initializes materials for all models in the scene. More...
 
PLATFORM_API bool setEnvironmentMap (const std::string &envMap)
 Set a new environment map as the background image. More...
 
PLATFORM_API const std::string & getEnvironmentMap () const
 Get the current environment map texture file, or empty if no environment is set. More...
 
PLATFORM_API bool hasEnvironmentMap () const
 Check if an environment map is currently set in the scene. More...
 
PLATFORM_API MaterialPtr getBackgroundMaterial () const
 Get the background material. More...
 
PLATFORM_API ModelDescriptorPtr loadModel (Blob &&blob, const ModelParams &params, LoaderProgress cb)
 Load a model from the given blob. More...
 
PLATFORM_API ModelDescriptorPtr loadModel (const std::string &path, const ModelParams &params, LoaderProgress cb)
 Load a model from the given file. More...
 
PLATFORM_API void visitModels (const std::function< void(Model &)> &functor)
 Apply the given functor to every model in the scene. More...
 
PLATFORM_API LoaderRegistrygetLoaderRegistry ()
 Get the registry for all supported loaders of this scene. More...
 
PLATFORM_API auto acquireReadAccess () const
 
PLATFORM_API void copyFrom (const Scene &rhs)
 Copy the scene from another scene. More...
 
PLATFORM_API void computeBounds ()
 Compute the bounds of the geometry handled by the scene. 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 ()
 

Additional Inherited Members

- Public Types inherited from core::BaseObject
using ModifiedCallback = std::function< void(const BaseObject &)>
 
- Protected Member Functions inherited from core::Scene
void _loadIBLMaps (const std::string &envMap)
 
- 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 inherited from core::Scene
AnimationParameters_animationParameters
 
GeometryParameters_geometryParameters
 
VolumeParameters_volumeParameters
 
FieldParameters_fieldParameters
 
MaterialPtr _backgroundMaterial {nullptr}
 
std::string _environmentMap
 
size_t _modelID {0}
 
ModelDescriptors _modelDescriptors
 
std::shared_timed_mutex _modelMutex
 
LightManager _lightManager
 
ClipPlanes _clipPlanes
 
LoaderRegistry _loaderRegistry
 
Boxd _bounds
 

Detailed Description

OSPRay specific scene

This object is the OSPRay specific implementation of a scene

Definition at line 43 of file OSPRayScene.h.

Constructor & Destructor Documentation

◆ OSPRayScene()

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

Definition at line 46 of file OSPRayScene.cpp.

◆ ~OSPRayScene()

core::engine::ospray::OSPRayScene::~OSPRayScene ( )

Definition at line 55 of file OSPRayScene.cpp.

Member Function Documentation

◆ commit()

void core::engine::ospray::OSPRayScene::commit ( )
finalvirtual

Called after scene-related changes have been made before rendering the scene.

Reimplemented from core::Scene.

Definition at line 71 of file OSPRayScene.cpp.

◆ commitLights()

bool core::engine::ospray::OSPRayScene::commitLights ( )
finalvirtual

Commits lights to renderers.

Returns
True if lights were committed, false otherwise

Implements core::Scene.

Definition at line 177 of file OSPRayScene.cpp.

◆ createModel()

ModelPtr core::engine::ospray::OSPRayScene::createModel ( ) const
finalvirtual

Factory method to create an engine-specific model.

Implements core::Scene.

Definition at line 285 of file OSPRayScene.cpp.

◆ getModel()

OSPModel core::engine::ospray::OSPRayScene::getModel ( )
inline

Definition at line 60 of file OSPRayScene.h.

◆ getSimulatedModel()

ModelDescriptorPtr core::engine::ospray::OSPRayScene::getSimulatedModel ( )

Definition at line 291 of file OSPRayScene.cpp.

◆ lightData()

OSPData core::engine::ospray::OSPRayScene::lightData ( )
inline

Definition at line 61 of file OSPRayScene.h.

◆ supportsConcurrentSceneUpdates()

bool core::engine::ospray::OSPRayScene::supportsConcurrentSceneUpdates ( ) const
inlinefinalvirtual

Reimplemented from core::Scene.

Definition at line 57 of file OSPRayScene.h.


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