Model Handle

template<IsSpectral TSpectral>
class ModelHandle : public huira::Handle<Model<TSpectral>>

Handle for referencing a Model asset in the scene.

ModelHandle provides safe, type-checked access to Model assets, allowing manipulation and querying of models within the scene. Used by Scene and FrameHandle.

Template Parameters:

TSpectral – Spectral type for the scene

Public Functions

ModelHandle() = delete
inline void print_graph() const
bool valid() const

Checks if the handle points to a valid, scene-owned object.

Returns:

true if valid, false otherwise

std::shared_ptr<U> get() const

Gets a shared_ptr to the referenced object, optionally downcasting to a derived type.

Template Parameters:

U – Type to cast to (default: T)

Throws:

std::runtime_error

Returns:

std::shared_ptr

Protected Functions

std::shared_ptr<T> get_() const

Gets a shared_ptr to the referenced object, enforcing validity.

Throws:

std::runtime_error – if the handle is invalid

Returns:

std::shared_ptr<T> Shared pointer to the object

Protected Attributes

std::weak_ptr<T> ptr_