LuciadCPillar 2023.1.03
luciad::IEditHandles Class Referenceabstract

Represents a collection of handles that determine how an edited object, a Feature or a Geometry for example, can be modified. More...

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

Public Member Functions

virtual ~IEditHandles ()=default
 
virtual void addObserver (std::shared_ptr< IEditHandlesObserver > observer)=0
 Adds an observer that allows you to receive change events when a handle is added or removed. More...
 
virtual std::vector< std::shared_ptr< IEditHandle > > getList () const =0
 
virtual void removeObserver (const std::shared_ptr< IEditHandlesObserver > &observer)=0
 Removes the given observer. More...
 

Detailed Description

Represents a collection of handles that determine how an edited object, a Feature or a Geometry for example, can be modified.

This collection keeps itself up-to-date while the edited object changes.

See the related guide for an overview of the editing API.

The responsibilities of this class are to:

  • provide a list of handles that can be used to interact with the edited object. For example, it provides handles that move one of the points that makes up a polyline.
  • make sure that this list of handles remains up-to-date when the edited feature or geometry is changed by one of its own handles. This can mean adding, updating or removing handles.
  • make sure that this list of handles remains up-to-date when the edited feature or geometry changes externally.
  • keep track of IEditHandlesObservers, and fire the appropriate EditHandlesEvents whenever handles are added or removed.

Note: IEditHandles is only accessed on the UI thread by Editor.

Since
2020.1

Constructor & Destructor Documentation

◆ ~IEditHandles()

virtual luciad::IEditHandles::~IEditHandles ( )
virtualdefault

Member Function Documentation

◆ addObserver()

virtual void luciad::IEditHandles::addObserver ( std::shared_ptr< IEditHandlesObserver observer)
pure virtual

Adds an observer that allows you to receive change events when a handle is added or removed.

Adding the same observer twice is forbidden, and will cause an exception to be thrown.

Parameters
observeran observer.
Exceptions
luciad::InvalidArgumentExceptionwhen the observer was already added.
luciad::NullArgumentExceptionwhen the observer is nullptr.

◆ getList()

virtual std::vector< std::shared_ptr< IEditHandle > > luciad::IEditHandles::getList ( ) const
pure virtual
Returns
a list of all IEditHandle instances that can be used for editing. To make sure these handles are used in a consistent way, it's important to return them in a consistent order. The Editor prioritizes handles for event handling according to the order they are returned in. The first returned element has the highest priority. All handles returned by this method must be valid, meaning that nullptr handles must be filtered out.

◆ removeObserver()

virtual void luciad::IEditHandles::removeObserver ( const std::shared_ptr< IEditHandlesObserver > &  observer)
pure virtual

Removes the given observer.

If the given observer was never added or already removed, an exception is thrown.

Parameters
observeran observer.
Exceptions
luciad::InvalidArgumentExceptionwhen the observer is not known.
luciad::NullArgumentExceptionwhen the observer is nullptr.