LuciadCPillar 2023.1.04
luciad::IEditHandlesObserver Class Referenceabstract

An observer that allows you to receive change events from an IEditHandles when the collection of handles changes. More...

#include <luciad/edit/handles/IEditHandles.h>

Public Member Functions

virtual ~IEditHandlesObserver ()=default
 
virtual void onEditHandlesChanged (const EditHandlesEvent &editHandlesEvent)=0
 This method is called when a handle is added ot removed from an IEditHandles. More...
 
virtual void onEditHandlesInvalid ()=0
 This method is called when IEditHandles has become invalid, and can not be used anymore for the currently edited object. More...
 

Static Public Member Functions

static std::shared_ptr< IEditHandlesObservercreate (std::function< void(const EditHandlesEvent &event)> onChangedFunction, std::function< void()> onInvalidFunction=nullptr)
 Creates a default IEditHandlesObserver instance that delegates the IEditHandlesObserver::onEditHandlesChanged to the given function. More...
 

Detailed Description

An observer that allows you to receive change events from an IEditHandles when the collection of handles changes.

Since
2020.1

Constructor & Destructor Documentation

◆ ~IEditHandlesObserver()

virtual luciad::IEditHandlesObserver::~IEditHandlesObserver ( )
virtualdefault

Member Function Documentation

◆ create()

static std::shared_ptr< IEditHandlesObserver > luciad::IEditHandlesObserver::create ( std::function< void(const EditHandlesEvent &event)>  onChangedFunction,
std::function< void()>  onInvalidFunction = nullptr 
)
static

Creates a default IEditHandlesObserver instance that delegates the IEditHandlesObserver::onEditHandlesChanged to the given function.

This is a convenience method that allows you to reduce boiler plate code, and use lambdas.

Parameters
onChangedFunctionthe function that is called by IEditHandlesObserver::onEditHandlesChanged
onInvalidFunctionthe function that is called by IEditHandlesObserver::onEditHandlesInvalid
Returns
an IEditHandlesObserver instance based on the given function.

◆ onEditHandlesChanged()

virtual void luciad::IEditHandlesObserver::onEditHandlesChanged ( const EditHandlesEvent editHandlesEvent)
pure virtual

This method is called when a handle is added ot removed from an IEditHandles.

Parameters
editHandlesEventthe event that describes the change

◆ onEditHandlesInvalid()

virtual void luciad::IEditHandlesObserver::onEditHandlesInvalid ( )
pure virtual

This method is called when IEditHandles has become invalid, and can not be used anymore for the currently edited object.

This allows the editing code to generate a new set of handles for the edited object.