NDEVR
API Documentation
QTModelManager

A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering capabilities to the model hierarchy. More...

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

Public Member Functions

void activeLayerChangedSignal (UUID id)
 Emitted when the active layer changes.
virtual void addCamera (const DynamicPointer< Camera > &object, bool generate_decorations=true) override
 Adds a camera to the manager and emits appropriate signals.
virtual void addCameraModel (const UUID &camera, const Model &object) override
 Associates a model with a camera viewport.
virtual void addGeometry (Geometry object) override
 Adds a geometry object to the manager and emits appropriate signals.
virtual void addLayer (Model object) override
 Adds a layer to the manager and emits appropriate signals.
void addLayerSignal (Buffer< UUID > id)
 Emitted when layers are added.
virtual void addMaterial (Material object) override
 Adds a material to the manager and emits appropriate signals.
virtual void addModel (Model object) override
 Adds a model to the manager and emits appropriate signals.
virtual void addScene (Scene object, bool add_all_objects=true) override
 Adds a scene to the manager and emits appropriate signals.
void addSelected (const UUID &id, bool signal=true)
 Adds a single object to the selection.
virtual void appendSelected (Buffer< UUID > ids) override
 Appends the given UUIDs to the current selection.
void canExitApplicationSignal (bool can_exit)
 Emitted to indicate whether the application can safely exit.
void canImportFileSignal (bool can_import_file)
 Emitted to indicate whether a file can be imported.
void canOpenProjectSignal (bool can_open_project)
 Emitted to indicate whether a project can be opened.
virtual bool canProcessMimeData (const QMimeData *data) const
 Checks whether the given MIME data can be processed (e.g., drag and drop).
void captureManagerStateChangeSignal ()
 Emitted when the capture manager state changes.
virtual void clearAll () override
 Clears all data from the manager, including scenes, models, and selections.
virtual void clearSelected () override
 Clears all selected objects and emits the corresponding signal.
ContextMenuManagercontextMenuManager ()
 Retrieves the context menu manager.
void deleteObject (UUID id) override
 Marks a design object for deletion by its UUID.
virtual void eraseModel (UUID id) override
 Erases a model from the manager, keeping it available for restoration.
virtual void exportModels (ExportRequest request)
 Exports models to a file based on the given export request.
virtual DynamicPointer< QTDesignObjectgetQTObject (UUID id)
 Retrieves a Qt wrapper for a design object by its UUID.
virtual Buffer< DynamicPointer< QTDesignObject > > getQTObjectsByID (const Buffer< UUID > &ids)
 Retrieves Qt wrappers for multiple design objects by their UUIDs.
GraphicsManagerBasegraphicsManager ()
 Retrieves the graphics manager used for rendering.
void graphicsSessionChangeSignal ()
 Emitted when graphics sessions change.
virtual bool hasBeenModified () const
 Checks whether the project has been modified since the last save.
virtual bool hasUserSavedProject () const
 Checks whether the user has explicitly saved the current project.
void layersUpdatedSignal (const Buffer< UUID > &ids)
 Emitted when layers are updated.
virtual DynamicPointer< LibraryManagerlibraryManager ()
 Retrieves the library manager for asset and template management.
virtual LogManagerlogManager () const override
 Retrieves the log manager used for diagnostic output.
void materialsUpdatedSignal (const Buffer< UUID > &ids)
 Emitted when materials are updated.
virtual QTModelManagerViewmodelManagerView ()
 Retrieves the QTModelManagerView associated with this manager.
void modelsUpdatedSignal (const Buffer< UUID > &ids)
 Emitted when models are updated.
void objectsUpdatedSignal (const Buffer< UUID > &ids)
 Emitted when design objects are updated.
void onActiveProjectChanged (UUID id)
 Emitted when the active project changes.
void onAddCamera (UUID id)
 Emitted when a camera is added.
void onAddCommand (UUID id)
 Emitted when a design command is added.
void onAddGeometry (Buffer< UUID > id)
 Emitted when geometry objects are added.
void onAddMaterial (Buffer< UUID > id)
 Emitted when materials are added.
void onAddModel (Buffer< UUID > id)
 Emitted when models are added.
void onAddScene (Buffer< UUID > id)
 Emitted when scenes are added.
void onAddViewportObject (UUID camera, UUID object)
 Emitted when a model is added to a camera viewport.
void onCleanupRequestSignal ()
 Emitted when a cleanup cycle is requested.
void onClearAllSignal ()
 Emitted when all data is cleared.
void onCommandExecutedSignal (UUID id)
 Emitted when a design command finishes execution.
void onDeleteCamera (UUID id)
 Emitted when a camera is deleted.
void onDeleteCommand (UUID id)
 Emitted when a command is deleted.
void onDeleteGeometry (UUID id)
 Emitted when a geometry is deleted.
void onDeleteMaterial (UUID id)
 Emitted when a material is deleted.
void onDeleteModel (UUID id)
 Emitted when a model is deleted.
void onDeleteObject (UUID id)
 Emitted when a design object is deleted.
void onDeleteObjects (Buffer< UUID > ids)
 Emitted when objects are deleted.
