Blue Brain BioExplorer
core::Renderer Class Referenceabstract

Renderer class inherits from PropertyObject class The Renderer class has methods to render a FrameBuffer, get variance, commit, and pick a point as well as virtual methods to set camera and render frames in specific engines. It also contains a protected ScenePtr _scene variable. More...

#include <Renderer.h>

Inheritance diagram for core::Renderer:
Collaboration diagram for core::Renderer:

Classes

struct  PickResult
 PickResult Struct containing hit boolean value and Vector3d pos PickResult struct is used to retrieve information about whether the pick ray hit anything and if so the vector position. More...
 

Public Member Functions

virtual void render (FrameBufferPtr frameBuffer)=0
 Virtual method to render a FrameBuffer This method is implemented in specific engine renderers to draw the FrameBuffer. More...
 
virtual float getVariance () const
 Get variance from previous render() This method returns the variance from the previous render() call. More...
 
virtual void commit ()=0
 This virtual method is implemented in specific engine renderers to signal that rendering is complete. More...
 
virtual void setCamera (CameraPtr camera)=0
 Set camera for renderer This virtual method is implemented in specific engine renderers to set the camera for rendering. More...
 
virtual PickResult pick (const Vector2f &)
 Pick method This method is used to pick a point on the scene and returns PickResult struct with hit boolean value and position. More...
 
PLATFORM_API Renderer (const AnimationParameters &animationParameters, const RenderingParameters &renderingParameters)
 Constructs the Renderer object with animationParameters and renderingParameters. More...
 
void setEngine (Engine *engine)
 Sets the _scene pointer to a specified ScenePtr. More...
 
PLATFORM_API bool getHeadLight () const
 
PLATFORM_API void setHeadLight (const bool value)
 
PLATFORM_API void setMaxAccumFrames (const size_t value)
 
PLATFORM_API size_t getMaxAccumFrames () const
 
PLATFORM_API uint32_t getSamplesPerPixel () const
 
PLATFORM_API void setSamplesPerPixel (const uint32_t value)
 
PLATFORM_API uint32_t getSubsampling () const
 
PLATFORM_API void setSubsampling (const uint32_t subsampling)
 
PLATFORM_API const Vector3dgetBackgroundColor () const
 
PLATFORM_API void setBackgroundColor (const Vector3d &value)
 
PLATFORM_API bool getAccumulation () const
 
- Public Member Functions inherited from core::PropertyObject
void setCurrentType (const std::string &type)
 
const std::string & getCurrentType () const
 
template<typename T >
void updateProperty (const std::string &name, const T &value, const bool triggerCallback=true)
 
bool hasProperty (const std::string &name) const
 
template<typename T >
getProperty (const std::string &name) const
 
template<typename T >
getPropertyOrValue (const std::string &name, T val) const
 
void setProperties (const PropertyMap &properties)
 
void setProperties (const std::string &type, const PropertyMap &properties)
 
void updateProperties (const PropertyMap &properties)
 
const auto & getPropertyMap () const
 
const auto & getPropertyMap (const std::string &type) const
 
strings getTypes () const
 
void clonePropertiesFrom (const PropertyObject &obj)
 
- 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 Attributes

const AnimationParameters_animationParameters
 
const RenderingParameters_renderingParameters
 
Engine_engine {nullptr}
 
bool _accumulation {true}
 
bool _headLight {true}
 
Vector3d _backgroundColor {0., 0., 0.}
 
uint32_t _spp {1}
 
uint32_t _subsampling {1}
 
size_t _maxAccumFrames {100}
 
- Protected Attributes inherited from core::PropertyObject
std::string _currentType
 
std::map< std::string, PropertyMap_properties
 

Additional Inherited Members

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

Detailed Description

Renderer class inherits from PropertyObject class The Renderer class has methods to render a FrameBuffer, get variance, commit, and pick a point as well as virtual methods to set camera and render frames in specific engines. It also contains a protected ScenePtr _scene variable.

Definition at line 41 of file Renderer.h.

Constructor & Destructor Documentation

◆ Renderer()

core::Renderer::Renderer ( const AnimationParameters animationParameters,
const RenderingParameters renderingParameters 
)

Constructs the Renderer object with animationParameters and renderingParameters.

Parameters
animationParametersconst reference to AnimationParameters struct containing parameters for animation
renderingParametersconst reference to RenderingParameters struct containing parameters for rendering

Definition at line 30 of file Renderer.cpp.

Member Function Documentation

◆ commit()

virtual void core::Renderer::commit ( )
pure virtual

This virtual method is implemented in specific engine renderers to signal that rendering is complete.

Implemented in core::engine::ospray::OSPRayRenderer, and core::engine::optix::OptiXRenderer.

◆ getAccumulation()

PLATFORM_API bool core::Renderer::getAccumulation ( ) const
inline

If the rendering should be refined by accumulating multiple passes

Definition at line 135 of file Renderer.h.

