This handles provider can create handles to edit Point
geometries.
More...
#include <luciad/edit/geometries/PointHandlesProvider.h>
|
| PointHandlesProvider () |
| Creates a new PointHandlesProvider that can create handles to modify Point geometries. More...
|
|
| ~PointHandlesProvider () override |
|
bool | canProvide (const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > &geometry, const std::shared_ptr< FeatureEditContext > &context) const override |
| Indicates if this handles provider can create handles for the given geometry. More...
|
|
std::shared_ptr< IPointConstraint > | getConstraint () const |
|
std::shared_ptr< IHandleFactory > | getHandleFactory () const |
|
std::shared_ptr< IEditHandles > | provide (std::shared_ptr< Observable< std::shared_ptr< Geometry > > > geometry, const std::shared_ptr< FeatureEditContext > &context, std::shared_ptr< IGeometryEditCallback > geometryEditCallback) const override |
| Returns the handles for the given feature. More...
|
|
std::shared_ptr< ITranslateEditAction > | provideTranslateAction (std::shared_ptr< Observable< std::shared_ptr< Geometry > > > geometry, const std::shared_ptr< FeatureEditContext > &context, std::shared_ptr< IGeometryEditCallback > geometryEditCallback) const override |
| Provides a translate action that can be used by the caller to add translation behavior. More...
|
|
void | setConstraint (std::shared_ptr< IPointConstraint > constraint) |
| Sets the constraint that is applied to the handles created by this handles provider. More...
|
|
void | setHandleFactory (std::shared_ptr< IHandleFactory > handleFactory) |
| Sets the IHandleFactory that is used to create handles by this provider. More...
|
|
Public Member Functions inherited from luciad::IGeometryHandlesProvider |
virtual | ~IGeometryHandlesProvider ()=default |
|
virtual bool | canProvide (const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > &geometry, const std::shared_ptr< FeatureEditContext > &context) const =0 |
| Indicates if this handles provider can create handles for the given geometry. More...
|
|
virtual std::shared_ptr< IEditHandles > | provide (std::shared_ptr< Observable< std::shared_ptr< Geometry > > > geometry, const std::shared_ptr< FeatureEditContext > &context, std::shared_ptr< IGeometryEditCallback > geometryEditCallback) const =0 |
| Returns the handles for the given feature. More...
|
|
virtual std::shared_ptr< ITranslateEditAction > | provideTranslateAction (std::shared_ptr< Observable< std::shared_ptr< Geometry > > > geometry, const std::shared_ptr< FeatureEditContext > &context, std::shared_ptr< IGeometryEditCallback > geometryEditCallback) const =0 |
| Provides a translate action that can be used by the caller to add translation behavior. More...
|
|
This handles provider can create handles to edit Point
geometries.
The handles provider offers the following handles:
Note: the handle to translate the entire feature is typically created by the IFeatureHandlesProvider
. FeatureHandlesProvider
does this by default.
- Since
- 2020.1
◆ PointHandlesProvider()
luciad::PointHandlesProvider::PointHandlesProvider |
( |
| ) |
|
◆ ~PointHandlesProvider()
luciad::PointHandlesProvider::~PointHandlesProvider |
( |
| ) |
|
|
override |
◆ canProvide()
bool luciad::PointHandlesProvider::canProvide |
( |
const std::shared_ptr< Observable< std::shared_ptr< Geometry > > > & |
geometry, |
|
|
const std::shared_ptr< FeatureEditContext > & |
context |
|
) |
| const |
|
overridevirtual |
Indicates if this handles provider can create handles for the given geometry.
- Parameters
-
geometry | an observable geometry, cannot be nullptr |
context | the context. Contains additional information about the edited feature, cannot be nullptr . |
- Returns
- if this handles provider can provide handles and a translate action for the given Feature
Implements luciad::IGeometryHandlesProvider.
◆ getConstraint()
std::shared_ptr< IPointConstraint > luciad::PointHandlesProvider::getConstraint |
( |
| ) |
const |
- Returns
- constraint the constraint that is applied to the handles' edit actions, or
nullptr
if no constraint is set.
◆ getHandleFactory()
std::shared_ptr< IHandleFactory > luciad::PointHandlesProvider::getHandleFactory |
( |
| ) |
const |
- Returns
- the handle factory used by the handles provider
◆ provide()
Returns the handles for the given feature.
Note: translation
of features is handled by IFeatureHandlesProvider
. So geometry handles providers should not provide handles to translate a geometry.
- Parameters
-
geometry | the observable geometry for which to provide handles, cannot be nullptr . |
context | the context. Contains additional information about the edited feature, cannot be nullptr . |
geometryEditCallback | a callback that notifies the caller when the Feature has changed, cannot be nullptr . |
- Returns
- handles for the given feature. Never
nullptr
.
Implements luciad::IGeometryHandlesProvider.
◆ provideTranslateAction()
Provides a translate action that can be used by the caller to add translation behavior.
A translation handle is typically added by an IFeatureHandlesProvider
, like for example the FeatureHandlesProvider
implementation. It calls this method to retrieve a translate action, and uses it to create a TranslateEditHandle
.
When ITranslateEditAction::translate
is called, the returned implementation must:
- Parameters
-
geometry | the observable geometry for which to provide a translate action, cannot be nullptr |
context | the context, cannot be nullptr |
geometryEditCallback | a callback that notifies the caller of this method when a translation has occurred, cannot be nullptr |
- Returns
- a translate action. Never
nullptr
.
Implements luciad::IGeometryHandlesProvider.
◆ setConstraint()
void luciad::PointHandlesProvider::setConstraint |
( |
std::shared_ptr< IPointConstraint > |
constraint | ) |
|
Sets the constraint that is applied to the handles created by this handles provider.
Handles always call the constraint with a PointChange
parameter, containing the point difference.
- Parameters
-
constraint | the constraint that is applied to the handles' edit actions, or nullptr if no constraint should be applied. |
◆ setHandleFactory()
void luciad::PointHandlesProvider::setHandleFactory |
( |
std::shared_ptr< IHandleFactory > |
handleFactory | ) |
|
Sets the IHandleFactory that is used to create handles by this provider.
If this method is not called, a default handle factory is used. You can change the behavior of this default handle factory by:
retrieving it
- wrapping it with your own
IHandleFactory
implementation, by delegating to the default factory
- omitting/replacing one or more handles that are returned
- Parameters
-
handleFactory | a handle factory |
- Exceptions
-