void onModelTopLevelChange (Buffer< UUID > id)
 Emitted when models change their top-level parent.
void onProjectUpdatedSignal ()
 Emitted when the active project is updated.
void onSelectedSignal (Buffer< UUID > ids, bool selected)
 Emitted when object selection changes.
void onShowPropertiesRequested (UUID object)
 Emitted when a properties dialog is requested for an object.
void onSwapSelectedSignal (Buffer< UUID > old_selected, Buffer< UUID > new_selected)
 Emitted when the entire selection is swapped.
void onUpdateCommand (UUID id)
 Emitted when a command is updated.
void onUpdateFocus (UUID id, bool focussed)
 Emitted when focus changes for an object.
void popFocus ()
 Removes the current focus object from the focus stack.
void popSelected (const UUID &id, bool signal=true)
 Removes a single object from the selection.
virtual void postDesignCommand (const DynamicPointer< DesignCommand > &command) override
 Posts a design command for asynchronous execution.
virtual void processMimeData (const QMimeData *data, PopupInfo origin=PopupInfo())
 Processes incoming MIME data, typically from a drag-and-drop operation.
ProjectFileManagerprojectFileManager ()
 Retrieves the project file manager.
virtual void removeSelected (const Buffer< UUID > &ids)
 Removes the given UUIDs from the current selection.
virtual void removeSelected (UUID id)
 Removes a single UUID from the current selection.
const Dictionary< String, std::function< void(const UUID &)> > & requestDeploymentCallbacks ()
 Retrieves all registered deployment request callbacks.
virtual void requestQTUpdate ()
 Requests a Qt update cycle to be scheduled.
virtual Model restoreModel (UUID id) override
 Restores a previously erased model.
virtual void runDesignCommand (const DynamicPointer< DesignCommand > &command) override
 Immediately runs a design command.
virtual void saveModel (FactoryParameters &file, bool is_blocking=false)
 Saves a model to a file.
virtual void setActiveLayer (UUID layer_id) override
 Sets the active layer by its UUID.
virtual void setActiveProject (UUID project_id) override
 Sets the active project by its UUID.
void setFocus (UUID id)
 Sets focus to a specific design object.
void setGraphicsManager (GraphicsManagerBase *graphics_manager)
 Sets the graphics manager used for rendering.
virtual void setProjectTimeZone ()
 Sets the project time zone based on current project settings.
void setRequestDeploymentCallback (const StringView &callback_name, const std::function< void(const UUID &)> &callback)
 Registers a callback to be invoked when a deployment is requested.
virtual void setSelected (Buffer< UUID > ids) override
 Sets the selection to the given set of UUIDs, replacing any existing selection.
void setSelectedToFocus ()
 Sets the currently selected objects as the focus target.
virtual void setWindowManager (WindowManager *manager)
 Sets the window manager used for dialog management.
virtual void ShowProperties (const ShowPropertiesSettings &settings)
 Shows a properties dialog for a design object.
virtual void startQTUpdate (const TimeSpan &interval)
 Starts the periodic Qt update timer.
virtual void stopAll ()
 Stops all active operations, including timers and background threads.
virtual void stopQTUpdate ()
 Stops the periodic Qt update timer.
virtual DesignTaskManagertaskManager () const override
 Retrieves the design task manager for background operations.
virtual void update (const Time &time, const std::function< void()> &wait_callback) override
 Performs an update cycle at the given time.
virtual void updateModelTopLevel (const Model &object) override
 Notifies that a model's top-level parent has changed.
virtual bool useProjectFolders () const
 Checks whether the manager uses project folders for file organization.
WindowManagerwindowManager ()
 Retrieves the window manager.
Public Member Functions inherited from DesignObjectLookup
 DesignObjectLookup ()
 Constructs a new DesignObjectLookup with default-initialized members.
virtual ~DesignObjectLookup ()
 Virtual destructor.
DesignParameterAccumulator accumulateDesignParameter (const DesignParameter &channel, const BitFlag &accumulation_flags) const
 Accumulates statistics for a single design parameter.
Buffer< DesignParameterAccumulatoraccumulateDesignParameters (const BitFlag &accumulation_flags) const
 Accumulates statistics for all design parameters matching the given flags.
virtual UUID activeProject () const
 Returns the UUID of the currently active project.
virtual Project activeProjectModel () const
 Returns the active project as a Project model.
virtual void addEffect (Effect object)
 Registers an effect in the lookup.
virtual void addSelection (const DesignSelection &object)
 Adds a design selection to the lookup.
void addUpdateTarget (DesignObjectUpdateTarget *target)
 Registers a target to receive design object update notifications.
virtual uint08 approximateMemorySize (bool include_app_owned=false) const
 Estimates the total memory usage of all stored design objects.
Bounds< 3, fltp08bounds () const
 Computes the 3D bounding box encompassing all stored objects.
Bounds< 3, fltp08boundsOfVisible () const
 Computes the 3D bounding box encompassing all visible objects.
Bounds< 3, fltp08boundsOfVisible (const Camera &camera) const
 Computes the 3D bounding box of all objects visible to the given camera.
virtual CameraManagercameraManager ()
 Returns the camera manager.
