NDEVR
API Documentation
SelectionWidget

A widget that displays controls and information for the currently selected design objects. More...

Inheritance diagram for SelectionWidget:
[legend]
Collaboration diagram for SelectionWidget:
[legend]

Public Types

enum  SizeMode {
  e_normal , e_small_horizontal , e_small_vertical , e_tiny_horizontal ,
  e_tiny_vertical
}
 Size modes controlling the layout of the selection widget. More...

Public Member Functions

 SelectionWidget (QTModelManager *manager, QWidget *parent=nullptr)
 Constructs a selection widget for the given model manager.
void addExclusionType (const StringView &type)
 Adds a model type that this widget should exclude.
void addFactory (SelectionButtonFactory *factory)
 Adds a custom selection button factory.
void addInclusionType (const StringView &type)
 Adds a model type that this widget can handle.
bool canHandle (UUID id) const
 Checks whether this widget can handle the given object.
bool canHandleDirectly (const Model &model) const
 Checks whether this widget can handle the given model directly.
void clear ()
 Clears the widget, removing all displayed objects.
void createGroup ()
 Creates the button group layout for the selection widget.
Model findModelThatIsHandled (const Model &root_model) const
 Searches the model hierarchy for a model that this widget can handle.
bool isShowing (UUID id) const
 Checks whether the given object is currently shown in the widget.
void onAddedSlot (UUID id)
 Handles notification that a new object was added.
void onClearSignal ()
 Emitted when the widget is cleared.
void onSelectedSignal ()
 Emitted when the widget updates for a new selection.
void onSelectedSlot (Buffer< UUID > id, bool selected)
 Handles selection change events from the model manager.
void onTargetUpdated (UUID id) override
 Called when a target design object is updated.
void onTargetUpdatedSlot (UUID id)
 Handles notification that a target object was updated.
virtual bool processKeyEvent (const StringView &id, const KeyEvent &key_event, DesignObjectLookup *lookup, Camera *camera) override
 Processes a key event identified by its string ID.
void resetKeyControllerToDefaults () override
 Resets all key mappings to their default values.
void setSizeMode (SizeMode mode)
 Sets the size mode controlling the layout.
void updateControls ()
 Updates the enabled and visible state of all controls.
void updateSelected ()
 Updates the widget to reflect the current selection state.
Public Member Functions inherited from DesignObjectWidgetInterface
virtual void addTarget (const DynamicPointer< QTDesignObject > &object)
 Adds a design object to the set of targets.
virtual Bounds< 3, fltp08bounds () const
 Returns the combined 3D bounding box of all target design objects.
void clearTargets ()
 Removes all target design objects from this widget.
QTModelManagermanager () const
 Returns the current model manager.
Buffer< Modelmodels () const
 Returns all target objects as Models.
virtual void removeTarget (const DynamicPointer< QTDesignObject > &object)
 Removes a specific target design object.
virtual void removeTarget (const UUID &object)
 Removes a specific target by UUID.
void setManager (QTModelManager *manager)
 Sets the model manager used for UUID-based lookups.
void setTarget (const DynamicPointer< QTDesignObject > &object)
 Sets a single target design object, replacing any existing targets.
void setTargetID (const UUID &object)
 Sets a single target by UUID, replacing any existing targets.
void setTargetIDs (const Buffer< UUID > &objects)
 Sets multiple targets by UUID, replacing any existing targets.
void setTargets (const Buffer< DynamicPointer< QTDesignObject > > &objects)
 Sets multiple target design objects, replacing any existing targets.
Buffer< UUIDtargetIDs () const
 Returns the UUIDs of all current target design objects.
Public Member Functions inherited from BasicKeyController
 BasicKeyController (const TranslatedString &key_controller_title)
 Constructs a BasicKeyController with the given title.
virtual void addKeyOption (const KeyOption &option)
 Adds a new key option mapping to this controller.
const Buffer< KeyOption > & currentKeyMaps () const
 Returns the current set of key option mappings.
