Blender V5.0
blender::draw::overlay::Bounds Class Reference

#include <overlay_bounds.hh>

Inherits blender::draw::overlay::Overlay.

Public Member Functions

 Bounds (const SelectionType selection_type)
void begin_sync (Resources &, const State &) final
void object_sync (Manager &, const ObjectRef &ob_ref, Resources &res, const State &state) final
void end_sync (Resources &res, const State &state) final
void draw_line (Framebuffer &framebuffer, Manager &manager, View &view) final

Detailed Description

Draw object bounds and texture space.

The object bound can be drawn because of:

  • display bounds (Object > Viewport Display > Bounds)
  • display as (Object > Viewport Display > Display As > Bounds)
  • rigid body (Physics > Rigid Body > Collision > Shape)

Texture space can be modified by (Data > Texture Space) and displayed by (Object > Viewport Display > Texture Space)

Definition at line 33 of file overlay_bounds.hh.

Constructor & Destructor Documentation

◆ Bounds()

blender::draw::overlay::Bounds::Bounds ( const SelectionType selection_type)
inline

Definition at line 51 of file overlay_bounds.hh.

Member Function Documentation

◆ begin_sync()

void blender::draw::overlay::Bounds::begin_sync ( Resources & ,
const State &  )
inlinefinalvirtual

Synchronization creates and fill render passes based on context state and scene state.

It runs for every scene update, so keep computation overhead low. If it is triggered, everything in the scene is considered updated. Note that this only concerns the render passes, the mesh batch caches are updated on a per object-data basis.

IMPORTANT: Synchronization must be view agnostic. That is, not rely on view position, projection matrix or frame-buffer size to do conditional pass creation. This is because, by design, syncing can happen once and rendered multiple time (multi view rendering, stereo rendering, orbiting view ...). Conditional pass creation, must be done in the drawing callbacks, but they should remain the exception. Also there will be no access to object data at this point. Creates passes used for object sync and enabling / disabling internal overlay types (e.g. vertices, edges, faces in edit mode). Runs once at the start of the sync cycle. Should also contain passes setup for overlays that are not per object overlays (e.g. Grid).

This method must be implemented.

Implements blender::draw::overlay::Overlay.

Definition at line 53 of file overlay_bounds.hh.

◆ draw_line()

void blender::draw::overlay::Bounds::draw_line ( Framebuffer & framebuffer,
Manager & manager,
View & view )
inlinefinalvirtual

Reimplemented from blender::draw::overlay::Overlay.

Definition at line 224 of file overlay_bounds.hh.

References GPU_framebuffer_bind(), and view.

◆ end_sync()

void blender::draw::overlay::Bounds::end_sync ( Resources & ,
const State &  )
inlinefinalvirtual

Finalize passes or buffers used for object sync. Runs once at the start of the sync cycle.

Reimplemented from blender::draw::overlay::Overlay.

Definition at line 206 of file overlay_bounds.hh.

References DRW_CLIPPING_UBO_SLOT, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, OVERLAY_GLOBALS_SLOT, and state.

◆ object_sync()

void blender::draw::overlay::Bounds::object_sync ( Manager & ,
const ObjectRef & ,
Resources & ,
const State &  )
inlinefinalvirtual

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