virtual const CameraManagercameraManager () const
 Returns the camera manager (const).
void cleanupMemory ()
 Releases unused memory held by internal data structures.
void colorByChannel (UUID target, const DesignParameter &channel)
 Applies color-by-channel visualization to a target model.
WLock commandLock ()
 Acquires a write lock specifically for command execution.
virtual DesignCommandManagercommandManager ()
 Returns the design command manager.
DynamicPointer< CameracreateCamera (const ViewportFormat &format)
 Creates a new camera with no explicit parent model.
DynamicPointer< CameracreateCamera (Model &parent, const ViewportFormat &format)
 Creates a new camera as a child of the specified parent model.
Material createCameraMaterial (UUID camera)
 Creates a new material associated with a specific camera.
Model createCameraModel (UUID camera)
 Creates a new model associated with a specific camera.
Model createLayer ()
 Creates a new layer model and registers it in the lookup.
Material createMaterial ()
 Creates a new material and registers it in the lookup.
Geometry createMesh ()
 Creates a new mesh geometry and registers it in the lookup.
Model createModel ()
 Creates a new model and registers it in the lookup.
const ScenedefaultScene ()
 Returns the default scene, which is constant to the application.
const Dictionary< UUID, DesignObject > & deletedObjects ()
 Returns the dictionary of all deleted design objects.
void deleteLayer (const UUID &layer_id, const UUID &scene_id)
 Removes a layer from a specific scene.
Buffer< DesignParameterdesignParameters () const
 Returns all available design parameters across all stored objects.
virtual ModelEditControllereditManager ()
 Returns the model edit controller.
Effect effect (const UUID &id, bool allow_deleted=false) const
 Retrieves an effect by its UUID.
const Dictionary< UUID, Effect > & effectObjects ()
 Returns the dictionary of all registered effects.
void ensureLayerExistsInAllScenes (const UUID &layer_id)
 Ensures the specified layer exists in all registered scenes.
void ensureLayerExistsInScene (const UUID &layer_id, const UUID &scene_id)
 Ensures a layer exists within a specific scene, creating it if necessary.
virtual void executePendingCommands ()
 Executes all pending design commands in the command queue.
Model findLayer (const String &layer, bool use_translation=true) const
 Finds a layer by its name string.
Model findLayer (const TranslatedString &layer) const
 Finds a layer by its translated name.
Geometry geometry (const UUID &id, bool allow_deleted=false) const
 Retrieves a geometry by its UUID.
const Dictionary< UUID, Geometry > & geometryObjects ()
 Returns the dictionary of all registered geometries.
const Dictionary< UUID, Model > & getAllSceneLayers (const UUID &id) const
 Returns all layers associated with a given scene.
DynamicPointer< CameragetCamera (const UUID &id)
 Retrieves a mutable camera pointer by its UUID.
ConstPointer< CameragetCamera (const UUID &id) const
 Retrieves a const camera pointer by its UUID.
Buffer< ModelgetCameraObjects () const
 Returns all models that are associated with cameras.
virtual Buffer< UUIDgetDescendantsOf (const Buffer< UUID > &model_ids)
 Returns the UUIDs of all descendants of the given models.
Set< UUIDgetExcludedIDs (UUID camera_id) const
 Returns the set of object IDs excluded from a specific camera's view.
virtual Buffer< UUIDgetInverseOf (const Buffer< UUID > &model_ids)
 Returns the UUIDs of all models that are NOT in the given set.
Buffer< ModelgetLayersByType (const Buffer< String > &types) const
 Returns all layers matching any of the specified type strings.
Buffer< ModelgetLayersByType (const StringView &type) const
 Returns all layers matching the specified type string.
Buffer< UUIDgetModelIDsByType (const StringView &type) const
 Returns the UUIDs of all models matching the specified type string.
Buffer< ModelgetModelsByID (const Buffer< UUID > &ids) const
 Retrieves models by their UUIDs from a buffer.
Buffer< ModelgetModelsByID (const Set< UUID > &ids) const
 Retrieves models by their UUIDs from a set.
Buffer< ModelgetModelsByName (const StringView &name) const
 Retrieves all models whose name matches the given string.
Buffer< ModelgetModelsByType (const Buffer< String > &types) const
 Returns all models matching any of the specified type strings.
Buffer< ModelgetModelsByType (const StringView &type) const
 Returns all models matching the specified type string.
Buffer< UUIDgetRootObjectIDs (bool include_app_owned=false) const
 Returns the UUIDs of all root-level objects.
Buffer< UUIDgetRootObjectIDs (UUID camera_id, bool include_app_owned=false) const
 Returns the UUIDs of root-level objects visible to a specific camera.
Buffer< ModelgetRootObjects (bool include_app_owned=false) const
 Returns all root-level model objects.
Buffer< ModelgetRootObjects (UUID camera_id, bool include_app_owned=false) const
 Returns root-level model objects visible to a specific camera.
const DynamicPointer< DesignSelection > & getSelectionInfo (const UUID &id)
 Retrieves a mutable selection info pointer by its UUID.
const ConstPointer< DesignSelection > & getSelectionInfo (const UUID &id) const
 Retrieves a const selection info pointer by its UUID.
