![]() |
ImFusion C++ SDK 4.5.0
|
#include <ImFusion/GUI/ViewObject.h>
Specialization of a ViewObject where the concrete types of the underlying GlObject and EventHandler are defined by the template parameters. More...
Specialization of a ViewObject where the concrete types of the underlying GlObject and EventHandler are defined by the template parameters.
This can be useful if you know them in advance, don't need to rely on polymorphism, and want to avoid manually casting repeatedly.
Public Member Functions | |
| TypedViewObject (std::unique_ptr< ObjectType > glObject, std::unique_ptr< EventHandlerType > eventHandler=nullptr) | |
| const ObjectType & | glObject () const |
| Get the underlying typed GlObject. | |
| ObjectType & | glObject () |
| const EventHandlerType * | eventHandler () const |
| Get the optionally attached EventHandler. | |
| EventHandlerType * | eventHandler () |
| EventResult | handleInputEvent (const InputEvent &event, const View &view) override |
| Gets called by the parent view in order to handle user input events. | |
| Public Member Functions inherited from ImFusion::GUI::ViewObject | |
| ViewObject (std::unique_ptr< GlObject > glObject) | |
| Instantiate a new ViewObject taking ownership of the underlying GlObject which must not be null. | |
| const GlObject & | glObject () const |
| Get the underlying abstract GlObject. | |
| GlObject & | glObject () |
| const GlObject * | gl () const |
| Original API methods for the underlying abstract GlObject. | |
| GlObject * | gl () |
Protected Attributes | |
| std::unique_ptr< EventHandlerType > | m_eventHandler |
| Protected Attributes inherited from ImFusion::GUI::ViewObject | |
| std::unique_ptr< GlObject > | m_glObject |
|
overridevirtual |
Gets called by the parent view in order to handle user input events.
It returns an EventResult to indicated if and how event propagation should continue.
| event | User input event to handle. |
| view | Parent View where the event originates from. This additional payload enables you to add the same ViewObject to multiple views and still implement view-specific handling logic. |
Implements ImFusion::GUI::ViewObject.