NDEVR
API Documentation
TransitIncidentManager

Central manager for transit incident data, including buses, drivers, witnesses, officers, and vehicles. More...

Collaboration diagram for TransitIncidentManager:
[legend]

Public Member Functions

 TransitIncidentManager (QTModelManager *manager)
 Constructs the TransitIncidentManager.
UUID activeAddressID () const
 Returns the UUID for the active address scene node.
UUID activeBusID () const
 Returns the UUID for the active bus scene node.
UUID activeDriverID () const
 Returns the UUID for the active driver scene node.
DynamicPointer< QTDesignObjectbusCache ()
 Returns the root design object for the bus cache.
DynamicPointer< QTDesignObjectdriverCache ()
 Returns the root design object for the driver cache.
DynamicPointer< QTDesignObjectincidentAddress ()
 Returns the design object for the incident address.
QTModelManagermanager () const
 Returns the model manager.
DynamicPointer< QTDesignObjectofficerRoot ()
 Returns the root design object for officers.
UUID officerRootID () const
 Returns the UUID for the officer root scene node.
DynamicPointer< QTDesignObjectpedestrianRoot ()
 Returns the root design object for pedestrians.
UUID pedestrianRootID () const
 Returns the UUID for the pedestrian root scene node.
void saveBusCache ()
 Persists the bus cache to disk.
void saveDriverCache ()
 Persists the driver cache to disk.
void setActiveBus (const UUID &id)
 Sets the active bus for the current incident by copying it from the cache.
void setActiveDriver (const UUID &id)
 Sets the active driver for the current incident by copying from the cache.
void setupProject ()
 Initializes all root scene nodes required for an incident project.
DynamicPointer< QTDesignObjectvehicleRoot ()
 Returns the root design object for involved vehicles.
UUID vehicleRootID () const
 Returns the UUID for the involved vehicles root scene node.
DynamicPointer< QTDesignObjectwitnessRoot ()
 Returns the root design object for witnesses.
UUID witnessRootID () const
 Returns the UUID for the witness root scene node.

Protected Member Functions

void createAddressRoot ()
 Creates the incident address root scene node if it does not already exist.
void createBussesRoot ()
 Loads or creates the bus cache root from disk.
void createDriverRoot ()
 Loads or creates the driver cache root from disk.
void createOfficerRoot ()
 Creates the officer root scene node if it does not already exist.
void createPedestrainRoot ()
 Creates the pedestrian root scene node if it does not already exist.
void createVehicleRoot ()
 Creates the involved vehicles root scene node if it does not already exist.
void createWitnessRoot ()
 Creates the witness root scene node if it does not already exist.
UUID readCache (const File &file, const StringView &root_name)
 Reads a cache file from disk, or creates a new root scene if the file does not exist.
void saveCache (const File &file, const UUID &root)
 Writes a scene tree to a cache file on disk.

Protected Attributes

File m_bus_cache_location
 File path to the bus cache on disk.
UUID m_bus_cache_root = Constant<UUID>::Invalid
 UUID of the bus cache root scene.
Buffer< UUIDm_bus_routes
 Cached list of bus route UUIDs.
File m_driver_cache_location
 File path to the driver cache on disk.
UUID m_driver_cache_root = Constant<UUID>::Invalid
 UUID of the driver cache root scene.
Buffer< UUIDm_drivers
 Cached list of driver UUIDs.
QTModelManagerm_manager
 The model manager used for data access.

Detailed Description

Central manager for transit incident data, including buses, drivers, witnesses, officers, and vehicles.

Definition at line 10 of file TransitIncidentManager.h.

Constructor & Destructor Documentation

◆ TransitIncidentManager()

TransitIncidentManager::TransitIncidentManager ( QTModelManager * manager)
inline

Constructs the TransitIncidentManager.

Parameters
[in]managerThe QTModelManager used for scene and model management.

Definition at line 15 of file TransitIncidentManager.h.

References m_bus_cache_location, m_driver_cache_location, m_manager, and manager().

Member Function Documentation

◆ activeAddressID()

UUID TransitIncidentManager::activeAddressID ( ) const
inline

Returns the UUID for the active address scene node.

Returns
The active address UUID.

Definition at line 142 of file TransitIncidentManager.h.

References m_manager.

Referenced by createAddressRoot(), and incidentAddress().

◆ activeBusID()

UUID TransitIncidentManager::activeBusID ( ) const
inline

Returns the UUID for the active bus scene node.

Returns
The active bus UUID.

Definition at line 136 of file TransitIncidentManager.h.

References m_manager.

Referenced by setActiveBus().

◆ activeDriverID()

UUID TransitIncidentManager::activeDriverID ( ) const
inline

Returns the UUID for the active driver scene node.

Returns
The active driver UUID.

Definition at line 130 of file TransitIncidentManager.h.

References m_manager.

Referenced by setActiveDriver().

◆ busCache()

DynamicPointer< QTDesignObject > TransitIncidentManager::busCache ( )
inline

Returns the root design object for the bus cache.

Returns
A DynamicPointer to the bus cache QTDesignObject.

Definition at line 63 of file TransitIncidentManager.h.

References m_bus_cache_root, and m_manager.

◆ driverCache()

DynamicPointer< QTDesignObject > TransitIncidentManager::driverCache ( )
inline

Returns the root design object for the driver cache.

Returns
A DynamicPointer to the driver cache QTDesignObject.

Definition at line 69 of file TransitIncidentManager.h.

References m_driver_cache_root, and m_manager.

◆ incidentAddress()

DynamicPointer< QTDesignObject > TransitIncidentManager::incidentAddress ( )
inline