bool hasCamera (const UUID &id) const
 Checks whether a camera with the given UUID exists.
bool hasEffect (const UUID &id) const
 Checks whether an effect with the given UUID exists.
bool hasGeometryID (const UUID &id, bool allow_deleted=false) const
 Checks whether a geometry with the given UUID exists.
bool hasLayerID (const UUID &id, bool allow_deleted=false) const
 Checks whether a layer with the given UUID exists in any scene.
bool hasLayerID (const UUID &id, const UUID &scene_id) const
 Checks whether a layer with the given UUID exists within a specific scene.
bool hasLayersOfType (const StringView &type) const
 Checks whether any layers of the specified type exist.
bool hasMaterialID (const UUID &id, bool allow_deleted=false) const
 Checks whether a material with the given UUID exists.
bool hasModelID (const UUID &id, bool allow_deleted=false) const
 Checks whether a model with the given UUID exists.
bool hasModelsOfType (const StringView &type) const
 Checks whether any models of the specified type exist.
bool hasObjectID (const UUID &id, bool allow_deleted=false) const
 Checks whether any design object with the given UUID exists.
bool hasSceneID (const UUID &id, bool allow_deleted=false) const
 Checks whether a scene with the given UUID exists.
bool hasSelectionInfo (const UUID &id) const
 Checks whether selection info with the given UUID exists.
void invalidateStationVisuals (bool invalidate_visuals, bool invalidate_font)
 Marks station visuals and/or fonts as needing re-rendering.
bool isCommandLocked () const
 Checks whether the command lock is currently held.
Model layer (const UUID &id, bool allow_deleted=false) const
 Retrieves a layer by its UUID.
Model layer (const UUID &layer_id, const UUID &scene_id, bool allow_deleted=false) const
 Retrieves a layer by its UUID within a specific scene.
const Dictionary< UUID, Dictionary< UUID, Model > > & layerObjects ()
 Returns the dictionary of all registered layers, organized by scene.
const void * lockPtr () const
 Returns a raw pointer to the internal lock primitive.
Material material (const UUID &id, bool allow_deleted=false) const
 Retrieves a material by its UUID.
const Dictionary< UUID, Material > & materialObjects ()
 Returns the dictionary of all registered materials.
Model model (const UUID &id, bool allow_deleted=false) const
 Retrieves a model by its UUID.
const Dictionary< UUID, Model > & modelObjects ()
 Returns the dictionary of all registered models.
Model modelOrLayer (const UUID &id, bool allow_deleted=false) const
 Retrieves a model or layer by its UUID, checking both stores.
Buffer< Modelmodels (const Buffer< UUID > &ids, bool allow_deleted=false) const
 Retrieves multiple models by their UUIDs.
DesignObject object (const UUID &id) const
 Retrieves a generic design object by its UUID.
const Dictionary< UUID, DesignObject > & objects ()
 Returns the dictionary of all registered design objects.
void performDeletion (Buffer< UUID > deleted_objects)
 Permanently removes the specified objects from all stores.
template<class t_design_command_type>
void postCommand (const DynamicPointer< t_design_command_type > &command)
 Posts a typed design command for asynchronous execution.
Dictionary< UUID, EnclosedModelInfoprocessSelection (const DesignSelection &info) const
 Processes a design selection and returns enclosed model information.
void processSelection (SelectionInfo &info) const
 Processes a selection query and populates the given SelectionInfo.
RLock readLock () const
 Acquires a shared read lock on the design object store.
RLock readLock (const std::function< void()> &wait_callback) const
 Acquires a shared read lock, calling a callback while waiting.
RDesignLock readLock (UUID id)
 Acquires a design-specific read lock for the object with the given UUID.
virtual void refreshModel (const Model &object)
 Triggers a refresh of the specified model.
virtual void refreshScene (UUID scene_id)
 Triggers a refresh of the scene with the given ID.
void removeDeletedObject (UUID id)
 Removes an object from the deleted objects store permanently.
void removeUpdateTarget (DesignObjectUpdateTarget *target)
 Unregisters a target from receiving design object update notifications.
virtual void requestAutoSave ()
 Requests an auto-save of the current design state.
virtual void requestAutoSaveCheckpoint ()
 Requests an auto-save checkpoint of the current design state.
virtual Material restoreMaterial (UUID id)
 Restores a previously deleted material back into the lookup.
template<class t_design_command_type>
void runCommand (const DynamicPointer< t_design_command_type > &command)
 Runs a typed design command synchronously.
Scene scene (const UUID &id, bool allow_deleted=false) const
 Retrieves a scene by its UUID.
const Dictionary< UUID, Scene > & sceneObjects ()
 Returns the dictionary of all registered scenes.
Buffer< UUIDselected () const
 Returns the UUIDs of all currently selected objects.
void selectEnclosed (UUID selection_id)
 Selects all models enclosed by the specified selection region.
virtual SelectionControllerselectionController ()
 Returns the selection controller for viewport-based selection.
virtual SelectionEffectselectionEffect ()
 Returns the selection effect used for highlighting selected objects.
