34#include <NDEVR/SoftwareService.h>
35#include <NDEVR/PopupInfo.h>
36#include <NDEVR/SelectionTreeManager.h>
37#include <NDEVR/Model.h>
38#include <NDEVR/DesignObjectLookup.h>
39#include <NDEVR/SnapLocation.h>
41#include <NDEVR/ApplicationOption.h>
42#include <NDEVR/UUID.h>
43#include <NDEVR/Dictionary.h>
176 QTModelManager(
const QTModelManager& manager) =
delete;
177 virtual ~QTModelManager();
289 virtual void update(
const Time& time,
const std::function<
void()>& wait_callback)
override;
448 virtual void _qtUpdate(
const Time& time);
449 virtual void _qtUpdateDeleted(
UUID model);
450 virtual void _qtUpdateDeleted();
451 virtual void _qtUpdateAdded();
452 virtual void _qtUpdateModified();
453 virtual void _qtUpdateModelModified(
UUID model);
454 virtual void _qtUpdateObject(
UUID object);
455 void appendToAddQueue(
UUID id);
510 void _performDeletion();
511 void _refreshModelList();
542#if NDEVR_SUPPORTS_THREADING
A thread that executes a user-provided callback function concurrently.
The equivelent of std::vector but with a bit more control.
A thread designed to read and write files using the FactoryIO interface.
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Forward declaration of the central design object registry.
DesignObjectLookup()
Constructs a new DesignObjectLookup with default-initialized members.
Model model(const UUID &id, bool allow_deleted=false) const
Retrieves a model by its UUID.
Buffer< UUID > selected() const
Returns the UUIDs of all currently selected objects.
Manages all active and inactive tasks for a DesignObjectLookup.
A hash-based key-value store, useful for quick associative lookups.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
A core class within the model hierarchy containing vertex-based data (Usually 3D data) within a set c...
A physical or virtual device used with the NDEVR Rendering Engine.
Used for interfacing with a Graphics engine, such as Vulkan or OpenGL.
virtual void clearAll()=0
Clears all sessions and pending requests.
virtual bool hasGraphicsSession(const DynamicPointer< GraphicsDevice > &device)=0
Checks whether a graphics session exists for the given device.
virtual bool requestHandleManagerUpdating() const =0
Checks whether this manager requests to handle its own updating.
virtual void removeRequest(const ConstPointer< CaptureRequest > &request)=0
Removes a capture request from the queue.
virtual void addGraphicsSession(DynamicPointer< GraphicsSession > session, bool add_cameras=true)=0
Adds a new graphics session to the manager.
virtual Buffer< DynamicPointer< GraphicsSession > > availableSessions() const =0
Retrieves all available graphics sessions.
virtual void executeRequest(const ConstPointer< CaptureRequest > &request)=0
Immediately executes a capture request.
virtual void updateActive(const DynamicPointer< GraphicsSession > &session, bool add_cameras=true)=0
Updates the active state of a graphics session.
virtual bool canServiceCaptureRequests() const =0
Checks whether the manager can service capture requests.
virtual void addRequest(const ConstPointer< CaptureRequest > &request)=0
Adds a capture request to the queue.
void captureManagerStateChangeSignal()
Emitted when the capture manager state changes.
void graphicsSessionChangeSignal()
Emitted when the set of graphics sessions changes.
virtual const DynamicPointer< GraphicsSession > & graphicsSession(const DynamicPointer< GraphicsDevice > &device)=0
Retrieves the graphics session associated with the given device.
Stores a default rendering engine to be used with the application.
static void SetDefaultFactory(GraphicsManagerFactory *factory)
Sets the default graphics manager factory for the application.
virtual GraphicsManagerBase * createManager(QTModelManager *manager)=0
Creates a new GraphicsManagerBase instance for the given model manager.
static GraphicsManagerFactory * s_factory
The singleton default factory instance.
static GraphicsManagerFactory * DefaultFactory()
Retrieves the default graphics manager factory.
A GraphicsPipeline that is responsible for setting up and rendering the resources of a DesignObjectLo...
Manages loading Models from a group that is stored either on a remote server or locally on the disk i...
A class that has any number of children that also feed into the log.
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
Takes user input in order to modify a model in real-time.
A core class that represents a node on model hierarchy.
Manages writing to the NDV file and any folder operations for projects.
A Model which represents a user-project.
An interface used to manage multiple CaptureRequests and scedule their completion.
A pointer to a DesignObject within a QTModelManager that receives and emits update signals based on t...
A Qt compatible ItemModel for interfacing with a DesignObjectLookup.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
void setSelectedToFocus()
Sets the currently selected objects as the focus target.
bool m_is_updating
Whether an update cycle is currently in progress.
SelectionTreeManager m_selection_tree_manager
Manages the selection tree for viewport interactions.
void canImportFileSignal(bool can_import_file)
Emitted to indicate whether a file can be imported.
virtual DynamicPointer< LibraryManager > libraryManager()
Retrieves the library manager for asset and template management.
virtual void eraseModel(UUID id) override
Erases a model from the manager, keeping it available for restoration.
void onDeleteObject(UUID id)
Emitted when a design object is deleted.
void onCommandExecutedSignal(UUID id)
Emitted when a design command finishes execution.
void setFocus(UUID id)
Sets focus to a specific design object.
QTModelManagerView * m_manager_view
The Qt item model view for this manager.
void onAddMaterial(Buffer< UUID > id)
Emitted when materials are added.
ProjectFileManager * projectFileManager()
Retrieves the project file manager.
Buffer< UUID > m_material_update_cache
Cache of material UUIDs pending update notification.
void setRequestDeploymentCallback(const StringView &callback_name, const std::function< void(const UUID &)> &callback)
Registers a callback to be invoked when a deployment is requested.
ProjectFileManager * m_project_file_manager
Manages project file operations.
virtual void setSelected(Buffer< UUID > ids) override
Sets the selection to the given set of UUIDs, replacing any existing selection.
virtual DesignTaskManager * taskManager() const override
Retrieves the design task manager for background operations.
virtual DynamicPointer< QTDesignObject > getQTObject(UUID id)
Retrieves a Qt wrapper for a design object by its UUID.
virtual void setWindowManager(WindowManager *manager)
Sets the window manager used for dialog management.
WindowManager * windowManager()
Retrieves the window manager.
virtual void addCameraModel(const UUID &camera, const Model &object) override
Associates a model with a camera viewport.
void onAddCommand(UUID id)
Emitted when a design command is added.
void activeLayerChangedSignal(UUID id)
Emitted when the active layer changes.
virtual Model restoreModel(UUID id) override
Restores a previously erased model.
void onProjectUpdatedSignal()
Emitted when the active project is updated.
void onAddViewportObject(UUID camera, UUID object)
Emitted when a model is added to a camera viewport.
virtual void requestQTUpdate()
Requests a Qt update cycle to be scheduled.
virtual void removeSelected(UUID id)
Removes a single UUID from the current selection.
Buffer< UUID > m_top_level_change
Queue of models with top-level parent changes.
virtual void appendSelected(Buffer< UUID > ids) override
Appends the given UUIDs to the current selection.
virtual void clearAll() override
Clears all data from the manager, including scenes, models, and selections.
void canExitApplicationSignal(bool can_exit)
Emitted to indicate whether the application can safely exit.
void onCleanupRequestSignal()
Emitted when a cleanup cycle is requested.
void onAddCamera(UUID id)
Emitted when a camera is added.
void finishCommand(const DynamicPointer< DesignCommand > &command) override
Finalizes a design command after execution.
void qtUpdate()
Performs the periodic Qt update cycle.
virtual void stopAll()
Stops all active operations, including timers and background threads.
void canOpenProjectSignal(bool can_open_project)
Emitted to indicate whether a project can be opened.
Buffer< UUID > m_model_update_cache
Cache of model UUIDs pending update notification.
Dictionary< UUID, DynamicPointer< QTDesignObject > > m_qt_design_objects
Map of UUIDs to their Qt wrapper objects.
void onUpdateCommand(UUID id)
Emitted when a command is updated.
GraphicsManagerBase * graphicsManager()
Retrieves the graphics manager used for rendering.
void addSelected(const UUID &id, bool signal=true)
Adds a single object to the selection.
void onSelectedSignal(Buffer< UUID > ids, bool selected)
Emitted when object selection changes.
virtual void addGeometry(Geometry object) override
Adds a geometry object to the manager and emits appropriate signals.
void onAddScene(Buffer< UUID > id)
Emitted when scenes are added.
void onActiveProjectChanged(UUID id)
Emitted when the active project changes.
virtual void addLayer(Model object) override
Adds a layer to the manager and emits appropriate signals.
virtual void ShowProperties(const ShowPropertiesSettings &settings)
Shows a properties dialog for a design object.
virtual void setActiveProject(UUID project_id) override
Sets the active project by its UUID.
void onAddModel(Buffer< UUID > id)
Emitted when models are added.
DynamicPointer< LibraryManager > m_library_manager
The library manager for assets and templates.
virtual Buffer< DynamicPointer< QTDesignObject > > getQTObjectsByID(const Buffer< UUID > &ids)
Retrieves Qt wrappers for multiple design objects by their UUIDs.
void onDeleteGeometry(UUID id)
Emitted when a geometry is deleted.
void addLayerSignal(Buffer< UUID > id)
Emitted when layers are added.
Buffer< UUID > m_added_objects
Queue of recently added object UUIDs.
void popSelected(const UUID &id, bool signal=true)
Removes a single object from the selection.
virtual void setProjectTimeZone()
Sets the project time zone based on current project settings.
GraphicsManagerBase * m_graphics_manager
The graphics rendering manager.
virtual LogManager * logManager() const override
Retrieves the log manager used for diagnostic output.
WindowManager * m_window_manager
The window manager for dialog and UI management.
virtual void saveModel(FactoryParameters &file, bool is_blocking=false)
Saves a model to a file.
virtual void updateModelTopLevel(const Model &object) override
Notifies that a model's top-level parent has changed.
void onSwapSelectedSignal(Buffer< UUID > old_selected, Buffer< UUID > new_selected)
Emitted when the entire selection is swapped.
virtual void processMimeData(const QMimeData *data, PopupInfo origin=PopupInfo())
Processes incoming MIME data, typically from a drag-and-drop operation.
virtual void runDesignCommand(const DynamicPointer< DesignCommand > &command) override
Immediately runs a design command.
void onDeleteObjects(Buffer< UUID > ids)
Emitted when objects are deleted.
void onDeleteMaterial(UUID id)
Emitted when a material is deleted.
Buffer< UUID > m_geometry_update_cache
Cache of geometry UUIDs pending update notification.
virtual void update(const Time &time, const std::function< void()> &wait_callback) override
Performs an update cycle at the given time.
Buffer< UUID > m_objects_to_remove
Queue of objects pending removal.
QTimer m_launch_timer
Timer used for periodic Qt updates.
virtual void addCamera(const DynamicPointer< Camera > &object, bool generate_decorations=true) override
Adds a camera to the manager and emits appropriate signals.
void onUpdateFocus(UUID id, bool focussed)
Emitted when focus changes for an object.
virtual bool hasBeenModified() const
Checks whether the project has been modified since the last save.
void materialsUpdatedSignal(const Buffer< UUID > &ids)
Emitted when materials are updated.
void setGraphicsManager(GraphicsManagerBase *graphics_manager)
Sets the graphics manager used for rendering.
void onClearAllSignal()
Emitted when all data is cleared.
virtual bool useProjectFolders() const
Checks whether the manager uses project folders for file organization.
virtual void exportModels(ExportRequest request)
Exports models to a file based on the given export request.
void captureManagerStateChangeSignal()
Emitted when the capture manager state changes.
Dictionary< String, std::function< void(const UUID &)> > m_request_deployment_callbacks
Registered deployment request callbacks.
void onDeleteModel(UUID id)
Emitted when a model is deleted.
void onModelTopLevelChange(Buffer< UUID > id)
Emitted when models change their top-level parent.
ContextMenuManager * contextMenuManager()
Retrieves the context menu manager.
void onDeleteCommand(UUID id)
Emitted when a command is deleted.
Time m_last_qt_update_time
Timestamp of the last Qt update cycle.
const Dictionary< String, std::function< void(const UUID &)> > & requestDeploymentCallbacks()
Retrieves all registered deployment request callbacks.
virtual void setActiveLayer(UUID layer_id) override
Sets the active layer by its UUID.
Buffer< UUID > m_scene_update_cache
Cache of scene UUIDs pending update notification.
virtual void startQTUpdate(const TimeSpan &interval)
Starts the periodic Qt update timer.
void graphicsSessionChangeSignal()
Emitted when graphics sessions change.
void deleteObject(UUID id) override
Marks a design object for deletion by its UUID.
void popFocus()
Removes the current focus object from the focus stack.
virtual void addModel(Model object) override
Adds a model to the manager and emits appropriate signals.
virtual void clearSelected() override
Clears all selected objects and emits the corresponding signal.
Time m_last_tree_create_time
Timestamp of the last tree creation.
virtual QTModelManagerView * modelManagerView()
Retrieves the QTModelManagerView associated with this manager.
virtual bool hasUserSavedProject() const
Checks whether the user has explicitly saved the current project.
virtual void stopQTUpdate()
Stops the periodic Qt update timer.
void layersUpdatedSignal(const Buffer< UUID > &ids)
Emitted when layers are updated.
CachedFactoryIOThread * m_write_thread
Background thread for file write operations.
ContextMenuManager * m_context_menu_manager
Manages right-click context menus.
virtual bool canProcessMimeData(const QMimeData *data) const
Checks whether the given MIME data can be processed (e.g., drag and drop).
Buffer< UUID > m_erased_objects
Queue of recently erased object UUIDs.
void modelsUpdatedSignal(const Buffer< UUID > &ids)
Emitted when models are updated.
virtual void addMaterial(Material object) override
Adds a material to the manager and emits appropriate signals.
virtual void removeSelected(const Buffer< UUID > &ids)
Removes the given UUIDs from the current selection.
Time m_last_audit_time
Timestamp of the last data audit.
void objectsUpdatedSignal(const Buffer< UUID > &ids)
Emitted when design objects are updated.
Buffer< UUID > m_camera_update_cache
Cache of camera UUIDs pending update notification.
Buffer< UUID > m_layer_update_cache
Cache of layer UUIDs pending update notification.
QTimer m_auto_save_timer
Timer used for auto-saving the project.
void onDeleteCamera(UUID id)
Emitted when a camera is deleted.
virtual void postDesignCommand(const DynamicPointer< DesignCommand > &command) override
Posts a design command for asynchronous execution.
virtual void addScene(Scene object, bool add_all_objects=true) override
Adds a scene to the manager and emits appropriate signals.
UUID m_focused_object
The UUID of the currently focused object.
bool m_needs_cleanup
Whether a cleanup pass is needed.
Buffer< UUID > m_deleted_objects
Queue of recently deleted object UUIDs.
void onShowPropertiesRequested(UUID object)
Emitted when a properties dialog is requested for an object.
void onAddGeometry(Buffer< UUID > id)
Emitted when geometry objects are added.
The root Model that is responsible for storing the underlying data for all Scene Models.
Manages selection trees, which optimize the process of selecting data within large Geometry objects.
Software Service Managers take a Software service to modify the behavior of the software.
Base interface for services that extend or modify software behavior through modules.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
The default thread class for executing concurrent sequences in the NDEVR API.
Stores a time span, or difference between two times, with an optional start time.
Represents a timestamp with utilities for manipulation and conversion.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Creates and manages the resources necessary for converting a DesignObjectLookup into 3D rendered data...
Manages all windows and logic surrounding dialogs and views for displaying and managing any environme...
The primary namespace for the NDEVR SDK.
A request to capture the 3D view as a 2D image.
Stores information related to exporting specific data from the software.
A container of input information that is to be filled with output information by an IOFactory.
A FileRequest bundles format data as well as a particular file.
Stores settings for setting up and displaying a DesignObjectDialog such as whether the dialog is part...