NDEVR
API Documentation
VehicleSelector

A widget that allows the user to browse, search, and select vehicles from the VehicleDatabase and place them into the design scene. More...

Collaboration diagram for VehicleSelector:
[legend]

Public Member Functions

 VehicleSelector (QTModelManager *lookup, ModelEditController *edit_controller, VehicleDatabase *db, QWidget *parent=nullptr)
 Constructs the vehicle selector widget.
void setCurrentRecord (uint04 record_idx)
 Sets the currently highlighted vehicle record.
void vehicleSelectedSignal ()
 Emitted when a vehicle has been selected by the user.

Protected Member Functions

void onPlaceVehicle ()
 Handles the place vehicle action from the UI.
void placeVehicle ()
 Places the currently selected vehicle into the scene.
void setupArchiveObject (DesignObjectChooser *chooser, const File &archive)
 Configures the archive object chooser for a given archive file.
void updateInsertEnabled ()
 Updates the enabled state of the insert/place button.
void updateUI ()
 Refreshes the UI to reflect the current selection state.

Protected Attributes

uint04 m_current_record = Constant<uint04>::Invalid
 Index of the currently selected record.
VehicleDatabasem_db
 The vehicle database being browsed.
ModelEditControllerm_edit_controller
 The edit controller for placing objects.
bool m_is_editing = false
 Whether the user is currently editing a placed vehicle.
QTModelManagerm_manager
 The Qt model manager for scene access.
VehicleTableViewm_table
 The table view displaying vehicle records.
Ui::VehicleSelectorUI * ui
 The auto-generated UI form.

Detailed Description

A widget that allows the user to browse, search, and select vehicles from the VehicleDatabase and place them into the design scene.


Definition at line 21 of file VehicleSelector.h.

Constructor & Destructor Documentation

◆ VehicleSelector()

VehicleSelector::VehicleSelector ( QTModelManager * lookup,
ModelEditController * edit_controller,
VehicleDatabase * db,
QWidget * parent = nullptr )

Constructs the vehicle selector widget.

Parameters
[in]lookupThe Qt model manager for scene access.
[in]edit_controllerThe edit controller for placing vehicles.
[in]dbThe vehicle database to browse.
[in]parentOptional parent widget.

Member Function Documentation

◆ setCurrentRecord()

void VehicleSelector::setCurrentRecord ( uint04 record_idx)

Sets the currently highlighted vehicle record.

Parameters
[in]record_idxThe record index to select.

◆ setupArchiveObject()

void VehicleSelector::setupArchiveObject ( DesignObjectChooser * chooser,
const File & archive )
protected

Configures the archive object chooser for a given archive file.

Parameters
[in]chooserThe design object chooser to configure.
[in]archiveThe archive file containing model data.

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