Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::inspector Struct Referenceabstract

Base class for type-specific property inspectors in the editor. More...

#include <inspector.h>

Inheritance diagram for unravel::inspector:
crtp_meta_type< inspector >

Public Types

using attribute_getter = std::function<entt::meta_any(const char*)>
 Function type for retrieving meta attributes by name.
 

Public Member Functions

virtual ~inspector ()=default
 Virtual destructor for proper cleanup.
 
virtual void before_inspect (const entt::meta_data &prop)
 Called before inspecting a property to set up layout.
 
virtual void after_inspect (const entt::meta_data &prop)
 Called after inspecting a property to clean up layout.
 
virtual auto inspect (rtti::context &ctx, entt::meta_any &var, const meta_any_proxy &var_proxy, const var_info &info, const entt::meta_custom &custom) -> inspect_result=0
 Pure virtual method to render and handle interaction for a variable.
 
- Public Member Functions inherited from crtp_meta_type< inspector >
virtual auto get_meta_type () const -> entt::meta_type
 
auto is () const -> bool
 
auto is (const entt::meta_type &type) const -> bool
 
virtual auto as_derived () -> entt::meta_any
 

Static Public Member Functions

template<typename T >
static void create_and_register (const entt::meta_type &inspected_type, std::unordered_map< entt::id_type, std::shared_ptr< inspector > > &type_map)
 Factory method to create and register inspector instances.
 
- Static Public Member Functions inherited from crtp_meta_type< inspector >
static auto get_static_meta_type () -> entt::meta_type
 

Protected Attributes

std::unique_ptr< property_layoutlayout_
 Layout manager for this inspector's UI.
 
bool open_ {}
 Whether this inspector's UI section is expanded.
 

Detailed Description

Base class for type-specific property inspectors in the editor.

Inspectors provide custom UI for editing different data types in the inspector panel. Each inspector handles rendering and interaction for a specific type (e.g., floats, vectors, textures).

Definition at line 240 of file inspector.h.

Member Typedef Documentation

◆ attribute_getter

using unravel::inspector::attribute_getter = std::function<entt::meta_any(const char*)>

Function type for retrieving meta attributes by name.

Definition at line 256 of file inspector.h.

Constructor & Destructor Documentation

◆ ~inspector()

virtual unravel::inspector::~inspector ( )
virtualdefault

Virtual destructor for proper cleanup.

Member Function Documentation

◆ after_inspect()

void unravel::inspector::after_inspect ( const entt::meta_data & prop)
virtual

Called after inspecting a property to clean up layout.

Parameters
propMeta property that was inspected

Definition at line 244 of file inspector.cpp.

◆ before_inspect()

void unravel::inspector::before_inspect ( const entt::meta_data & prop)
virtual

Called before inspecting a property to set up layout.

Parameters
propMeta property being inspected

Definition at line 239 of file inspector.cpp.

◆ create_and_register()

template<typename T >
static void unravel::inspector::create_and_register ( const entt::meta_type & inspected_type,
std::unordered_map< entt::id_type, std::shared_ptr< inspector > > & type_map )
inlinestatic

Factory method to create and register inspector instances.

Template Parameters
TInspector type to create
Parameters
inspected_typeType that this inspector handles
type_mapRegistry map to store the inspector instance

Definition at line 249 of file inspector.h.

◆ inspect()

virtual auto unravel::inspector::inspect ( rtti::context & ctx,
entt::meta_any & var,
const meta_any_proxy & var_proxy,
const var_info & info,
const entt::meta_custom & custom ) -> inspect_result
pure virtual

Pure virtual method to render and handle interaction for a variable.

Parameters
ctxRuntime type information context
varVariable being inspected
var_proxyProxy for accessing the variable
infoMetadata about the variable
customCustom attributes for the variable
Returns
Result indicating what changes occurred

Member Data Documentation

◆ layout_

std::unique_ptr<property_layout> unravel::inspector::layout_
protected

Layout manager for this inspector's UI.

Definition at line 292 of file inspector.h.

◆ open_

bool unravel::inspector::open_ {}
protected

Whether this inspector's UI section is expanded.

Definition at line 294 of file inspector.h.


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