Loading...
Searching...
No Matches
Gfx::GeometryViewer::SceneDrawer Class Referencefinal
Inheritance diagram for Gfx::GeometryViewer::SceneDrawer:
score::gfx::ModelSceneDrawer

Detailed Description

Draws every primitive of a scene with its world transform, in the shading modes of the Geometry viewer, and the lights and cameras of the scene as line gizmos. Part of the viewer's renderer, on the render thread.

The scene is walked when it changes, not every frame. A mesh is uploaded once, and kept for as long as the buffers of its primitive stay the same: a scene whose transforms only move does not upload anything again.

Public Member Functions

 SceneDrawer (const GeometryViewerNode &node)
 
 SceneDrawer (const SceneDrawer &)=delete
 
SceneDrawer & operator= (const SceneDrawer &)=delete
 
bool setScene (const ossia::scene_spec &scene) override
 The scene the renderer received; returns whether it is another one.
 
bool active () const noexcept override
 
const ossia::aabb & bounds () const noexcept override
 The bounds of what is drawn, in the space of the scene.
 
void update (score::gfx::RenderList &renderer, QRhiResourceUpdateBatch &res, score::gfx::PassMap &passes, QRhiBuffer *processUBO, QRhiBuffer *cameraUBO, const SceneView &view) override
 Once the passes of the renderer exist for the frame.
 
void draw (score::gfx::RenderList &renderer, QRhiCommandBuffer &cb, score::gfx::Edge &edge) override
 
bool hasLines () const noexcept override
 The gizmos and the outline of the selected object.
 
void drawLines (score::gfx::RenderList &renderer, QRhiCommandBuffer &cb, score::gfx::Edge &edge, QRhiGraphicsPipeline *lines, QRhiShaderResourceBindings *srb) override
 With the line pipeline of the guides: world-space positions and colours.
 
void release () override
 

Member Function Documentation

◆ active()

bool Gfx::GeometryViewer::SceneDrawer::active ( ) const
inlineoverridevirtualnoexcept

The scene needs more than the single geometry the renderer draws on its own: several primitives, transforms, lights or cameras

Implements score::gfx::ModelSceneDrawer.

◆ bounds()

const ossia::aabb & Gfx::GeometryViewer::SceneDrawer::bounds ( ) const
inlineoverridevirtualnoexcept

The bounds of what is drawn, in the space of the scene.

Implements score::gfx::ModelSceneDrawer.

◆ draw()

void Gfx::GeometryViewer::SceneDrawer::draw ( score::gfx::RenderList &  renderer,
QRhiCommandBuffer &  cb,
score::gfx::Edge &  edge 
)
overridevirtual

◆ drawLines()

void Gfx::GeometryViewer::SceneDrawer::drawLines ( score::gfx::RenderList &  renderer,
QRhiCommandBuffer &  cb,
score::gfx::Edge &  edge,
QRhiGraphicsPipeline *  lines,
QRhiShaderResourceBindings *  srb 
)
overridevirtual

With the line pipeline of the guides: world-space positions and colours.

Implements score::gfx::ModelSceneDrawer.

◆ hasLines()

bool Gfx::GeometryViewer::SceneDrawer::hasLines ( ) const
inlineoverridevirtualnoexcept

The gizmos and the outline of the selected object.

Implements score::gfx::ModelSceneDrawer.

◆ release()

void Gfx::GeometryViewer::SceneDrawer::release ( )
overridevirtual

The GPU resources go away, the scene stays: the next update uploads it again

Implements score::gfx::ModelSceneDrawer.

◆ setScene()

bool Gfx::GeometryViewer::SceneDrawer::setScene ( const ossia::scene_spec &  scene)
overridevirtual

The scene the renderer received; returns whether it is another one.

Implements score::gfx::ModelSceneDrawer.

◆ update()

void Gfx::GeometryViewer::SceneDrawer::update ( score::gfx::RenderList &  renderer,
QRhiResourceUpdateBatch &  res,
score::gfx::PassMap &  passes,
QRhiBuffer *  processUBO,
QRhiBuffer *  cameraUBO,
const SceneView &  view 
)
overridevirtual

Once the passes of the renderer exist for the frame.

Implements score::gfx::ModelSceneDrawer.


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