◆ getBackgroundColor()

PLATFORM_API const Vector3d& core::Renderer::getBackgroundColor ( ) const
inline

Background color

Definition at line 131 of file Renderer.h.

◆ getHeadLight()

PLATFORM_API bool core::Renderer::getHeadLight ( ) const
inline

Light source follow camera origin

Definition at line 107 of file Renderer.h.

◆ getMaxAccumFrames()

PLATFORM_API size_t core::Renderer::getMaxAccumFrames ( ) const
inline

Definition at line 117 of file Renderer.h.

◆ getSamplesPerPixel()

PLATFORM_API uint32_t core::Renderer::getSamplesPerPixel ( ) const
inline

Number of samples per pixel

Definition at line 120 of file Renderer.h.

◆ getSubsampling()

PLATFORM_API uint32_t core::Renderer::getSubsampling ( ) const
inline

Sub-sampling

Definition at line 124 of file Renderer.h.

◆ getVariance()

virtual float core::Renderer::getVariance ( ) const
inlinevirtual

Get variance from previous render() This method returns the variance from the previous render() call.

Returns
float Variance value

Reimplemented in core::engine::ospray::OSPRayRenderer.

Definition at line 68 of file Renderer.h.

◆ pick()

virtual PickResult core::Renderer::pick ( const Vector2f )
inlinevirtual

Pick method This method is used to pick a point on the scene and returns PickResult struct with hit boolean value and position.

Parameters
pickPosVector2f with pick position coordinates
Returns
PickResult returns PickResult struct that contains boolean hit value and vector position

Reimplemented in core::engine::ospray::OSPRayRenderer, and core::engine::optix::OptiXRenderer.

Definition at line 89 of file Renderer.h.

◆ render()

virtual void core::Renderer::render ( FrameBufferPtr  frameBuffer)
pure virtual

Virtual method to render a FrameBuffer This method is implemented in specific engine renderers to draw the FrameBuffer.

Parameters
frameBufferPtr to FrameBuffer that will be drawn

Implemented in core::engine::ospray::OSPRayRenderer, and core::engine::optix::OptiXRenderer.

◆ setBackgroundColor()

PLATFORM_API void core::Renderer::setBackgroundColor ( const Vector3d value)
inline

Definition at line 132 of file Renderer.h.

◆ setCamera()

virtual void core::Renderer::setCamera ( CameraPtr  camera)
pure virtual

Set camera for renderer This virtual method is implemented in specific engine renderers to set the camera for rendering.

Parameters
cameraCameraPtr of a camera object to set

Implemented in core::engine::ospray::OSPRayRenderer, and core::engine::optix::OptiXRenderer.

◆ setEngine()

void core::Renderer::setEngine ( Engine engine)
inline

Sets the _scene pointer to a specified ScenePtr.

Parameters
sceneScenePtr of the scene object to set

Definition at line 102 of file Renderer.h.

◆ setHeadLight()

PLATFORM_API void core::Renderer::setHeadLight ( const bool  value)
inline

Definition at line 108 of file Renderer.h.

◆ setMaxAccumFrames()

PLATFORM_API void core::Renderer::setMaxAccumFrames ( const size_t  value)
inline

The maximum number of accumulation frames before engine signals to stop continuation of rendering.

See also
Engine::continueRendering()

Definition at line 116 of file Renderer.h.

◆ setSamplesPerPixel()

PLATFORM_API void core::Renderer::setSamplesPerPixel ( const uint32_t  value)
inline

Definition at line 121 of file Renderer.h.

◆ setSubsampling()

PLATFORM_API void core::Renderer::setSubsampling ( const uint32_t  subsampling)
inline

Definition at line 125 of file Renderer.h.

Member Data Documentation

◆ _accumulation

bool core::Renderer::_accumulation {true}
protected

Definition at line 142 of file Renderer.h.

◆ _animationParameters

const AnimationParameters& core::Renderer::_animationParameters
protected

Definition at line 138 of file Renderer.h.

◆ _backgroundColor

Vector3d core::Renderer::_backgroundColor {0., 0., 0.}
protected

Definition at line 144 of file Renderer.h.

◆ _engine

Engine* core::Renderer::_engine {nullptr}
protected

Definition at line 140 of file Renderer.h.

◆ _headLight

bool core::Renderer::_headLight {true}
protected

Definition at line 143 of file Renderer.h.

◆ _maxAccumFrames

size_t core::Renderer::_maxAccumFrames {100}
protected

Definition at line 147 of file Renderer.h.

◆ _renderingParameters

const RenderingParameters& core::Renderer::_renderingParameters
protected

Definition at line 139 of file Renderer.h.

◆ _spp

uint32_t core::Renderer::_spp {1}
protected

Definition at line 145 of file Renderer.h.

◆ _subsampling

uint32_t core::Renderer::_subsampling {1}
protected

Definition at line 146 of file Renderer.h.


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