2#include "NDEVR/Headers/QTModelManager.h"
3#include "IOFactory/Headers/NDVFactory.h"
4#include "Design/Headers/ContactInfo.h"
5#include "Base/Headers/FileResource.h"
88 Scene scene(_t(
"Active Bus"));
89 scene.
set<NDPC::e_translatable_name>(_t(
"Active Bus"));
107 Scene scene(_t(
"Active Driver"));
108 scene.
set<NDPC::e_translatable_name>(_t(
"Active Driver"));
115 active_driver.copyFrom(model,
true);
132 return m_manager->activeProject().appendUUID(
"active_driver");
138 return m_manager->activeProject().appendUUID(
"active_bus");
144 return m_manager->activeProject().appendUUID(
"active_address");
150 return m_manager->activeProject().appendUUID(
"witness_root");
156 return m_manager->activeProject().appendUUID(
"officer_root");
162 return m_manager->activeProject().appendUUID(
"pedestrain_root");
168 return m_manager->activeProject().appendUUID(
"involved_vehicles_root");
197 lib_assert(params.
models.size() == 1,
"Unexpected bus cache size");
198 if(params.
models.size() >= 1)
223 Scene third_parties(_t(
"Officers"));
224 third_parties.
set<
NDPO::icon>(
"user+shadow+s:0.5+ox:0.5+oy:0.5+visible");
235 Scene third_parties(_t(
"Witnesses"));
236 third_parties.
set<
NDPO::icon>(
"user+shadow+s:0.5+ox:0.5+oy:0.5+visible");
247 Scene third_parties(_t(
"Pedestrians"));
248 third_parties.
set<
NDPO::icon>(
"user+shadow+s:0.5+ox:0.5+oy:0.5+visible");
259 Scene third_parties(_t(
"Vehicles"));
260 third_parties.
set<
NDPO::icon>(
"steering_wheel+shadow+s:0.5+ox:0.5+oy:0.5+visible");
271 Scene third_parties(_t(
"Address"));
273 PhysicalAddressModel accident_address(third_parties);
The equivelent of std::vector but with a bit more control.
constexpr decltype(auto) get(t_property_type property) const
Retrieves a property value from the database, cast to the requested type.
void set(t_property_type property, const t_type &value)
Sets a property value in the database.
bool isValid() const
Checks whether this design object has a valid index into the database.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
bool generate_trees
Whether to generate spatial tree structures for the imported data.
bool application_locked
Whether the imported data should be locked from user editing.
bool center_model
Whether to translate the model so its center is at the origin.
bool tree_is_visible
Whether the imported model tree is initially visible.
Contains methods for getting information about particular OS directories or static program file direc...
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
A core class that represents a node on model hierarchy.
Model createChild()
Creates a new child model and appends it to this model's child list.
void copyFrom(const Model &model, bool deep_copy, bool copy_ids=false, bool recursive=true, bool keep_root_properties=false)
Copies data from another model into this model.
virtual bool readFile(FactoryParameters ¶ms) override
Reads an NDV file and populates the factory parameters with the resulting model data.
virtual bool writeFile(FactoryParameters ¶ms) override
Writes model data to an NDV file as described by the factory parameters.
static FileFormat NDVFormat()
Returns the FileFormat descriptor for the NDV file format.
static NDVFactory & DefaultFactory()
Returns the singleton NDVFactory instance.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
The root Model that is responsible for storing the underlying data for all Scene Models.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
UUID activeAddressID() const
Returns the UUID for the active address scene node.
File m_bus_cache_location
File path to the bus cache on disk.
void createVehicleRoot()
Creates the involved vehicles root scene node if it does not already exist.
DynamicPointer< QTDesignObject > busCache()
Returns the root design object for the bus cache.
void createPedestrainRoot()
Creates the pedestrian root scene node if it does not already exist.
void saveBusCache()
Persists the bus cache to disk.
UUID witnessRootID() const
Returns the UUID for the witness root scene node.
DynamicPointer< QTDesignObject > incidentAddress()
Returns the design object for the incident address.
void createAddressRoot()
Creates the incident address root scene node if it does not already exist.
TransitIncidentManager(QTModelManager *manager)
Constructs the TransitIncidentManager.
DynamicPointer< QTDesignObject > vehicleRoot()
Returns the root design object for involved vehicles.
void createOfficerRoot()
Creates the officer root scene node if it does not already exist.
UUID officerRootID() const
Returns the UUID for the officer root scene node.
void saveCache(const File &file, const UUID &root)
Writes a scene tree to a cache file on disk.
void createBussesRoot()
Loads or creates the bus cache root from disk.
void createDriverRoot()
Loads or creates the driver cache root from disk.
void setupProject()
Initializes all root scene nodes required for an incident project.
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.
DynamicPointer< QTDesignObject > witnessRoot()
Returns the root design object for witnesses.
void setActiveBus(const UUID &id)
Sets the active bus for the current incident by copying it from the cache.
UUID vehicleRootID() const
Returns the UUID for the involved vehicles root scene node.
UUID activeDriverID() const
Returns the UUID for the active driver scene node.
DynamicPointer< QTDesignObject > officerRoot()
Returns the root design object for officers.
void createWitnessRoot()
Creates the witness root scene node if it does not already exist.
UUID activeBusID() const
Returns the UUID for the active bus scene node.
File m_driver_cache_location
File path to the driver cache on disk.
Buffer< UUID > m_drivers
Cached list of driver UUIDs.
Buffer< UUID > m_bus_routes
Cached list of bus route UUIDs.
void setActiveDriver(const UUID &id)
Sets the active driver for the current incident by copying from the cache.
UUID pedestrianRootID() const
Returns the UUID for the pedestrian root scene node.
QTModelManager * manager() const
Returns the model manager.
DynamicPointer< QTDesignObject > driverCache()
Returns the root design object for the driver cache.
UUID m_bus_cache_root
UUID of the bus cache root scene.
DynamicPointer< QTDesignObject > pedestrianRoot()
Returns the root design object for pedestrians.
UUID m_driver_cache_root
UUID of the driver cache root scene.
QTModelManager * m_manager
The model manager used for data access.
void saveDriverCache()
Persists the driver cache to disk.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Used to lock a particular variable for writing.
The primary namespace for the NDEVR SDK.
@ guid
A 128-bit globally unique identifier for the object.
@ tree_visible
Whether the object is visible in the design tree view.
@ uncompressed_data
Uncompressed binary data storage.
@ file
The source file path associated with this object.
@ icon
Icon identifier for the object.
A container of input information that is to be filled with output information by an IOFactory.
FactoryOptions options
All read/write options including special parameters.
Buffer< UUID > models
UUIDs of models created or targeted by the operation.
DesignObjectLookup * lookup
The design object lookup used to resolve models and objects.
A FileRequest bundles format data as well as a particular file.