void setSelectionEffect (SelectionEffect *effect)
 Sets the selection effect used for highlighting selected objects.
void setupDefaultScene ()
 Initializes the default scene with standard settings.
void setViewportFocus (AutoZoomFocus focus)
 Sets the auto-zoom focus target for viewports.
void startUpdateThread (const TimeSpan &span, std::function< void(const Exception &)> exception_callback)
 Starts a background thread that periodically calls update().
void stopUpdateThread ()
 Stops the background update thread if it is running.
WLock tryCommandLock ()
 Attempts to acquire a command write lock without blocking.
RLock tryReadLock (const TimeSpan &span) const
 Attempts to acquire a read lock within the specified time span.
RLock tryReadLock (uint08 milliseconds=10) const
 Attempts to acquire a read lock within the specified timeout.
WLock tryWriteLock (const TimeSpan &span)
 Attempts to acquire a write lock within the specified time span.
WLock tryWriteLock (uint08 milliseconds=10)
 Attempts to acquire a write lock within the specified timeout.
void updateTranslation ()
 Triggers a translation update for all design objects.
Buffer< UUIDvisibleModels () const
 Returns the UUIDs of all currently visible models.
WLock writeLock () const
 Acquires an exclusive write lock on the design object store.
WLock writeLock (const std::function< void()> &wait_callback)
 Acquires an exclusive write lock, calling a callback while waiting.
WDesignLock writeLock (UUID id)
 Acquires a design-specific write lock for the object with the given UUID.

Protected Member Functions

void qtUpdate ()
 Performs the periodic Qt update cycle.
Protected Member Functions inherited from DesignObjectLookup
void updateEffects (const Time &time, const std::function< void()> &wait_callback)
 Updates all active effects for the current time step.

Protected Attributes

Buffer< UUIDm_added_objects
 Queue of recently added object UUIDs.
QTimer m_auto_save_timer
 Timer used for auto-saving the project.
Buffer< UUIDm_camera_update_cache
 Cache of camera UUIDs pending update notification.
ContextMenuManagerm_context_menu_manager = nullptr
 Manages right-click context menus.
Buffer< UUIDm_deleted_objects
 Queue of recently deleted object UUIDs.
Buffer< UUIDm_erased_objects
 Queue of recently erased object UUIDs.
UUID m_focused_object
 The UUID of the currently focused object.
Buffer< UUIDm_geometry_update_cache
 Cache of geometry UUIDs pending update notification.
GraphicsManagerBasem_graphics_manager = nullptr
 The graphics rendering manager.
bool m_is_updating
 Whether an update cycle is currently in progress.
Time m_last_audit_time
 Timestamp of the last data audit.
Time m_last_qt_update_time
 Timestamp of the last Qt update cycle.
Time m_last_tree_create_time = Time(0)
 Timestamp of the last tree creation.
QTimer m_launch_timer
 Timer used for periodic Qt updates.
Buffer< UUIDm_layer_update_cache
 Cache of layer UUIDs pending update notification.
DynamicPointer< LibraryManagerm_library_manager
 The library manager for assets and templates.
QTModelManagerViewm_manager_view = nullptr
 The Qt item model view for this manager.
Buffer< UUIDm_material_update_cache
 Cache of material UUIDs pending update notification.
Buffer< UUIDm_model_update_cache
 Cache of model UUIDs pending update notification.
bool m_needs_cleanup
 Whether a cleanup pass is needed.
Buffer< UUIDm_objects_to_remove
 Queue of objects pending removal.
ProjectFileManagerm_project_file_manager = nullptr
 Manages project file operations.
Dictionary< UUID, DynamicPointer< QTDesignObject > > m_qt_design_objects
 Map of UUIDs to their Qt wrapper objects.
Dictionary< String, std::function< void(const UUID &)> > m_request_deployment_callbacks
 Registered deployment request callbacks.
Buffer< UUIDm_scene_update_cache
 Cache of scene UUIDs pending update notification.
SelectionTreeManager m_selection_tree_manager
 Manages the selection tree for viewport interactions.
Buffer< UUIDm_top_level_change
 Queue of models with top-level parent changes.
WindowManagerm_window_manager = nullptr
 The window manager for dialog and UI management.
CachedFactoryIOThreadm_write_thread = nullptr
 Background thread for file write operations.
Protected Attributes inherited from DesignObjectLookup
UUID m_active_layer
 The UUID of the currently active layer.
UUID m_active_project
 The UUID of the currently active project.
CameraManagerm_camera_controller
 Manages all camera instances and their lifecycle.
Dictionary< UUID, Modelm_camera_root
 Root models associated with each camera.
DesignCommandManagerm_command_controller
 Manages the design command queue and execution.
Scene m_default_scene
 The default scene, constant to the application (not written to files).
Dictionary< UUID, DesignObjectm_deleted_objects
 Design objects that have been soft-deleted.
Dictionary< UUID, DesignObjectm_design_objects
 All registered design objects keyed by UUID.
ModelEditControllerm_edit_controller
 Manages model editing operations.
Dictionary< UUID, Effectm_effect_objects
 All registered effect objects keyed by UUID.