Returns the design object for the incident address.

Returns
A DynamicPointer to the address QTDesignObject.

Definition at line 75 of file TransitIncidentManager.h.

References activeAddressID(), and m_manager.

◆ manager()

QTModelManager * TransitIncidentManager::manager ( ) const
inline

Returns the model manager.

Returns
A pointer to the QTModelManager.

Definition at line 22 of file TransitIncidentManager.h.

References m_manager.

Referenced by TransitIncidentManager().

◆ officerRoot()

DynamicPointer< QTDesignObject > TransitIncidentManager::officerRoot ( )
inline

Returns the root design object for officers.

Returns
A DynamicPointer to the officer root QTDesignObject.

Definition at line 39 of file TransitIncidentManager.h.

References m_manager, and officerRootID().

Referenced by OfficersEditor::OfficersEditor().

◆ officerRootID()

UUID TransitIncidentManager::officerRootID ( ) const
inline

Returns the UUID for the officer root scene node.

Returns
The officer root UUID.

Definition at line 154 of file TransitIncidentManager.h.

References m_manager.

Referenced by createOfficerRoot(), and officerRoot().

◆ pedestrianRoot()

DynamicPointer< QTDesignObject > TransitIncidentManager::pedestrianRoot ( )
inline

Returns the root design object for pedestrians.

Returns
A DynamicPointer to the pedestrian root QTDesignObject.

Definition at line 51 of file TransitIncidentManager.h.

References m_manager, and pedestrianRootID().

Referenced by TransitIncidentPedestrianEditor::TransitIncidentPedestrianEditor().

◆ pedestrianRootID()

UUID TransitIncidentManager::pedestrianRootID ( ) const
inline

Returns the UUID for the pedestrian root scene node.

Returns
The pedestrian root UUID.

Definition at line 160 of file TransitIncidentManager.h.

References m_manager.

Referenced by createPedestrainRoot(), and pedestrianRoot().

◆ readCache()

UUID TransitIncidentManager::readCache ( const File & file,
const StringView & root_name )
inlineprotected

Reads a cache file from disk, or creates a new root scene if the file does not exist.

Parameters
[in]fileThe cache file path.
[in]root_nameThe display name for the root scene.
Returns
The UUID of the loaded or created root scene.

Definition at line 185 of file TransitIncidentManager.h.

References FactoryOptions::application_locked, FactoryOptions::center_model, NDVFactory::DefaultFactory(), file, FactoryOptions::generate_trees, DesignObject::get(), guid, FactoryParameters::lookup, m_manager, FactoryParameters::models, NDVFactory::NDVFormat(), FactoryParameters::options, NDVFactory::readFile(), DesignObject::set(), FactoryOptions::tree_is_visible, and tree_visible.

Referenced by createBussesRoot(), and createDriverRoot().

◆ saveCache()

void TransitIncidentManager::saveCache ( const File & file,
const UUID & root )
inlineprotected

Writes a scene tree to a cache file on disk.

Parameters
[in]fileThe cache file path.
[in]rootThe UUID of the root scene to save.

Definition at line 210 of file TransitIncidentManager.h.

References NDVFactory::DefaultFactory(), file, FactoryParameters::lookup, m_manager, FactoryParameters::models, NDVFactory::NDVFormat(), and NDVFactory::writeFile().

Referenced by saveBusCache(), and saveDriverCache().

◆ setActiveBus()

void TransitIncidentManager::setActiveBus ( const UUID & id)
inline

Sets the active bus for the current incident by copying it from the cache.

Parameters
[in]idThe UUID of the bus to make active.

Definition at line 81 of file TransitIncidentManager.h.

References activeBusID(), Model::copyFrom(), Model::createChild(), guid, DesignObject::isValid(), m_manager, DesignObject::set(), and uncompressed_data.

◆ setActiveDriver()

void TransitIncidentManager::setActiveDriver ( const UUID & id)
inline

Sets the active driver for the current incident by copying from the cache.

Parameters
[in]idThe UUID of the driver to make active.

Definition at line 101 of file TransitIncidentManager.h.

References activeDriverID(), Model::createChild(), guid, m_manager, DesignObject::set(), and uncompressed_data.

◆ vehicleRoot()

DynamicPointer< QTDesignObject > TransitIncidentManager::vehicleRoot ( )
inline

Returns the root design object for involved vehicles.

Returns
A DynamicPointer to the vehicle root QTDesignObject.

Definition at line 57 of file TransitIncidentManager.h.

References m_manager, and vehicleRootID().

Referenced by TransitIncidentVehiclesEditor::TransitIncidentVehiclesEditor().

◆ vehicleRootID()

UUID TransitIncidentManager::vehicleRootID ( ) const
inline

Returns the UUID for the involved vehicles root scene node.

Returns
The vehicle root UUID.

Definition at line 166 of file TransitIncidentManager.h.

References m_manager.

Referenced by createVehicleRoot(), and vehicleRoot().

◆ witnessRoot()

DynamicPointer< QTDesignObject > TransitIncidentManager::witnessRoot ( )
inline

Returns the root design object for witnesses.

Returns
A DynamicPointer to the witness root QTDesignObject.

Definition at line 45 of file TransitIncidentManager.h.

References m_manager, and witnessRootID().

Referenced by WitnessEditor::WitnessEditor().

◆ witnessRootID()

UUID TransitIncidentManager::witnessRootID ( ) const
inline

Returns the UUID for the witness root scene node.

Returns
The witness root UUID.

Definition at line 148 of file TransitIncidentManager.h.

References m_manager.

Referenced by createWitnessRoot(), and witnessRoot().


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