virtual void getINI (INIFactory &factory) override
 Serializes or deserializes key controller settings to/from an INI file.
const TranslatedStringkeyControllerTitle () const
 Returns the display title of this key controller.
bool processKeyEvent (const KeyEvent &key_event, DesignObjectLookup *lookup, Camera *camera) final override
 Processes a key event by matching it against registered key options.
virtual void setKeyOption (const KeyOption &option)
 Sets or updates an existing key option mapping.
Public Member Functions inherited from INIInterface
 INIInterface ()
 Constructs an INIInterface with no default INI file.
 INIInterface (const File &default_ini)
 Constructs an INIInterface with the specified default INI file.
virtual ~INIInterface ()
 Virtual destructor for safe polymorphic cleanup.
virtual void finishReadingINI (INIFactory &)
 Called after reading an INI file.
virtual void prepareForINI (INIFactory &)
 Called before reading or writing an INI file.
virtual bool readINIOptions ()
 Reads INI options from the default INI file.
virtual bool readINIOptions (File &ini_file)
 Reads INI options from the specified INI file.
virtual bool saveINIOptions (bool multithead=false)
 Saves INI options to the default INI file.
virtual bool saveINIOptions (File &ini_file, bool multithead=false)
 Saves INI options to the specified INI file.
void setDefaultINIFile (const File &file)
 Sets the default INI file path used for reading and writing options.
virtual void writeToLog (const StringView &title, LogPtr log, uint01 log_level=2U)
 Writes the current INI options to the specified log with a title.
virtual void writeToLog (LogPtr log, uint01 log_level=2U)
 Writes the current INI options to the specified log.

Static Public Member Functions

static void AddGlobalExclusionType (const StringView &type)
 Adds a global exclusion type applied to all selection widgets.
static void AddGlobalExclusionTypes (const Buffer< String > &types)
 Adds multiple global exclusion types at once.
static void AddGlobalInclusionType (const StringView &type)
 Adds a global inclusion type applied to all selection widgets.

Additional Inherited Members

Protected Member Functions inherited from DesignObjectWidgetInterface
const Dictionary< UUID, DynamicPointer< QTDesignObject > > & targets () const
 Returns a const reference to the dictionary of all targets.
Protected Attributes inherited from DesignObjectWidgetInterface
DesignObjectInterfacem_interface
 The internal QObject-based implementation handling signals and target storage.
Protected Attributes inherited from BasicKeyController
TranslatedString m_key_controller_title
 The display title for this key controller.
Buffer< KeyOptionm_key_options
 The collection of registered key option mappings.
bool m_save_ini_on_change_key_option_change = false
 Whether to automatically save INI settings when a key option changes.
Protected Attributes inherited from INIInterface
File m_default_ini
 The default file path used for reading and writing INI options.

Detailed Description

A widget that displays controls and information for the currently selected design objects.


Supports filtering by object type and customizable button factories.

Definition at line 111 of file SelectionWidget.h.

Member Enumeration Documentation

◆ SizeMode

Size modes controlling the layout of the selection widget.

Enumerator
e_normal 

Full-size layout.

e_small_horizontal 

Compact horizontal layout.

e_small_vertical 

Compact vertical layout.

e_tiny_horizontal 

Minimal horizontal layout.

e_tiny_vertical 

Minimal vertical layout.

Definition at line 118 of file SelectionWidget.h.

Constructor & Destructor Documentation

◆ SelectionWidget()

SelectionWidget::SelectionWidget ( QTModelManager * manager,
QWidget * parent = nullptr )

Constructs a selection widget for the given model manager.

Parameters
[in]managerThe model manager to interact with.
[in]parentThe parent widget.

References SelectionWidget(), and DesignObjectWidgetInterface::manager().

Referenced by SelectionWidget().

Member Function Documentation

◆ addExclusionType()

void SelectionWidget::addExclusionType ( const StringView & type)

Adds a model type that this widget should exclude.