Dictionary< UUID, std::pair< UUID, uint04 > > m_erased_objects
 Erased objects stored with their parent UUID and child index.
std::function< void(const Exception &)> m_exception_callback = nullptr
 Callback for exceptions thrown during background updates.
Dictionary< UUID, Geometrym_geometry_objects
 All registered geometry objects keyed by UUID.
ResourceListenerm_invalidate_station_visuals_listener
 Listener that triggers station visual invalidation.
ResourceListenerm_language_change_listener
 Listener that triggers translation updates on language change.
Time m_last_update_time
 The timestamp of the most recent update cycle.
Dictionary< UUID, Dictionary< UUID, Model > > m_layer_objects
 Layers organized by scene UUID, then layer UUID.
LogManagerm_log_manager
 Manages logging for design operations.
Dictionary< UUID, Materialm_material_objects
 All registered material objects keyed by UUID.
Dictionary< UUID, Modelm_model_objects
 All registered model objects keyed by UUID.
Dictionary< UUID, Modelm_model_root_objects
 Top-level root model objects.
TimeSpan m_preferred_update_timespan
 The preferred interval between background update cycles.
Dictionary< UUID, Modelm_referenced_root_objects
 Root objects referenced from external sources.
Dictionary< UUID, Scenem_referenced_scenes
 Scenes referenced by the lookup but not directly owned.
Dictionary< UUID, Scenem_scene_objects
 All registered scene objects keyed by UUID.
Buffer< UUIDm_selected_objects
 The UUIDs of currently selected objects.
SelectionControllerm_selection_controller
 Manages viewport-based selection logic.
SelectionEffectm_selection_effect
 The visual effect applied to selected objects.
Dictionary< UUID, DynamicPointer< DesignSelection > > m_selection_info
 Selection metadata keyed by selection UUID.
DesignTaskManagerm_task_controller
 Manages asynchronous design tasks.
bool m_update_language
 Whether a language/translation update is pending.
bool m_update_station_font
 Whether station fonts need to be re-rendered.
bool m_update_station_visuals
 Whether station visuals need to be re-rendered.
Buffer< DesignObjectUpdateTarget * > m_update_targets
 Registered targets that receive design object update notifications.
Threadm_update_thread = nullptr
 The background update thread, or nullptr if not running.
UUID m_uuid
 The unique identifier for this DesignObjectLookup instance.

Private Member Functions

void finishCommand (const DynamicPointer< DesignCommand > &command) override
 Finalizes a design command after execution.

Additional Inherited Members

Public Attributes inherited from DesignObjectLookup
Resource< Timeautosave_checkpoint_request_time
 The time of the most recent auto-save checkpoint request.
Resource< Timeautosave_request_time
 The time of the most recent auto-save request.
Resource< UUIDcurrent_layer
 The UUID of the currently active layer.
Resource< RGBColorfocus_color
 The highlight color used for focused objects.
Resource< Timemodified_time
 The last modification time of the design data.

Detailed Description

A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering capabilities to the model hierarchy.


Definition at line 171 of file QTModelManager.h.

Member Function Documentation

◆ addCamera()

virtual void QTModelManager::addCamera ( const DynamicPointer< Camera > & object,
bool generate_decorations = true )
overridevirtual

Adds a camera to the manager and emits appropriate signals.

Parameters
[in]objectThe camera to add.
[in]generate_decorationsWhether to generate default decoration models for the camera.

Reimplemented from DesignObjectLookup.

◆ addCameraModel()

virtual void QTModelManager::addCameraModel ( const UUID & camera,
const Model & object )
overridevirtual

Associates a model with a camera viewport.

Parameters
[in]cameraThe UUID of the camera.
[in]objectThe model to associate with the camera.

Reimplemented from DesignObjectLookup.

◆ addGeometry()

virtual void QTModelManager::addGeometry ( Geometry object)
overridevirtual

Adds a geometry object to the manager and emits appropriate signals.

Parameters
[in]objectThe geometry to add.

Reimplemented from DesignObjectLookup.

◆ addLayer()

virtual void QTModelManager::addLayer ( Model object)
overridevirtual

Adds a layer to the manager and emits appropriate signals.

Parameters
[in]objectThe layer model to add.

Reimplemented from DesignObjectLookup.

◆ addMaterial()

virtual void QTModelManager::addMaterial ( Material object)
overridevirtual

Adds a material to the manager and emits appropriate signals.

Parameters
[in]objectThe material to add.

Reimplemented from DesignObjectLookup.

◆ addModel()

virtual void QTModelManager::addModel ( Model object)
overridevirtual

Adds a model to the manager and emits appropriate signals.

Parameters
[in]objectThe model to add.

Reimplemented from DesignObjectLookup.

Referenced by CheckoutCode::AddAndShow(), and BuildActionProgramLogic::executeMenuItems().

◆ addScene()

virtual void QTModelManager::addScene ( Scene object,
bool add_all_objects = true )
overridevirtual

Adds a scene to the manager and emits appropriate signals.

Parameters
[in]objectThe scene to add.
[in]add_all_objectsWhether to recursively add all child objects.

Reimplemented from DesignObjectLookup.

◆ addSelected()

