Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
foray::scene::Node Class Reference

A scene node. Extends the registry with hierarchical information. More...

#include <foray_node.hpp>

Inheritance diagram for foray::scene::Node:
foray::scene::Registry foray::NoMoveDefaults

Public Member Functions

 Node (Scene *scene, Node *parent=nullptr)
 
 FORAY_PROPERTY_V (Parent)
 
 FORAY_PROPERTY_R (Children)
 
 FORAY_PROPERTY_R (Name)
 
ncomp::TransformGetTransform ()
 
template<typename TComponent >
int32_t FindChildrenWithComponent (std::vector< Node * > &outnodes)
 
template<typename TComponent >
int32_t FindComponentsRecursive (std::vector< TComponent * > &outnodes)
 
virtual ~Node ()
 
- Public Member Functions inherited from foray::scene::Registry
 Registry ()
 
 Registry (CallbackDispatcher *root)
 
template<typename TComponent , typename... Args>
TComponentMakeComponent (Args &&... args)
 Instantiates a new componente.
 
template<typename TComponent >
void AddComponent (TComponent *component)
 Adds a manually instantiated component instance (initiate with new, Registry manages finalization)
 
template<typename TComponent >
void MoveComponent (TComponent *component)
 Moves a component registered to a different Registry to this.
 
template<typename TComponent >
bool HasComponent () const
 Test wether a component matching type TComponent is registered.
 
template<typename TComponent >
TComponentGetComponent ()
 Gets first component that can be cast to TComponent type.
 
template<typename TComponent >
const TComponentGetComponent () const
 Gets first component that can be cast to TComponent type.
 
template<typename TComponent >
int32_t GetComponents (std::vector< TComponent * > &out)
 Appends all components which can be cast to TComponent type to the out vector.
 
template<typename TComponent >
int32_t GetComponents (std::vector< const TComponent * > &out) const
 Appends all components which can be cast to TComponent type to the out vector.
 
bool RemoveDeleteComponent (Component *component)
 Removes and finalizes a component.
 
virtual void Destroy ()
 Finalizes all attached components.
 
virtual ~Registry ()
 
RegistrySetCallbackDispatcher (CallbackDispatcher *rootRegistry)
 The root registry manages global callbacks invokable on the components.
 
- Public Member Functions inherited from foray::NoMoveDefaults
 NoMoveDefaults ()=default
 
 NoMoveDefaults (const NoMoveDefaults &other)=delete
 
 NoMoveDefaults (NoMoveDefaults &&other)=default
 
NoMoveDefaultsoperator= (const NoMoveDefaults &other)=delete
 

Protected Attributes

NodemParent = nullptr
 
std::vector< Node * > mChildren = {}
 
std::string mName = ""
 
- Protected Attributes inherited from foray::scene::Registry
CallbackDispatchermCallbackDispatcher = nullptr
 All components attached to the registry.
 
std::vector< Component * > mComponents = {}
 

Additional Inherited Members

- Protected Member Functions inherited from foray::scene::Registry
void Register (Component *component)
 
bool Unregister (Component *component)
 
void RegisterToRoot (Component *component)
 
void UnregisterFromRoot (Component *component)
 

Detailed Description

A scene node. Extends the registry with hierarchical information.

Constructor & Destructor Documentation

◆ Node()

foray::scene::Node::Node ( Scene scene,
Node parent = nullptr 
)

◆ ~Node()

virtual foray::scene::Node::~Node ( )
inlinevirtual

Member Function Documentation

◆ FindChildrenWithComponent()

template<typename TComponent >
int32_t foray::scene::Node::FindChildrenWithComponent ( std::vector< Node * > &  outnodes)
inline

◆ FindComponentsRecursive()

template<typename TComponent >
int32_t foray::scene::Node::FindComponentsRecursive ( std::vector< TComponent * > &  outnodes)
inline

◆ FORAY_PROPERTY_R() [1/2]

foray::scene::Node::FORAY_PROPERTY_R ( Children  )

◆ FORAY_PROPERTY_R() [2/2]

foray::scene::Node::FORAY_PROPERTY_R ( Name  )

◆ FORAY_PROPERTY_V()

foray::scene::Node::FORAY_PROPERTY_V ( Parent  )

◆ GetTransform()

ncomp::Transform * foray::scene::Node::GetTransform ( )

Member Data Documentation

◆ mChildren

std::vector<Node*> foray::scene::Node::mChildren = {}
protected

◆ mName

std::string foray::scene::Node::mName = ""
protected

◆ mParent

Node* foray::scene::Node::mParent = nullptr
protected

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