Parameters
[in]typeThe type identifier to exclude.

◆ addFactory()

void SelectionWidget::addFactory ( SelectionButtonFactory * factory)

Adds a custom selection button factory.

Parameters
[in]factoryThe factory to add.

◆ AddGlobalExclusionType()

void SelectionWidget::AddGlobalExclusionType ( const StringView & type)
static

Adds a global exclusion type applied to all selection widgets.

Parameters
[in]typeThe type identifier to exclude globally.

◆ AddGlobalExclusionTypes()

void SelectionWidget::AddGlobalExclusionTypes ( const Buffer< String > & types)
static

Adds multiple global exclusion types at once.

Parameters
[in]typesThe type identifiers to exclude globally.

◆ AddGlobalInclusionType()

void SelectionWidget::AddGlobalInclusionType ( const StringView & type)
static

Adds a global inclusion type applied to all selection widgets.

Parameters
[in]typeThe type identifier to include globally.

◆ addInclusionType()

void SelectionWidget::addInclusionType ( const StringView & type)

Adds a model type that this widget can handle.

Parameters
[in]typeThe type identifier to include.

◆ canHandle()

bool SelectionWidget::canHandle ( UUID id) const

Checks whether this widget can handle the given object.

Parameters
[in]idThe UUID of the object to check.
Returns
True if the widget can handle this object.

◆ canHandleDirectly()

bool SelectionWidget::canHandleDirectly ( const Model & model) const

Checks whether this widget can handle the given model directly.

Parameters
[in]modelThe model to check.
Returns
True if the model can be handled directly.

◆ findModelThatIsHandled()

Model SelectionWidget::findModelThatIsHandled ( const Model & root_model) const

Searches the model hierarchy for a model that this widget can handle.

Parameters
[in]root_modelThe root model to search from.
Returns
The first handled model found, or an invalid model.

◆ isShowing()

bool SelectionWidget::isShowing ( UUID id) const

Checks whether the given object is currently shown in the widget.

Parameters
[in]idThe UUID of the object.
Returns
True if the object is currently displayed.

◆ onAddedSlot()

void SelectionWidget::onAddedSlot ( UUID id)

Handles notification that a new object was added.

Parameters
[in]idThe UUID of the added object.

◆ onSelectedSlot()

void SelectionWidget::onSelectedSlot ( Buffer< UUID > id,
bool selected )

Handles selection change events from the model manager.

Parameters
[in]idThe UUIDs of the affected objects.
[in]selectedWhether the objects were selected or deselected.

◆ onTargetUpdated()

void SelectionWidget::onTargetUpdated ( UUID )
overridevirtual

Called when a target design object is updated.

Override to handle updates.

Parameters
[in]idThe UUID of the updated object (unused in base implementation).

Reimplemented from DesignObjectWidgetInterface.

◆ onTargetUpdatedSlot()

void SelectionWidget::onTargetUpdatedSlot ( UUID id)

Handles notification that a target object was updated.

Parameters
[in]idThe UUID of the updated object.

◆ processKeyEvent()

virtual bool SelectionWidget::processKeyEvent ( const StringView & id,
const KeyEvent & key_event,
DesignObjectLookup * lookup,
Camera * camera )
overridevirtual

Processes a key event identified by its string ID.

Subclasses implement specific behavior.

Parameters
[in]idThe string identifier of the key option that matched.
[in]key_eventThe key event to process.
[in]lookupThe design object lookup context.
[in]cameraThe active camera context.
Returns
True if the key event was handled, false otherwise.

Implements BasicKeyController.

◆ resetKeyControllerToDefaults()

void SelectionWidget::resetKeyControllerToDefaults ( )
overridevirtual

Resets all key mappings to their default values.

Subclasses must implement this.

Implements BasicKeyController.

◆ setSizeMode()

void SelectionWidget::setSizeMode ( SizeMode mode)

Sets the size mode controlling the layout.

Parameters
[in]modeThe size mode to apply.

The documentation for this class was generated from the following file: