Blue Brain BioExplorer
core::Core Class Reference

#include <Core.h>

Classes

struct  Impl
 

Public Member Functions

PLATFORM_API Core (int argc, const char **argv)
 
PLATFORM_API ~Core ()
 
Simple execution API <br>
PLATFORM_API void commitAndRender (const RenderInput &renderInput, RenderOutput &renderOutput)
 
PLATFORM_API bool commitAndRender ()
 

Low-level execution API

PLATFORM_API bool commit ()
 
PLATFORM_API void render ()
 
PLATFORM_API void postRender ()
 
PLATFORM_API EnginegetEngine ()
 
PLATFORM_API ParametersManagergetParametersManager ()
 
PLATFORM_API KeyboardHandlergetKeyboardHandler ()
 
PLATFORM_API AbstractManipulatorgetCameraManipulator ()
 

Detailed Description

Core is a minimalistic library that allows optimized ray-tracing rendering of meshes and parametric geometry. Core provides an abstraction of the underlying rendering engines, making it possible to use the best rendering engine depending on the case.

Core uses plugins for extended function. There are a few built-in plugins and additional plugins can be dynamically loaded.

The underlying rendering engine (OSPRay, Optix, FireRays, etc) is specified in the rendering parameters and is invoked by the render method for generating the frames.

Underlying rendering engines support CPU, GPU and heterogeneous architectures

This object exposes the basic API for Core

Definition at line 49 of file Core.h.

Constructor & Destructor Documentation

◆ Core()

core::Core::Core ( int  argc,
const char **  argv 
)

Core instance initialization.

Initialization involves command line parsing, engine creation, plugin loading and initialization, data loading, scene creation and setup of keyboard mouse interactions.

In a setup using event loops, the event loop must be set up correctly before calling this constructor to ensure that plugins can install their event callbacks successfully.

Command line parameters provide options about the application itself, the geometry and the renderer. Core creates the scene using built-in and plug-in provided loaders.

Definition at line 473 of file Core.cpp.

◆ ~Core()

core::Core::~Core ( )
default

Member Function Documentation

◆ commit()

bool core::Core::commit ( )

Handle events, update animation, call preRender() on plugins and commit changes on the engine, scene, camera, renderer, etc. to prepare rendering of a new frame.

Returns
true if render() is allowed/needed after all states have been evaluated (accum rendering, data loading, etc.)
Note
threadsafe with render()

Definition at line 498 of file Core.cpp.

◆ commitAndRender() [1/2]

bool core::Core::commitAndRender ( )

Renders color and depth buffers of the current scene, according to default parameters. This is typically used by an application that does not provide any on-screen visualization. In such cases, input and output parameters are provided by network events. For instance, a camera event defines the origin, target and up vector of the camera, and an ImageJPEG event triggers the rendering and gathers the results in a form of a base64 encoded JPEG image.

Combines commit(), render() and postRender() together in a synchronized fashion.

Returns
true if rendering should continue or false if user inputs requested to stop.

Definition at line 488 of file Core.cpp.

◆ commitAndRender() [2/2]

void core::Core::commitAndRender ( const RenderInput renderInput,
RenderOutput renderOutput 
)

Renders color and depth buffers of the current scene, according to specified parameters.

Combines commit() and render() together in a synchronized fashion.

Parameters
renderInputRendering parameters such as the position of the camera and according model and projection matrices
renderOutputColor and depth buffers

Definition at line 479 of file Core.cpp.

◆ getCameraManipulator()

AbstractManipulator & core::Core::getCameraManipulator ( )

Gets the camera manipulator

Definition at line 524 of file Core.cpp.

◆ getEngine()

Engine & core::Core::getEngine ( )
Returns
the current engine

Definition at line 510 of file Core.cpp.

◆ getKeyboardHandler()

KeyboardHandler & core::Core::getKeyboardHandler ( )

Gets the keyboard handler

Definition at line 519 of file Core.cpp.

◆ getParametersManager()

ParametersManager & core::Core::getParametersManager ( )
Returns
The parameter manager

Definition at line 514 of file Core.cpp.

◆ postRender()

void core::Core::postRender ( )

Call postRender() on engine and plugins to signal finish of render(). Shall only be called after render() has finished. This is only needed if commit() and render() are called individually.

Definition at line 506 of file Core.cpp.

◆ render()

void core::Core::render ( )

Render a frame into the current framebuffer.

Note
threadsafe with commit()

Definition at line 502 of file Core.cpp.


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