UnresolvedHandle

template<IsSpectral TSpectral>
class UnresolvedObjectHandle : public huira::Handle<UnresolvedObject<TSpectral>>

Handle for unresolved scene objects.

Provides access and control for unresolved scene objects, allowing irradiance to be set or queried. This handle is used to interact with unresolved objects in a type-safe manner. The irradiance a scene view resolves for an instance of one (which, for an emitter, sphere or asteroid, depends on where it is) is the view’s: see SceneView::unresolved_irradiance().

Template Parameters:

TSpectral – The spectral type (e.g., RGB, Visible8)

Public Functions

UnresolvedObjectHandle() = delete
void set_irradiance(const units::SpectralWattsPerMeterSquared<TSpectral> &irradiance) const

Sets the spectral irradiance of the unresolved object.

Updates the irradiance value of the underlying unresolved object.

Parameters:

spectral_irradiance – The new spectral irradiance value in W·m⁻².

void set_irradiance(const units::WattsPerMeterSquared &irradiance) const

Sets the total irradiance of the unresolved object.

Updates the irradiance value of the underlying unresolved object using a total irradiance value.

Parameters:

irradiance – The new total irradiance value in W·m⁻².

TSpectral get_irradiance() const

Returns the irradiance the unresolved object was given.

This is the irradiance a plain unresolved object gives wherever it is placed. That of an instance of one whose irradiance depends on where it is (an emitter, sphere or asteroid) is resolved by a scene view: see SceneView::unresolved_irradiance().

Returns:

The spectral irradiance it was given, in W·m⁻².

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 – if the handle is invalid or the cast fails

Returns:

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

inline std::string name() const
inline std::uint64_t id() const
inline std::string type() const

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_

Friends

friend class Scene< TSpectral >
friend class FrameHandle< TSpectral >