void QTModelManager::addSelected ( const UUID & id,
bool signal = true )

Adds a single object to the selection.

Parameters
[in]idThe UUID of the object to select.
[in]signalWhether to emit a selection change signal.

◆ appendSelected()

virtual void QTModelManager::appendSelected ( Buffer< UUID > ids)
overridevirtual

Appends the given UUIDs to the current selection.

Parameters
[in]idsThe UUIDs to append to the selection.

Reimplemented from DesignObjectLookup.

◆ canProcessMimeData()

virtual bool QTModelManager::canProcessMimeData ( const QMimeData * data) const
virtual

Checks whether the given MIME data can be processed (e.g., drag and drop).

Parameters
[in]dataThe MIME data to check.
Returns
True if the data can be processed.

◆ contextMenuManager()

ContextMenuManager * QTModelManager::contextMenuManager ( )
inline

Retrieves the context menu manager.

Returns
A pointer to the context menu manager.

Definition at line 278 of file QTModelManager.h.

References m_context_menu_manager.

◆ deleteObject()

void QTModelManager::deleteObject ( UUID id)
overridevirtual

Marks a design object for deletion by its UUID.

Parameters
[in]idThe UUID of the object to delete.

Reimplemented from DesignObjectLookup.

◆ eraseModel()

virtual void QTModelManager::eraseModel ( UUID id)
overridevirtual

Erases a model from the manager, keeping it available for restoration.

Parameters
[in]idThe UUID of the model to erase.

Reimplemented from DesignObjectLookup.

◆ exportModels()

virtual void QTModelManager::exportModels ( ExportRequest request)
virtual

Exports models to a file based on the given export request.

Parameters
[in]requestThe export request parameters.

◆ finishCommand()

void QTModelManager::finishCommand ( const DynamicPointer< DesignCommand > & command)
overrideprivatevirtual

Finalizes a design command after execution.

Parameters
[in]commandThe design command to finish.

Reimplemented from DesignObjectLookup.

◆ getQTObject()

virtual DynamicPointer< QTDesignObject > QTModelManager::getQTObject ( UUID id)
virtual

Retrieves a Qt wrapper for a design object by its UUID.

Parameters
[in]idThe UUID of the design object.
Returns
A dynamic pointer to the QTDesignObject.

◆ getQTObjectsByID()

virtual Buffer< DynamicPointer< QTDesignObject > > QTModelManager::getQTObjectsByID ( const Buffer< UUID > & ids)
virtual

Retrieves Qt wrappers for multiple design objects by their UUIDs.

Parameters
[in]idsThe UUIDs of the design objects to retrieve.
Returns
A buffer of dynamic pointers to the QTDesignObjects.

◆ graphicsManager()

GraphicsManagerBase * QTModelManager::graphicsManager ( )

Retrieves the graphics manager used for rendering.

Returns
A pointer to the graphics manager.

Referenced by GLESCameraViewFactory::canCreateView().

◆ hasBeenModified()

virtual bool QTModelManager::hasBeenModified ( ) const
virtual

Checks whether the project has been modified since the last save.

Returns
True if the project has unsaved changes.

◆ hasUserSavedProject()

virtual bool QTModelManager::hasUserSavedProject ( ) const
virtual

Checks whether the user has explicitly saved the current project.

Returns
True if the project has been saved by the user.

◆ libraryManager()

virtual DynamicPointer< LibraryManager > QTModelManager::libraryManager ( )
virtual

Retrieves the library manager for asset and template management.

Returns
A dynamic pointer to the library manager.

◆ logManager()

virtual LogManager * QTModelManager::logManager ( ) const
overridevirtual

Retrieves the log manager used for diagnostic output.

Returns
A pointer to the log manager.

Reimplemented from DesignObjectLookup.

Referenced by BuildActionProgramLogic::executeMenuItems(), and BuildActionProgramLogic::setTreeWidgetsForSelection().

◆ modelManagerView()

virtual QTModelManagerView * QTModelManager::modelManagerView ( )
virtual

Retrieves the QTModelManagerView associated with this manager.

Returns
A pointer to the model manager view.

◆ popSelected()

void QTModelManager::popSelected ( const UUID & id,
bool signal = true )

Removes a single object from the selection.

Parameters
[in]idThe UUID of the object to deselect.
[in]signalWhether to emit a selection change signal.

◆ postDesignCommand()

virtual void QTModelManager::postDesignCommand ( const DynamicPointer< DesignCommand > & command)
overridevirtual

Posts a design command for asynchronous execution.

Parameters
[in]commandThe design command to post.

Reimplemented from DesignObjectLookup.

◆ processMimeData()

virtual void QTModelManager::processMimeData ( const QMimeData * data,
PopupInfo origin = PopupInfo() )
virtual

Processes incoming MIME data, typically from a drag-and-drop operation.

Parameters
[in]dataThe MIME data to process.
[in]originThe popup origin information for positioning.

◆ projectFileManager()

ProjectFileManager * QTModelManager::projectFileManager ( )
inline

Retrieves the project file manager.

Returns
A pointer to the project file manager.

Definition at line 371 of file QTModelManager.h.

References m_project_file_manager.

