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

#include <OptiXScene.h>

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

Public Member Functions

 OptiXScene (AnimationParameters &animationParameters, GeometryParameters &geometryParameters, VolumeParameters &volumeParameters, FieldParameters &fieldParameters)
 
 ~OptiXScene ()
 
void commit () final
 Called after scene-related changes have been made before rendering the scene. More...
 
bool commitLights () final
 Commits lights to renderers. More...
 
ModelPtr createModel () const final
 Factory method to create an engine-specific model. More...
 
bool supportsConcurrentSceneUpdates () const final
 
- 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

OptiX specific scene

This object is the OptiX specific implementation of a scene

Definition at line 45 of file OptiXScene.h.

Constructor & Destructor Documentation

◆ OptiXScene()

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

Definition at line 45 of file OptiXScene.cpp.

◆ ~OptiXScene()

core::engine::optix::OptiXScene::~OptiXScene ( )

Definition at line 67 of file OptiXScene.cpp.

Member Function Documentation

◆ commit()

void core::engine::optix::OptiXScene::commit ( )
finalvirtual

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

Reimplemented from core::Scene.

Definition at line 223 of file OptiXScene.cpp.

◆ commitLights()

bool core::engine::optix::OptiXScene::commitLights ( )
finalvirtual

Commits lights to renderers.

Returns
True if lights were committed, false otherwise

Implements core::Scene.

Definition at line 78 of file OptiXScene.cpp.

◆ createModel()

ModelPtr core::engine::optix::OptiXScene::createModel ( ) const
finalvirtual

Factory method to create an engine-specific model.

Implements core::Scene.

Definition at line 142 of file OptiXScene.cpp.

◆ supportsConcurrentSceneUpdates()

bool core::engine::optix::OptiXScene::supportsConcurrentSceneUpdates ( ) const
inlinefinalvirtual

Reimplemented from core::Scene.

Definition at line 62 of file OptiXScene.h.


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