LuciadCPillar 2024.0.05
luciad::IGeometryCreateCallback Class Referenceabstract

A callback interface that can signal that a geometry was changed in the context of creation. More...

#include <luciad/create/geometries/IGeometryCreateCallback.h>

Public Member Functions

virtual ~IGeometryCreateCallback ()=default
 
virtual void onGeometryChanged (const std::shared_ptr< Geometry > &newGeometry, ChangeStatus changeStatus)=0
 Can be implemented to handle the given geometry. More...
 
virtual void onGeometryCreateFailed (const ErrorInfo &errorInfo)=0
 Can be implemented to handle the case when geometry creation has failed. More...
 

Static Public Member Functions

static std::shared_ptr< IGeometryCreateCallbackcreate (std::function< void(const std::shared_ptr< Geometry > &, ChangeStatus)> onChangedFunction, std::function< void(const ErrorInfo &)> onFailedFunction)
 Creates a default IGeometryCreateCallback instance that delegates the IGeometryCreateCallback::onGeometryChanged to the given function. More...
 

Detailed Description

A callback interface that can signal that a geometry was changed in the context of creation.

This class is used by IGeometryCreator implementations.

Since
2020.1

Constructor & Destructor Documentation

◆ ~IGeometryCreateCallback()

virtual luciad::IGeometryCreateCallback::~IGeometryCreateCallback ( )
virtualdefault

Member Function Documentation

◆ create()

static std::shared_ptr< IGeometryCreateCallback > luciad::IGeometryCreateCallback::create ( std::function< void(const std::shared_ptr< Geometry > &, ChangeStatus)>  onChangedFunction,
std::function< void(const ErrorInfo &)>  onFailedFunction 
)
static

Creates a default IGeometryCreateCallback instance that delegates the IGeometryCreateCallback::onGeometryChanged to the given function.

This is a convenience method that allows to reduce boiler plate code using lambdas.

Parameters
onChangedFunctionthe function that is called by IGeometryCreateCallback::onGeometryChanged
onFailedFunctionthe function that is called by IGeometryCreateCallback::onGeometryCreateFailed
Returns
an IGeometryCreateCallback instance based on the given function.

◆ onGeometryChanged()

virtual void luciad::IGeometryCreateCallback::onGeometryChanged ( const std::shared_ptr< Geometry > &  newGeometry,
ChangeStatus  changeStatus 
)
pure virtual

Can be implemented to handle the given geometry.

Parameters
newGeometrythe new geometry, cannot be nullptr
changeStatusthe status of this change

◆ onGeometryCreateFailed()

virtual void luciad::IGeometryCreateCallback::onGeometryCreateFailed ( const ErrorInfo errorInfo)
pure virtual

Can be implemented to handle the case when geometry creation has failed.

Parameters
errorInfoan info object that describes why creation failed.