◆ removeSelected() [1/2]

virtual void QTModelManager::removeSelected ( const Buffer< UUID > & ids)
virtual

Removes the given UUIDs from the current selection.

Parameters
[in]idsThe UUIDs to deselect.

◆ removeSelected() [2/2]

virtual void QTModelManager::removeSelected ( UUID id)
virtual

Removes a single UUID from the current selection.

Parameters
[in]idThe UUID to deselect.

◆ requestDeploymentCallbacks()

const Dictionary< String, std::function< void(const UUID &)> > & QTModelManager::requestDeploymentCallbacks ( )

Retrieves all registered deployment request callbacks.

Returns
A dictionary mapping callback names to their functions.

◆ restoreModel()

virtual Model QTModelManager::restoreModel ( UUID id)
overridevirtual

Restores a previously erased model.

Parameters
[in]idThe UUID of the model to restore.
Returns
The restored model.

Reimplemented from DesignObjectLookup.

◆ runDesignCommand()

virtual void QTModelManager::runDesignCommand ( const DynamicPointer< DesignCommand > & command)
overridevirtual

Immediately runs a design command.

Parameters
[in]commandThe design command to execute.

Reimplemented from DesignObjectLookup.

References DesignObjectLookup::model().

◆ saveModel()

virtual void QTModelManager::saveModel ( FactoryParameters & file,
bool is_blocking = false )
virtual

Saves a model to a file.

Parameters
[in]fileThe factory parameters specifying the output file.
[in]is_blockingWhether to block until the save completes.

◆ setActiveLayer()

virtual void QTModelManager::setActiveLayer ( UUID layer_id)
overridevirtual

Sets the active layer by its UUID.

Parameters
[in]layer_idThe UUID of the layer to activate.

Reimplemented from DesignObjectLookup.

◆ setActiveProject()

virtual void QTModelManager::setActiveProject ( UUID project_id)
overridevirtual

Sets the active project by its UUID.

Parameters
[in]project_idThe UUID of the project to activate.

Reimplemented from DesignObjectLookup.

◆ setFocus()

void QTModelManager::setFocus ( UUID id)

Sets focus to a specific design object.

Parameters
[in]idThe UUID of the object to focus.

◆ setGraphicsManager()

void QTModelManager::setGraphicsManager ( GraphicsManagerBase * graphics_manager)

Sets the graphics manager used for rendering.

Parameters
[in]graphics_managerThe graphics manager to set.

◆ setRequestDeploymentCallback()

void QTModelManager::setRequestDeploymentCallback ( const StringView & callback_name,
const std::function< void(const UUID &)> & callback )

Registers a callback to be invoked when a deployment is requested.

Parameters
[in]callback_nameThe name identifier for the callback.
[in]callbackThe callback function to invoke with the deployed object's UUID.

◆ setSelected()

virtual void QTModelManager::setSelected ( Buffer< UUID > ids)
overridevirtual

Sets the selection to the given set of UUIDs, replacing any existing selection.

Parameters
[in]idsThe UUIDs to select.

Reimplemented from DesignObjectLookup.

◆ setWindowManager()

virtual void QTModelManager::setWindowManager ( WindowManager * manager)
inlinevirtual

Sets the window manager used for dialog management.

Parameters
[in]managerThe window manager to set.

Definition at line 273 of file QTModelManager.h.

References m_window_manager.

◆ ShowProperties()

virtual void QTModelManager::ShowProperties ( const ShowPropertiesSettings & settings)
virtual

Shows a properties dialog for a design object.

Parameters
[in]settingsThe settings controlling how the properties dialog is displayed.

Referenced by CheckoutCode::AddAndShow(), and BuildActionProgramLogic::executeMenuItems().

◆ startQTUpdate()

virtual void QTModelManager::startQTUpdate ( const TimeSpan & interval)
virtual

Starts the periodic Qt update timer.

Parameters
[in]intervalThe time interval between updates.

◆ taskManager()

virtual DesignTaskManager * QTModelManager::taskManager ( ) const
overridevirtual

Retrieves the design task manager for background operations.

Returns
A pointer to the task manager.

Reimplemented from DesignObjectLookup.

◆ update()

virtual void QTModelManager::update ( const Time & time,
const std::function< void()> & wait_callback )
overridevirtual

Performs an update cycle at the given time.

Parameters
[in]timeThe current time.
[in]wait_callbackA callback to invoke while waiting for threaded tasks.

Reimplemented from DesignObjectLookup.

◆ updateModelTopLevel()

virtual void QTModelManager::updateModelTopLevel ( const Model & object)
overridevirtual

Notifies that a model's top-level parent has changed.

Parameters
[in]objectThe model whose top-level changed.

Reimplemented from DesignObjectLookup.

◆ useProjectFolders()

virtual bool QTModelManager::useProjectFolders ( ) const
virtual

Checks whether the manager uses project folders for file organization.

Returns
True if project folders are used.

◆ windowManager()

WindowManager * QTModelManager::windowManager ( )
inline

Retrieves the window manager.

Returns
A pointer to the window manager.

Definition at line 268 of file QTModelManager.h.

References m_window_manager.


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